codecraftai-restclient-github-public 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccai/restclient/github/public/__init__.py +0 -0
- ccai/restclient/github/public/generation/githubrestclientgenerator.py +56 -0
- ccai/restclient/github/public/generation/specs/api-hints.json +172 -0
- ccai/restclient/github/public/generation/specs/api-public.json +306020 -0
- ccai/restclient/github/public/generation/specs/pagination-hints.json +31 -0
- ccai/restclient/github/public/githubpublicrestclient.py +262 -0
- ccai/restclient/github/public/githubrestclientbase.py +120 -0
- ccai/restclient/github/public/groups/__init__.py +0 -0
- ccai/restclient/github/public/groups/actions.py +8042 -0
- ccai/restclient/github/public/groups/activity.py +1488 -0
- ccai/restclient/github/public/groups/apiinsights.py +478 -0
- ccai/restclient/github/public/groups/apps.py +1662 -0
- ccai/restclient/github/public/groups/billing.py +401 -0
- ccai/restclient/github/public/groups/campaigns.py +262 -0
- ccai/restclient/github/public/groups/checks.py +632 -0
- ccai/restclient/github/public/groups/classroom.py +276 -0
- ccai/restclient/github/public/groups/codescanning.py +1203 -0
- ccai/restclient/github/public/groups/codesecurity.py +997 -0
- ccai/restclient/github/public/groups/codesofconduct.py +92 -0
- ccai/restclient/github/public/groups/codespaces.py +2271 -0
- ccai/restclient/github/public/groups/copilot.py +517 -0
- ccai/restclient/github/public/groups/credentials.py +62 -0
- ccai/restclient/github/public/groups/dependabot.py +1155 -0
- ccai/restclient/github/public/groups/dependencygraph.py +152 -0
- ccai/restclient/github/public/groups/emojis.py +51 -0
- ccai/restclient/github/public/groups/gists.py +909 -0
- ccai/restclient/github/public/groups/git.py +734 -0
- ccai/restclient/github/public/groups/gitignore.py +96 -0
- ccai/restclient/github/public/groups/hostedcompute.py +290 -0
- ccai/restclient/github/public/groups/interactions.py +389 -0
- ccai/restclient/github/public/groups/issues.py +2460 -0
- ccai/restclient/github/public/groups/licenses.py +153 -0
- ccai/restclient/github/public/groups/markdown.py +88 -0
- ccai/restclient/github/public/groups/meta.py +213 -0
- ccai/restclient/github/public/groups/migrations.py +1079 -0
- ccai/restclient/github/public/groups/oidc.py +102 -0
- ccai/restclient/github/public/groups/orgs.py +3958 -0
- ccai/restclient/github/public/groups/packages.py +1316 -0
- ccai/restclient/github/public/groups/privateregistries.py +294 -0
- ccai/restclient/github/public/groups/projectsclassic.py +1154 -0
- ccai/restclient/github/public/groups/pulls.py +1469 -0
- ccai/restclient/github/public/groups/ratelimit.py +68 -0
- ccai/restclient/github/public/groups/reactions.py +1247 -0
- ccai/restclient/github/public/groups/repos.py +9741 -0
- ccai/restclient/github/public/groups/search.py +417 -0
- ccai/restclient/github/public/groups/secretscanning.py +568 -0
- ccai/restclient/github/public/groups/securityadvisories.py +541 -0
- ccai/restclient/github/public/groups/teams.py +2985 -0
- ccai/restclient/github/public/groups/users.py +2054 -0
- ccai/restclient/github/public/py.typed +0 -0
- ccai/restclient/github/public/schemas/__init__.py +0 -0
- ccai/restclient/github/public/schemas/actions.py +418 -0
- ccai/restclient/github/public/schemas/activity.py +95 -0
- ccai/restclient/github/public/schemas/actor.py +20 -0
- ccai/restclient/github/public/schemas/addedtoprojectissueevent.py +24 -0
- ccai/restclient/github/public/schemas/apps.py +151 -0
- ccai/restclient/github/public/schemas/assignedissueevent.py +25 -0
- ccai/restclient/github/public/schemas/authenticationtoken.py +20 -0
- ccai/restclient/github/public/schemas/automerge.py +16 -0
- ccai/restclient/github/public/schemas/basicerror.py +16 -0
- ccai/restclient/github/public/schemas/billing.py +27 -0
- ccai/restclient/github/public/schemas/billingusagereport.py +12 -0
- ccai/restclient/github/public/schemas/billingusagereportuser.py +12 -0
- ccai/restclient/github/public/schemas/campaigns.py +27 -0
- ccai/restclient/github/public/schemas/checkrunwithsimplechecksuite.py +31 -0
- ccai/restclient/github/public/schemas/checks.py +80 -0
- ccai/restclient/github/public/schemas/classroom.py +109 -0
- ccai/restclient/github/public/schemas/codeofconductsimple.py +18 -0
- ccai/restclient/github/public/schemas/codescanning.py +197 -0
- ccai/restclient/github/public/schemas/codescanningalertlocation.py +17 -0
- ccai/restclient/github/public/schemas/codescanningalertrule.py +20 -0
- ccai/restclient/github/public/schemas/codescanningalertrulesummary.py +20 -0
- ccai/restclient/github/public/schemas/codescanninganalysistool.py +14 -0
- ccai/restclient/github/public/schemas/codescanningautofixcommitsresponse.py +11 -0
- ccai/restclient/github/public/schemas/codescanningdefaultsetupupdateresponse.py +15 -0
- ccai/restclient/github/public/schemas/codescanningsarifsreceipt.py +11 -0
- ccai/restclient/github/public/schemas/codescanningvariantanalysisrepository.py +20 -0
- ccai/restclient/github/public/schemas/codescanningvariantanalysisskippedrepogroup.py +13 -0
- ccai/restclient/github/public/schemas/codesecurity.py +73 -0
- ccai/restclient/github/public/schemas/codesofconduct.py +19 -0
- ccai/restclient/github/public/schemas/codespaces.py +130 -0
- ccai/restclient/github/public/schemas/codespacewithfullrepository.py +45 -0
- ccai/restclient/github/public/schemas/commit.py +25 -0
- ccai/restclient/github/public/schemas/contenttree.py +27 -0
- ccai/restclient/github/public/schemas/convertednotetoissueissueevent.py +24 -0
- ccai/restclient/github/public/schemas/copilot.py +50 -0
- ccai/restclient/github/public/schemas/copilotdotcomchat.py +16 -0
- ccai/restclient/github/public/schemas/copilotdotcompullrequests.py +16 -0
- ccai/restclient/github/public/schemas/copilotidechat.py +16 -0
- ccai/restclient/github/public/schemas/copilotidecodecompletions.py +17 -0
- ccai/restclient/github/public/schemas/copilotorganizationseatbreakdown.py +18 -0
- ccai/restclient/github/public/schemas/cvssseverities.py +13 -0
- ccai/restclient/github/public/schemas/demilestonedissueevent.py +24 -0
- ccai/restclient/github/public/schemas/dependabot.py +87 -0
- ccai/restclient/github/public/schemas/dependabotalertpackage.py +14 -0
- ccai/restclient/github/public/schemas/dependabotalertsecurityadvisory.py +29 -0
- ccai/restclient/github/public/schemas/dependabotalertsecurityvulnerability.py +18 -0
- ccai/restclient/github/public/schemas/dependency.py +16 -0
- ccai/restclient/github/public/schemas/dependencygraph.py +29 -0
- ccai/restclient/github/public/schemas/deploymentsimple.py +28 -0
- ccai/restclient/github/public/schemas/discussion.py +37 -0
- ccai/restclient/github/public/schemas/enterprise.py +24 -0
- ccai/restclient/github/public/schemas/enterpriseteam.py +27 -0
- ccai/restclient/github/public/schemas/enterprisewebhooks.py +26 -0
- ccai/restclient/github/public/schemas/gisthistory.py +19 -0
- ccai/restclient/github/public/schemas/gists.py +88 -0
- ccai/restclient/github/public/schemas/git.py +71 -0
- ccai/restclient/github/public/schemas/gitignore.py +14 -0
- ccai/restclient/github/public/schemas/hookdelivery.py +29 -0
- ccai/restclient/github/public/schemas/hookdeliveryitem.py +26 -0
- ccai/restclient/github/public/schemas/hookresponse.py +14 -0
- ccai/restclient/github/public/schemas/hostedcompute.py +30 -0
- ccai/restclient/github/public/schemas/installation.py +35 -0
- ccai/restclient/github/public/schemas/installationtoken.py +22 -0
- ccai/restclient/github/public/schemas/interactions.py +23 -0
- ccai/restclient/github/public/schemas/issuedependenciessummary.py +13 -0
- ccai/restclient/github/public/schemas/issueeventdismissedreview.py +15 -0
- ccai/restclient/github/public/schemas/issueeventlabel.py +16 -0
- ccai/restclient/github/public/schemas/issueeventmilestone.py +13 -0
- ccai/restclient/github/public/schemas/issueeventprojectcard.py +18 -0
- ccai/restclient/github/public/schemas/issueeventrename.py +14 -0
- ccai/restclient/github/public/schemas/issuefieldvalue.py +19 -0
- ccai/restclient/github/public/schemas/issues.py +135 -0
- ccai/restclient/github/public/schemas/labeledissueevent.py +24 -0
- ccai/restclient/github/public/schemas/licenses.py +58 -0
- ccai/restclient/github/public/schemas/link.py +13 -0
- ccai/restclient/github/public/schemas/linkwithtype.py +14 -0
- ccai/restclient/github/public/schemas/lockedissueevent.py +24 -0
- ccai/restclient/github/public/schemas/manifest.py +15 -0
- ccai/restclient/github/public/schemas/marketplaceaccount.py +18 -0
- ccai/restclient/github/public/schemas/mergegroup.py +17 -0
- ccai/restclient/github/public/schemas/meta.py +67 -0
- ccai/restclient/github/public/schemas/migrations.py +84 -0
- ccai/restclient/github/public/schemas/milestonedissueevent.py +24 -0
- ccai/restclient/github/public/schemas/minimalrepository.py +102 -0
- ccai/restclient/github/public/schemas/movedcolumninprojectissueevent.py +24 -0
- ccai/restclient/github/public/schemas/nullableactionshostedrunnerpoolimage.py +16 -0
- ccai/restclient/github/public/schemas/nullablecodeofconductsimple.py +18 -0
- ccai/restclient/github/public/schemas/nullablecodespacemachine.py +21 -0
- ccai/restclient/github/public/schemas/nullablecollaborator.py +37 -0
- ccai/restclient/github/public/schemas/nullablecommunityhealthfile.py +11 -0
- ccai/restclient/github/public/schemas/nullablegituser.py +15 -0
- ccai/restclient/github/public/schemas/nullableintegration.py +28 -0
- ccai/restclient/github/public/schemas/nullableissue.py +52 -0
- ccai/restclient/github/public/schemas/nullablelicensesimple.py +20 -0
- ccai/restclient/github/public/schemas/nullablemilestone.py +30 -0
- ccai/restclient/github/public/schemas/nullableminimalrepository.py +102 -0
- ccai/restclient/github/public/schemas/nullableorganizationsimple.py +26 -0
- ccai/restclient/github/public/schemas/nullableprojectsv2statusupdate.py +24 -0
- ccai/restclient/github/public/schemas/nullablerepository.py +110 -0
- ccai/restclient/github/public/schemas/nullablerepositorywebhooks.py +115 -0
- ccai/restclient/github/public/schemas/nullablescopedinstallation.py +18 -0
- ccai/restclient/github/public/schemas/nullablesimplecommit.py +20 -0
- ccai/restclient/github/public/schemas/nullablesimplerepository.py +60 -0
- ccai/restclient/github/public/schemas/nullablesimpleuser.py +36 -0
- ccai/restclient/github/public/schemas/nullableteamsimple.py +27 -0
- ccai/restclient/github/public/schemas/oidc.py +15 -0
- ccai/restclient/github/public/schemas/organizationinvitation.py +26 -0
- ccai/restclient/github/public/schemas/organizationsimplewebhooks.py +27 -0
- ccai/restclient/github/public/schemas/orgprivateregistryconfigurationwithselectedrepositories.py +21 -0
- ccai/restclient/github/public/schemas/orgs.py +332 -0
- ccai/restclient/github/public/schemas/packages.py +42 -0
- ccai/restclient/github/public/schemas/pagebuildstatus.py +14 -0
- ccai/restclient/github/public/schemas/pageshttpscertificate.py +15 -0
- ccai/restclient/github/public/schemas/pagessourcehash.py +11 -0
- ccai/restclient/github/public/schemas/personalaccesstokenrequest.py +28 -0
- ccai/restclient/github/public/schemas/privateregistries.py +20 -0
- ccai/restclient/github/public/schemas/projectsclassic.py +70 -0
- ccai/restclient/github/public/schemas/projectsv2.py +31 -0
- ccai/restclient/github/public/schemas/projectsv2item.py +23 -0
- ccai/restclient/github/public/schemas/projectsv2iterationsetting.py +20 -0
- ccai/restclient/github/public/schemas/projectsv2singleselectoption.py +18 -0
- ccai/restclient/github/public/schemas/projectsv2statusupdate.py +24 -0
- ccai/restclient/github/public/schemas/protectedbranchrequiredstatuscheck.py +20 -0
- ccai/restclient/github/public/schemas/publicip.py +15 -0
- ccai/restclient/github/public/schemas/pullrequestminimal.py +16 -0
- ccai/restclient/github/public/schemas/pullrequestsimple.py +50 -0
- ccai/restclient/github/public/schemas/pulls.py +185 -0
- ccai/restclient/github/public/schemas/ratelimit.py +23 -0
- ccai/restclient/github/public/schemas/reactions.py +17 -0
- ccai/restclient/github/public/schemas/referencedworkflow.py +15 -0
- ccai/restclient/github/public/schemas/removedfromprojectissueevent.py +24 -0
- ccai/restclient/github/public/schemas/renamedissueevent.py +24 -0
- ccai/restclient/github/public/schemas/repos.py +952 -0
- ccai/restclient/github/public/schemas/repository.py +110 -0
- ccai/restclient/github/public/schemas/repositoryadvisorycredit.py +15 -0
- ccai/restclient/github/public/schemas/repositoryadvisoryvulnerability.py +18 -0
- ccai/restclient/github/public/schemas/repositoryrulebranchnamepattern.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulecodescanning.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulecommitauthoremailpattern.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulecommitmessagepattern.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulecommitteremailpattern.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulecreation.py +13 -0
- ccai/restclient/github/public/schemas/repositoryruledeletion.py +13 -0
- ccai/restclient/github/public/schemas/repositoryrulefileextensionrestriction.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulefilepathrestriction.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulemaxfilepathlength.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulemaxfilesize.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulemergequeue.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulenonfastforward.py +13 -0
- ccai/restclient/github/public/schemas/repositoryruleparamscodescanningtool.py +15 -0
- ccai/restclient/github/public/schemas/repositoryruleparamsrequiredreviewerconfiguration.py +17 -0
- ccai/restclient/github/public/schemas/repositoryruleparamsrestrictedcommits.py +14 -0
- ccai/restclient/github/public/schemas/repositoryruleparamsreviewer.py +14 -0
- ccai/restclient/github/public/schemas/repositoryruleparamsstatuscheckconfiguration.py +14 -0
- ccai/restclient/github/public/schemas/repositoryruleparamsworkflowfilereference.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulepullrequest.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulerequireddeployments.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulerequiredlinearhistory.py +13 -0
- ccai/restclient/github/public/schemas/repositoryrulerequiredsignatures.py +13 -0
- ccai/restclient/github/public/schemas/repositoryrulerequiredstatuschecks.py +16 -0
- ccai/restclient/github/public/schemas/repositoryrulerulesetinfo.py +15 -0
- ccai/restclient/github/public/schemas/repositoryrulesetconditionsrepositoryidtarget.py +15 -0
- ccai/restclient/github/public/schemas/repositoryrulesetconditionsrepositorynametarget.py +15 -0
- ccai/restclient/github/public/schemas/repositoryrulesetconditionsrepositorypropertyspec.py +17 -0
- ccai/restclient/github/public/schemas/repositoryrulesetconditionsrepositorypropertytarget.py +15 -0
- ccai/restclient/github/public/schemas/repositoryruletagnamepattern.py +16 -0
- ccai/restclient/github/public/schemas/repositoryruleupdate.py +16 -0
- ccai/restclient/github/public/schemas/repositoryruleviolationerror.py +18 -0
- ccai/restclient/github/public/schemas/repositoryruleworkflows.py +16 -0
- ccai/restclient/github/public/schemas/repositorywebhooks.py +115 -0
- ccai/restclient/github/public/schemas/reviewdismissedissueevent.py +24 -0
- ccai/restclient/github/public/schemas/reviewrequestedissueevent.py +26 -0
- ccai/restclient/github/public/schemas/reviewrequestremovedissueevent.py +26 -0
- ccai/restclient/github/public/schemas/rulesetversion.py +17 -0
- ccai/restclient/github/public/schemas/runnerlabel.py +15 -0
- ccai/restclient/github/public/schemas/scimerror.py +20 -0
- ccai/restclient/github/public/schemas/search.py +263 -0
- ccai/restclient/github/public/schemas/secretscanning.py +96 -0
- ccai/restclient/github/public/schemas/secretscanningalertwebhook.py +33 -0
- ccai/restclient/github/public/schemas/secretscanninglocationcommit.py +21 -0
- ccai/restclient/github/public/schemas/secretscanninglocationdiscussionbody.py +13 -0
- ccai/restclient/github/public/schemas/secretscanninglocationdiscussioncomment.py +13 -0
- ccai/restclient/github/public/schemas/secretscanninglocationdiscussiontitle.py +13 -0
- ccai/restclient/github/public/schemas/secretscanninglocationissuebody.py +13 -0
- ccai/restclient/github/public/schemas/secretscanninglocationissuecomment.py +13 -0
- ccai/restclient/github/public/schemas/secretscanninglocationissuetitle.py +13 -0
- ccai/restclient/github/public/schemas/secretscanninglocationpullrequestbody.py +13 -0
- ccai/restclient/github/public/schemas/secretscanninglocationpullrequestcomment.py +13 -0
- ccai/restclient/github/public/schemas/secretscanninglocationpullrequestreview.py +13 -0
- ccai/restclient/github/public/schemas/secretscanninglocationpullrequestreviewcomment.py +13 -0
- ccai/restclient/github/public/schemas/secretscanninglocationpullrequesttitle.py +13 -0
- ccai/restclient/github/public/schemas/secretscanninglocationwikicommit.py +21 -0
- ccai/restclient/github/public/schemas/secretscanningpatternoverride.py +23 -0
- ccai/restclient/github/public/schemas/secretscanningscan.py +18 -0
- ccai/restclient/github/public/schemas/securityadvisories.py +106 -0
- ccai/restclient/github/public/schemas/securityadvisoryepss.py +14 -0
- ccai/restclient/github/public/schemas/securityandanalysis.py +18 -0
- ccai/restclient/github/public/schemas/shortblob.py +14 -0
- ccai/restclient/github/public/schemas/simplechecksuite.py +28 -0
- ccai/restclient/github/public/schemas/simpleclassroomorganization.py +20 -0
- ccai/restclient/github/public/schemas/simpleclassroomrepository.py +18 -0
- ccai/restclient/github/public/schemas/simpleclassroomuser.py +16 -0
- ccai/restclient/github/public/schemas/simplecommit.py +20 -0
- ccai/restclient/github/public/schemas/simplecommitstatus.py +22 -0
- ccai/restclient/github/public/schemas/simpleinstallation.py +16 -0
- ccai/restclient/github/public/schemas/simplerepository.py +60 -0
- ccai/restclient/github/public/schemas/statechangeissueevent.py +24 -0
- ccai/restclient/github/public/schemas/subissuessummary.py +12 -0
- ccai/restclient/github/public/schemas/teamorganization.py +63 -0
- ccai/restclient/github/public/schemas/teams.py +202 -0
- ccai/restclient/github/public/schemas/timelineassignedissueevent.py +24 -0
- ccai/restclient/github/public/schemas/timelinecommentevent.py +30 -0
- ccai/restclient/github/public/schemas/timelinecommitcommentedevent.py +18 -0
- ccai/restclient/github/public/schemas/timelinecommittedevent.py +25 -0
- ccai/restclient/github/public/schemas/timelinecrossreferencedevent.py +19 -0
- ccai/restclient/github/public/schemas/timelinelinecommentedevent.py +17 -0
- ccai/restclient/github/public/schemas/timelinereviewedevent.py +29 -0
- ccai/restclient/github/public/schemas/timelineunassignedissueevent.py +24 -0
- ccai/restclient/github/public/schemas/traffic.py +12 -0
- ccai/restclient/github/public/schemas/unassignedissueevent.py +25 -0
- ccai/restclient/github/public/schemas/unlabeledissueevent.py +24 -0
- ccai/restclient/github/public/schemas/users.py +183 -0
- ccai/restclient/github/public/schemas/validationerror.py +17 -0
- ccai/restclient/github/public/schemas/validationerrorsimple.py +17 -0
- ccai/restclient/github/public/schemas/verification.py +16 -0
- ccai/restclient/github/public/schemas/vulnerability.py +18 -0
- ccai/restclient/github/public/schemas/webhookbranchprotectionconfigurationdisabled.py +15 -0
- ccai/restclient/github/public/schemas/webhookbranchprotectionconfigurationenabled.py +15 -0
- ccai/restclient/github/public/schemas/webhookbranchprotectionrulecreated.py +16 -0
- ccai/restclient/github/public/schemas/webhookbranchprotectionruledeleted.py +16 -0
- ccai/restclient/github/public/schemas/webhookbranchprotectionruleedited.py +19 -0
- ccai/restclient/github/public/schemas/webhookcheckruncompleted.py +15 -0
- ccai/restclient/github/public/schemas/webhookcheckruncompletedformencoded.py +13 -0
- ccai/restclient/github/public/schemas/webhookcheckruncreated.py +15 -0
- ccai/restclient/github/public/schemas/webhookcheckruncreatedformencoded.py +13 -0
- ccai/restclient/github/public/schemas/webhookcheckrunrequestedaction.py +18 -0
- ccai/restclient/github/public/schemas/webhookcheckrunrequestedactionformencoded.py +13 -0
- ccai/restclient/github/public/schemas/webhookcheckrunrerequested.py +15 -0
- ccai/restclient/github/public/schemas/webhookcheckrunrerequestedformencoded.py +13 -0
- ccai/restclient/github/public/schemas/webhookchecksuitecompleted.py +18 -0
- ccai/restclient/github/public/schemas/webhookchecksuiterequested.py +18 -0
- ccai/restclient/github/public/schemas/webhookchecksuitererequested.py +18 -0
- ccai/restclient/github/public/schemas/webhookcodescanningalertappearedinbranch.py +20 -0
- ccai/restclient/github/public/schemas/webhookcodescanningalertclosedbyuser.py +20 -0
- ccai/restclient/github/public/schemas/webhookcodescanningalertcreated.py +20 -0
- ccai/restclient/github/public/schemas/webhookcodescanningalertfixed.py +20 -0
- ccai/restclient/github/public/schemas/webhookcodescanningalertreopened.py +20 -0
- ccai/restclient/github/public/schemas/webhookcodescanningalertreopenedbyuser.py +20 -0
- ccai/restclient/github/public/schemas/webhookcommitcommentcreated.py +18 -0
- ccai/restclient/github/public/schemas/webhookcreate.py +21 -0
- ccai/restclient/github/public/schemas/webhookcustompropertycreated.py +15 -0
- ccai/restclient/github/public/schemas/webhookcustompropertydeleted.py +17 -0
- ccai/restclient/github/public/schemas/webhookcustompropertypromotedtoenterprise.py +15 -0
- ccai/restclient/github/public/schemas/webhookcustompropertyupdated.py +15 -0
- ccai/restclient/github/public/schemas/webhookcustompropertyvaluesupdated.py +19 -0
- ccai/restclient/github/public/schemas/webhookdelete.py +17 -0
- ccai/restclient/github/public/schemas/webhookdependabotalertautodismissed.py +16 -0
- ccai/restclient/github/public/schemas/webhookdependabotalertautoreopened.py +16 -0
- ccai/restclient/github/public/schemas/webhookdependabotalertcreated.py +16 -0
- ccai/restclient/github/public/schemas/webhookdependabotalertdismissed.py +16 -0
- ccai/restclient/github/public/schemas/webhookdependabotalertfixed.py +16 -0
- ccai/restclient/github/public/schemas/webhookdependabotalertreintroduced.py +16 -0
- ccai/restclient/github/public/schemas/webhookdependabotalertreopened.py +16 -0
- ccai/restclient/github/public/schemas/webhookdeploykeycreated.py +16 -0
- ccai/restclient/github/public/schemas/webhookdeploykeydeleted.py +16 -0
- ccai/restclient/github/public/schemas/webhookdeploymentcreated.py +20 -0
- ccai/restclient/github/public/schemas/webhookdeploymentprotectionrulerequested.py +21 -0
- ccai/restclient/github/public/schemas/webhookdeploymentreviewapproved.py +24 -0
- ccai/restclient/github/public/schemas/webhookdeploymentreviewrejected.py +24 -0
- ccai/restclient/github/public/schemas/webhookdeploymentreviewrequested.py +23 -0
- ccai/restclient/github/public/schemas/webhookdeploymentstatuscreated.py +22 -0
- ccai/restclient/github/public/schemas/webhookdiscussionanswered.py +17 -0
- ccai/restclient/github/public/schemas/webhookdiscussioncategorychanged.py +19 -0
- ccai/restclient/github/public/schemas/webhookdiscussionclosed.py +16 -0
- ccai/restclient/github/public/schemas/webhookdiscussioncommentcreated.py +17 -0
- ccai/restclient/github/public/schemas/webhookdiscussioncommentdeleted.py +17 -0
- ccai/restclient/github/public/schemas/webhookdiscussioncommentedited.py +20 -0
- ccai/restclient/github/public/schemas/webhookdiscussioncreated.py +16 -0
- ccai/restclient/github/public/schemas/webhookdiscussiondeleted.py +16 -0
- ccai/restclient/github/public/schemas/webhookdiscussionedited.py +19 -0
- ccai/restclient/github/public/schemas/webhookdiscussionlabeled.py +17 -0
- ccai/restclient/github/public/schemas/webhookdiscussionlocked.py +16 -0
- ccai/restclient/github/public/schemas/webhookdiscussionpinned.py +16 -0
- ccai/restclient/github/public/schemas/webhookdiscussionreopened.py +16 -0
- ccai/restclient/github/public/schemas/webhookdiscussiontransferred.py +19 -0
- ccai/restclient/github/public/schemas/webhookdiscussionunanswered.py +15 -0
- ccai/restclient/github/public/schemas/webhookdiscussionunlabeled.py +17 -0
- ccai/restclient/github/public/schemas/webhookdiscussionunlocked.py +16 -0
- ccai/restclient/github/public/schemas/webhookdiscussionunpinned.py +16 -0
- ccai/restclient/github/public/schemas/webhookfork.py +18 -0
- ccai/restclient/github/public/schemas/webhookgithubappauthorizationrevoked.py +11 -0
- ccai/restclient/github/public/schemas/webhookgollum.py +17 -0
- ccai/restclient/github/public/schemas/webhookinstallationcreated.py +19 -0
- ccai/restclient/github/public/schemas/webhookinstallationdeleted.py +19 -0
- ccai/restclient/github/public/schemas/webhookinstallationnewpermissionsaccepted.py +19 -0
- ccai/restclient/github/public/schemas/webhookinstallationrepositoriesadded.py +21 -0
- ccai/restclient/github/public/schemas/webhookinstallationrepositoriesremoved.py +21 -0
- ccai/restclient/github/public/schemas/webhookinstallationsuspend.py +19 -0
- ccai/restclient/github/public/schemas/webhookinstallationtargetrenamed.py +20 -0
- ccai/restclient/github/public/schemas/webhookinstallationunsuspend.py +19 -0
- ccai/restclient/github/public/schemas/webhookissuecommentcreated.py +19 -0
- ccai/restclient/github/public/schemas/webhookissuecommentdeleted.py +17 -0
- ccai/restclient/github/public/schemas/webhookissuecommentedited.py +18 -0
- ccai/restclient/github/public/schemas/webhookissuedependenciesblockedbyadded.py +19 -0
- ccai/restclient/github/public/schemas/webhookissuedependenciesblockedbyremoved.py +19 -0
- ccai/restclient/github/public/schemas/webhookissuedependenciesblockingadded.py +19 -0
- ccai/restclient/github/public/schemas/webhookissuedependenciesblockingremoved.py +19 -0
- ccai/restclient/github/public/schemas/webhookissuesassigned.py +17 -0
- ccai/restclient/github/public/schemas/webhookissuesclosed.py +16 -0
- ccai/restclient/github/public/schemas/webhookissuesdeleted.py +18 -0
- ccai/restclient/github/public/schemas/webhookissuesdemilestoned.py +19 -0
- ccai/restclient/github/public/schemas/webhookissuesedited.py +20 -0
- ccai/restclient/github/public/schemas/webhookissueslabeled.py +19 -0
- ccai/restclient/github/public/schemas/webhookissueslocked.py +18 -0
- ccai/restclient/github/public/schemas/webhookissuesmilestoned.py +19 -0
- ccai/restclient/github/public/schemas/webhookissuesopened.py +19 -0
- ccai/restclient/github/public/schemas/webhookissuespinned.py +16 -0
- ccai/restclient/github/public/schemas/webhookissuesreopened.py +18 -0
- ccai/restclient/github/public/schemas/webhookissuestransferred.py +19 -0
- ccai/restclient/github/public/schemas/webhookissuestyped.py +17 -0
- ccai/restclient/github/public/schemas/webhookissuesunassigned.py +17 -0
- ccai/restclient/github/public/schemas/webhookissuesunlabeled.py +17 -0
- ccai/restclient/github/public/schemas/webhookissuesunlocked.py +18 -0
- ccai/restclient/github/public/schemas/webhookissuesunpinned.py +16 -0
- ccai/restclient/github/public/schemas/webhookissuesuntyped.py +17 -0
- ccai/restclient/github/public/schemas/webhooklabelcreated.py +16 -0
- ccai/restclient/github/public/schemas/webhooklabeldeleted.py +16 -0
- ccai/restclient/github/public/schemas/webhooklabeledited.py +19 -0
- ccai/restclient/github/public/schemas/webhookmarketplacepurchasecancelled.py +18 -0
- ccai/restclient/github/public/schemas/webhookmarketplacepurchasechanged.py +20 -0
- ccai/restclient/github/public/schemas/webhookmarketplacepurchasependingchange.py +20 -0
- ccai/restclient/github/public/schemas/webhookmarketplacepurchasependingchangecancelled.py +20 -0
- ccai/restclient/github/public/schemas/webhookmarketplacepurchasepurchased.py +18 -0
- ccai/restclient/github/public/schemas/webhookmemberadded.py +19 -0
- ccai/restclient/github/public/schemas/webhookmemberedited.py +19 -0
- ccai/restclient/github/public/schemas/webhookmemberremoved.py +16 -0
- ccai/restclient/github/public/schemas/webhookmembershipadded.py +20 -0
- ccai/restclient/github/public/schemas/webhookmembershipremoved.py +20 -0
- ccai/restclient/github/public/schemas/webhookmergegroupchecksrequested.py +15 -0
- ccai/restclient/github/public/schemas/webhookmergegroupdestroyed.py +16 -0
- ccai/restclient/github/public/schemas/webhookmetadeleted.py +19 -0
- ccai/restclient/github/public/schemas/webhookmilestoneclosed.py +16 -0
- ccai/restclient/github/public/schemas/webhookmilestonecreated.py +16 -0
- ccai/restclient/github/public/schemas/webhookmilestonedeleted.py +16 -0
- ccai/restclient/github/public/schemas/webhookmilestoneedited.py +19 -0
- ccai/restclient/github/public/schemas/webhookmilestoneopened.py +16 -0
- ccai/restclient/github/public/schemas/webhookorganizationdeleted.py +16 -0
- ccai/restclient/github/public/schemas/webhookorganizationmemberadded.py +16 -0
- ccai/restclient/github/public/schemas/webhookorganizationmemberinvited.py +19 -0
- ccai/restclient/github/public/schemas/webhookorganizationmemberremoved.py +16 -0
- ccai/restclient/github/public/schemas/webhookorganizationrenamed.py +19 -0
- ccai/restclient/github/public/schemas/webhookorgblockblocked.py +16 -0
- ccai/restclient/github/public/schemas/webhookorgblockunblocked.py +16 -0
- ccai/restclient/github/public/schemas/webhookpackagepublished.py +18 -0
- ccai/restclient/github/public/schemas/webhookpackageupdated.py +18 -0
- ccai/restclient/github/public/schemas/webhookpagebuild.py +18 -0
- ccai/restclient/github/public/schemas/webhookpersonalaccesstokenrequestapproved.py +15 -0
- ccai/restclient/github/public/schemas/webhookpersonalaccesstokenrequestcancelled.py +15 -0
- ccai/restclient/github/public/schemas/webhookpersonalaccesstokenrequestcreated.py +15 -0
- ccai/restclient/github/public/schemas/webhookpersonalaccesstokenrequestdenied.py +15 -0
- ccai/restclient/github/public/schemas/webhookping.py +17 -0
- ccai/restclient/github/public/schemas/webhookpingformencoded.py +13 -0
- ccai/restclient/github/public/schemas/webhookprojectcardconverted.py +19 -0
- ccai/restclient/github/public/schemas/webhookprojectcardcreated.py +16 -0
- ccai/restclient/github/public/schemas/webhookprojectcarddeleted.py +18 -0
- ccai/restclient/github/public/schemas/webhookprojectcardedited.py +19 -0
- ccai/restclient/github/public/schemas/webhookprojectcardmoved.py +19 -0
- ccai/restclient/github/public/schemas/webhookprojectclosed.py +16 -0
- ccai/restclient/github/public/schemas/webhookprojectcolumncreated.py +16 -0
- ccai/restclient/github/public/schemas/webhookprojectcolumndeleted.py +16 -0
- ccai/restclient/github/public/schemas/webhookprojectcolumnedited.py +19 -0
- ccai/restclient/github/public/schemas/webhookprojectcolumnmoved.py +16 -0
- ccai/restclient/github/public/schemas/webhookprojectcreated.py +16 -0
- ccai/restclient/github/public/schemas/webhookprojectdeleted.py +16 -0
- ccai/restclient/github/public/schemas/webhookprojectedited.py +19 -0
- ccai/restclient/github/public/schemas/webhookprojectreopened.py +16 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2itemarchived.py +15 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2itemconverted.py +17 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2itemcreated.py +14 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2itemdeleted.py +14 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2itemedited.py +17 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2itemreordered.py +17 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2itemrestored.py +15 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2projectclosed.py +14 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2projectcreated.py +17 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2projectdeleted.py +14 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2projectedited.py +17 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2projectreopened.py +14 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2statusupdatecreated.py +14 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2statusupdatedeleted.py +14 -0
- ccai/restclient/github/public/schemas/webhookprojectsv2statusupdateedited.py +17 -0
- ccai/restclient/github/public/schemas/webhookpublic.py +14 -0
- ccai/restclient/github/public/schemas/webhookpullrequestassigned.py +20 -0
- ccai/restclient/github/public/schemas/webhookpullrequestautomergedisabled.py +20 -0
- ccai/restclient/github/public/schemas/webhookpullrequestautomergeenabled.py +20 -0
- ccai/restclient/github/public/schemas/webhookpullrequestclosed.py +17 -0
- ccai/restclient/github/public/schemas/webhookpullrequestconvertedtodraft.py +17 -0
- ccai/restclient/github/public/schemas/webhookpullrequestdemilestoned.py +17 -0
- ccai/restclient/github/public/schemas/webhookpullrequestdequeued.py +20 -0
- ccai/restclient/github/public/schemas/webhookpullrequestedited.py +20 -0
- ccai/restclient/github/public/schemas/webhookpullrequestenqueued.py +19 -0
- ccai/restclient/github/public/schemas/webhookpullrequestlabeled.py +20 -0
- ccai/restclient/github/public/schemas/webhookpullrequestlocked.py +19 -0
- ccai/restclient/github/public/schemas/webhookpullrequestmilestoned.py +17 -0
- ccai/restclient/github/public/schemas/webhookpullrequestopened.py +17 -0
- ccai/restclient/github/public/schemas/webhookpullrequestreadyforreview.py +17 -0
- ccai/restclient/github/public/schemas/webhookpullrequestreopened.py +17 -0
- ccai/restclient/github/public/schemas/webhookpullrequestreviewcommentcreated.py +19 -0
- ccai/restclient/github/public/schemas/webhookpullrequestreviewcommentdeleted.py +19 -0
- ccai/restclient/github/public/schemas/webhookpullrequestreviewcommentedited.py +20 -0
- ccai/restclient/github/public/schemas/webhookpullrequestreviewdismissed.py +19 -0
- ccai/restclient/github/public/schemas/webhookpullrequestreviewedited.py +20 -0
- ccai/restclient/github/public/schemas/webhookpullrequestreviewsubmitted.py +19 -0
- ccai/restclient/github/public/schemas/webhookpullrequestreviewthreadresolved.py +20 -0
- ccai/restclient/github/public/schemas/webhookpullrequestreviewthreadunresolved.py +20 -0
- ccai/restclient/github/public/schemas/webhookpullrequestsynchronize.py +21 -0
- ccai/restclient/github/public/schemas/webhookpullrequestunassigned.py +20 -0
- ccai/restclient/github/public/schemas/webhookpullrequestunlabeled.py +20 -0
- ccai/restclient/github/public/schemas/webhookpullrequestunlocked.py +19 -0
- ccai/restclient/github/public/schemas/webhookpush.py +27 -0
- ccai/restclient/github/public/schemas/webhookregistrypackagepublished.py +18 -0
- ccai/restclient/github/public/schemas/webhookregistrypackageupdated.py +18 -0
- ccai/restclient/github/public/schemas/webhookreleasecreated.py +16 -0
- ccai/restclient/github/public/schemas/webhookreleasedeleted.py +16 -0
- ccai/restclient/github/public/schemas/webhookreleaseedited.py +19 -0
- ccai/restclient/github/public/schemas/webhookreleaseprereleased.py +18 -0
- ccai/restclient/github/public/schemas/webhookreleasepublished.py +16 -0
- ccai/restclient/github/public/schemas/webhookreleasereleased.py +16 -0
- ccai/restclient/github/public/schemas/webhookreleaseunpublished.py +16 -0
- ccai/restclient/github/public/schemas/webhookrepositoryadvisorypublished.py +16 -0
- ccai/restclient/github/public/schemas/webhookrepositoryadvisoryreported.py +16 -0
- ccai/restclient/github/public/schemas/webhookrepositoryarchived.py +15 -0
- ccai/restclient/github/public/schemas/webhookrepositorycreated.py +15 -0
- ccai/restclient/github/public/schemas/webhookrepositorydeleted.py +15 -0
- ccai/restclient/github/public/schemas/webhookrepositorydispatchsample.py +19 -0
- ccai/restclient/github/public/schemas/webhookrepositoryedited.py +18 -0
- ccai/restclient/github/public/schemas/webhookrepositoryimport.py +15 -0
- ccai/restclient/github/public/schemas/webhookrepositoryprivatized.py +15 -0
- ccai/restclient/github/public/schemas/webhookrepositorypublicized.py +15 -0
- ccai/restclient/github/public/schemas/webhookrepositoryrenamed.py +18 -0
- ccai/restclient/github/public/schemas/webhookrepositoryrulesetcreated.py +16 -0
- ccai/restclient/github/public/schemas/webhookrepositoryrulesetdeleted.py +16 -0
- ccai/restclient/github/public/schemas/webhookrepositoryrulesetedited.py +19 -0
- ccai/restclient/github/public/schemas/webhookrepositorytransferred.py +18 -0
- ccai/restclient/github/public/schemas/webhookrepositoryunarchived.py +15 -0
- ccai/restclient/github/public/schemas/webhookrepositoryvulnerabilityalertcreate.py +16 -0
- ccai/restclient/github/public/schemas/webhookrepositoryvulnerabilityalertdismiss.py +18 -0
- ccai/restclient/github/public/schemas/webhookrepositoryvulnerabilityalertreopen.py +16 -0
- ccai/restclient/github/public/schemas/webhookrepositoryvulnerabilityalertresolve.py +18 -0
- ccai/restclient/github/public/schemas/webhookrubygemsmetadata.py +21 -0
- ccai/restclient/github/public/schemas/webhooksalert.py +31 -0
- ccai/restclient/github/public/schemas/webhooksanswer.py +24 -0
- ccai/restclient/github/public/schemas/webhooksapprover.py +28 -0
- ccai/restclient/github/public/schemas/webhookschanges.py +15 -0
- ccai/restclient/github/public/schemas/webhookschanges8.py +12 -0
- ccai/restclient/github/public/schemas/webhookscomment.py +24 -0
- ccai/restclient/github/public/schemas/webhooksdeploykey.py +24 -0
- ccai/restclient/github/public/schemas/webhooksecretscanningalertcreated.py +16 -0
- ccai/restclient/github/public/schemas/webhooksecretscanningalertlocationcreated.py +16 -0
- ccai/restclient/github/public/schemas/webhooksecretscanningalertlocationcreatedformencoded.py +10 -0
- ccai/restclient/github/public/schemas/webhooksecretscanningalertpubliclyleaked.py +16 -0
- ccai/restclient/github/public/schemas/webhooksecretscanningalertreopened.py +16 -0
- ccai/restclient/github/public/schemas/webhooksecretscanningalertresolved.py +16 -0
- ccai/restclient/github/public/schemas/webhooksecretscanningalertvalidated.py +16 -0
- ccai/restclient/github/public/schemas/webhooksecretscanningscancompleted.py +24 -0
- ccai/restclient/github/public/schemas/webhooksecurityadvisorypublished.py +16 -0
- ccai/restclient/github/public/schemas/webhooksecurityadvisoryupdated.py +16 -0
- ccai/restclient/github/public/schemas/webhooksecurityadvisorywithdrawn.py +18 -0
- ccai/restclient/github/public/schemas/webhooksecurityandanalysis.py +17 -0
- ccai/restclient/github/public/schemas/webhooksissue.py +48 -0
- ccai/restclient/github/public/schemas/webhooksissue2.py +48 -0
- ccai/restclient/github/public/schemas/webhooksissuecomment.py +26 -0
- ccai/restclient/github/public/schemas/webhookslabel.py +18 -0
- ccai/restclient/github/public/schemas/webhooksmarketplacepurchase.py +18 -0
- ccai/restclient/github/public/schemas/webhooksmembership.py +21 -0
- ccai/restclient/github/public/schemas/webhooksmilestone.py +30 -0
- ccai/restclient/github/public/schemas/webhooksmilestone3.py +30 -0
- ccai/restclient/github/public/schemas/webhooksponsorshipcancelled.py +16 -0
- ccai/restclient/github/public/schemas/webhooksponsorshipcreated.py +16 -0
- ccai/restclient/github/public/schemas/webhooksponsorshipedited.py +19 -0
- ccai/restclient/github/public/schemas/webhooksponsorshippendingcancellation.py +17 -0
- ccai/restclient/github/public/schemas/webhooksponsorshippendingtierchange.py +18 -0
- ccai/restclient/github/public/schemas/webhooksponsorshiptierchanged.py +17 -0
- ccai/restclient/github/public/schemas/webhookspreviousmarketplacepurchase.py +18 -0
- ccai/restclient/github/public/schemas/webhooksproject.py +24 -0
- ccai/restclient/github/public/schemas/webhooksprojectcard.py +24 -0
- ccai/restclient/github/public/schemas/webhooksprojectchanges.py +12 -0
- ccai/restclient/github/public/schemas/webhooksprojectcolumn.py +20 -0
- ccai/restclient/github/public/schemas/webhookspullrequest5.py +59 -0
- ccai/restclient/github/public/schemas/webhooksrelease.py +36 -0
- ccai/restclient/github/public/schemas/webhooksrelease1.py +36 -0
- ccai/restclient/github/public/schemas/webhooksreview.py +26 -0
- ccai/restclient/github/public/schemas/webhooksreviewcomment.py +41 -0
- ccai/restclient/github/public/schemas/webhooksrule.py +42 -0
- ccai/restclient/github/public/schemas/webhookssecurityadvisory.py +27 -0
- ccai/restclient/github/public/schemas/webhookssponsorship.py +18 -0
- ccai/restclient/github/public/schemas/webhookstarcreated.py +18 -0
- ccai/restclient/github/public/schemas/webhookstardeleted.py +18 -0
- ccai/restclient/github/public/schemas/webhookstatus.py +28 -0
- ccai/restclient/github/public/schemas/webhooksteam.py +28 -0
- ccai/restclient/github/public/schemas/webhooksteam1.py +28 -0
- ccai/restclient/github/public/schemas/webhooksubissuesparentissueadded.py +19 -0
- ccai/restclient/github/public/schemas/webhooksubissuesparentissueremoved.py +19 -0
- ccai/restclient/github/public/schemas/webhooksubissuessubissueadded.py +19 -0
- ccai/restclient/github/public/schemas/webhooksubissuessubissueremoved.py +19 -0
- ccai/restclient/github/public/schemas/webhooksuser.py +33 -0
- ccai/restclient/github/public/schemas/webhooksusermannequin.py +33 -0
- ccai/restclient/github/public/schemas/webhooksworkflow.py +19 -0
- ccai/restclient/github/public/schemas/webhooksworkflowjobrun.py +19 -0
- ccai/restclient/github/public/schemas/webhookteamadd.py +15 -0
- ccai/restclient/github/public/schemas/webhookteamaddedtorepository.py +18 -0
- ccai/restclient/github/public/schemas/webhookteamcreated.py +18 -0
- ccai/restclient/github/public/schemas/webhookteamdeleted.py +18 -0
- ccai/restclient/github/public/schemas/webhookteamedited.py +19 -0
- ccai/restclient/github/public/schemas/webhookteamremovedfromrepository.py +18 -0
- ccai/restclient/github/public/schemas/webhookwatchstarted.py +15 -0
- ccai/restclient/github/public/schemas/webhookworkflowdispatch.py +19 -0
- ccai/restclient/github/public/schemas/webhookworkflowjobcompleted.py +17 -0
- ccai/restclient/github/public/schemas/webhookworkflowjobinprogress.py +17 -0
- ccai/restclient/github/public/schemas/webhookworkflowjobqueued.py +19 -0
- ccai/restclient/github/public/schemas/webhookworkflowjobwaiting.py +19 -0
- ccai/restclient/github/public/schemas/webhookworkflowruncompleted.py +19 -0
- ccai/restclient/github/public/schemas/webhookworkflowruninprogress.py +19 -0
- ccai/restclient/github/public/schemas/webhookworkflowrunrequested.py +19 -0
- codecraftai_restclient_github_public-1.2.0.dist-info/METADATA +87 -0
- codecraftai_restclient_github_public-1.2.0.dist-info/RECORD +579 -0
- codecraftai_restclient_github_public-1.2.0.dist-info/WHEEL +4 -0
- codecraftai_restclient_github_public-1.2.0.dist-info/licenses/LICENSE.md +204 -0
|
@@ -0,0 +1,2985 @@
|
|
|
1
|
+
# Auto-generated by RestClientGenerator. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict, List, Optional
|
|
4
|
+
|
|
5
|
+
from ccai.restclient.base.aspectsrest import AspectsRest
|
|
6
|
+
from ccai.restclient.base.pagedlist import PagedList
|
|
7
|
+
from ccai.restclient.base.restapigroup import RestApiGroup
|
|
8
|
+
from ccai.restclient.github.public.schemas.minimalrepository import MinimalRepository
|
|
9
|
+
from ccai.restclient.github.public.schemas.organizationinvitation import OrganizationInvitation
|
|
10
|
+
from ccai.restclient.github.public.schemas.repos import SimpleUser
|
|
11
|
+
from ccai.restclient.github.public.schemas.repos import Team
|
|
12
|
+
from ccai.restclient.github.public.schemas.teams import TeamDiscussion
|
|
13
|
+
from ccai.restclient.github.public.schemas.teams import TeamDiscussionComment
|
|
14
|
+
from ccai.restclient.github.public.schemas.teams import TeamFull
|
|
15
|
+
from ccai.restclient.github.public.schemas.teams import TeamMembership
|
|
16
|
+
from ccai.restclient.github.public.schemas.teams import TeamProject
|
|
17
|
+
from ccai.restclient.github.public.schemas.teams import TeamRepository
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class TeamsApiGroup(RestApiGroup):
|
|
21
|
+
"""
|
|
22
|
+
Interact with GitHub Teams.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
def add_member_legacy(self, team_id: int, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
26
|
+
"""
|
|
27
|
+
Add team member (Legacy)
|
|
28
|
+
|
|
29
|
+
The "Add team member" endpoint (described below) is closing down.
|
|
30
|
+
|
|
31
|
+
We recommend using the [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams.
|
|
32
|
+
|
|
33
|
+
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
|
|
34
|
+
|
|
35
|
+
To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization.
|
|
36
|
+
|
|
37
|
+
> [!NOTE]
|
|
38
|
+
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."
|
|
39
|
+
|
|
40
|
+
Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."
|
|
41
|
+
"""
|
|
42
|
+
client = self.client
|
|
43
|
+
if aspects is None:
|
|
44
|
+
aspects = client.aspects
|
|
45
|
+
|
|
46
|
+
header_params = client.headers
|
|
47
|
+
if headers is not None:
|
|
48
|
+
header_params = headers
|
|
49
|
+
|
|
50
|
+
leaf_template = "/teams/{team_id}/members/{username}"
|
|
51
|
+
path_params = {
|
|
52
|
+
'team_id': team_id,
|
|
53
|
+
'username': username,
|
|
54
|
+
}
|
|
55
|
+
call_leaf = leaf_template.format(**path_params)
|
|
56
|
+
|
|
57
|
+
query_params = None
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
if exp_status is None:
|
|
61
|
+
exp_status = [204]
|
|
62
|
+
|
|
63
|
+
resp = client.perform_call(
|
|
64
|
+
leaf=call_leaf,
|
|
65
|
+
method="PUT",
|
|
66
|
+
params=query_params if query_params else None,
|
|
67
|
+
body=None,
|
|
68
|
+
exp_status=exp_status,
|
|
69
|
+
headers=header_params if header_params else None,
|
|
70
|
+
context_msg=None,
|
|
71
|
+
aspects=aspects,
|
|
72
|
+
)
|
|
73
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
74
|
+
rtnval = None
|
|
75
|
+
else:
|
|
76
|
+
rtnval = resp.json()
|
|
77
|
+
return rtnval
|
|
78
|
+
|
|
79
|
+
def add_or_update_membership_for_user_in_org(self, org: str, team_slug: str, username: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamMembership:
|
|
80
|
+
"""
|
|
81
|
+
Add or update team membership for a user
|
|
82
|
+
|
|
83
|
+
Adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.
|
|
84
|
+
|
|
85
|
+
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
|
|
86
|
+
|
|
87
|
+
> [!NOTE]
|
|
88
|
+
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."
|
|
89
|
+
|
|
90
|
+
An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team.
|
|
91
|
+
|
|
92
|
+
If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.
|
|
93
|
+
|
|
94
|
+
> [!NOTE]
|
|
95
|
+
> You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`.
|
|
96
|
+
"""
|
|
97
|
+
client = self.client
|
|
98
|
+
if aspects is None:
|
|
99
|
+
aspects = client.aspects
|
|
100
|
+
|
|
101
|
+
header_params = client.headers
|
|
102
|
+
if headers is not None:
|
|
103
|
+
header_params = headers
|
|
104
|
+
|
|
105
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/memberships/{username}"
|
|
106
|
+
path_params = {
|
|
107
|
+
'org': org,
|
|
108
|
+
'team_slug': team_slug,
|
|
109
|
+
'username': username,
|
|
110
|
+
}
|
|
111
|
+
call_leaf = leaf_template.format(**path_params)
|
|
112
|
+
|
|
113
|
+
query_params = None
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
if exp_status is None:
|
|
117
|
+
exp_status = [200]
|
|
118
|
+
|
|
119
|
+
resp = client.perform_call(
|
|
120
|
+
leaf=call_leaf,
|
|
121
|
+
method="PUT",
|
|
122
|
+
params=query_params if query_params else None,
|
|
123
|
+
body=body,
|
|
124
|
+
exp_status=exp_status,
|
|
125
|
+
headers=header_params if header_params else None,
|
|
126
|
+
context_msg=None,
|
|
127
|
+
aspects=aspects,
|
|
128
|
+
)
|
|
129
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
130
|
+
rtnobj = None
|
|
131
|
+
else:
|
|
132
|
+
raw_data = resp.json()
|
|
133
|
+
rtnobj = TeamMembership.from_dict(raw_data)
|
|
134
|
+
return rtnobj
|
|
135
|
+
|
|
136
|
+
def add_or_update_membership_for_user_legacy(self, team_id: int, username: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamMembership:
|
|
137
|
+
"""
|
|
138
|
+
Add or update team membership for a user (Legacy)
|
|
139
|
+
|
|
140
|
+
> [!WARNING]
|
|
141
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint.
|
|
142
|
+
|
|
143
|
+
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
|
|
144
|
+
|
|
145
|
+
If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer.
|
|
146
|
+
|
|
147
|
+
> [!NOTE]
|
|
148
|
+
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."
|
|
149
|
+
|
|
150
|
+
If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner.
|
|
151
|
+
|
|
152
|
+
If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.
|
|
153
|
+
"""
|
|
154
|
+
client = self.client
|
|
155
|
+
if aspects is None:
|
|
156
|
+
aspects = client.aspects
|
|
157
|
+
|
|
158
|
+
header_params = client.headers
|
|
159
|
+
if headers is not None:
|
|
160
|
+
header_params = headers
|
|
161
|
+
|
|
162
|
+
leaf_template = "/teams/{team_id}/memberships/{username}"
|
|
163
|
+
path_params = {
|
|
164
|
+
'team_id': team_id,
|
|
165
|
+
'username': username,
|
|
166
|
+
}
|
|
167
|
+
call_leaf = leaf_template.format(**path_params)
|
|
168
|
+
|
|
169
|
+
query_params = None
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
if exp_status is None:
|
|
173
|
+
exp_status = [200]
|
|
174
|
+
|
|
175
|
+
resp = client.perform_call(
|
|
176
|
+
leaf=call_leaf,
|
|
177
|
+
method="PUT",
|
|
178
|
+
params=query_params if query_params else None,
|
|
179
|
+
body=body,
|
|
180
|
+
exp_status=exp_status,
|
|
181
|
+
headers=header_params if header_params else None,
|
|
182
|
+
context_msg=None,
|
|
183
|
+
aspects=aspects,
|
|
184
|
+
)
|
|
185
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
186
|
+
rtnobj = None
|
|
187
|
+
else:
|
|
188
|
+
raw_data = resp.json()
|
|
189
|
+
rtnobj = TeamMembership.from_dict(raw_data)
|
|
190
|
+
return rtnobj
|
|
191
|
+
|
|
192
|
+
def add_or_update_project_permissions_in_org(self, org: str, team_slug: str, project_id: int, body: Optional[Dict[str, Any]], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
193
|
+
"""
|
|
194
|
+
Add or update team project permissions
|
|
195
|
+
|
|
196
|
+
> [!WARNING]
|
|
197
|
+
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
|
|
198
|
+
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
|
|
199
|
+
"""
|
|
200
|
+
client = self.client
|
|
201
|
+
if aspects is None:
|
|
202
|
+
aspects = client.aspects
|
|
203
|
+
|
|
204
|
+
header_params = client.headers
|
|
205
|
+
if headers is not None:
|
|
206
|
+
header_params = headers
|
|
207
|
+
|
|
208
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/projects/{project_id}"
|
|
209
|
+
path_params = {
|
|
210
|
+
'org': org,
|
|
211
|
+
'team_slug': team_slug,
|
|
212
|
+
'project_id': project_id,
|
|
213
|
+
}
|
|
214
|
+
call_leaf = leaf_template.format(**path_params)
|
|
215
|
+
|
|
216
|
+
query_params = None
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
if exp_status is None:
|
|
220
|
+
exp_status = [204]
|
|
221
|
+
|
|
222
|
+
resp = client.perform_call(
|
|
223
|
+
leaf=call_leaf,
|
|
224
|
+
method="PUT",
|
|
225
|
+
params=query_params if query_params else None,
|
|
226
|
+
body=body,
|
|
227
|
+
exp_status=exp_status,
|
|
228
|
+
headers=header_params if header_params else None,
|
|
229
|
+
context_msg=None,
|
|
230
|
+
aspects=aspects,
|
|
231
|
+
)
|
|
232
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
233
|
+
rtnval = None
|
|
234
|
+
else:
|
|
235
|
+
rtnval = resp.json()
|
|
236
|
+
return rtnval
|
|
237
|
+
|
|
238
|
+
def add_or_update_project_permissions_legacy(self, team_id: int, project_id: int, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
239
|
+
"""
|
|
240
|
+
Add or update team project permissions (Legacy)
|
|
241
|
+
|
|
242
|
+
> [!WARNING]
|
|
243
|
+
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
|
|
244
|
+
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
|
|
245
|
+
"""
|
|
246
|
+
client = self.client
|
|
247
|
+
if aspects is None:
|
|
248
|
+
aspects = client.aspects
|
|
249
|
+
|
|
250
|
+
header_params = client.headers
|
|
251
|
+
if headers is not None:
|
|
252
|
+
header_params = headers
|
|
253
|
+
|
|
254
|
+
leaf_template = "/teams/{team_id}/projects/{project_id}"
|
|
255
|
+
path_params = {
|
|
256
|
+
'team_id': team_id,
|
|
257
|
+
'project_id': project_id,
|
|
258
|
+
}
|
|
259
|
+
call_leaf = leaf_template.format(**path_params)
|
|
260
|
+
|
|
261
|
+
query_params = None
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
if exp_status is None:
|
|
265
|
+
exp_status = [204]
|
|
266
|
+
|
|
267
|
+
resp = client.perform_call(
|
|
268
|
+
leaf=call_leaf,
|
|
269
|
+
method="PUT",
|
|
270
|
+
params=query_params if query_params else None,
|
|
271
|
+
body=body,
|
|
272
|
+
exp_status=exp_status,
|
|
273
|
+
headers=header_params if header_params else None,
|
|
274
|
+
context_msg=None,
|
|
275
|
+
aspects=aspects,
|
|
276
|
+
)
|
|
277
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
278
|
+
rtnval = None
|
|
279
|
+
else:
|
|
280
|
+
rtnval = resp.json()
|
|
281
|
+
return rtnval
|
|
282
|
+
|
|
283
|
+
def add_or_update_repo_permissions_in_org(self, org: str, team_slug: str, owner: str, repo: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
284
|
+
"""
|
|
285
|
+
Add or update team repository permissions
|
|
286
|
+
|
|
287
|
+
To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."
|
|
288
|
+
|
|
289
|
+
> [!NOTE]
|
|
290
|
+
> You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.
|
|
291
|
+
|
|
292
|
+
For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)".
|
|
293
|
+
"""
|
|
294
|
+
client = self.client
|
|
295
|
+
if aspects is None:
|
|
296
|
+
aspects = client.aspects
|
|
297
|
+
|
|
298
|
+
header_params = client.headers
|
|
299
|
+
if headers is not None:
|
|
300
|
+
header_params = headers
|
|
301
|
+
|
|
302
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
303
|
+
path_params = {
|
|
304
|
+
'org': org,
|
|
305
|
+
'team_slug': team_slug,
|
|
306
|
+
'owner': owner,
|
|
307
|
+
'repo': repo,
|
|
308
|
+
}
|
|
309
|
+
call_leaf = leaf_template.format(**path_params)
|
|
310
|
+
|
|
311
|
+
query_params = None
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
if exp_status is None:
|
|
315
|
+
exp_status = [204]
|
|
316
|
+
|
|
317
|
+
resp = client.perform_call(
|
|
318
|
+
leaf=call_leaf,
|
|
319
|
+
method="PUT",
|
|
320
|
+
params=query_params if query_params else None,
|
|
321
|
+
body=body,
|
|
322
|
+
exp_status=exp_status,
|
|
323
|
+
headers=header_params if header_params else None,
|
|
324
|
+
context_msg=None,
|
|
325
|
+
aspects=aspects,
|
|
326
|
+
)
|
|
327
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
328
|
+
rtnval = None
|
|
329
|
+
else:
|
|
330
|
+
rtnval = resp.json()
|
|
331
|
+
return rtnval
|
|
332
|
+
|
|
333
|
+
def add_or_update_repo_permissions_legacy(self, team_id: int, owner: str, repo: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
334
|
+
"""
|
|
335
|
+
Add or update team repository permissions (Legacy)
|
|
336
|
+
|
|
337
|
+
> [!WARNING]
|
|
338
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint.
|
|
339
|
+
|
|
340
|
+
To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization.
|
|
341
|
+
|
|
342
|
+
Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."
|
|
343
|
+
"""
|
|
344
|
+
client = self.client
|
|
345
|
+
if aspects is None:
|
|
346
|
+
aspects = client.aspects
|
|
347
|
+
|
|
348
|
+
header_params = client.headers
|
|
349
|
+
if headers is not None:
|
|
350
|
+
header_params = headers
|
|
351
|
+
|
|
352
|
+
leaf_template = "/teams/{team_id}/repos/{owner}/{repo}"
|
|
353
|
+
path_params = {
|
|
354
|
+
'team_id': team_id,
|
|
355
|
+
'owner': owner,
|
|
356
|
+
'repo': repo,
|
|
357
|
+
}
|
|
358
|
+
call_leaf = leaf_template.format(**path_params)
|
|
359
|
+
|
|
360
|
+
query_params = None
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
if exp_status is None:
|
|
364
|
+
exp_status = [204]
|
|
365
|
+
|
|
366
|
+
resp = client.perform_call(
|
|
367
|
+
leaf=call_leaf,
|
|
368
|
+
method="PUT",
|
|
369
|
+
params=query_params if query_params else None,
|
|
370
|
+
body=body,
|
|
371
|
+
exp_status=exp_status,
|
|
372
|
+
headers=header_params if header_params else None,
|
|
373
|
+
context_msg=None,
|
|
374
|
+
aspects=aspects,
|
|
375
|
+
)
|
|
376
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
377
|
+
rtnval = None
|
|
378
|
+
else:
|
|
379
|
+
rtnval = resp.json()
|
|
380
|
+
return rtnval
|
|
381
|
+
|
|
382
|
+
def check_permissions_for_project_in_org(self, org: str, team_slug: str, project_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamProject:
|
|
383
|
+
"""
|
|
384
|
+
Check team permissions for a project
|
|
385
|
+
|
|
386
|
+
> [!WARNING]
|
|
387
|
+
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
|
|
388
|
+
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
|
|
389
|
+
"""
|
|
390
|
+
client = self.client
|
|
391
|
+
if aspects is None:
|
|
392
|
+
aspects = client.aspects
|
|
393
|
+
|
|
394
|
+
header_params = client.headers
|
|
395
|
+
if headers is not None:
|
|
396
|
+
header_params = headers
|
|
397
|
+
|
|
398
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/projects/{project_id}"
|
|
399
|
+
path_params = {
|
|
400
|
+
'org': org,
|
|
401
|
+
'team_slug': team_slug,
|
|
402
|
+
'project_id': project_id,
|
|
403
|
+
}
|
|
404
|
+
call_leaf = leaf_template.format(**path_params)
|
|
405
|
+
|
|
406
|
+
query_params = None
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
if exp_status is None:
|
|
410
|
+
exp_status = [200]
|
|
411
|
+
|
|
412
|
+
resp = client.perform_call(
|
|
413
|
+
leaf=call_leaf,
|
|
414
|
+
method="GET",
|
|
415
|
+
params=query_params if query_params else None,
|
|
416
|
+
body=None,
|
|
417
|
+
exp_status=exp_status,
|
|
418
|
+
headers=header_params if header_params else None,
|
|
419
|
+
context_msg=None,
|
|
420
|
+
aspects=aspects,
|
|
421
|
+
)
|
|
422
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
423
|
+
rtnobj = None
|
|
424
|
+
else:
|
|
425
|
+
raw_data = resp.json()
|
|
426
|
+
rtnobj = TeamProject.from_dict(raw_data)
|
|
427
|
+
return rtnobj
|
|
428
|
+
|
|
429
|
+
def check_permissions_for_project_legacy(self, team_id: int, project_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamProject:
|
|
430
|
+
"""
|
|
431
|
+
Check team permissions for a project (Legacy)
|
|
432
|
+
|
|
433
|
+
> [!WARNING]
|
|
434
|
+
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
|
|
435
|
+
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
|
|
436
|
+
"""
|
|
437
|
+
client = self.client
|
|
438
|
+
if aspects is None:
|
|
439
|
+
aspects = client.aspects
|
|
440
|
+
|
|
441
|
+
header_params = client.headers
|
|
442
|
+
if headers is not None:
|
|
443
|
+
header_params = headers
|
|
444
|
+
|
|
445
|
+
leaf_template = "/teams/{team_id}/projects/{project_id}"
|
|
446
|
+
path_params = {
|
|
447
|
+
'team_id': team_id,
|
|
448
|
+
'project_id': project_id,
|
|
449
|
+
}
|
|
450
|
+
call_leaf = leaf_template.format(**path_params)
|
|
451
|
+
|
|
452
|
+
query_params = None
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
if exp_status is None:
|
|
456
|
+
exp_status = [200]
|
|
457
|
+
|
|
458
|
+
resp = client.perform_call(
|
|
459
|
+
leaf=call_leaf,
|
|
460
|
+
method="GET",
|
|
461
|
+
params=query_params if query_params else None,
|
|
462
|
+
body=None,
|
|
463
|
+
exp_status=exp_status,
|
|
464
|
+
headers=header_params if header_params else None,
|
|
465
|
+
context_msg=None,
|
|
466
|
+
aspects=aspects,
|
|
467
|
+
)
|
|
468
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
469
|
+
rtnobj = None
|
|
470
|
+
else:
|
|
471
|
+
raw_data = resp.json()
|
|
472
|
+
rtnobj = TeamProject.from_dict(raw_data)
|
|
473
|
+
return rtnobj
|
|
474
|
+
|
|
475
|
+
def check_permissions_for_repo_in_org(self, org: str, team_slug: str, owner: str, repo: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamRepository:
|
|
476
|
+
"""
|
|
477
|
+
Check team permissions for a repository
|
|
478
|
+
|
|
479
|
+
Checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked.
|
|
480
|
+
|
|
481
|
+
You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `application/vnd.github.v3.repository+json` accept header.
|
|
482
|
+
|
|
483
|
+
If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status.
|
|
484
|
+
|
|
485
|
+
If the repository is private, you must have at least `read` permission for that repository, and your token must have the `repo` or `admin:org` scope. Otherwise, you will receive a `404 Not Found` response status.
|
|
486
|
+
|
|
487
|
+
> [!NOTE]
|
|
488
|
+
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.
|
|
489
|
+
"""
|
|
490
|
+
client = self.client
|
|
491
|
+
if aspects is None:
|
|
492
|
+
aspects = client.aspects
|
|
493
|
+
|
|
494
|
+
header_params = client.headers
|
|
495
|
+
if headers is not None:
|
|
496
|
+
header_params = headers
|
|
497
|
+
|
|
498
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
499
|
+
path_params = {
|
|
500
|
+
'org': org,
|
|
501
|
+
'team_slug': team_slug,
|
|
502
|
+
'owner': owner,
|
|
503
|
+
'repo': repo,
|
|
504
|
+
}
|
|
505
|
+
call_leaf = leaf_template.format(**path_params)
|
|
506
|
+
|
|
507
|
+
query_params = None
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
if exp_status is None:
|
|
511
|
+
exp_status = [200, 204]
|
|
512
|
+
|
|
513
|
+
resp = client.perform_call(
|
|
514
|
+
leaf=call_leaf,
|
|
515
|
+
method="GET",
|
|
516
|
+
params=query_params if query_params else None,
|
|
517
|
+
body=None,
|
|
518
|
+
exp_status=exp_status,
|
|
519
|
+
headers=header_params if header_params else None,
|
|
520
|
+
context_msg=None,
|
|
521
|
+
aspects=aspects,
|
|
522
|
+
)
|
|
523
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
524
|
+
rtnobj = None
|
|
525
|
+
else:
|
|
526
|
+
raw_data = resp.json()
|
|
527
|
+
rtnobj = TeamRepository.from_dict(raw_data)
|
|
528
|
+
return rtnobj
|
|
529
|
+
|
|
530
|
+
def check_permissions_for_repo_legacy(self, team_id: int, owner: str, repo: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamRepository:
|
|
531
|
+
"""
|
|
532
|
+
Check team permissions for a repository (Legacy)
|
|
533
|
+
|
|
534
|
+
> [!WARNING]
|
|
535
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository) endpoint.
|
|
536
|
+
|
|
537
|
+
> [!NOTE]
|
|
538
|
+
> Repositories inherited through a parent team will also be checked.
|
|
539
|
+
|
|
540
|
+
You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `Accept` header:
|
|
541
|
+
"""
|
|
542
|
+
client = self.client
|
|
543
|
+
if aspects is None:
|
|
544
|
+
aspects = client.aspects
|
|
545
|
+
|
|
546
|
+
header_params = client.headers
|
|
547
|
+
if headers is not None:
|
|
548
|
+
header_params = headers
|
|
549
|
+
|
|
550
|
+
leaf_template = "/teams/{team_id}/repos/{owner}/{repo}"
|
|
551
|
+
path_params = {
|
|
552
|
+
'team_id': team_id,
|
|
553
|
+
'owner': owner,
|
|
554
|
+
'repo': repo,
|
|
555
|
+
}
|
|
556
|
+
call_leaf = leaf_template.format(**path_params)
|
|
557
|
+
|
|
558
|
+
query_params = None
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
if exp_status is None:
|
|
562
|
+
exp_status = [200, 204]
|
|
563
|
+
|
|
564
|
+
resp = client.perform_call(
|
|
565
|
+
leaf=call_leaf,
|
|
566
|
+
method="GET",
|
|
567
|
+
params=query_params if query_params else None,
|
|
568
|
+
body=None,
|
|
569
|
+
exp_status=exp_status,
|
|
570
|
+
headers=header_params if header_params else None,
|
|
571
|
+
context_msg=None,
|
|
572
|
+
aspects=aspects,
|
|
573
|
+
)
|
|
574
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
575
|
+
rtnobj = None
|
|
576
|
+
else:
|
|
577
|
+
raw_data = resp.json()
|
|
578
|
+
rtnobj = TeamRepository.from_dict(raw_data)
|
|
579
|
+
return rtnobj
|
|
580
|
+
|
|
581
|
+
def create(self, org: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
582
|
+
"""
|
|
583
|
+
Create a team
|
|
584
|
+
|
|
585
|
+
To create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://docs.github.com/articles/setting-team-creation-permissions-in-your-organization)."
|
|
586
|
+
|
|
587
|
+
When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see "[About teams](https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/about-teams)".
|
|
588
|
+
"""
|
|
589
|
+
client = self.client
|
|
590
|
+
if aspects is None:
|
|
591
|
+
aspects = client.aspects
|
|
592
|
+
|
|
593
|
+
header_params = client.headers
|
|
594
|
+
if headers is not None:
|
|
595
|
+
header_params = headers
|
|
596
|
+
|
|
597
|
+
leaf_template = "/orgs/{org}/teams"
|
|
598
|
+
path_params = {
|
|
599
|
+
'org': org,
|
|
600
|
+
}
|
|
601
|
+
call_leaf = leaf_template.format(**path_params)
|
|
602
|
+
|
|
603
|
+
query_params = None
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
if exp_status is None:
|
|
607
|
+
exp_status = [201]
|
|
608
|
+
|
|
609
|
+
resp = client.perform_call(
|
|
610
|
+
leaf=call_leaf,
|
|
611
|
+
method="POST",
|
|
612
|
+
params=query_params if query_params else None,
|
|
613
|
+
body=body,
|
|
614
|
+
exp_status=exp_status,
|
|
615
|
+
headers=header_params if header_params else None,
|
|
616
|
+
context_msg=None,
|
|
617
|
+
aspects=aspects,
|
|
618
|
+
)
|
|
619
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
620
|
+
rtnval = None
|
|
621
|
+
else:
|
|
622
|
+
rtnval = resp.json()
|
|
623
|
+
return rtnval
|
|
624
|
+
|
|
625
|
+
def create_discussion_comment_in_org(self, org: str, team_slug: str, discussion_number: int, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
626
|
+
"""
|
|
627
|
+
Create a discussion comment
|
|
628
|
+
|
|
629
|
+
Creates a new comment on a team discussion.
|
|
630
|
+
|
|
631
|
+
This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."
|
|
632
|
+
|
|
633
|
+
> [!NOTE]
|
|
634
|
+
> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.
|
|
635
|
+
|
|
636
|
+
OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
|
|
637
|
+
"""
|
|
638
|
+
client = self.client
|
|
639
|
+
if aspects is None:
|
|
640
|
+
aspects = client.aspects
|
|
641
|
+
|
|
642
|
+
header_params = client.headers
|
|
643
|
+
if headers is not None:
|
|
644
|
+
header_params = headers
|
|
645
|
+
|
|
646
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
|
|
647
|
+
path_params = {
|
|
648
|
+
'org': org,
|
|
649
|
+
'team_slug': team_slug,
|
|
650
|
+
'discussion_number': discussion_number,
|
|
651
|
+
}
|
|
652
|
+
call_leaf = leaf_template.format(**path_params)
|
|
653
|
+
|
|
654
|
+
query_params = None
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
if exp_status is None:
|
|
658
|
+
exp_status = [201]
|
|
659
|
+
|
|
660
|
+
resp = client.perform_call(
|
|
661
|
+
leaf=call_leaf,
|
|
662
|
+
method="POST",
|
|
663
|
+
params=query_params if query_params else None,
|
|
664
|
+
body=body,
|
|
665
|
+
exp_status=exp_status,
|
|
666
|
+
headers=header_params if header_params else None,
|
|
667
|
+
context_msg=None,
|
|
668
|
+
aspects=aspects,
|
|
669
|
+
)
|
|
670
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
671
|
+
rtnval = None
|
|
672
|
+
else:
|
|
673
|
+
rtnval = resp.json()
|
|
674
|
+
return rtnval
|
|
675
|
+
|
|
676
|
+
def create_discussion_comment_legacy(self, team_id: int, discussion_number: int, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
677
|
+
"""
|
|
678
|
+
Create a discussion comment (Legacy)
|
|
679
|
+
|
|
680
|
+
> [!WARNING]
|
|
681
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/rest/teams/discussion-comments#create-a-discussion-comment) endpoint.
|
|
682
|
+
|
|
683
|
+
Creates a new comment on a team discussion.
|
|
684
|
+
|
|
685
|
+
This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."
|
|
686
|
+
|
|
687
|
+
OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
|
|
688
|
+
"""
|
|
689
|
+
client = self.client
|
|
690
|
+
if aspects is None:
|
|
691
|
+
aspects = client.aspects
|
|
692
|
+
|
|
693
|
+
header_params = client.headers
|
|
694
|
+
if headers is not None:
|
|
695
|
+
header_params = headers
|
|
696
|
+
|
|
697
|
+
leaf_template = "/teams/{team_id}/discussions/{discussion_number}/comments"
|
|
698
|
+
path_params = {
|
|
699
|
+
'team_id': team_id,
|
|
700
|
+
'discussion_number': discussion_number,
|
|
701
|
+
}
|
|
702
|
+
call_leaf = leaf_template.format(**path_params)
|
|
703
|
+
|
|
704
|
+
query_params = None
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
if exp_status is None:
|
|
708
|
+
exp_status = [201]
|
|
709
|
+
|
|
710
|
+
resp = client.perform_call(
|
|
711
|
+
leaf=call_leaf,
|
|
712
|
+
method="POST",
|
|
713
|
+
params=query_params if query_params else None,
|
|
714
|
+
body=body,
|
|
715
|
+
exp_status=exp_status,
|
|
716
|
+
headers=header_params if header_params else None,
|
|
717
|
+
context_msg=None,
|
|
718
|
+
aspects=aspects,
|
|
719
|
+
)
|
|
720
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
721
|
+
rtnval = None
|
|
722
|
+
else:
|
|
723
|
+
rtnval = resp.json()
|
|
724
|
+
return rtnval
|
|
725
|
+
|
|
726
|
+
def create_discussion_in_org(self, org: str, team_slug: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
727
|
+
"""
|
|
728
|
+
Create a discussion
|
|
729
|
+
|
|
730
|
+
Creates a new discussion post on a team's page.
|
|
731
|
+
|
|
732
|
+
This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."
|
|
733
|
+
|
|
734
|
+
> [!NOTE]
|
|
735
|
+
> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`.
|
|
736
|
+
|
|
737
|
+
OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
|
|
738
|
+
"""
|
|
739
|
+
client = self.client
|
|
740
|
+
if aspects is None:
|
|
741
|
+
aspects = client.aspects
|
|
742
|
+
|
|
743
|
+
header_params = client.headers
|
|
744
|
+
if headers is not None:
|
|
745
|
+
header_params = headers
|
|
746
|
+
|
|
747
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/discussions"
|
|
748
|
+
path_params = {
|
|
749
|
+
'org': org,
|
|
750
|
+
'team_slug': team_slug,
|
|
751
|
+
}
|
|
752
|
+
call_leaf = leaf_template.format(**path_params)
|
|
753
|
+
|
|
754
|
+
query_params = None
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
if exp_status is None:
|
|
758
|
+
exp_status = [201]
|
|
759
|
+
|
|
760
|
+
resp = client.perform_call(
|
|
761
|
+
leaf=call_leaf,
|
|
762
|
+
method="POST",
|
|
763
|
+
params=query_params if query_params else None,
|
|
764
|
+
body=body,
|
|
765
|
+
exp_status=exp_status,
|
|
766
|
+
headers=header_params if header_params else None,
|
|
767
|
+
context_msg=None,
|
|
768
|
+
aspects=aspects,
|
|
769
|
+
)
|
|
770
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
771
|
+
rtnval = None
|
|
772
|
+
else:
|
|
773
|
+
rtnval = resp.json()
|
|
774
|
+
return rtnval
|
|
775
|
+
|
|
776
|
+
def create_discussion_legacy(self, team_id: int, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
777
|
+
"""
|
|
778
|
+
Create a discussion (Legacy)
|
|
779
|
+
|
|
780
|
+
> [!WARNING]
|
|
781
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/rest/teams/discussions#create-a-discussion) endpoint.
|
|
782
|
+
|
|
783
|
+
Creates a new discussion post on a team's page.
|
|
784
|
+
|
|
785
|
+
This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."
|
|
786
|
+
|
|
787
|
+
OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
|
|
788
|
+
"""
|
|
789
|
+
client = self.client
|
|
790
|
+
if aspects is None:
|
|
791
|
+
aspects = client.aspects
|
|
792
|
+
|
|
793
|
+
header_params = client.headers
|
|
794
|
+
if headers is not None:
|
|
795
|
+
header_params = headers
|
|
796
|
+
|
|
797
|
+
leaf_template = "/teams/{team_id}/discussions"
|
|
798
|
+
path_params = {
|
|
799
|
+
'team_id': team_id,
|
|
800
|
+
}
|
|
801
|
+
call_leaf = leaf_template.format(**path_params)
|
|
802
|
+
|
|
803
|
+
query_params = None
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
if exp_status is None:
|
|
807
|
+
exp_status = [201]
|
|
808
|
+
|
|
809
|
+
resp = client.perform_call(
|
|
810
|
+
leaf=call_leaf,
|
|
811
|
+
method="POST",
|
|
812
|
+
params=query_params if query_params else None,
|
|
813
|
+
body=body,
|
|
814
|
+
exp_status=exp_status,
|
|
815
|
+
headers=header_params if header_params else None,
|
|
816
|
+
context_msg=None,
|
|
817
|
+
aspects=aspects,
|
|
818
|
+
)
|
|
819
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
820
|
+
rtnval = None
|
|
821
|
+
else:
|
|
822
|
+
rtnval = resp.json()
|
|
823
|
+
return rtnval
|
|
824
|
+
|
|
825
|
+
def delete_discussion_comment_in_org(self, org: str, team_slug: str, discussion_number: int, comment_number: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
826
|
+
"""
|
|
827
|
+
Delete a discussion comment
|
|
828
|
+
|
|
829
|
+
Deletes a comment on a team discussion.
|
|
830
|
+
|
|
831
|
+
> [!NOTE]
|
|
832
|
+
> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.
|
|
833
|
+
|
|
834
|
+
OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
|
|
835
|
+
"""
|
|
836
|
+
client = self.client
|
|
837
|
+
if aspects is None:
|
|
838
|
+
aspects = client.aspects
|
|
839
|
+
|
|
840
|
+
header_params = client.headers
|
|
841
|
+
if headers is not None:
|
|
842
|
+
header_params = headers
|
|
843
|
+
|
|
844
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
|
|
845
|
+
path_params = {
|
|
846
|
+
'org': org,
|
|
847
|
+
'team_slug': team_slug,
|
|
848
|
+
'discussion_number': discussion_number,
|
|
849
|
+
'comment_number': comment_number,
|
|
850
|
+
}
|
|
851
|
+
call_leaf = leaf_template.format(**path_params)
|
|
852
|
+
|
|
853
|
+
query_params = None
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
if exp_status is None:
|
|
857
|
+
exp_status = [204]
|
|
858
|
+
|
|
859
|
+
resp = client.perform_call(
|
|
860
|
+
leaf=call_leaf,
|
|
861
|
+
method="DELETE",
|
|
862
|
+
params=query_params if query_params else None,
|
|
863
|
+
body=None,
|
|
864
|
+
exp_status=exp_status,
|
|
865
|
+
headers=header_params if header_params else None,
|
|
866
|
+
context_msg=None,
|
|
867
|
+
aspects=aspects,
|
|
868
|
+
)
|
|
869
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
870
|
+
rtnval = None
|
|
871
|
+
else:
|
|
872
|
+
rtnval = resp.json()
|
|
873
|
+
return rtnval
|
|
874
|
+
|
|
875
|
+
def delete_discussion_comment_legacy(self, team_id: int, discussion_number: int, comment_number: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
876
|
+
"""
|
|
877
|
+
Delete a discussion comment (Legacy)
|
|
878
|
+
|
|
879
|
+
> [!WARNING]
|
|
880
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint.
|
|
881
|
+
|
|
882
|
+
Deletes a comment on a team discussion.
|
|
883
|
+
|
|
884
|
+
OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
|
|
885
|
+
"""
|
|
886
|
+
client = self.client
|
|
887
|
+
if aspects is None:
|
|
888
|
+
aspects = client.aspects
|
|
889
|
+
|
|
890
|
+
header_params = client.headers
|
|
891
|
+
if headers is not None:
|
|
892
|
+
header_params = headers
|
|
893
|
+
|
|
894
|
+
leaf_template = "/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}"
|
|
895
|
+
path_params = {
|
|
896
|
+
'team_id': team_id,
|
|
897
|
+
'discussion_number': discussion_number,
|
|
898
|
+
'comment_number': comment_number,
|
|
899
|
+
}
|
|
900
|
+
call_leaf = leaf_template.format(**path_params)
|
|
901
|
+
|
|
902
|
+
query_params = None
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
if exp_status is None:
|
|
906
|
+
exp_status = [204]
|
|
907
|
+
|
|
908
|
+
resp = client.perform_call(
|
|
909
|
+
leaf=call_leaf,
|
|
910
|
+
method="DELETE",
|
|
911
|
+
params=query_params if query_params else None,
|
|
912
|
+
body=None,
|
|
913
|
+
exp_status=exp_status,
|
|
914
|
+
headers=header_params if header_params else None,
|
|
915
|
+
context_msg=None,
|
|
916
|
+
aspects=aspects,
|
|
917
|
+
)
|
|
918
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
919
|
+
rtnval = None
|
|
920
|
+
else:
|
|
921
|
+
rtnval = resp.json()
|
|
922
|
+
return rtnval
|
|
923
|
+
|
|
924
|
+
def delete_discussion_in_org(self, org: str, team_slug: str, discussion_number: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
925
|
+
"""
|
|
926
|
+
Delete a discussion
|
|
927
|
+
|
|
928
|
+
Delete a discussion from a team's page.
|
|
929
|
+
|
|
930
|
+
> [!NOTE]
|
|
931
|
+
> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.
|
|
932
|
+
|
|
933
|
+
OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
|
|
934
|
+
"""
|
|
935
|
+
client = self.client
|
|
936
|
+
if aspects is None:
|
|
937
|
+
aspects = client.aspects
|
|
938
|
+
|
|
939
|
+
header_params = client.headers
|
|
940
|
+
if headers is not None:
|
|
941
|
+
header_params = headers
|
|
942
|
+
|
|
943
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
|
|
944
|
+
path_params = {
|
|
945
|
+
'org': org,
|
|
946
|
+
'team_slug': team_slug,
|
|
947
|
+
'discussion_number': discussion_number,
|
|
948
|
+
}
|
|
949
|
+
call_leaf = leaf_template.format(**path_params)
|
|
950
|
+
|
|
951
|
+
query_params = None
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
if exp_status is None:
|
|
955
|
+
exp_status = [204]
|
|
956
|
+
|
|
957
|
+
resp = client.perform_call(
|
|
958
|
+
leaf=call_leaf,
|
|
959
|
+
method="DELETE",
|
|
960
|
+
params=query_params if query_params else None,
|
|
961
|
+
body=None,
|
|
962
|
+
exp_status=exp_status,
|
|
963
|
+
headers=header_params if header_params else None,
|
|
964
|
+
context_msg=None,
|
|
965
|
+
aspects=aspects,
|
|
966
|
+
)
|
|
967
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
968
|
+
rtnval = None
|
|
969
|
+
else:
|
|
970
|
+
rtnval = resp.json()
|
|
971
|
+
return rtnval
|
|
972
|
+
|
|
973
|
+
def delete_discussion_legacy(self, team_id: int, discussion_number: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
974
|
+
"""
|
|
975
|
+
Delete a discussion (Legacy)
|
|
976
|
+
|
|
977
|
+
> [!WARNING]
|
|
978
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/rest/teams/discussions#delete-a-discussion) endpoint.
|
|
979
|
+
|
|
980
|
+
Delete a discussion from a team's page.
|
|
981
|
+
|
|
982
|
+
OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
|
|
983
|
+
"""
|
|
984
|
+
client = self.client
|
|
985
|
+
if aspects is None:
|
|
986
|
+
aspects = client.aspects
|
|
987
|
+
|
|
988
|
+
header_params = client.headers
|
|
989
|
+
if headers is not None:
|
|
990
|
+
header_params = headers
|
|
991
|
+
|
|
992
|
+
leaf_template = "/teams/{team_id}/discussions/{discussion_number}"
|
|
993
|
+
path_params = {
|
|
994
|
+
'team_id': team_id,
|
|
995
|
+
'discussion_number': discussion_number,
|
|
996
|
+
}
|
|
997
|
+
call_leaf = leaf_template.format(**path_params)
|
|
998
|
+
|
|
999
|
+
query_params = None
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
if exp_status is None:
|
|
1003
|
+
exp_status = [204]
|
|
1004
|
+
|
|
1005
|
+
resp = client.perform_call(
|
|
1006
|
+
leaf=call_leaf,
|
|
1007
|
+
method="DELETE",
|
|
1008
|
+
params=query_params if query_params else None,
|
|
1009
|
+
body=None,
|
|
1010
|
+
exp_status=exp_status,
|
|
1011
|
+
headers=header_params if header_params else None,
|
|
1012
|
+
context_msg=None,
|
|
1013
|
+
aspects=aspects,
|
|
1014
|
+
)
|
|
1015
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1016
|
+
rtnval = None
|
|
1017
|
+
else:
|
|
1018
|
+
rtnval = resp.json()
|
|
1019
|
+
return rtnval
|
|
1020
|
+
|
|
1021
|
+
def delete_in_org(self, org: str, team_slug: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
1022
|
+
"""
|
|
1023
|
+
Delete a team
|
|
1024
|
+
|
|
1025
|
+
To delete a team, the authenticated user must be an organization owner or team maintainer.
|
|
1026
|
+
|
|
1027
|
+
If you are an organization owner, deleting a parent team will delete all of its child teams as well.
|
|
1028
|
+
|
|
1029
|
+
> [!NOTE]
|
|
1030
|
+
> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`.
|
|
1031
|
+
"""
|
|
1032
|
+
client = self.client
|
|
1033
|
+
if aspects is None:
|
|
1034
|
+
aspects = client.aspects
|
|
1035
|
+
|
|
1036
|
+
header_params = client.headers
|
|
1037
|
+
if headers is not None:
|
|
1038
|
+
header_params = headers
|
|
1039
|
+
|
|
1040
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}"
|
|
1041
|
+
path_params = {
|
|
1042
|
+
'org': org,
|
|
1043
|
+
'team_slug': team_slug,
|
|
1044
|
+
}
|
|
1045
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1046
|
+
|
|
1047
|
+
query_params = None
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
if exp_status is None:
|
|
1051
|
+
exp_status = [204]
|
|
1052
|
+
|
|
1053
|
+
resp = client.perform_call(
|
|
1054
|
+
leaf=call_leaf,
|
|
1055
|
+
method="DELETE",
|
|
1056
|
+
params=query_params if query_params else None,
|
|
1057
|
+
body=None,
|
|
1058
|
+
exp_status=exp_status,
|
|
1059
|
+
headers=header_params if header_params else None,
|
|
1060
|
+
context_msg=None,
|
|
1061
|
+
aspects=aspects,
|
|
1062
|
+
)
|
|
1063
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1064
|
+
rtnval = None
|
|
1065
|
+
else:
|
|
1066
|
+
rtnval = resp.json()
|
|
1067
|
+
return rtnval
|
|
1068
|
+
|
|
1069
|
+
def delete_legacy(self, team_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
1070
|
+
"""
|
|
1071
|
+
Delete a team (Legacy)
|
|
1072
|
+
|
|
1073
|
+
> [!WARNING]
|
|
1074
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/rest/teams/teams#delete-a-team) endpoint.
|
|
1075
|
+
|
|
1076
|
+
To delete a team, the authenticated user must be an organization owner or team maintainer.
|
|
1077
|
+
|
|
1078
|
+
If you are an organization owner, deleting a parent team will delete all of its child teams as well.
|
|
1079
|
+
"""
|
|
1080
|
+
client = self.client
|
|
1081
|
+
if aspects is None:
|
|
1082
|
+
aspects = client.aspects
|
|
1083
|
+
|
|
1084
|
+
header_params = client.headers
|
|
1085
|
+
if headers is not None:
|
|
1086
|
+
header_params = headers
|
|
1087
|
+
|
|
1088
|
+
leaf_template = "/teams/{team_id}"
|
|
1089
|
+
path_params = {
|
|
1090
|
+
'team_id': team_id,
|
|
1091
|
+
}
|
|
1092
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1093
|
+
|
|
1094
|
+
query_params = None
|
|
1095
|
+
|
|
1096
|
+
|
|
1097
|
+
if exp_status is None:
|
|
1098
|
+
exp_status = [204]
|
|
1099
|
+
|
|
1100
|
+
resp = client.perform_call(
|
|
1101
|
+
leaf=call_leaf,
|
|
1102
|
+
method="DELETE",
|
|
1103
|
+
params=query_params if query_params else None,
|
|
1104
|
+
body=None,
|
|
1105
|
+
exp_status=exp_status,
|
|
1106
|
+
headers=header_params if header_params else None,
|
|
1107
|
+
context_msg=None,
|
|
1108
|
+
aspects=aspects,
|
|
1109
|
+
)
|
|
1110
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1111
|
+
rtnval = None
|
|
1112
|
+
else:
|
|
1113
|
+
rtnval = resp.json()
|
|
1114
|
+
return rtnval
|
|
1115
|
+
|
|
1116
|
+
def get_by_name(self, org: str, team_slug: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamFull:
|
|
1117
|
+
"""
|
|
1118
|
+
Get a team by name
|
|
1119
|
+
|
|
1120
|
+
Gets a team using the team's `slug`. To create the `slug`, GitHub replaces special characters in the `name` string, changes all words to lowercase, and replaces spaces with a `-` separator. For example, `"My TEam Näme"` would become `my-team-name`.
|
|
1121
|
+
|
|
1122
|
+
> [!NOTE]
|
|
1123
|
+
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`.
|
|
1124
|
+
"""
|
|
1125
|
+
client = self.client
|
|
1126
|
+
if aspects is None:
|
|
1127
|
+
aspects = client.aspects
|
|
1128
|
+
|
|
1129
|
+
header_params = client.headers
|
|
1130
|
+
if headers is not None:
|
|
1131
|
+
header_params = headers
|
|
1132
|
+
|
|
1133
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}"
|
|
1134
|
+
path_params = {
|
|
1135
|
+
'org': org,
|
|
1136
|
+
'team_slug': team_slug,
|
|
1137
|
+
}
|
|
1138
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1139
|
+
|
|
1140
|
+
query_params = None
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
if exp_status is None:
|
|
1144
|
+
exp_status = [200]
|
|
1145
|
+
|
|
1146
|
+
resp = client.perform_call(
|
|
1147
|
+
leaf=call_leaf,
|
|
1148
|
+
method="GET",
|
|
1149
|
+
params=query_params if query_params else None,
|
|
1150
|
+
body=None,
|
|
1151
|
+
exp_status=exp_status,
|
|
1152
|
+
headers=header_params if header_params else None,
|
|
1153
|
+
context_msg=None,
|
|
1154
|
+
aspects=aspects,
|
|
1155
|
+
)
|
|
1156
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1157
|
+
rtnobj = None
|
|
1158
|
+
else:
|
|
1159
|
+
raw_data = resp.json()
|
|
1160
|
+
rtnobj = TeamFull.from_dict(raw_data)
|
|
1161
|
+
return rtnobj
|
|
1162
|
+
|
|
1163
|
+
def get_discussion_comment_in_org(self, org: str, team_slug: str, discussion_number: int, comment_number: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamDiscussionComment:
|
|
1164
|
+
"""
|
|
1165
|
+
Get a discussion comment
|
|
1166
|
+
|
|
1167
|
+
Get a specific comment on a team discussion.
|
|
1168
|
+
|
|
1169
|
+
> [!NOTE]
|
|
1170
|
+
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.
|
|
1171
|
+
|
|
1172
|
+
OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
|
|
1173
|
+
"""
|
|
1174
|
+
client = self.client
|
|
1175
|
+
if aspects is None:
|
|
1176
|
+
aspects = client.aspects
|
|
1177
|
+
|
|
1178
|
+
header_params = client.headers
|
|
1179
|
+
if headers is not None:
|
|
1180
|
+
header_params = headers
|
|
1181
|
+
|
|
1182
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
|
|
1183
|
+
path_params = {
|
|
1184
|
+
'org': org,
|
|
1185
|
+
'team_slug': team_slug,
|
|
1186
|
+
'discussion_number': discussion_number,
|
|
1187
|
+
'comment_number': comment_number,
|
|
1188
|
+
}
|
|
1189
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1190
|
+
|
|
1191
|
+
query_params = None
|
|
1192
|
+
|
|
1193
|
+
|
|
1194
|
+
if exp_status is None:
|
|
1195
|
+
exp_status = [200]
|
|
1196
|
+
|
|
1197
|
+
resp = client.perform_call(
|
|
1198
|
+
leaf=call_leaf,
|
|
1199
|
+
method="GET",
|
|
1200
|
+
params=query_params if query_params else None,
|
|
1201
|
+
body=None,
|
|
1202
|
+
exp_status=exp_status,
|
|
1203
|
+
headers=header_params if header_params else None,
|
|
1204
|
+
context_msg=None,
|
|
1205
|
+
aspects=aspects,
|
|
1206
|
+
)
|
|
1207
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1208
|
+
rtnobj = None
|
|
1209
|
+
else:
|
|
1210
|
+
raw_data = resp.json()
|
|
1211
|
+
rtnobj = TeamDiscussionComment.from_dict(raw_data)
|
|
1212
|
+
return rtnobj
|
|
1213
|
+
|
|
1214
|
+
def get_discussion_comment_legacy(self, team_id: int, discussion_number: int, comment_number: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamDiscussionComment:
|
|
1215
|
+
"""
|
|
1216
|
+
Get a discussion comment (Legacy)
|
|
1217
|
+
|
|
1218
|
+
> [!WARNING]
|
|
1219
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/rest/teams/discussion-comments#get-a-discussion-comment) endpoint.
|
|
1220
|
+
|
|
1221
|
+
Get a specific comment on a team discussion.
|
|
1222
|
+
|
|
1223
|
+
OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
|
|
1224
|
+
"""
|
|
1225
|
+
client = self.client
|
|
1226
|
+
if aspects is None:
|
|
1227
|
+
aspects = client.aspects
|
|
1228
|
+
|
|
1229
|
+
header_params = client.headers
|
|
1230
|
+
if headers is not None:
|
|
1231
|
+
header_params = headers
|
|
1232
|
+
|
|
1233
|
+
leaf_template = "/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}"
|
|
1234
|
+
path_params = {
|
|
1235
|
+
'team_id': team_id,
|
|
1236
|
+
'discussion_number': discussion_number,
|
|
1237
|
+
'comment_number': comment_number,
|
|
1238
|
+
}
|
|
1239
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1240
|
+
|
|
1241
|
+
query_params = None
|
|
1242
|
+
|
|
1243
|
+
|
|
1244
|
+
if exp_status is None:
|
|
1245
|
+
exp_status = [200]
|
|
1246
|
+
|
|
1247
|
+
resp = client.perform_call(
|
|
1248
|
+
leaf=call_leaf,
|
|
1249
|
+
method="GET",
|
|
1250
|
+
params=query_params if query_params else None,
|
|
1251
|
+
body=None,
|
|
1252
|
+
exp_status=exp_status,
|
|
1253
|
+
headers=header_params if header_params else None,
|
|
1254
|
+
context_msg=None,
|
|
1255
|
+
aspects=aspects,
|
|
1256
|
+
)
|
|
1257
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1258
|
+
rtnobj = None
|
|
1259
|
+
else:
|
|
1260
|
+
raw_data = resp.json()
|
|
1261
|
+
rtnobj = TeamDiscussionComment.from_dict(raw_data)
|
|
1262
|
+
return rtnobj
|
|
1263
|
+
|
|
1264
|
+
def get_discussion_in_org(self, org: str, team_slug: str, discussion_number: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamDiscussion:
|
|
1265
|
+
"""
|
|
1266
|
+
Get a discussion
|
|
1267
|
+
|
|
1268
|
+
Get a specific discussion on a team's page.
|
|
1269
|
+
|
|
1270
|
+
> [!NOTE]
|
|
1271
|
+
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.
|
|
1272
|
+
|
|
1273
|
+
OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
|
|
1274
|
+
"""
|
|
1275
|
+
client = self.client
|
|
1276
|
+
if aspects is None:
|
|
1277
|
+
aspects = client.aspects
|
|
1278
|
+
|
|
1279
|
+
header_params = client.headers
|
|
1280
|
+
if headers is not None:
|
|
1281
|
+
header_params = headers
|
|
1282
|
+
|
|
1283
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
|
|
1284
|
+
path_params = {
|
|
1285
|
+
'org': org,
|
|
1286
|
+
'team_slug': team_slug,
|
|
1287
|
+
'discussion_number': discussion_number,
|
|
1288
|
+
}
|
|
1289
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1290
|
+
|
|
1291
|
+
query_params = None
|
|
1292
|
+
|
|
1293
|
+
|
|
1294
|
+
if exp_status is None:
|
|
1295
|
+
exp_status = [200]
|
|
1296
|
+
|
|
1297
|
+
resp = client.perform_call(
|
|
1298
|
+
leaf=call_leaf,
|
|
1299
|
+
method="GET",
|
|
1300
|
+
params=query_params if query_params else None,
|
|
1301
|
+
body=None,
|
|
1302
|
+
exp_status=exp_status,
|
|
1303
|
+
headers=header_params if header_params else None,
|
|
1304
|
+
context_msg=None,
|
|
1305
|
+
aspects=aspects,
|
|
1306
|
+
)
|
|
1307
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1308
|
+
rtnobj = None
|
|
1309
|
+
else:
|
|
1310
|
+
raw_data = resp.json()
|
|
1311
|
+
rtnobj = TeamDiscussion.from_dict(raw_data)
|
|
1312
|
+
return rtnobj
|
|
1313
|
+
|
|
1314
|
+
def get_discussion_legacy(self, team_id: int, discussion_number: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamDiscussion:
|
|
1315
|
+
"""
|
|
1316
|
+
Get a discussion (Legacy)
|
|
1317
|
+
|
|
1318
|
+
> [!WARNING]
|
|
1319
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/rest/teams/discussions#get-a-discussion) endpoint.
|
|
1320
|
+
|
|
1321
|
+
Get a specific discussion on a team's page.
|
|
1322
|
+
|
|
1323
|
+
OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
|
|
1324
|
+
"""
|
|
1325
|
+
client = self.client
|
|
1326
|
+
if aspects is None:
|
|
1327
|
+
aspects = client.aspects
|
|
1328
|
+
|
|
1329
|
+
header_params = client.headers
|
|
1330
|
+
if headers is not None:
|
|
1331
|
+
header_params = headers
|
|
1332
|
+
|
|
1333
|
+
leaf_template = "/teams/{team_id}/discussions/{discussion_number}"
|
|
1334
|
+
path_params = {
|
|
1335
|
+
'team_id': team_id,
|
|
1336
|
+
'discussion_number': discussion_number,
|
|
1337
|
+
}
|
|
1338
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1339
|
+
|
|
1340
|
+
query_params = None
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
if exp_status is None:
|
|
1344
|
+
exp_status = [200]
|
|
1345
|
+
|
|
1346
|
+
resp = client.perform_call(
|
|
1347
|
+
leaf=call_leaf,
|
|
1348
|
+
method="GET",
|
|
1349
|
+
params=query_params if query_params else None,
|
|
1350
|
+
body=None,
|
|
1351
|
+
exp_status=exp_status,
|
|
1352
|
+
headers=header_params if header_params else None,
|
|
1353
|
+
context_msg=None,
|
|
1354
|
+
aspects=aspects,
|
|
1355
|
+
)
|
|
1356
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1357
|
+
rtnobj = None
|
|
1358
|
+
else:
|
|
1359
|
+
raw_data = resp.json()
|
|
1360
|
+
rtnobj = TeamDiscussion.from_dict(raw_data)
|
|
1361
|
+
return rtnobj
|
|
1362
|
+
|
|
1363
|
+
def get_legacy(self, team_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamFull:
|
|
1364
|
+
"""
|
|
1365
|
+
Get a team (Legacy)
|
|
1366
|
+
|
|
1367
|
+
> [!WARNING]
|
|
1368
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/rest/teams/teams#get-a-team-by-name) endpoint.
|
|
1369
|
+
"""
|
|
1370
|
+
client = self.client
|
|
1371
|
+
if aspects is None:
|
|
1372
|
+
aspects = client.aspects
|
|
1373
|
+
|
|
1374
|
+
header_params = client.headers
|
|
1375
|
+
if headers is not None:
|
|
1376
|
+
header_params = headers
|
|
1377
|
+
|
|
1378
|
+
leaf_template = "/teams/{team_id}"
|
|
1379
|
+
path_params = {
|
|
1380
|
+
'team_id': team_id,
|
|
1381
|
+
}
|
|
1382
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1383
|
+
|
|
1384
|
+
query_params = None
|
|
1385
|
+
|
|
1386
|
+
|
|
1387
|
+
if exp_status is None:
|
|
1388
|
+
exp_status = [200]
|
|
1389
|
+
|
|
1390
|
+
resp = client.perform_call(
|
|
1391
|
+
leaf=call_leaf,
|
|
1392
|
+
method="GET",
|
|
1393
|
+
params=query_params if query_params else None,
|
|
1394
|
+
body=None,
|
|
1395
|
+
exp_status=exp_status,
|
|
1396
|
+
headers=header_params if header_params else None,
|
|
1397
|
+
context_msg=None,
|
|
1398
|
+
aspects=aspects,
|
|
1399
|
+
)
|
|
1400
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1401
|
+
rtnobj = None
|
|
1402
|
+
else:
|
|
1403
|
+
raw_data = resp.json()
|
|
1404
|
+
rtnobj = TeamFull.from_dict(raw_data)
|
|
1405
|
+
return rtnobj
|
|
1406
|
+
|
|
1407
|
+
def get_member_legacy(self, team_id: int, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
1408
|
+
"""
|
|
1409
|
+
Get team member (Legacy)
|
|
1410
|
+
|
|
1411
|
+
The "Get team member" endpoint (described below) is closing down.
|
|
1412
|
+
|
|
1413
|
+
We recommend using the [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships.
|
|
1414
|
+
|
|
1415
|
+
To list members in a team, the team must be visible to the authenticated user.
|
|
1416
|
+
"""
|
|
1417
|
+
client = self.client
|
|
1418
|
+
if aspects is None:
|
|
1419
|
+
aspects = client.aspects
|
|
1420
|
+
|
|
1421
|
+
header_params = client.headers
|
|
1422
|
+
if headers is not None:
|
|
1423
|
+
header_params = headers
|
|
1424
|
+
|
|
1425
|
+
leaf_template = "/teams/{team_id}/members/{username}"
|
|
1426
|
+
path_params = {
|
|
1427
|
+
'team_id': team_id,
|
|
1428
|
+
'username': username,
|
|
1429
|
+
}
|
|
1430
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1431
|
+
|
|
1432
|
+
query_params = None
|
|
1433
|
+
|
|
1434
|
+
|
|
1435
|
+
if exp_status is None:
|
|
1436
|
+
exp_status = [204]
|
|
1437
|
+
|
|
1438
|
+
resp = client.perform_call(
|
|
1439
|
+
leaf=call_leaf,
|
|
1440
|
+
method="GET",
|
|
1441
|
+
params=query_params if query_params else None,
|
|
1442
|
+
body=None,
|
|
1443
|
+
exp_status=exp_status,
|
|
1444
|
+
headers=header_params if header_params else None,
|
|
1445
|
+
context_msg=None,
|
|
1446
|
+
aspects=aspects,
|
|
1447
|
+
)
|
|
1448
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1449
|
+
rtnval = None
|
|
1450
|
+
else:
|
|
1451
|
+
rtnval = resp.json()
|
|
1452
|
+
return rtnval
|
|
1453
|
+
|
|
1454
|
+
def get_membership_for_user_in_org(self, org: str, team_slug: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamMembership:
|
|
1455
|
+
"""
|
|
1456
|
+
Get team membership for a user
|
|
1457
|
+
|
|
1458
|
+
Team members will include the members of child teams.
|
|
1459
|
+
|
|
1460
|
+
To get a user's membership with a team, the team must be visible to the authenticated user.
|
|
1461
|
+
|
|
1462
|
+
> [!NOTE]
|
|
1463
|
+
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`.
|
|
1464
|
+
|
|
1465
|
+
> [!NOTE]
|
|
1466
|
+
> The response contains the `state` of the membership and the member's `role`.
|
|
1467
|
+
|
|
1468
|
+
The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team).
|
|
1469
|
+
"""
|
|
1470
|
+
client = self.client
|
|
1471
|
+
if aspects is None:
|
|
1472
|
+
aspects = client.aspects
|
|
1473
|
+
|
|
1474
|
+
header_params = client.headers
|
|
1475
|
+
if headers is not None:
|
|
1476
|
+
header_params = headers
|
|
1477
|
+
|
|
1478
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/memberships/{username}"
|
|
1479
|
+
path_params = {
|
|
1480
|
+
'org': org,
|
|
1481
|
+
'team_slug': team_slug,
|
|
1482
|
+
'username': username,
|
|
1483
|
+
}
|
|
1484
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1485
|
+
|
|
1486
|
+
query_params = None
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
if exp_status is None:
|
|
1490
|
+
exp_status = [200]
|
|
1491
|
+
|
|
1492
|
+
resp = client.perform_call(
|
|
1493
|
+
leaf=call_leaf,
|
|
1494
|
+
method="GET",
|
|
1495
|
+
params=query_params if query_params else None,
|
|
1496
|
+
body=None,
|
|
1497
|
+
exp_status=exp_status,
|
|
1498
|
+
headers=header_params if header_params else None,
|
|
1499
|
+
context_msg=None,
|
|
1500
|
+
aspects=aspects,
|
|
1501
|
+
)
|
|
1502
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1503
|
+
rtnobj = None
|
|
1504
|
+
else:
|
|
1505
|
+
raw_data = resp.json()
|
|
1506
|
+
rtnobj = TeamMembership.from_dict(raw_data)
|
|
1507
|
+
return rtnobj
|
|
1508
|
+
|
|
1509
|
+
def get_membership_for_user_legacy(self, team_id: int, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamMembership:
|
|
1510
|
+
"""
|
|
1511
|
+
Get team membership for a user (Legacy)
|
|
1512
|
+
|
|
1513
|
+
> [!WARNING]
|
|
1514
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/rest/teams/members#get-team-membership-for-a-user) endpoint.
|
|
1515
|
+
|
|
1516
|
+
Team members will include the members of child teams.
|
|
1517
|
+
|
|
1518
|
+
To get a user's membership with a team, the team must be visible to the authenticated user.
|
|
1519
|
+
|
|
1520
|
+
**Note:**
|
|
1521
|
+
The response contains the `state` of the membership and the member's `role`.
|
|
1522
|
+
|
|
1523
|
+
The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/rest/teams/teams#create-a-team).
|
|
1524
|
+
"""
|
|
1525
|
+
client = self.client
|
|
1526
|
+
if aspects is None:
|
|
1527
|
+
aspects = client.aspects
|
|
1528
|
+
|
|
1529
|
+
header_params = client.headers
|
|
1530
|
+
if headers is not None:
|
|
1531
|
+
header_params = headers
|
|
1532
|
+
|
|
1533
|
+
leaf_template = "/teams/{team_id}/memberships/{username}"
|
|
1534
|
+
path_params = {
|
|
1535
|
+
'team_id': team_id,
|
|
1536
|
+
'username': username,
|
|
1537
|
+
}
|
|
1538
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1539
|
+
|
|
1540
|
+
query_params = None
|
|
1541
|
+
|
|
1542
|
+
|
|
1543
|
+
if exp_status is None:
|
|
1544
|
+
exp_status = [200]
|
|
1545
|
+
|
|
1546
|
+
resp = client.perform_call(
|
|
1547
|
+
leaf=call_leaf,
|
|
1548
|
+
method="GET",
|
|
1549
|
+
params=query_params if query_params else None,
|
|
1550
|
+
body=None,
|
|
1551
|
+
exp_status=exp_status,
|
|
1552
|
+
headers=header_params if header_params else None,
|
|
1553
|
+
context_msg=None,
|
|
1554
|
+
aspects=aspects,
|
|
1555
|
+
)
|
|
1556
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1557
|
+
rtnobj = None
|
|
1558
|
+
else:
|
|
1559
|
+
raw_data = resp.json()
|
|
1560
|
+
rtnobj = TeamMembership.from_dict(raw_data)
|
|
1561
|
+
return rtnobj
|
|
1562
|
+
|
|
1563
|
+
def list(self, org: str, *, per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[Team]:
|
|
1564
|
+
"""
|
|
1565
|
+
List teams
|
|
1566
|
+
|
|
1567
|
+
Lists all teams in an organization that are visible to the authenticated user.
|
|
1568
|
+
"""
|
|
1569
|
+
client = self.client
|
|
1570
|
+
if aspects is None:
|
|
1571
|
+
aspects = client.aspects
|
|
1572
|
+
|
|
1573
|
+
header_params = client.headers
|
|
1574
|
+
if headers is not None:
|
|
1575
|
+
header_params = headers
|
|
1576
|
+
|
|
1577
|
+
leaf_template = "/orgs/{org}/teams"
|
|
1578
|
+
path_params = {
|
|
1579
|
+
'org': org,
|
|
1580
|
+
}
|
|
1581
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1582
|
+
|
|
1583
|
+
query_params = {}
|
|
1584
|
+
if per_page is not None:
|
|
1585
|
+
query_params['per_page'] = per_page
|
|
1586
|
+
if page is not None:
|
|
1587
|
+
query_params['page'] = page
|
|
1588
|
+
|
|
1589
|
+
|
|
1590
|
+
if exp_status is None:
|
|
1591
|
+
exp_status = [200]
|
|
1592
|
+
|
|
1593
|
+
resp = client.perform_call(
|
|
1594
|
+
leaf=call_leaf,
|
|
1595
|
+
method="GET",
|
|
1596
|
+
params=query_params if query_params else None,
|
|
1597
|
+
body=None,
|
|
1598
|
+
exp_status=exp_status,
|
|
1599
|
+
headers=header_params if header_params else None,
|
|
1600
|
+
context_msg=None,
|
|
1601
|
+
aspects=aspects,
|
|
1602
|
+
)
|
|
1603
|
+
raw_data = resp.json()
|
|
1604
|
+
items = [self._parse_item(item, Team) for item in raw_data]
|
|
1605
|
+
rtnval = PagedList[Team](items, dict(resp.headers), raw_data)
|
|
1606
|
+
return rtnval
|
|
1607
|
+
|
|
1608
|
+
def list_child_in_org(self, org: str, team_slug: str, *, per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[Team]:
|
|
1609
|
+
"""
|
|
1610
|
+
List child teams
|
|
1611
|
+
|
|
1612
|
+
Lists the child teams of the team specified by `{team_slug}`.
|
|
1613
|
+
|
|
1614
|
+
> [!NOTE]
|
|
1615
|
+
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`.
|
|
1616
|
+
"""
|
|
1617
|
+
client = self.client
|
|
1618
|
+
if aspects is None:
|
|
1619
|
+
aspects = client.aspects
|
|
1620
|
+
|
|
1621
|
+
header_params = client.headers
|
|
1622
|
+
if headers is not None:
|
|
1623
|
+
header_params = headers
|
|
1624
|
+
|
|
1625
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/teams"
|
|
1626
|
+
path_params = {
|
|
1627
|
+
'org': org,
|
|
1628
|
+
'team_slug': team_slug,
|
|
1629
|
+
}
|
|
1630
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1631
|
+
|
|
1632
|
+
query_params = {}
|
|
1633
|
+
if per_page is not None:
|
|
1634
|
+
query_params['per_page'] = per_page
|
|
1635
|
+
if page is not None:
|
|
1636
|
+
query_params['page'] = page
|
|
1637
|
+
|
|
1638
|
+
|
|
1639
|
+
if exp_status is None:
|
|
1640
|
+
exp_status = [200]
|
|
1641
|
+
|
|
1642
|
+
resp = client.perform_call(
|
|
1643
|
+
leaf=call_leaf,
|
|
1644
|
+
method="GET",
|
|
1645
|
+
params=query_params if query_params else None,
|
|
1646
|
+
body=None,
|
|
1647
|
+
exp_status=exp_status,
|
|
1648
|
+
headers=header_params if header_params else None,
|
|
1649
|
+
context_msg=None,
|
|
1650
|
+
aspects=aspects,
|
|
1651
|
+
)
|
|
1652
|
+
raw_data = resp.json()
|
|
1653
|
+
items = [self._parse_item(item, Team) for item in raw_data]
|
|
1654
|
+
rtnval = PagedList[Team](items, dict(resp.headers), raw_data)
|
|
1655
|
+
return rtnval
|
|
1656
|
+
|
|
1657
|
+
def list_child_legacy(self, team_id: int, *, per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[Team]:
|
|
1658
|
+
"""
|
|
1659
|
+
List child teams (Legacy)
|
|
1660
|
+
|
|
1661
|
+
> [!WARNING]
|
|
1662
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/rest/teams/teams#list-child-teams) endpoint.
|
|
1663
|
+
"""
|
|
1664
|
+
client = self.client
|
|
1665
|
+
if aspects is None:
|
|
1666
|
+
aspects = client.aspects
|
|
1667
|
+
|
|
1668
|
+
header_params = client.headers
|
|
1669
|
+
if headers is not None:
|
|
1670
|
+
header_params = headers
|
|
1671
|
+
|
|
1672
|
+
leaf_template = "/teams/{team_id}/teams"
|
|
1673
|
+
path_params = {
|
|
1674
|
+
'team_id': team_id,
|
|
1675
|
+
}
|
|
1676
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1677
|
+
|
|
1678
|
+
query_params = {}
|
|
1679
|
+
if per_page is not None:
|
|
1680
|
+
query_params['per_page'] = per_page
|
|
1681
|
+
if page is not None:
|
|
1682
|
+
query_params['page'] = page
|
|
1683
|
+
|
|
1684
|
+
|
|
1685
|
+
if exp_status is None:
|
|
1686
|
+
exp_status = [200]
|
|
1687
|
+
|
|
1688
|
+
resp = client.perform_call(
|
|
1689
|
+
leaf=call_leaf,
|
|
1690
|
+
method="GET",
|
|
1691
|
+
params=query_params if query_params else None,
|
|
1692
|
+
body=None,
|
|
1693
|
+
exp_status=exp_status,
|
|
1694
|
+
headers=header_params if header_params else None,
|
|
1695
|
+
context_msg=None,
|
|
1696
|
+
aspects=aspects,
|
|
1697
|
+
)
|
|
1698
|
+
raw_data = resp.json()
|
|
1699
|
+
items = [self._parse_item(item, Team) for item in raw_data]
|
|
1700
|
+
rtnval = PagedList[Team](items, dict(resp.headers), raw_data)
|
|
1701
|
+
return rtnval
|
|
1702
|
+
|
|
1703
|
+
def list_discussion_comments_in_org(self, org: str, team_slug: str, discussion_number: int, *, direction: Optional[str] = "desc", per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[TeamDiscussionComment]:
|
|
1704
|
+
"""
|
|
1705
|
+
List discussion comments
|
|
1706
|
+
|
|
1707
|
+
List all comments on a team discussion.
|
|
1708
|
+
|
|
1709
|
+
> [!NOTE]
|
|
1710
|
+
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.
|
|
1711
|
+
|
|
1712
|
+
OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
|
|
1713
|
+
"""
|
|
1714
|
+
client = self.client
|
|
1715
|
+
if aspects is None:
|
|
1716
|
+
aspects = client.aspects
|
|
1717
|
+
|
|
1718
|
+
header_params = client.headers
|
|
1719
|
+
if headers is not None:
|
|
1720
|
+
header_params = headers
|
|
1721
|
+
|
|
1722
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"
|
|
1723
|
+
path_params = {
|
|
1724
|
+
'org': org,
|
|
1725
|
+
'team_slug': team_slug,
|
|
1726
|
+
'discussion_number': discussion_number,
|
|
1727
|
+
}
|
|
1728
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1729
|
+
|
|
1730
|
+
query_params = {}
|
|
1731
|
+
if direction is not None:
|
|
1732
|
+
query_params['direction'] = direction
|
|
1733
|
+
if per_page is not None:
|
|
1734
|
+
query_params['per_page'] = per_page
|
|
1735
|
+
if page is not None:
|
|
1736
|
+
query_params['page'] = page
|
|
1737
|
+
|
|
1738
|
+
|
|
1739
|
+
if exp_status is None:
|
|
1740
|
+
exp_status = [200]
|
|
1741
|
+
|
|
1742
|
+
resp = client.perform_call(
|
|
1743
|
+
leaf=call_leaf,
|
|
1744
|
+
method="GET",
|
|
1745
|
+
params=query_params if query_params else None,
|
|
1746
|
+
body=None,
|
|
1747
|
+
exp_status=exp_status,
|
|
1748
|
+
headers=header_params if header_params else None,
|
|
1749
|
+
context_msg=None,
|
|
1750
|
+
aspects=aspects,
|
|
1751
|
+
)
|
|
1752
|
+
raw_data = resp.json()
|
|
1753
|
+
items = [self._parse_item(item, TeamDiscussionComment) for item in raw_data]
|
|
1754
|
+
rtnval = PagedList[TeamDiscussionComment](items, dict(resp.headers), raw_data)
|
|
1755
|
+
return rtnval
|
|
1756
|
+
|
|
1757
|
+
def list_discussion_comments_legacy(self, team_id: int, discussion_number: int, *, direction: Optional[str] = "desc", per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[TeamDiscussionComment]:
|
|
1758
|
+
"""
|
|
1759
|
+
List discussion comments (Legacy)
|
|
1760
|
+
|
|
1761
|
+
> [!WARNING]
|
|
1762
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/rest/teams/discussion-comments#list-discussion-comments) endpoint.
|
|
1763
|
+
|
|
1764
|
+
List all comments on a team discussion.
|
|
1765
|
+
|
|
1766
|
+
OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
|
|
1767
|
+
"""
|
|
1768
|
+
client = self.client
|
|
1769
|
+
if aspects is None:
|
|
1770
|
+
aspects = client.aspects
|
|
1771
|
+
|
|
1772
|
+
header_params = client.headers
|
|
1773
|
+
if headers is not None:
|
|
1774
|
+
header_params = headers
|
|
1775
|
+
|
|
1776
|
+
leaf_template = "/teams/{team_id}/discussions/{discussion_number}/comments"
|
|
1777
|
+
path_params = {
|
|
1778
|
+
'team_id': team_id,
|
|
1779
|
+
'discussion_number': discussion_number,
|
|
1780
|
+
}
|
|
1781
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1782
|
+
|
|
1783
|
+
query_params = {}
|
|
1784
|
+
if direction is not None:
|
|
1785
|
+
query_params['direction'] = direction
|
|
1786
|
+
if per_page is not None:
|
|
1787
|
+
query_params['per_page'] = per_page
|
|
1788
|
+
if page is not None:
|
|
1789
|
+
query_params['page'] = page
|
|
1790
|
+
|
|
1791
|
+
|
|
1792
|
+
if exp_status is None:
|
|
1793
|
+
exp_status = [200]
|
|
1794
|
+
|
|
1795
|
+
resp = client.perform_call(
|
|
1796
|
+
leaf=call_leaf,
|
|
1797
|
+
method="GET",
|
|
1798
|
+
params=query_params if query_params else None,
|
|
1799
|
+
body=None,
|
|
1800
|
+
exp_status=exp_status,
|
|
1801
|
+
headers=header_params if header_params else None,
|
|
1802
|
+
context_msg=None,
|
|
1803
|
+
aspects=aspects,
|
|
1804
|
+
)
|
|
1805
|
+
raw_data = resp.json()
|
|
1806
|
+
items = [self._parse_item(item, TeamDiscussionComment) for item in raw_data]
|
|
1807
|
+
rtnval = PagedList[TeamDiscussionComment](items, dict(resp.headers), raw_data)
|
|
1808
|
+
return rtnval
|
|
1809
|
+
|
|
1810
|
+
def list_discussions_in_org(self, org: str, team_slug: str, *, direction: Optional[str] = "desc", per_page: Optional[int] = 30, page: Optional[int] = 1, pinned: Optional[str] = None, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[TeamDiscussion]:
|
|
1811
|
+
"""
|
|
1812
|
+
List discussions
|
|
1813
|
+
|
|
1814
|
+
List all discussions on a team's page.
|
|
1815
|
+
|
|
1816
|
+
> [!NOTE]
|
|
1817
|
+
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`.
|
|
1818
|
+
|
|
1819
|
+
OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
|
|
1820
|
+
"""
|
|
1821
|
+
client = self.client
|
|
1822
|
+
if aspects is None:
|
|
1823
|
+
aspects = client.aspects
|
|
1824
|
+
|
|
1825
|
+
header_params = client.headers
|
|
1826
|
+
if headers is not None:
|
|
1827
|
+
header_params = headers
|
|
1828
|
+
|
|
1829
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/discussions"
|
|
1830
|
+
path_params = {
|
|
1831
|
+
'org': org,
|
|
1832
|
+
'team_slug': team_slug,
|
|
1833
|
+
}
|
|
1834
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1835
|
+
|
|
1836
|
+
query_params = {}
|
|
1837
|
+
if direction is not None:
|
|
1838
|
+
query_params['direction'] = direction
|
|
1839
|
+
if per_page is not None:
|
|
1840
|
+
query_params['per_page'] = per_page
|
|
1841
|
+
if page is not None:
|
|
1842
|
+
query_params['page'] = page
|
|
1843
|
+
if pinned is not None:
|
|
1844
|
+
query_params['pinned'] = pinned
|
|
1845
|
+
|
|
1846
|
+
|
|
1847
|
+
if exp_status is None:
|
|
1848
|
+
exp_status = [200]
|
|
1849
|
+
|
|
1850
|
+
resp = client.perform_call(
|
|
1851
|
+
leaf=call_leaf,
|
|
1852
|
+
method="GET",
|
|
1853
|
+
params=query_params if query_params else None,
|
|
1854
|
+
body=None,
|
|
1855
|
+
exp_status=exp_status,
|
|
1856
|
+
headers=header_params if header_params else None,
|
|
1857
|
+
context_msg=None,
|
|
1858
|
+
aspects=aspects,
|
|
1859
|
+
)
|
|
1860
|
+
raw_data = resp.json()
|
|
1861
|
+
items = [self._parse_item(item, TeamDiscussion) for item in raw_data]
|
|
1862
|
+
rtnval = PagedList[TeamDiscussion](items, dict(resp.headers), raw_data)
|
|
1863
|
+
return rtnval
|
|
1864
|
+
|
|
1865
|
+
def list_discussions_legacy(self, team_id: int, *, direction: Optional[str] = "desc", per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[TeamDiscussion]:
|
|
1866
|
+
"""
|
|
1867
|
+
List discussions (Legacy)
|
|
1868
|
+
|
|
1869
|
+
> [!WARNING]
|
|
1870
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/rest/teams/discussions#list-discussions) endpoint.
|
|
1871
|
+
|
|
1872
|
+
List all discussions on a team's page.
|
|
1873
|
+
|
|
1874
|
+
OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint.
|
|
1875
|
+
"""
|
|
1876
|
+
client = self.client
|
|
1877
|
+
if aspects is None:
|
|
1878
|
+
aspects = client.aspects
|
|
1879
|
+
|
|
1880
|
+
header_params = client.headers
|
|
1881
|
+
if headers is not None:
|
|
1882
|
+
header_params = headers
|
|
1883
|
+
|
|
1884
|
+
leaf_template = "/teams/{team_id}/discussions"
|
|
1885
|
+
path_params = {
|
|
1886
|
+
'team_id': team_id,
|
|
1887
|
+
}
|
|
1888
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1889
|
+
|
|
1890
|
+
query_params = {}
|
|
1891
|
+
if direction is not None:
|
|
1892
|
+
query_params['direction'] = direction
|
|
1893
|
+
if per_page is not None:
|
|
1894
|
+
query_params['per_page'] = per_page
|
|
1895
|
+
if page is not None:
|
|
1896
|
+
query_params['page'] = page
|
|
1897
|
+
|
|
1898
|
+
|
|
1899
|
+
if exp_status is None:
|
|
1900
|
+
exp_status = [200]
|
|
1901
|
+
|
|
1902
|
+
resp = client.perform_call(
|
|
1903
|
+
leaf=call_leaf,
|
|
1904
|
+
method="GET",
|
|
1905
|
+
params=query_params if query_params else None,
|
|
1906
|
+
body=None,
|
|
1907
|
+
exp_status=exp_status,
|
|
1908
|
+
headers=header_params if header_params else None,
|
|
1909
|
+
context_msg=None,
|
|
1910
|
+
aspects=aspects,
|
|
1911
|
+
)
|
|
1912
|
+
raw_data = resp.json()
|
|
1913
|
+
items = [self._parse_item(item, TeamDiscussion) for item in raw_data]
|
|
1914
|
+
rtnval = PagedList[TeamDiscussion](items, dict(resp.headers), raw_data)
|
|
1915
|
+
return rtnval
|
|
1916
|
+
|
|
1917
|
+
def list_for_authenticated_user(self, *, per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[TeamFull]:
|
|
1918
|
+
"""
|
|
1919
|
+
List teams for the authenticated user
|
|
1920
|
+
|
|
1921
|
+
List all of the teams across all of the organizations to which the authenticated
|
|
1922
|
+
user belongs.
|
|
1923
|
+
|
|
1924
|
+
OAuth app tokens and personal access tokens (classic) need the `user`, `repo`, or `read:org` scope to use this endpoint.
|
|
1925
|
+
|
|
1926
|
+
When using a fine-grained personal access token, the resource owner of the token must be a single organization, and the response will only include the teams from that organization.
|
|
1927
|
+
"""
|
|
1928
|
+
client = self.client
|
|
1929
|
+
if aspects is None:
|
|
1930
|
+
aspects = client.aspects
|
|
1931
|
+
|
|
1932
|
+
header_params = client.headers
|
|
1933
|
+
if headers is not None:
|
|
1934
|
+
header_params = headers
|
|
1935
|
+
|
|
1936
|
+
call_leaf = "/user/teams"
|
|
1937
|
+
|
|
1938
|
+
query_params = {}
|
|
1939
|
+
if per_page is not None:
|
|
1940
|
+
query_params['per_page'] = per_page
|
|
1941
|
+
if page is not None:
|
|
1942
|
+
query_params['page'] = page
|
|
1943
|
+
|
|
1944
|
+
|
|
1945
|
+
if exp_status is None:
|
|
1946
|
+
exp_status = [200]
|
|
1947
|
+
|
|
1948
|
+
resp = client.perform_call(
|
|
1949
|
+
leaf=call_leaf,
|
|
1950
|
+
method="GET",
|
|
1951
|
+
params=query_params if query_params else None,
|
|
1952
|
+
body=None,
|
|
1953
|
+
exp_status=exp_status,
|
|
1954
|
+
headers=header_params if header_params else None,
|
|
1955
|
+
context_msg=None,
|
|
1956
|
+
aspects=aspects,
|
|
1957
|
+
)
|
|
1958
|
+
raw_data = resp.json()
|
|
1959
|
+
items = [self._parse_item(item, TeamFull) for item in raw_data]
|
|
1960
|
+
rtnval = PagedList[TeamFull](items, dict(resp.headers), raw_data)
|
|
1961
|
+
return rtnval
|
|
1962
|
+
|
|
1963
|
+
def list_members_in_org(self, org: str, team_slug: str, *, role: Optional[str] = "all", per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[SimpleUser]:
|
|
1964
|
+
"""
|
|
1965
|
+
List team members
|
|
1966
|
+
|
|
1967
|
+
Team members will include the members of child teams.
|
|
1968
|
+
|
|
1969
|
+
To list members in a team, the team must be visible to the authenticated user.
|
|
1970
|
+
"""
|
|
1971
|
+
client = self.client
|
|
1972
|
+
if aspects is None:
|
|
1973
|
+
aspects = client.aspects
|
|
1974
|
+
|
|
1975
|
+
header_params = client.headers
|
|
1976
|
+
if headers is not None:
|
|
1977
|
+
header_params = headers
|
|
1978
|
+
|
|
1979
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/members"
|
|
1980
|
+
path_params = {
|
|
1981
|
+
'org': org,
|
|
1982
|
+
'team_slug': team_slug,
|
|
1983
|
+
}
|
|
1984
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1985
|
+
|
|
1986
|
+
query_params = {}
|
|
1987
|
+
if role is not None:
|
|
1988
|
+
query_params['role'] = role
|
|
1989
|
+
if per_page is not None:
|
|
1990
|
+
query_params['per_page'] = per_page
|
|
1991
|
+
if page is not None:
|
|
1992
|
+
query_params['page'] = page
|
|
1993
|
+
|
|
1994
|
+
|
|
1995
|
+
if exp_status is None:
|
|
1996
|
+
exp_status = [200]
|
|
1997
|
+
|
|
1998
|
+
resp = client.perform_call(
|
|
1999
|
+
leaf=call_leaf,
|
|
2000
|
+
method="GET",
|
|
2001
|
+
params=query_params if query_params else None,
|
|
2002
|
+
body=None,
|
|
2003
|
+
exp_status=exp_status,
|
|
2004
|
+
headers=header_params if header_params else None,
|
|
2005
|
+
context_msg=None,
|
|
2006
|
+
aspects=aspects,
|
|
2007
|
+
)
|
|
2008
|
+
raw_data = resp.json()
|
|
2009
|
+
items = [self._parse_item(item, SimpleUser) for item in raw_data]
|
|
2010
|
+
rtnval = PagedList[SimpleUser](items, dict(resp.headers), raw_data)
|
|
2011
|
+
return rtnval
|
|
2012
|
+
|
|
2013
|
+
def list_members_legacy(self, team_id: int, *, role: Optional[str] = "all", per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[SimpleUser]:
|
|
2014
|
+
"""
|
|
2015
|
+
List team members (Legacy)
|
|
2016
|
+
|
|
2017
|
+
> [!WARNING]
|
|
2018
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/rest/teams/members#list-team-members) endpoint.
|
|
2019
|
+
|
|
2020
|
+
Team members will include the members of child teams.
|
|
2021
|
+
"""
|
|
2022
|
+
client = self.client
|
|
2023
|
+
if aspects is None:
|
|
2024
|
+
aspects = client.aspects
|
|
2025
|
+
|
|
2026
|
+
header_params = client.headers
|
|
2027
|
+
if headers is not None:
|
|
2028
|
+
header_params = headers
|
|
2029
|
+
|
|
2030
|
+
leaf_template = "/teams/{team_id}/members"
|
|
2031
|
+
path_params = {
|
|
2032
|
+
'team_id': team_id,
|
|
2033
|
+
}
|
|
2034
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2035
|
+
|
|
2036
|
+
query_params = {}
|
|
2037
|
+
if role is not None:
|
|
2038
|
+
query_params['role'] = role
|
|
2039
|
+
if per_page is not None:
|
|
2040
|
+
query_params['per_page'] = per_page
|
|
2041
|
+
if page is not None:
|
|
2042
|
+
query_params['page'] = page
|
|
2043
|
+
|
|
2044
|
+
|
|
2045
|
+
if exp_status is None:
|
|
2046
|
+
exp_status = [200]
|
|
2047
|
+
|
|
2048
|
+
resp = client.perform_call(
|
|
2049
|
+
leaf=call_leaf,
|
|
2050
|
+
method="GET",
|
|
2051
|
+
params=query_params if query_params else None,
|
|
2052
|
+
body=None,
|
|
2053
|
+
exp_status=exp_status,
|
|
2054
|
+
headers=header_params if header_params else None,
|
|
2055
|
+
context_msg=None,
|
|
2056
|
+
aspects=aspects,
|
|
2057
|
+
)
|
|
2058
|
+
raw_data = resp.json()
|
|
2059
|
+
items = [self._parse_item(item, SimpleUser) for item in raw_data]
|
|
2060
|
+
rtnval = PagedList[SimpleUser](items, dict(resp.headers), raw_data)
|
|
2061
|
+
return rtnval
|
|
2062
|
+
|
|
2063
|
+
def list_pending_invitations_in_org(self, org: str, team_slug: str, *, per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[OrganizationInvitation]:
|
|
2064
|
+
"""
|
|
2065
|
+
List pending team invitations
|
|
2066
|
+
|
|
2067
|
+
The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`.
|
|
2068
|
+
|
|
2069
|
+
> [!NOTE]
|
|
2070
|
+
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/invitations`.
|
|
2071
|
+
"""
|
|
2072
|
+
client = self.client
|
|
2073
|
+
if aspects is None:
|
|
2074
|
+
aspects = client.aspects
|
|
2075
|
+
|
|
2076
|
+
header_params = client.headers
|
|
2077
|
+
if headers is not None:
|
|
2078
|
+
header_params = headers
|
|
2079
|
+
|
|
2080
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/invitations"
|
|
2081
|
+
path_params = {
|
|
2082
|
+
'org': org,
|
|
2083
|
+
'team_slug': team_slug,
|
|
2084
|
+
}
|
|
2085
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2086
|
+
|
|
2087
|
+
query_params = {}
|
|
2088
|
+
if per_page is not None:
|
|
2089
|
+
query_params['per_page'] = per_page
|
|
2090
|
+
if page is not None:
|
|
2091
|
+
query_params['page'] = page
|
|
2092
|
+
|
|
2093
|
+
|
|
2094
|
+
if exp_status is None:
|
|
2095
|
+
exp_status = [200]
|
|
2096
|
+
|
|
2097
|
+
resp = client.perform_call(
|
|
2098
|
+
leaf=call_leaf,
|
|
2099
|
+
method="GET",
|
|
2100
|
+
params=query_params if query_params else None,
|
|
2101
|
+
body=None,
|
|
2102
|
+
exp_status=exp_status,
|
|
2103
|
+
headers=header_params if header_params else None,
|
|
2104
|
+
context_msg=None,
|
|
2105
|
+
aspects=aspects,
|
|
2106
|
+
)
|
|
2107
|
+
raw_data = resp.json()
|
|
2108
|
+
items = [self._parse_item(item, OrganizationInvitation) for item in raw_data]
|
|
2109
|
+
rtnval = PagedList[OrganizationInvitation](items, dict(resp.headers), raw_data)
|
|
2110
|
+
return rtnval
|
|
2111
|
+
|
|
2112
|
+
def list_pending_invitations_legacy(self, team_id: int, *, per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[OrganizationInvitation]:
|
|
2113
|
+
"""
|
|
2114
|
+
List pending team invitations (Legacy)
|
|
2115
|
+
|
|
2116
|
+
> [!WARNING]
|
|
2117
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List pending team invitations`](https://docs.github.com/rest/teams/members#list-pending-team-invitations) endpoint.
|
|
2118
|
+
|
|
2119
|
+
The return hash contains a `role` field which refers to the Organization Invitation role and will be one of the following values: `direct_member`, `admin`, `billing_manager`, `hiring_manager`, or `reinstate`. If the invitee is not a GitHub member, the `login` field in the return hash will be `null`.
|
|
2120
|
+
"""
|
|
2121
|
+
client = self.client
|
|
2122
|
+
if aspects is None:
|
|
2123
|
+
aspects = client.aspects
|
|
2124
|
+
|
|
2125
|
+
header_params = client.headers
|
|
2126
|
+
if headers is not None:
|
|
2127
|
+
header_params = headers
|
|
2128
|
+
|
|
2129
|
+
leaf_template = "/teams/{team_id}/invitations"
|
|
2130
|
+
path_params = {
|
|
2131
|
+
'team_id': team_id,
|
|
2132
|
+
}
|
|
2133
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2134
|
+
|
|
2135
|
+
query_params = {}
|
|
2136
|
+
if per_page is not None:
|
|
2137
|
+
query_params['per_page'] = per_page
|
|
2138
|
+
if page is not None:
|
|
2139
|
+
query_params['page'] = page
|
|
2140
|
+
|
|
2141
|
+
|
|
2142
|
+
if exp_status is None:
|
|
2143
|
+
exp_status = [200]
|
|
2144
|
+
|
|
2145
|
+
resp = client.perform_call(
|
|
2146
|
+
leaf=call_leaf,
|
|
2147
|
+
method="GET",
|
|
2148
|
+
params=query_params if query_params else None,
|
|
2149
|
+
body=None,
|
|
2150
|
+
exp_status=exp_status,
|
|
2151
|
+
headers=header_params if header_params else None,
|
|
2152
|
+
context_msg=None,
|
|
2153
|
+
aspects=aspects,
|
|
2154
|
+
)
|
|
2155
|
+
raw_data = resp.json()
|
|
2156
|
+
items = [self._parse_item(item, OrganizationInvitation) for item in raw_data]
|
|
2157
|
+
rtnval = PagedList[OrganizationInvitation](items, dict(resp.headers), raw_data)
|
|
2158
|
+
return rtnval
|
|
2159
|
+
|
|
2160
|
+
def list_projects_in_org(self, org: str, team_slug: str, *, per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[TeamProject]:
|
|
2161
|
+
"""
|
|
2162
|
+
List team projects
|
|
2163
|
+
|
|
2164
|
+
> [!WARNING]
|
|
2165
|
+
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
|
|
2166
|
+
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
|
|
2167
|
+
"""
|
|
2168
|
+
client = self.client
|
|
2169
|
+
if aspects is None:
|
|
2170
|
+
aspects = client.aspects
|
|
2171
|
+
|
|
2172
|
+
header_params = client.headers
|
|
2173
|
+
if headers is not None:
|
|
2174
|
+
header_params = headers
|
|
2175
|
+
|
|
2176
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/projects"
|
|
2177
|
+
path_params = {
|
|
2178
|
+
'org': org,
|
|
2179
|
+
'team_slug': team_slug,
|
|
2180
|
+
}
|
|
2181
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2182
|
+
|
|
2183
|
+
query_params = {}
|
|
2184
|
+
if per_page is not None:
|
|
2185
|
+
query_params['per_page'] = per_page
|
|
2186
|
+
if page is not None:
|
|
2187
|
+
query_params['page'] = page
|
|
2188
|
+
|
|
2189
|
+
|
|
2190
|
+
if exp_status is None:
|
|
2191
|
+
exp_status = [200]
|
|
2192
|
+
|
|
2193
|
+
resp = client.perform_call(
|
|
2194
|
+
leaf=call_leaf,
|
|
2195
|
+
method="GET",
|
|
2196
|
+
params=query_params if query_params else None,
|
|
2197
|
+
body=None,
|
|
2198
|
+
exp_status=exp_status,
|
|
2199
|
+
headers=header_params if header_params else None,
|
|
2200
|
+
context_msg=None,
|
|
2201
|
+
aspects=aspects,
|
|
2202
|
+
)
|
|
2203
|
+
raw_data = resp.json()
|
|
2204
|
+
items = [self._parse_item(item, TeamProject) for item in raw_data]
|
|
2205
|
+
rtnval = PagedList[TeamProject](items, dict(resp.headers), raw_data)
|
|
2206
|
+
return rtnval
|
|
2207
|
+
|
|
2208
|
+
def list_projects_legacy(self, team_id: int, *, per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[TeamProject]:
|
|
2209
|
+
"""
|
|
2210
|
+
List team projects (Legacy)
|
|
2211
|
+
|
|
2212
|
+
> [!WARNING]
|
|
2213
|
+
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
|
|
2214
|
+
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
|
|
2215
|
+
"""
|
|
2216
|
+
client = self.client
|
|
2217
|
+
if aspects is None:
|
|
2218
|
+
aspects = client.aspects
|
|
2219
|
+
|
|
2220
|
+
header_params = client.headers
|
|
2221
|
+
if headers is not None:
|
|
2222
|
+
header_params = headers
|
|
2223
|
+
|
|
2224
|
+
leaf_template = "/teams/{team_id}/projects"
|
|
2225
|
+
path_params = {
|
|
2226
|
+
'team_id': team_id,
|
|
2227
|
+
}
|
|
2228
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2229
|
+
|
|
2230
|
+
query_params = {}
|
|
2231
|
+
if per_page is not None:
|
|
2232
|
+
query_params['per_page'] = per_page
|
|
2233
|
+
if page is not None:
|
|
2234
|
+
query_params['page'] = page
|
|
2235
|
+
|
|
2236
|
+
|
|
2237
|
+
if exp_status is None:
|
|
2238
|
+
exp_status = [200]
|
|
2239
|
+
|
|
2240
|
+
resp = client.perform_call(
|
|
2241
|
+
leaf=call_leaf,
|
|
2242
|
+
method="GET",
|
|
2243
|
+
params=query_params if query_params else None,
|
|
2244
|
+
body=None,
|
|
2245
|
+
exp_status=exp_status,
|
|
2246
|
+
headers=header_params if header_params else None,
|
|
2247
|
+
context_msg=None,
|
|
2248
|
+
aspects=aspects,
|
|
2249
|
+
)
|
|
2250
|
+
raw_data = resp.json()
|
|
2251
|
+
items = [self._parse_item(item, TeamProject) for item in raw_data]
|
|
2252
|
+
rtnval = PagedList[TeamProject](items, dict(resp.headers), raw_data)
|
|
2253
|
+
return rtnval
|
|
2254
|
+
|
|
2255
|
+
def list_repos_in_org(self, org: str, team_slug: str, *, per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[MinimalRepository]:
|
|
2256
|
+
"""
|
|
2257
|
+
List team repositories
|
|
2258
|
+
|
|
2259
|
+
Lists a team's repositories visible to the authenticated user.
|
|
2260
|
+
|
|
2261
|
+
> [!NOTE]
|
|
2262
|
+
> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`.
|
|
2263
|
+
"""
|
|
2264
|
+
client = self.client
|
|
2265
|
+
if aspects is None:
|
|
2266
|
+
aspects = client.aspects
|
|
2267
|
+
|
|
2268
|
+
header_params = client.headers
|
|
2269
|
+
if headers is not None:
|
|
2270
|
+
header_params = headers
|
|
2271
|
+
|
|
2272
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/repos"
|
|
2273
|
+
path_params = {
|
|
2274
|
+
'org': org,
|
|
2275
|
+
'team_slug': team_slug,
|
|
2276
|
+
}
|
|
2277
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2278
|
+
|
|
2279
|
+
query_params = {}
|
|
2280
|
+
if per_page is not None:
|
|
2281
|
+
query_params['per_page'] = per_page
|
|
2282
|
+
if page is not None:
|
|
2283
|
+
query_params['page'] = page
|
|
2284
|
+
|
|
2285
|
+
|
|
2286
|
+
if exp_status is None:
|
|
2287
|
+
exp_status = [200]
|
|
2288
|
+
|
|
2289
|
+
resp = client.perform_call(
|
|
2290
|
+
leaf=call_leaf,
|
|
2291
|
+
method="GET",
|
|
2292
|
+
params=query_params if query_params else None,
|
|
2293
|
+
body=None,
|
|
2294
|
+
exp_status=exp_status,
|
|
2295
|
+
headers=header_params if header_params else None,
|
|
2296
|
+
context_msg=None,
|
|
2297
|
+
aspects=aspects,
|
|
2298
|
+
)
|
|
2299
|
+
raw_data = resp.json()
|
|
2300
|
+
items = [self._parse_item(item, MinimalRepository) for item in raw_data]
|
|
2301
|
+
rtnval = PagedList[MinimalRepository](items, dict(resp.headers), raw_data)
|
|
2302
|
+
return rtnval
|
|
2303
|
+
|
|
2304
|
+
def list_repos_legacy(self, team_id: int, *, per_page: Optional[int] = 30, page: Optional[int] = 1, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[MinimalRepository]:
|
|
2305
|
+
"""
|
|
2306
|
+
List team repositories (Legacy)
|
|
2307
|
+
|
|
2308
|
+
> [!WARNING]
|
|
2309
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/rest/teams/teams#list-team-repositories) endpoint.
|
|
2310
|
+
"""
|
|
2311
|
+
client = self.client
|
|
2312
|
+
if aspects is None:
|
|
2313
|
+
aspects = client.aspects
|
|
2314
|
+
|
|
2315
|
+
header_params = client.headers
|
|
2316
|
+
if headers is not None:
|
|
2317
|
+
header_params = headers
|
|
2318
|
+
|
|
2319
|
+
leaf_template = "/teams/{team_id}/repos"
|
|
2320
|
+
path_params = {
|
|
2321
|
+
'team_id': team_id,
|
|
2322
|
+
}
|
|
2323
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2324
|
+
|
|
2325
|
+
query_params = {}
|
|
2326
|
+
if per_page is not None:
|
|
2327
|
+
query_params['per_page'] = per_page
|
|
2328
|
+
if page is not None:
|
|
2329
|
+
query_params['page'] = page
|
|
2330
|
+
|
|
2331
|
+
|
|
2332
|
+
if exp_status is None:
|
|
2333
|
+
exp_status = [200]
|
|
2334
|
+
|
|
2335
|
+
resp = client.perform_call(
|
|
2336
|
+
leaf=call_leaf,
|
|
2337
|
+
method="GET",
|
|
2338
|
+
params=query_params if query_params else None,
|
|
2339
|
+
body=None,
|
|
2340
|
+
exp_status=exp_status,
|
|
2341
|
+
headers=header_params if header_params else None,
|
|
2342
|
+
context_msg=None,
|
|
2343
|
+
aspects=aspects,
|
|
2344
|
+
)
|
|
2345
|
+
raw_data = resp.json()
|
|
2346
|
+
items = [self._parse_item(item, MinimalRepository) for item in raw_data]
|
|
2347
|
+
rtnval = PagedList[MinimalRepository](items, dict(resp.headers), raw_data)
|
|
2348
|
+
return rtnval
|
|
2349
|
+
|
|
2350
|
+
def remove_member_legacy(self, team_id: int, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
2351
|
+
"""
|
|
2352
|
+
Remove team member (Legacy)
|
|
2353
|
+
|
|
2354
|
+
The "Remove team member" endpoint (described below) is closing down.
|
|
2355
|
+
|
|
2356
|
+
We recommend using the [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships.
|
|
2357
|
+
|
|
2358
|
+
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
|
|
2359
|
+
|
|
2360
|
+
To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team.
|
|
2361
|
+
|
|
2362
|
+
> [!NOTE]
|
|
2363
|
+
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."
|
|
2364
|
+
"""
|
|
2365
|
+
client = self.client
|
|
2366
|
+
if aspects is None:
|
|
2367
|
+
aspects = client.aspects
|
|
2368
|
+
|
|
2369
|
+
header_params = client.headers
|
|
2370
|
+
if headers is not None:
|
|
2371
|
+
header_params = headers
|
|
2372
|
+
|
|
2373
|
+
leaf_template = "/teams/{team_id}/members/{username}"
|
|
2374
|
+
path_params = {
|
|
2375
|
+
'team_id': team_id,
|
|
2376
|
+
'username': username,
|
|
2377
|
+
}
|
|
2378
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2379
|
+
|
|
2380
|
+
query_params = None
|
|
2381
|
+
|
|
2382
|
+
|
|
2383
|
+
if exp_status is None:
|
|
2384
|
+
exp_status = [204]
|
|
2385
|
+
|
|
2386
|
+
resp = client.perform_call(
|
|
2387
|
+
leaf=call_leaf,
|
|
2388
|
+
method="DELETE",
|
|
2389
|
+
params=query_params if query_params else None,
|
|
2390
|
+
body=None,
|
|
2391
|
+
exp_status=exp_status,
|
|
2392
|
+
headers=header_params if header_params else None,
|
|
2393
|
+
context_msg=None,
|
|
2394
|
+
aspects=aspects,
|
|
2395
|
+
)
|
|
2396
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2397
|
+
rtnval = None
|
|
2398
|
+
else:
|
|
2399
|
+
rtnval = resp.json()
|
|
2400
|
+
return rtnval
|
|
2401
|
+
|
|
2402
|
+
def remove_membership_for_user_in_org(self, org: str, team_slug: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
2403
|
+
"""
|
|
2404
|
+
Remove team membership for a user
|
|
2405
|
+
|
|
2406
|
+
To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.
|
|
2407
|
+
|
|
2408
|
+
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
|
|
2409
|
+
|
|
2410
|
+
> [!NOTE]
|
|
2411
|
+
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."
|
|
2412
|
+
|
|
2413
|
+
> [!NOTE]
|
|
2414
|
+
> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`.
|
|
2415
|
+
"""
|
|
2416
|
+
client = self.client
|
|
2417
|
+
if aspects is None:
|
|
2418
|
+
aspects = client.aspects
|
|
2419
|
+
|
|
2420
|
+
header_params = client.headers
|
|
2421
|
+
if headers is not None:
|
|
2422
|
+
header_params = headers
|
|
2423
|
+
|
|
2424
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/memberships/{username}"
|
|
2425
|
+
path_params = {
|
|
2426
|
+
'org': org,
|
|
2427
|
+
'team_slug': team_slug,
|
|
2428
|
+
'username': username,
|
|
2429
|
+
}
|
|
2430
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2431
|
+
|
|
2432
|
+
query_params = None
|
|
2433
|
+
|
|
2434
|
+
|
|
2435
|
+
if exp_status is None:
|
|
2436
|
+
exp_status = [204]
|
|
2437
|
+
|
|
2438
|
+
resp = client.perform_call(
|
|
2439
|
+
leaf=call_leaf,
|
|
2440
|
+
method="DELETE",
|
|
2441
|
+
params=query_params if query_params else None,
|
|
2442
|
+
body=None,
|
|
2443
|
+
exp_status=exp_status,
|
|
2444
|
+
headers=header_params if header_params else None,
|
|
2445
|
+
context_msg=None,
|
|
2446
|
+
aspects=aspects,
|
|
2447
|
+
)
|
|
2448
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2449
|
+
rtnval = None
|
|
2450
|
+
else:
|
|
2451
|
+
rtnval = resp.json()
|
|
2452
|
+
return rtnval
|
|
2453
|
+
|
|
2454
|
+
def remove_membership_for_user_legacy(self, team_id: int, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
2455
|
+
"""
|
|
2456
|
+
Remove team membership for a user (Legacy)
|
|
2457
|
+
|
|
2458
|
+
> [!WARNING]
|
|
2459
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user) endpoint.
|
|
2460
|
+
|
|
2461
|
+
Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.
|
|
2462
|
+
|
|
2463
|
+
To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.
|
|
2464
|
+
|
|
2465
|
+
> [!NOTE]
|
|
2466
|
+
> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub](https://docs.github.com/articles/synchronizing-teams-between-your-identity-provider-and-github/)."
|
|
2467
|
+
"""
|
|
2468
|
+
client = self.client
|
|
2469
|
+
if aspects is None:
|
|
2470
|
+
aspects = client.aspects
|
|
2471
|
+
|
|
2472
|
+
header_params = client.headers
|
|
2473
|
+
if headers is not None:
|
|
2474
|
+
header_params = headers
|
|
2475
|
+
|
|
2476
|
+
leaf_template = "/teams/{team_id}/memberships/{username}"
|
|
2477
|
+
path_params = {
|
|
2478
|
+
'team_id': team_id,
|
|
2479
|
+
'username': username,
|
|
2480
|
+
}
|
|
2481
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2482
|
+
|
|
2483
|
+
query_params = None
|
|
2484
|
+
|
|
2485
|
+
|
|
2486
|
+
if exp_status is None:
|
|
2487
|
+
exp_status = [204]
|
|
2488
|
+
|
|
2489
|
+
resp = client.perform_call(
|
|
2490
|
+
leaf=call_leaf,
|
|
2491
|
+
method="DELETE",
|
|
2492
|
+
params=query_params if query_params else None,
|
|
2493
|
+
body=None,
|
|
2494
|
+
exp_status=exp_status,
|
|
2495
|
+
headers=header_params if header_params else None,
|
|
2496
|
+
context_msg=None,
|
|
2497
|
+
aspects=aspects,
|
|
2498
|
+
)
|
|
2499
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2500
|
+
rtnval = None
|
|
2501
|
+
else:
|
|
2502
|
+
rtnval = resp.json()
|
|
2503
|
+
return rtnval
|
|
2504
|
+
|
|
2505
|
+
def remove_project_in_org(self, org: str, team_slug: str, project_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
2506
|
+
"""
|
|
2507
|
+
Remove a project from a team
|
|
2508
|
+
|
|
2509
|
+
> [!WARNING]
|
|
2510
|
+
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
|
|
2511
|
+
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
|
|
2512
|
+
"""
|
|
2513
|
+
client = self.client
|
|
2514
|
+
if aspects is None:
|
|
2515
|
+
aspects = client.aspects
|
|
2516
|
+
|
|
2517
|
+
header_params = client.headers
|
|
2518
|
+
if headers is not None:
|
|
2519
|
+
header_params = headers
|
|
2520
|
+
|
|
2521
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/projects/{project_id}"
|
|
2522
|
+
path_params = {
|
|
2523
|
+
'org': org,
|
|
2524
|
+
'team_slug': team_slug,
|
|
2525
|
+
'project_id': project_id,
|
|
2526
|
+
}
|
|
2527
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2528
|
+
|
|
2529
|
+
query_params = None
|
|
2530
|
+
|
|
2531
|
+
|
|
2532
|
+
if exp_status is None:
|
|
2533
|
+
exp_status = [204]
|
|
2534
|
+
|
|
2535
|
+
resp = client.perform_call(
|
|
2536
|
+
leaf=call_leaf,
|
|
2537
|
+
method="DELETE",
|
|
2538
|
+
params=query_params if query_params else None,
|
|
2539
|
+
body=None,
|
|
2540
|
+
exp_status=exp_status,
|
|
2541
|
+
headers=header_params if header_params else None,
|
|
2542
|
+
context_msg=None,
|
|
2543
|
+
aspects=aspects,
|
|
2544
|
+
)
|
|
2545
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2546
|
+
rtnval = None
|
|
2547
|
+
else:
|
|
2548
|
+
rtnval = resp.json()
|
|
2549
|
+
return rtnval
|
|
2550
|
+
|
|
2551
|
+
def remove_project_legacy(self, team_id: int, project_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
2552
|
+
"""
|
|
2553
|
+
Remove a project from a team (Legacy)
|
|
2554
|
+
|
|
2555
|
+
> [!WARNING]
|
|
2556
|
+
> **Closing down notice:** Projects (classic) is being deprecated in favor of the new Projects experience.
|
|
2557
|
+
> See the [changelog](https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/) for more information.
|
|
2558
|
+
"""
|
|
2559
|
+
client = self.client
|
|
2560
|
+
if aspects is None:
|
|
2561
|
+
aspects = client.aspects
|
|
2562
|
+
|
|
2563
|
+
header_params = client.headers
|
|
2564
|
+
if headers is not None:
|
|
2565
|
+
header_params = headers
|
|
2566
|
+
|
|
2567
|
+
leaf_template = "/teams/{team_id}/projects/{project_id}"
|
|
2568
|
+
path_params = {
|
|
2569
|
+
'team_id': team_id,
|
|
2570
|
+
'project_id': project_id,
|
|
2571
|
+
}
|
|
2572
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2573
|
+
|
|
2574
|
+
query_params = None
|
|
2575
|
+
|
|
2576
|
+
|
|
2577
|
+
if exp_status is None:
|
|
2578
|
+
exp_status = [204]
|
|
2579
|
+
|
|
2580
|
+
resp = client.perform_call(
|
|
2581
|
+
leaf=call_leaf,
|
|
2582
|
+
method="DELETE",
|
|
2583
|
+
params=query_params if query_params else None,
|
|
2584
|
+
body=None,
|
|
2585
|
+
exp_status=exp_status,
|
|
2586
|
+
headers=header_params if header_params else None,
|
|
2587
|
+
context_msg=None,
|
|
2588
|
+
aspects=aspects,
|
|
2589
|
+
)
|
|
2590
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2591
|
+
rtnval = None
|
|
2592
|
+
else:
|
|
2593
|
+
rtnval = resp.json()
|
|
2594
|
+
return rtnval
|
|
2595
|
+
|
|
2596
|
+
def remove_repo_in_org(self, org: str, team_slug: str, owner: str, repo: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
2597
|
+
"""
|
|
2598
|
+
Remove a repository from a team
|
|
2599
|
+
|
|
2600
|
+
If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.
|
|
2601
|
+
|
|
2602
|
+
> [!NOTE]
|
|
2603
|
+
> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.
|
|
2604
|
+
"""
|
|
2605
|
+
client = self.client
|
|
2606
|
+
if aspects is None:
|
|
2607
|
+
aspects = client.aspects
|
|
2608
|
+
|
|
2609
|
+
header_params = client.headers
|
|
2610
|
+
if headers is not None:
|
|
2611
|
+
header_params = headers
|
|
2612
|
+
|
|
2613
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"
|
|
2614
|
+
path_params = {
|
|
2615
|
+
'org': org,
|
|
2616
|
+
'team_slug': team_slug,
|
|
2617
|
+
'owner': owner,
|
|
2618
|
+
'repo': repo,
|
|
2619
|
+
}
|
|
2620
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2621
|
+
|
|
2622
|
+
query_params = None
|
|
2623
|
+
|
|
2624
|
+
|
|
2625
|
+
if exp_status is None:
|
|
2626
|
+
exp_status = [204]
|
|
2627
|
+
|
|
2628
|
+
resp = client.perform_call(
|
|
2629
|
+
leaf=call_leaf,
|
|
2630
|
+
method="DELETE",
|
|
2631
|
+
params=query_params if query_params else None,
|
|
2632
|
+
body=None,
|
|
2633
|
+
exp_status=exp_status,
|
|
2634
|
+
headers=header_params if header_params else None,
|
|
2635
|
+
context_msg=None,
|
|
2636
|
+
aspects=aspects,
|
|
2637
|
+
)
|
|
2638
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2639
|
+
rtnval = None
|
|
2640
|
+
else:
|
|
2641
|
+
rtnval = resp.json()
|
|
2642
|
+
return rtnval
|
|
2643
|
+
|
|
2644
|
+
def remove_repo_legacy(self, team_id: int, owner: str, repo: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
2645
|
+
"""
|
|
2646
|
+
Remove a repository from a team (Legacy)
|
|
2647
|
+
|
|
2648
|
+
> [!WARNING]
|
|
2649
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team) endpoint.
|
|
2650
|
+
|
|
2651
|
+
If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team.
|
|
2652
|
+
"""
|
|
2653
|
+
client = self.client
|
|
2654
|
+
if aspects is None:
|
|
2655
|
+
aspects = client.aspects
|
|
2656
|
+
|
|
2657
|
+
header_params = client.headers
|
|
2658
|
+
if headers is not None:
|
|
2659
|
+
header_params = headers
|
|
2660
|
+
|
|
2661
|
+
leaf_template = "/teams/{team_id}/repos/{owner}/{repo}"
|
|
2662
|
+
path_params = {
|
|
2663
|
+
'team_id': team_id,
|
|
2664
|
+
'owner': owner,
|
|
2665
|
+
'repo': repo,
|
|
2666
|
+
}
|
|
2667
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2668
|
+
|
|
2669
|
+
query_params = None
|
|
2670
|
+
|
|
2671
|
+
|
|
2672
|
+
if exp_status is None:
|
|
2673
|
+
exp_status = [204]
|
|
2674
|
+
|
|
2675
|
+
resp = client.perform_call(
|
|
2676
|
+
leaf=call_leaf,
|
|
2677
|
+
method="DELETE",
|
|
2678
|
+
params=query_params if query_params else None,
|
|
2679
|
+
body=None,
|
|
2680
|
+
exp_status=exp_status,
|
|
2681
|
+
headers=header_params if header_params else None,
|
|
2682
|
+
context_msg=None,
|
|
2683
|
+
aspects=aspects,
|
|
2684
|
+
)
|
|
2685
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2686
|
+
rtnval = None
|
|
2687
|
+
else:
|
|
2688
|
+
rtnval = resp.json()
|
|
2689
|
+
return rtnval
|
|
2690
|
+
|
|
2691
|
+
def update_discussion_comment_in_org(self, org: str, team_slug: str, discussion_number: int, comment_number: int, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamDiscussionComment:
|
|
2692
|
+
"""
|
|
2693
|
+
Update a discussion comment
|
|
2694
|
+
|
|
2695
|
+
Edits the body text of a discussion comment.
|
|
2696
|
+
|
|
2697
|
+
> [!NOTE]
|
|
2698
|
+
> You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.
|
|
2699
|
+
|
|
2700
|
+
OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
|
|
2701
|
+
"""
|
|
2702
|
+
client = self.client
|
|
2703
|
+
if aspects is None:
|
|
2704
|
+
aspects = client.aspects
|
|
2705
|
+
|
|
2706
|
+
header_params = client.headers
|
|
2707
|
+
if headers is not None:
|
|
2708
|
+
header_params = headers
|
|
2709
|
+
|
|
2710
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"
|
|
2711
|
+
path_params = {
|
|
2712
|
+
'org': org,
|
|
2713
|
+
'team_slug': team_slug,
|
|
2714
|
+
'discussion_number': discussion_number,
|
|
2715
|
+
'comment_number': comment_number,
|
|
2716
|
+
}
|
|
2717
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2718
|
+
|
|
2719
|
+
query_params = None
|
|
2720
|
+
|
|
2721
|
+
|
|
2722
|
+
if exp_status is None:
|
|
2723
|
+
exp_status = [200]
|
|
2724
|
+
|
|
2725
|
+
resp = client.perform_call(
|
|
2726
|
+
leaf=call_leaf,
|
|
2727
|
+
method="PATCH",
|
|
2728
|
+
params=query_params if query_params else None,
|
|
2729
|
+
body=body,
|
|
2730
|
+
exp_status=exp_status,
|
|
2731
|
+
headers=header_params if header_params else None,
|
|
2732
|
+
context_msg=None,
|
|
2733
|
+
aspects=aspects,
|
|
2734
|
+
)
|
|
2735
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2736
|
+
rtnobj = None
|
|
2737
|
+
else:
|
|
2738
|
+
raw_data = resp.json()
|
|
2739
|
+
rtnobj = TeamDiscussionComment.from_dict(raw_data)
|
|
2740
|
+
return rtnobj
|
|
2741
|
+
|
|
2742
|
+
def update_discussion_comment_legacy(self, team_id: int, discussion_number: int, comment_number: int, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamDiscussionComment:
|
|
2743
|
+
"""
|
|
2744
|
+
Update a discussion comment (Legacy)
|
|
2745
|
+
|
|
2746
|
+
> [!WARNING]
|
|
2747
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/rest/teams/discussion-comments#update-a-discussion-comment) endpoint.
|
|
2748
|
+
|
|
2749
|
+
Edits the body text of a discussion comment.
|
|
2750
|
+
|
|
2751
|
+
OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
|
|
2752
|
+
"""
|
|
2753
|
+
client = self.client
|
|
2754
|
+
if aspects is None:
|
|
2755
|
+
aspects = client.aspects
|
|
2756
|
+
|
|
2757
|
+
header_params = client.headers
|
|
2758
|
+
if headers is not None:
|
|
2759
|
+
header_params = headers
|
|
2760
|
+
|
|
2761
|
+
leaf_template = "/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}"
|
|
2762
|
+
path_params = {
|
|
2763
|
+
'team_id': team_id,
|
|
2764
|
+
'discussion_number': discussion_number,
|
|
2765
|
+
'comment_number': comment_number,
|
|
2766
|
+
}
|
|
2767
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2768
|
+
|
|
2769
|
+
query_params = None
|
|
2770
|
+
|
|
2771
|
+
|
|
2772
|
+
if exp_status is None:
|
|
2773
|
+
exp_status = [200]
|
|
2774
|
+
|
|
2775
|
+
resp = client.perform_call(
|
|
2776
|
+
leaf=call_leaf,
|
|
2777
|
+
method="PATCH",
|
|
2778
|
+
params=query_params if query_params else None,
|
|
2779
|
+
body=body,
|
|
2780
|
+
exp_status=exp_status,
|
|
2781
|
+
headers=header_params if header_params else None,
|
|
2782
|
+
context_msg=None,
|
|
2783
|
+
aspects=aspects,
|
|
2784
|
+
)
|
|
2785
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2786
|
+
rtnobj = None
|
|
2787
|
+
else:
|
|
2788
|
+
raw_data = resp.json()
|
|
2789
|
+
rtnobj = TeamDiscussionComment.from_dict(raw_data)
|
|
2790
|
+
return rtnobj
|
|
2791
|
+
|
|
2792
|
+
def update_discussion_in_org(self, org: str, team_slug: str, discussion_number: int, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamDiscussion:
|
|
2793
|
+
"""
|
|
2794
|
+
Update a discussion
|
|
2795
|
+
|
|
2796
|
+
Edits the title and body text of a discussion post. Only the parameters you provide are updated.
|
|
2797
|
+
|
|
2798
|
+
> [!NOTE]
|
|
2799
|
+
> You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.
|
|
2800
|
+
|
|
2801
|
+
OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
|
|
2802
|
+
"""
|
|
2803
|
+
client = self.client
|
|
2804
|
+
if aspects is None:
|
|
2805
|
+
aspects = client.aspects
|
|
2806
|
+
|
|
2807
|
+
header_params = client.headers
|
|
2808
|
+
if headers is not None:
|
|
2809
|
+
header_params = headers
|
|
2810
|
+
|
|
2811
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"
|
|
2812
|
+
path_params = {
|
|
2813
|
+
'org': org,
|
|
2814
|
+
'team_slug': team_slug,
|
|
2815
|
+
'discussion_number': discussion_number,
|
|
2816
|
+
}
|
|
2817
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2818
|
+
|
|
2819
|
+
query_params = None
|
|
2820
|
+
|
|
2821
|
+
|
|
2822
|
+
if exp_status is None:
|
|
2823
|
+
exp_status = [200]
|
|
2824
|
+
|
|
2825
|
+
resp = client.perform_call(
|
|
2826
|
+
leaf=call_leaf,
|
|
2827
|
+
method="PATCH",
|
|
2828
|
+
params=query_params if query_params else None,
|
|
2829
|
+
body=body,
|
|
2830
|
+
exp_status=exp_status,
|
|
2831
|
+
headers=header_params if header_params else None,
|
|
2832
|
+
context_msg=None,
|
|
2833
|
+
aspects=aspects,
|
|
2834
|
+
)
|
|
2835
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2836
|
+
rtnobj = None
|
|
2837
|
+
else:
|
|
2838
|
+
raw_data = resp.json()
|
|
2839
|
+
rtnobj = TeamDiscussion.from_dict(raw_data)
|
|
2840
|
+
return rtnobj
|
|
2841
|
+
|
|
2842
|
+
def update_discussion_legacy(self, team_id: int, discussion_number: int, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamDiscussion:
|
|
2843
|
+
"""
|
|
2844
|
+
Update a discussion (Legacy)
|
|
2845
|
+
|
|
2846
|
+
> [!WARNING]
|
|
2847
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/rest/teams/discussions#update-a-discussion) endpoint.
|
|
2848
|
+
|
|
2849
|
+
Edits the title and body text of a discussion post. Only the parameters you provide are updated.
|
|
2850
|
+
|
|
2851
|
+
OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint.
|
|
2852
|
+
"""
|
|
2853
|
+
client = self.client
|
|
2854
|
+
if aspects is None:
|
|
2855
|
+
aspects = client.aspects
|
|
2856
|
+
|
|
2857
|
+
header_params = client.headers
|
|
2858
|
+
if headers is not None:
|
|
2859
|
+
header_params = headers
|
|
2860
|
+
|
|
2861
|
+
leaf_template = "/teams/{team_id}/discussions/{discussion_number}"
|
|
2862
|
+
path_params = {
|
|
2863
|
+
'team_id': team_id,
|
|
2864
|
+
'discussion_number': discussion_number,
|
|
2865
|
+
}
|
|
2866
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2867
|
+
|
|
2868
|
+
query_params = None
|
|
2869
|
+
|
|
2870
|
+
|
|
2871
|
+
if exp_status is None:
|
|
2872
|
+
exp_status = [200]
|
|
2873
|
+
|
|
2874
|
+
resp = client.perform_call(
|
|
2875
|
+
leaf=call_leaf,
|
|
2876
|
+
method="PATCH",
|
|
2877
|
+
params=query_params if query_params else None,
|
|
2878
|
+
body=body,
|
|
2879
|
+
exp_status=exp_status,
|
|
2880
|
+
headers=header_params if header_params else None,
|
|
2881
|
+
context_msg=None,
|
|
2882
|
+
aspects=aspects,
|
|
2883
|
+
)
|
|
2884
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2885
|
+
rtnobj = None
|
|
2886
|
+
else:
|
|
2887
|
+
raw_data = resp.json()
|
|
2888
|
+
rtnobj = TeamDiscussion.from_dict(raw_data)
|
|
2889
|
+
return rtnobj
|
|
2890
|
+
|
|
2891
|
+
def update_in_org(self, org: str, team_slug: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamFull:
|
|
2892
|
+
"""
|
|
2893
|
+
Update a team
|
|
2894
|
+
|
|
2895
|
+
To edit a team, the authenticated user must either be an organization owner or a team maintainer.
|
|
2896
|
+
|
|
2897
|
+
> [!NOTE]
|
|
2898
|
+
> You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`.
|
|
2899
|
+
"""
|
|
2900
|
+
client = self.client
|
|
2901
|
+
if aspects is None:
|
|
2902
|
+
aspects = client.aspects
|
|
2903
|
+
|
|
2904
|
+
header_params = client.headers
|
|
2905
|
+
if headers is not None:
|
|
2906
|
+
header_params = headers
|
|
2907
|
+
|
|
2908
|
+
leaf_template = "/orgs/{org}/teams/{team_slug}"
|
|
2909
|
+
path_params = {
|
|
2910
|
+
'org': org,
|
|
2911
|
+
'team_slug': team_slug,
|
|
2912
|
+
}
|
|
2913
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2914
|
+
|
|
2915
|
+
query_params = None
|
|
2916
|
+
|
|
2917
|
+
|
|
2918
|
+
if exp_status is None:
|
|
2919
|
+
exp_status = [200, 201]
|
|
2920
|
+
|
|
2921
|
+
resp = client.perform_call(
|
|
2922
|
+
leaf=call_leaf,
|
|
2923
|
+
method="PATCH",
|
|
2924
|
+
params=query_params if query_params else None,
|
|
2925
|
+
body=body,
|
|
2926
|
+
exp_status=exp_status,
|
|
2927
|
+
headers=header_params if header_params else None,
|
|
2928
|
+
context_msg=None,
|
|
2929
|
+
aspects=aspects,
|
|
2930
|
+
)
|
|
2931
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2932
|
+
rtnobj = None
|
|
2933
|
+
else:
|
|
2934
|
+
raw_data = resp.json()
|
|
2935
|
+
rtnobj = TeamFull.from_dict(raw_data)
|
|
2936
|
+
return rtnobj
|
|
2937
|
+
|
|
2938
|
+
def update_legacy(self, team_id: int, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> TeamFull:
|
|
2939
|
+
"""
|
|
2940
|
+
Update a team (Legacy)
|
|
2941
|
+
|
|
2942
|
+
> [!WARNING]
|
|
2943
|
+
> **Endpoint closing down notice:** This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/rest/teams/teams#update-a-team) endpoint.
|
|
2944
|
+
|
|
2945
|
+
To edit a team, the authenticated user must either be an organization owner or a team maintainer.
|
|
2946
|
+
|
|
2947
|
+
> [!NOTE]
|
|
2948
|
+
> With nested teams, the `privacy` for parent teams cannot be `secret`.
|
|
2949
|
+
"""
|
|
2950
|
+
client = self.client
|
|
2951
|
+
if aspects is None:
|
|
2952
|
+
aspects = client.aspects
|
|
2953
|
+
|
|
2954
|
+
header_params = client.headers
|
|
2955
|
+
if headers is not None:
|
|
2956
|
+
header_params = headers
|
|
2957
|
+
|
|
2958
|
+
leaf_template = "/teams/{team_id}"
|
|
2959
|
+
path_params = {
|
|
2960
|
+
'team_id': team_id,
|
|
2961
|
+
}
|
|
2962
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2963
|
+
|
|
2964
|
+
query_params = None
|
|
2965
|
+
|
|
2966
|
+
|
|
2967
|
+
if exp_status is None:
|
|
2968
|
+
exp_status = [200, 201]
|
|
2969
|
+
|
|
2970
|
+
resp = client.perform_call(
|
|
2971
|
+
leaf=call_leaf,
|
|
2972
|
+
method="PATCH",
|
|
2973
|
+
params=query_params if query_params else None,
|
|
2974
|
+
body=body,
|
|
2975
|
+
exp_status=exp_status,
|
|
2976
|
+
headers=header_params if header_params else None,
|
|
2977
|
+
context_msg=None,
|
|
2978
|
+
aspects=aspects,
|
|
2979
|
+
)
|
|
2980
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2981
|
+
rtnobj = None
|
|
2982
|
+
else:
|
|
2983
|
+
raw_data = resp.json()
|
|
2984
|
+
rtnobj = TeamFull.from_dict(raw_data)
|
|
2985
|
+
return rtnobj
|