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,3958 @@
|
|
|
1
|
+
# Auto-generated by RestClientGenerator. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict, List, Optional, Union
|
|
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.apps import WebhookConfig
|
|
9
|
+
from ccai.restclient.github.public.schemas.hookdelivery import HookDelivery
|
|
10
|
+
from ccai.restclient.github.public.schemas.hookdeliveryitem import HookDeliveryItem
|
|
11
|
+
from ccai.restclient.github.public.schemas.minimalrepository import MinimalRepository
|
|
12
|
+
from ccai.restclient.github.public.schemas.organizationinvitation import OrganizationInvitation
|
|
13
|
+
from ccai.restclient.github.public.schemas.orgs import CustomProperty
|
|
14
|
+
from ccai.restclient.github.public.schemas.orgs import CustomPropertySetPayload
|
|
15
|
+
from ccai.restclient.github.public.schemas.orgs import IssueType
|
|
16
|
+
from ccai.restclient.github.public.schemas.orgs import OrgHook
|
|
17
|
+
from ccai.restclient.github.public.schemas.orgs import OrgMembership
|
|
18
|
+
from ccai.restclient.github.public.schemas.orgs import OrgRepoCustomPropertyValues
|
|
19
|
+
from ccai.restclient.github.public.schemas.orgs import OrganizationCreateIssueType
|
|
20
|
+
from ccai.restclient.github.public.schemas.orgs import OrganizationFull
|
|
21
|
+
from ccai.restclient.github.public.schemas.orgs import OrganizationProgrammaticAccessGrant
|
|
22
|
+
from ccai.restclient.github.public.schemas.orgs import OrganizationProgrammaticAccessGrantRequest
|
|
23
|
+
from ccai.restclient.github.public.schemas.orgs import OrganizationRole
|
|
24
|
+
from ccai.restclient.github.public.schemas.orgs import OrganizationSimple
|
|
25
|
+
from ccai.restclient.github.public.schemas.orgs import OrganizationUpdateIssueType
|
|
26
|
+
from ccai.restclient.github.public.schemas.orgs import TeamRoleAssignment
|
|
27
|
+
from ccai.restclient.github.public.schemas.orgs import TeamSimple
|
|
28
|
+
from ccai.restclient.github.public.schemas.orgs import UserRoleAssignment
|
|
29
|
+
from ccai.restclient.github.public.schemas.repos import SimpleUser
|
|
30
|
+
from ccai.restclient.github.public.schemas.repos import Team
|
|
31
|
+
from ccai.restclient.github.public.schemas.rulesetversion import RulesetVersion
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class OrgsApiGroup(RestApiGroup):
|
|
35
|
+
"""
|
|
36
|
+
Interact with GitHub Orgs.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
def add_security_manager_team(self, org: str, team_slug: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
40
|
+
"""
|
|
41
|
+
Add a security manager team
|
|
42
|
+
|
|
43
|
+
> [!WARNING]
|
|
44
|
+
> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.
|
|
45
|
+
"""
|
|
46
|
+
client = self.client
|
|
47
|
+
if aspects is None:
|
|
48
|
+
aspects = client.aspects
|
|
49
|
+
|
|
50
|
+
header_params = client.headers
|
|
51
|
+
if headers is not None:
|
|
52
|
+
header_params = headers
|
|
53
|
+
|
|
54
|
+
leaf_template = "/orgs/{org}/security-managers/teams/{team_slug}"
|
|
55
|
+
path_params = {
|
|
56
|
+
'org': org,
|
|
57
|
+
'team_slug': team_slug,
|
|
58
|
+
}
|
|
59
|
+
call_leaf = leaf_template.format(**path_params)
|
|
60
|
+
|
|
61
|
+
query_params = None
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
if exp_status is None:
|
|
65
|
+
exp_status = [204]
|
|
66
|
+
|
|
67
|
+
resp = client.perform_call(
|
|
68
|
+
leaf=call_leaf,
|
|
69
|
+
method="PUT",
|
|
70
|
+
params=query_params if query_params else None,
|
|
71
|
+
body=None,
|
|
72
|
+
exp_status=exp_status,
|
|
73
|
+
headers=header_params if header_params else None,
|
|
74
|
+
context_msg=None,
|
|
75
|
+
aspects=aspects,
|
|
76
|
+
)
|
|
77
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
78
|
+
rtnval = None
|
|
79
|
+
else:
|
|
80
|
+
rtnval = resp.json()
|
|
81
|
+
return rtnval
|
|
82
|
+
|
|
83
|
+
def assign_team_to_org_role(self, org: str, team_slug: str, role_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
84
|
+
"""
|
|
85
|
+
Assign an organization role to a team
|
|
86
|
+
|
|
87
|
+
Assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
|
|
88
|
+
|
|
89
|
+
The authenticated user must be an administrator for the organization to use this endpoint.
|
|
90
|
+
|
|
91
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
|
|
92
|
+
"""
|
|
93
|
+
client = self.client
|
|
94
|
+
if aspects is None:
|
|
95
|
+
aspects = client.aspects
|
|
96
|
+
|
|
97
|
+
header_params = client.headers
|
|
98
|
+
if headers is not None:
|
|
99
|
+
header_params = headers
|
|
100
|
+
|
|
101
|
+
leaf_template = "/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
|
|
102
|
+
path_params = {
|
|
103
|
+
'org': org,
|
|
104
|
+
'team_slug': team_slug,
|
|
105
|
+
'role_id': role_id,
|
|
106
|
+
}
|
|
107
|
+
call_leaf = leaf_template.format(**path_params)
|
|
108
|
+
|
|
109
|
+
query_params = None
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
if exp_status is None:
|
|
113
|
+
exp_status = [204]
|
|
114
|
+
|
|
115
|
+
resp = client.perform_call(
|
|
116
|
+
leaf=call_leaf,
|
|
117
|
+
method="PUT",
|
|
118
|
+
params=query_params if query_params else None,
|
|
119
|
+
body=None,
|
|
120
|
+
exp_status=exp_status,
|
|
121
|
+
headers=header_params if header_params else None,
|
|
122
|
+
context_msg=None,
|
|
123
|
+
aspects=aspects,
|
|
124
|
+
)
|
|
125
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
126
|
+
rtnval = None
|
|
127
|
+
else:
|
|
128
|
+
rtnval = resp.json()
|
|
129
|
+
return rtnval
|
|
130
|
+
|
|
131
|
+
def assign_user_to_org_role(self, org: str, username: str, role_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
132
|
+
"""
|
|
133
|
+
Assign an organization role to a user
|
|
134
|
+
|
|
135
|
+
Assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
|
|
136
|
+
|
|
137
|
+
The authenticated user must be an administrator for the organization to use this endpoint.
|
|
138
|
+
|
|
139
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
|
|
140
|
+
"""
|
|
141
|
+
client = self.client
|
|
142
|
+
if aspects is None:
|
|
143
|
+
aspects = client.aspects
|
|
144
|
+
|
|
145
|
+
header_params = client.headers
|
|
146
|
+
if headers is not None:
|
|
147
|
+
header_params = headers
|
|
148
|
+
|
|
149
|
+
leaf_template = "/orgs/{org}/organization-roles/users/{username}/{role_id}"
|
|
150
|
+
path_params = {
|
|
151
|
+
'org': org,
|
|
152
|
+
'username': username,
|
|
153
|
+
'role_id': role_id,
|
|
154
|
+
}
|
|
155
|
+
call_leaf = leaf_template.format(**path_params)
|
|
156
|
+
|
|
157
|
+
query_params = None
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
if exp_status is None:
|
|
161
|
+
exp_status = [204]
|
|
162
|
+
|
|
163
|
+
resp = client.perform_call(
|
|
164
|
+
leaf=call_leaf,
|
|
165
|
+
method="PUT",
|
|
166
|
+
params=query_params if query_params else None,
|
|
167
|
+
body=None,
|
|
168
|
+
exp_status=exp_status,
|
|
169
|
+
headers=header_params if header_params else None,
|
|
170
|
+
context_msg=None,
|
|
171
|
+
aspects=aspects,
|
|
172
|
+
)
|
|
173
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
174
|
+
rtnval = None
|
|
175
|
+
else:
|
|
176
|
+
rtnval = resp.json()
|
|
177
|
+
return rtnval
|
|
178
|
+
|
|
179
|
+
def block_user(self, org: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
180
|
+
"""
|
|
181
|
+
Block a user from an organization
|
|
182
|
+
|
|
183
|
+
Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned.
|
|
184
|
+
"""
|
|
185
|
+
client = self.client
|
|
186
|
+
if aspects is None:
|
|
187
|
+
aspects = client.aspects
|
|
188
|
+
|
|
189
|
+
header_params = client.headers
|
|
190
|
+
if headers is not None:
|
|
191
|
+
header_params = headers
|
|
192
|
+
|
|
193
|
+
leaf_template = "/orgs/{org}/blocks/{username}"
|
|
194
|
+
path_params = {
|
|
195
|
+
'org': org,
|
|
196
|
+
'username': username,
|
|
197
|
+
}
|
|
198
|
+
call_leaf = leaf_template.format(**path_params)
|
|
199
|
+
|
|
200
|
+
query_params = None
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
if exp_status is None:
|
|
204
|
+
exp_status = [204]
|
|
205
|
+
|
|
206
|
+
resp = client.perform_call(
|
|
207
|
+
leaf=call_leaf,
|
|
208
|
+
method="PUT",
|
|
209
|
+
params=query_params if query_params else None,
|
|
210
|
+
body=None,
|
|
211
|
+
exp_status=exp_status,
|
|
212
|
+
headers=header_params if header_params else None,
|
|
213
|
+
context_msg=None,
|
|
214
|
+
aspects=aspects,
|
|
215
|
+
)
|
|
216
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
217
|
+
rtnval = None
|
|
218
|
+
else:
|
|
219
|
+
rtnval = resp.json()
|
|
220
|
+
return rtnval
|
|
221
|
+
|
|
222
|
+
def cancel_invitation(self, org: str, invitation_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
223
|
+
"""
|
|
224
|
+
Cancel an organization invitation
|
|
225
|
+
|
|
226
|
+
Cancel an organization invitation. In order to cancel an organization invitation, the authenticated user must be an organization owner.
|
|
227
|
+
|
|
228
|
+
This endpoint triggers [notifications](https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/about-notifications).
|
|
229
|
+
"""
|
|
230
|
+
client = self.client
|
|
231
|
+
if aspects is None:
|
|
232
|
+
aspects = client.aspects
|
|
233
|
+
|
|
234
|
+
header_params = client.headers
|
|
235
|
+
if headers is not None:
|
|
236
|
+
header_params = headers
|
|
237
|
+
|
|
238
|
+
leaf_template = "/orgs/{org}/invitations/{invitation_id}"
|
|
239
|
+
path_params = {
|
|
240
|
+
'org': org,
|
|
241
|
+
'invitation_id': invitation_id,
|
|
242
|
+
}
|
|
243
|
+
call_leaf = leaf_template.format(**path_params)
|
|
244
|
+
|
|
245
|
+
query_params = None
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
if exp_status is None:
|
|
249
|
+
exp_status = [204]
|
|
250
|
+
|
|
251
|
+
resp = client.perform_call(
|
|
252
|
+
leaf=call_leaf,
|
|
253
|
+
method="DELETE",
|
|
254
|
+
params=query_params if query_params else None,
|
|
255
|
+
body=None,
|
|
256
|
+
exp_status=exp_status,
|
|
257
|
+
headers=header_params if header_params else None,
|
|
258
|
+
context_msg=None,
|
|
259
|
+
aspects=aspects,
|
|
260
|
+
)
|
|
261
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
262
|
+
rtnval = None
|
|
263
|
+
else:
|
|
264
|
+
rtnval = resp.json()
|
|
265
|
+
return rtnval
|
|
266
|
+
|
|
267
|
+
def check_blocked_user(self, org: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
268
|
+
"""
|
|
269
|
+
Check if a user is blocked by an organization
|
|
270
|
+
|
|
271
|
+
Returns a 204 if the given user is blocked by the given organization. Returns a 404 if the organization is not blocking the user, or if the user account has been identified as spam by GitHub.
|
|
272
|
+
"""
|
|
273
|
+
client = self.client
|
|
274
|
+
if aspects is None:
|
|
275
|
+
aspects = client.aspects
|
|
276
|
+
|
|
277
|
+
header_params = client.headers
|
|
278
|
+
if headers is not None:
|
|
279
|
+
header_params = headers
|
|
280
|
+
|
|
281
|
+
leaf_template = "/orgs/{org}/blocks/{username}"
|
|
282
|
+
path_params = {
|
|
283
|
+
'org': org,
|
|
284
|
+
'username': username,
|
|
285
|
+
}
|
|
286
|
+
call_leaf = leaf_template.format(**path_params)
|
|
287
|
+
|
|
288
|
+
query_params = None
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
if exp_status is None:
|
|
292
|
+
exp_status = [204]
|
|
293
|
+
|
|
294
|
+
resp = client.perform_call(
|
|
295
|
+
leaf=call_leaf,
|
|
296
|
+
method="GET",
|
|
297
|
+
params=query_params if query_params else None,
|
|
298
|
+
body=None,
|
|
299
|
+
exp_status=exp_status,
|
|
300
|
+
headers=header_params if header_params else None,
|
|
301
|
+
context_msg=None,
|
|
302
|
+
aspects=aspects,
|
|
303
|
+
)
|
|
304
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
305
|
+
rtnval = None
|
|
306
|
+
else:
|
|
307
|
+
rtnval = resp.json()
|
|
308
|
+
return rtnval
|
|
309
|
+
|
|
310
|
+
def check_membership_for_user(self, org: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
311
|
+
"""
|
|
312
|
+
Check organization membership for a user
|
|
313
|
+
|
|
314
|
+
Check if a user is, publicly or privately, a member of the organization.
|
|
315
|
+
"""
|
|
316
|
+
client = self.client
|
|
317
|
+
if aspects is None:
|
|
318
|
+
aspects = client.aspects
|
|
319
|
+
|
|
320
|
+
header_params = client.headers
|
|
321
|
+
if headers is not None:
|
|
322
|
+
header_params = headers
|
|
323
|
+
|
|
324
|
+
leaf_template = "/orgs/{org}/members/{username}"
|
|
325
|
+
path_params = {
|
|
326
|
+
'org': org,
|
|
327
|
+
'username': username,
|
|
328
|
+
}
|
|
329
|
+
call_leaf = leaf_template.format(**path_params)
|
|
330
|
+
|
|
331
|
+
query_params = None
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
if exp_status is None:
|
|
335
|
+
exp_status = [204]
|
|
336
|
+
|
|
337
|
+
resp = client.perform_call(
|
|
338
|
+
leaf=call_leaf,
|
|
339
|
+
method="GET",
|
|
340
|
+
params=query_params if query_params else None,
|
|
341
|
+
body=None,
|
|
342
|
+
exp_status=exp_status,
|
|
343
|
+
headers=header_params if header_params else None,
|
|
344
|
+
context_msg=None,
|
|
345
|
+
aspects=aspects,
|
|
346
|
+
)
|
|
347
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
348
|
+
rtnval = None
|
|
349
|
+
else:
|
|
350
|
+
rtnval = resp.json()
|
|
351
|
+
return rtnval
|
|
352
|
+
|
|
353
|
+
def check_public_membership_for_user(self, org: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
354
|
+
"""
|
|
355
|
+
Check public organization membership for a user
|
|
356
|
+
|
|
357
|
+
Check if the provided user is a public member of the organization.
|
|
358
|
+
"""
|
|
359
|
+
client = self.client
|
|
360
|
+
if aspects is None:
|
|
361
|
+
aspects = client.aspects
|
|
362
|
+
|
|
363
|
+
header_params = client.headers
|
|
364
|
+
if headers is not None:
|
|
365
|
+
header_params = headers
|
|
366
|
+
|
|
367
|
+
leaf_template = "/orgs/{org}/public_members/{username}"
|
|
368
|
+
path_params = {
|
|
369
|
+
'org': org,
|
|
370
|
+
'username': username,
|
|
371
|
+
}
|
|
372
|
+
call_leaf = leaf_template.format(**path_params)
|
|
373
|
+
|
|
374
|
+
query_params = None
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
if exp_status is None:
|
|
378
|
+
exp_status = [204]
|
|
379
|
+
|
|
380
|
+
resp = client.perform_call(
|
|
381
|
+
leaf=call_leaf,
|
|
382
|
+
method="GET",
|
|
383
|
+
params=query_params if query_params else None,
|
|
384
|
+
body=None,
|
|
385
|
+
exp_status=exp_status,
|
|
386
|
+
headers=header_params if header_params else None,
|
|
387
|
+
context_msg=None,
|
|
388
|
+
aspects=aspects,
|
|
389
|
+
)
|
|
390
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
391
|
+
rtnval = None
|
|
392
|
+
else:
|
|
393
|
+
rtnval = resp.json()
|
|
394
|
+
return rtnval
|
|
395
|
+
|
|
396
|
+
def convert_member_to_outside_collaborator(self, org: str, username: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
397
|
+
"""
|
|
398
|
+
Convert an organization member to outside collaborator
|
|
399
|
+
|
|
400
|
+
When an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)."
|
|
401
|
+
"""
|
|
402
|
+
client = self.client
|
|
403
|
+
if aspects is None:
|
|
404
|
+
aspects = client.aspects
|
|
405
|
+
|
|
406
|
+
header_params = client.headers
|
|
407
|
+
if headers is not None:
|
|
408
|
+
header_params = headers
|
|
409
|
+
|
|
410
|
+
leaf_template = "/orgs/{org}/outside_collaborators/{username}"
|
|
411
|
+
path_params = {
|
|
412
|
+
'org': org,
|
|
413
|
+
'username': username,
|
|
414
|
+
}
|
|
415
|
+
call_leaf = leaf_template.format(**path_params)
|
|
416
|
+
|
|
417
|
+
query_params = None
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
if exp_status is None:
|
|
421
|
+
exp_status = [202, 204]
|
|
422
|
+
|
|
423
|
+
resp = client.perform_call(
|
|
424
|
+
leaf=call_leaf,
|
|
425
|
+
method="PUT",
|
|
426
|
+
params=query_params if query_params else None,
|
|
427
|
+
body=body,
|
|
428
|
+
exp_status=exp_status,
|
|
429
|
+
headers=header_params if header_params else None,
|
|
430
|
+
context_msg=None,
|
|
431
|
+
aspects=aspects,
|
|
432
|
+
)
|
|
433
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
434
|
+
rtnval = None
|
|
435
|
+
else:
|
|
436
|
+
rtnval = resp.json()
|
|
437
|
+
return rtnval
|
|
438
|
+
|
|
439
|
+
def create_invitation(self, org: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
440
|
+
"""
|
|
441
|
+
Create an organization invitation
|
|
442
|
+
|
|
443
|
+
Invite people to an organization by using their GitHub user ID or their email address. In order to create invitations in an organization, the authenticated user must be an organization owner.
|
|
444
|
+
|
|
445
|
+
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)"
|
|
446
|
+
and "[Best practices for using the REST API](https://docs.github.com/rest/guides/best-practices-for-using-the-rest-api)."
|
|
447
|
+
"""
|
|
448
|
+
client = self.client
|
|
449
|
+
if aspects is None:
|
|
450
|
+
aspects = client.aspects
|
|
451
|
+
|
|
452
|
+
header_params = client.headers
|
|
453
|
+
if headers is not None:
|
|
454
|
+
header_params = headers
|
|
455
|
+
|
|
456
|
+
leaf_template = "/orgs/{org}/invitations"
|
|
457
|
+
path_params = {
|
|
458
|
+
'org': org,
|
|
459
|
+
}
|
|
460
|
+
call_leaf = leaf_template.format(**path_params)
|
|
461
|
+
|
|
462
|
+
query_params = None
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
if exp_status is None:
|
|
466
|
+
exp_status = [201]
|
|
467
|
+
|
|
468
|
+
resp = client.perform_call(
|
|
469
|
+
leaf=call_leaf,
|
|
470
|
+
method="POST",
|
|
471
|
+
params=query_params if query_params else None,
|
|
472
|
+
body=body,
|
|
473
|
+
exp_status=exp_status,
|
|
474
|
+
headers=header_params if header_params else None,
|
|
475
|
+
context_msg=None,
|
|
476
|
+
aspects=aspects,
|
|
477
|
+
)
|
|
478
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
479
|
+
rtnval = None
|
|
480
|
+
else:
|
|
481
|
+
rtnval = resp.json()
|
|
482
|
+
return rtnval
|
|
483
|
+
|
|
484
|
+
def create_issue_type(self, org: str, body: OrganizationCreateIssueType, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> IssueType:
|
|
485
|
+
"""
|
|
486
|
+
Create issue type for an organization
|
|
487
|
+
|
|
488
|
+
Create a new issue type for an organization.
|
|
489
|
+
|
|
490
|
+
You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).
|
|
491
|
+
|
|
492
|
+
To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
|
|
493
|
+
personal access tokens (classic) need the `admin:org` scope to use this endpoint.
|
|
494
|
+
"""
|
|
495
|
+
client = self.client
|
|
496
|
+
if aspects is None:
|
|
497
|
+
aspects = client.aspects
|
|
498
|
+
|
|
499
|
+
header_params = client.headers
|
|
500
|
+
if headers is not None:
|
|
501
|
+
header_params = headers
|
|
502
|
+
|
|
503
|
+
leaf_template = "/orgs/{org}/issue-types"
|
|
504
|
+
path_params = {
|
|
505
|
+
'org': org,
|
|
506
|
+
}
|
|
507
|
+
call_leaf = leaf_template.format(**path_params)
|
|
508
|
+
|
|
509
|
+
query_params = None
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
if exp_status is None:
|
|
513
|
+
exp_status = [200]
|
|
514
|
+
|
|
515
|
+
resp = client.perform_call(
|
|
516
|
+
leaf=call_leaf,
|
|
517
|
+
method="POST",
|
|
518
|
+
params=query_params if query_params else None,
|
|
519
|
+
body=body,
|
|
520
|
+
exp_status=exp_status,
|
|
521
|
+
headers=header_params if header_params else None,
|
|
522
|
+
context_msg=None,
|
|
523
|
+
aspects=aspects,
|
|
524
|
+
)
|
|
525
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
526
|
+
rtnobj = None
|
|
527
|
+
else:
|
|
528
|
+
raw_data = resp.json()
|
|
529
|
+
rtnobj = IssueType.from_dict(raw_data)
|
|
530
|
+
return rtnobj
|
|
531
|
+
|
|
532
|
+
def create_or_update_custom_properties(self, org: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> List[CustomProperty]:
|
|
533
|
+
"""
|
|
534
|
+
Create or update custom properties for an organization
|
|
535
|
+
|
|
536
|
+
Creates new or updates existing custom properties defined for an organization in a batch.
|
|
537
|
+
|
|
538
|
+
If the property already exists, the existing property will be replaced with the new values.
|
|
539
|
+
Missing optional values will fall back to default values, previous values will be overwritten.
|
|
540
|
+
E.g. if a property exists with `values_editable_by: org_and_repo_actors` and it's updated without specifying `values_editable_by`, it will be updated to default value `org_actors`.
|
|
541
|
+
|
|
542
|
+
To use this endpoint, the authenticated user must be one of:
|
|
543
|
+
- An administrator for the organization.
|
|
544
|
+
- A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization.
|
|
545
|
+
"""
|
|
546
|
+
client = self.client
|
|
547
|
+
if aspects is None:
|
|
548
|
+
aspects = client.aspects
|
|
549
|
+
|
|
550
|
+
header_params = client.headers
|
|
551
|
+
if headers is not None:
|
|
552
|
+
header_params = headers
|
|
553
|
+
|
|
554
|
+
leaf_template = "/orgs/{org}/properties/schema"
|
|
555
|
+
path_params = {
|
|
556
|
+
'org': org,
|
|
557
|
+
}
|
|
558
|
+
call_leaf = leaf_template.format(**path_params)
|
|
559
|
+
|
|
560
|
+
query_params = None
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
if exp_status is None:
|
|
564
|
+
exp_status = [200]
|
|
565
|
+
|
|
566
|
+
resp = client.perform_call(
|
|
567
|
+
leaf=call_leaf,
|
|
568
|
+
method="PATCH",
|
|
569
|
+
params=query_params if query_params else None,
|
|
570
|
+
body=body,
|
|
571
|
+
exp_status=exp_status,
|
|
572
|
+
headers=header_params if header_params else None,
|
|
573
|
+
context_msg=None,
|
|
574
|
+
aspects=aspects,
|
|
575
|
+
)
|
|
576
|
+
raw_data = resp.json()
|
|
577
|
+
items = [self._parse_item(item, CustomProperty) for item in raw_data]
|
|
578
|
+
return items
|
|
579
|
+
|
|
580
|
+
def create_or_update_custom_properties_values_for_repos(self, org: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
581
|
+
"""
|
|
582
|
+
Create or update custom property values for organization repositories
|
|
583
|
+
|
|
584
|
+
Create new or update existing custom property values for repositories in a batch that belong to an organization.
|
|
585
|
+
Each target repository will have its custom property values updated to match the values provided in the request.
|
|
586
|
+
|
|
587
|
+
A maximum of 30 repositories can be updated in a single request.
|
|
588
|
+
|
|
589
|
+
Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.
|
|
590
|
+
|
|
591
|
+
To use this endpoint, the authenticated user must be one of:
|
|
592
|
+
- An administrator for the organization.
|
|
593
|
+
- A user, or a user on a team, with the fine-grained permission of `custom_properties_org_values_editor` in the organization.
|
|
594
|
+
"""
|
|
595
|
+
client = self.client
|
|
596
|
+
if aspects is None:
|
|
597
|
+
aspects = client.aspects
|
|
598
|
+
|
|
599
|
+
header_params = client.headers
|
|
600
|
+
if headers is not None:
|
|
601
|
+
header_params = headers
|
|
602
|
+
|
|
603
|
+
leaf_template = "/orgs/{org}/properties/values"
|
|
604
|
+
path_params = {
|
|
605
|
+
'org': org,
|
|
606
|
+
}
|
|
607
|
+
call_leaf = leaf_template.format(**path_params)
|
|
608
|
+
|
|
609
|
+
query_params = None
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
if exp_status is None:
|
|
613
|
+
exp_status = [204]
|
|
614
|
+
|
|
615
|
+
resp = client.perform_call(
|
|
616
|
+
leaf=call_leaf,
|
|
617
|
+
method="PATCH",
|
|
618
|
+
params=query_params if query_params else None,
|
|
619
|
+
body=body,
|
|
620
|
+
exp_status=exp_status,
|
|
621
|
+
headers=header_params if header_params else None,
|
|
622
|
+
context_msg=None,
|
|
623
|
+
aspects=aspects,
|
|
624
|
+
)
|
|
625
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
626
|
+
rtnval = None
|
|
627
|
+
else:
|
|
628
|
+
rtnval = resp.json()
|
|
629
|
+
return rtnval
|
|
630
|
+
|
|
631
|
+
def create_or_update_custom_property(self, org: str, custom_property_name: str, body: CustomPropertySetPayload, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> CustomProperty:
|
|
632
|
+
"""
|
|
633
|
+
Create or update a custom property for an organization
|
|
634
|
+
|
|
635
|
+
Creates a new or updates an existing custom property that is defined for an organization.
|
|
636
|
+
|
|
637
|
+
To use this endpoint, the authenticated user must be one of:
|
|
638
|
+
- An administrator for the organization.
|
|
639
|
+
- A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization.
|
|
640
|
+
"""
|
|
641
|
+
client = self.client
|
|
642
|
+
if aspects is None:
|
|
643
|
+
aspects = client.aspects
|
|
644
|
+
|
|
645
|
+
header_params = client.headers
|
|
646
|
+
if headers is not None:
|
|
647
|
+
header_params = headers
|
|
648
|
+
|
|
649
|
+
leaf_template = "/orgs/{org}/properties/schema/{custom_property_name}"
|
|
650
|
+
path_params = {
|
|
651
|
+
'org': org,
|
|
652
|
+
'custom_property_name': custom_property_name,
|
|
653
|
+
}
|
|
654
|
+
call_leaf = leaf_template.format(**path_params)
|
|
655
|
+
|
|
656
|
+
query_params = None
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
if exp_status is None:
|
|
660
|
+
exp_status = [200]
|
|
661
|
+
|
|
662
|
+
resp = client.perform_call(
|
|
663
|
+
leaf=call_leaf,
|
|
664
|
+
method="PUT",
|
|
665
|
+
params=query_params if query_params else None,
|
|
666
|
+
body=body,
|
|
667
|
+
exp_status=exp_status,
|
|
668
|
+
headers=header_params if header_params else None,
|
|
669
|
+
context_msg=None,
|
|
670
|
+
aspects=aspects,
|
|
671
|
+
)
|
|
672
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
673
|
+
rtnobj = None
|
|
674
|
+
else:
|
|
675
|
+
raw_data = resp.json()
|
|
676
|
+
rtnobj = CustomProperty.from_dict(raw_data)
|
|
677
|
+
return rtnobj
|
|
678
|
+
|
|
679
|
+
def create_webhook(self, org: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
680
|
+
"""
|
|
681
|
+
Create an organization webhook
|
|
682
|
+
|
|
683
|
+
Create a hook that posts payloads in JSON format.
|
|
684
|
+
|
|
685
|
+
You must be an organization owner to use this endpoint.
|
|
686
|
+
|
|
687
|
+
OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or
|
|
688
|
+
edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
|
|
689
|
+
"""
|
|
690
|
+
client = self.client
|
|
691
|
+
if aspects is None:
|
|
692
|
+
aspects = client.aspects
|
|
693
|
+
|
|
694
|
+
header_params = client.headers
|
|
695
|
+
if headers is not None:
|
|
696
|
+
header_params = headers
|
|
697
|
+
|
|
698
|
+
leaf_template = "/orgs/{org}/hooks"
|
|
699
|
+
path_params = {
|
|
700
|
+
'org': org,
|
|
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 delete(self, org: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
727
|
+
"""
|
|
728
|
+
Delete an organization
|
|
729
|
+
|
|
730
|
+
Deletes an organization and all its repositories.
|
|
731
|
+
|
|
732
|
+
The organization login will be unavailable for 90 days after deletion.
|
|
733
|
+
|
|
734
|
+
Please review the Terms of Service regarding account deletion before using this endpoint:
|
|
735
|
+
|
|
736
|
+
https://docs.github.com/site-policy/github-terms/github-terms-of-service
|
|
737
|
+
"""
|
|
738
|
+
client = self.client
|
|
739
|
+
if aspects is None:
|
|
740
|
+
aspects = client.aspects
|
|
741
|
+
|
|
742
|
+
header_params = client.headers
|
|
743
|
+
if headers is not None:
|
|
744
|
+
header_params = headers
|
|
745
|
+
|
|
746
|
+
leaf_template = "/orgs/{org}"
|
|
747
|
+
path_params = {
|
|
748
|
+
'org': org,
|
|
749
|
+
}
|
|
750
|
+
call_leaf = leaf_template.format(**path_params)
|
|
751
|
+
|
|
752
|
+
query_params = None
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
if exp_status is None:
|
|
756
|
+
exp_status = [202]
|
|
757
|
+
|
|
758
|
+
resp = client.perform_call(
|
|
759
|
+
leaf=call_leaf,
|
|
760
|
+
method="DELETE",
|
|
761
|
+
params=query_params if query_params else None,
|
|
762
|
+
body=None,
|
|
763
|
+
exp_status=exp_status,
|
|
764
|
+
headers=header_params if header_params else None,
|
|
765
|
+
context_msg=None,
|
|
766
|
+
aspects=aspects,
|
|
767
|
+
)
|
|
768
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
769
|
+
rtnval = None
|
|
770
|
+
else:
|
|
771
|
+
rtnval = resp.json()
|
|
772
|
+
return rtnval
|
|
773
|
+
|
|
774
|
+
def delete_attestations_bulk(self, org: str, body: Union[str, str], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
775
|
+
"""
|
|
776
|
+
Delete attestations in bulk
|
|
777
|
+
|
|
778
|
+
Delete artifact attestations in bulk by either subject digests or unique ID.
|
|
779
|
+
"""
|
|
780
|
+
client = self.client
|
|
781
|
+
if aspects is None:
|
|
782
|
+
aspects = client.aspects
|
|
783
|
+
|
|
784
|
+
header_params = client.headers
|
|
785
|
+
if headers is not None:
|
|
786
|
+
header_params = headers
|
|
787
|
+
|
|
788
|
+
leaf_template = "/orgs/{org}/attestations/delete-request"
|
|
789
|
+
path_params = {
|
|
790
|
+
'org': org,
|
|
791
|
+
}
|
|
792
|
+
call_leaf = leaf_template.format(**path_params)
|
|
793
|
+
|
|
794
|
+
query_params = None
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
if exp_status is None:
|
|
798
|
+
exp_status = [200]
|
|
799
|
+
|
|
800
|
+
resp = client.perform_call(
|
|
801
|
+
leaf=call_leaf,
|
|
802
|
+
method="POST",
|
|
803
|
+
params=query_params if query_params else None,
|
|
804
|
+
body=body,
|
|
805
|
+
exp_status=exp_status,
|
|
806
|
+
headers=header_params if header_params else None,
|
|
807
|
+
context_msg=None,
|
|
808
|
+
aspects=aspects,
|
|
809
|
+
)
|
|
810
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
811
|
+
rtnval = None
|
|
812
|
+
else:
|
|
813
|
+
rtnval = resp.json()
|
|
814
|
+
return rtnval
|
|
815
|
+
|
|
816
|
+
def delete_attestations_by_id(self, org: str, attestation_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
817
|
+
"""
|
|
818
|
+
Delete attestations by ID
|
|
819
|
+
|
|
820
|
+
Delete an artifact attestation by unique ID that is associated with a repository owned by an org.
|
|
821
|
+
"""
|
|
822
|
+
client = self.client
|
|
823
|
+
if aspects is None:
|
|
824
|
+
aspects = client.aspects
|
|
825
|
+
|
|
826
|
+
header_params = client.headers
|
|
827
|
+
if headers is not None:
|
|
828
|
+
header_params = headers
|
|
829
|
+
|
|
830
|
+
leaf_template = "/orgs/{org}/attestations/{attestation_id}"
|
|
831
|
+
path_params = {
|
|
832
|
+
'org': org,
|
|
833
|
+
'attestation_id': attestation_id,
|
|
834
|
+
}
|
|
835
|
+
call_leaf = leaf_template.format(**path_params)
|
|
836
|
+
|
|
837
|
+
query_params = None
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
if exp_status is None:
|
|
841
|
+
exp_status = [200, 204]
|
|
842
|
+
|
|
843
|
+
resp = client.perform_call(
|
|
844
|
+
leaf=call_leaf,
|
|
845
|
+
method="DELETE",
|
|
846
|
+
params=query_params if query_params else None,
|
|
847
|
+
body=None,
|
|
848
|
+
exp_status=exp_status,
|
|
849
|
+
headers=header_params if header_params else None,
|
|
850
|
+
context_msg=None,
|
|
851
|
+
aspects=aspects,
|
|
852
|
+
)
|
|
853
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
854
|
+
rtnval = None
|
|
855
|
+
else:
|
|
856
|
+
rtnval = resp.json()
|
|
857
|
+
return rtnval
|
|
858
|
+
|
|
859
|
+
def delete_attestations_by_subject_digest(self, org: str, subject_digest: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
860
|
+
"""
|
|
861
|
+
Delete attestations by subject digest
|
|
862
|
+
|
|
863
|
+
Delete an artifact attestation by subject digest.
|
|
864
|
+
"""
|
|
865
|
+
client = self.client
|
|
866
|
+
if aspects is None:
|
|
867
|
+
aspects = client.aspects
|
|
868
|
+
|
|
869
|
+
header_params = client.headers
|
|
870
|
+
if headers is not None:
|
|
871
|
+
header_params = headers
|
|
872
|
+
|
|
873
|
+
leaf_template = "/orgs/{org}/attestations/digest/{subject_digest}"
|
|
874
|
+
path_params = {
|
|
875
|
+
'org': org,
|
|
876
|
+
'subject_digest': subject_digest,
|
|
877
|
+
}
|
|
878
|
+
call_leaf = leaf_template.format(**path_params)
|
|
879
|
+
|
|
880
|
+
query_params = None
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
if exp_status is None:
|
|
884
|
+
exp_status = [200, 204]
|
|
885
|
+
|
|
886
|
+
resp = client.perform_call(
|
|
887
|
+
leaf=call_leaf,
|
|
888
|
+
method="DELETE",
|
|
889
|
+
params=query_params if query_params else None,
|
|
890
|
+
body=None,
|
|
891
|
+
exp_status=exp_status,
|
|
892
|
+
headers=header_params if header_params else None,
|
|
893
|
+
context_msg=None,
|
|
894
|
+
aspects=aspects,
|
|
895
|
+
)
|
|
896
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
897
|
+
rtnval = None
|
|
898
|
+
else:
|
|
899
|
+
rtnval = resp.json()
|
|
900
|
+
return rtnval
|
|
901
|
+
|
|
902
|
+
def delete_issue_type(self, org: str, issue_type_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
903
|
+
"""
|
|
904
|
+
Delete issue type for an organization
|
|
905
|
+
|
|
906
|
+
Deletes an issue type for an organization.
|
|
907
|
+
|
|
908
|
+
You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).
|
|
909
|
+
|
|
910
|
+
To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
|
|
911
|
+
personal access tokens (classic) need the `admin:org` scope to use this endpoint.
|
|
912
|
+
"""
|
|
913
|
+
client = self.client
|
|
914
|
+
if aspects is None:
|
|
915
|
+
aspects = client.aspects
|
|
916
|
+
|
|
917
|
+
header_params = client.headers
|
|
918
|
+
if headers is not None:
|
|
919
|
+
header_params = headers
|
|
920
|
+
|
|
921
|
+
leaf_template = "/orgs/{org}/issue-types/{issue_type_id}"
|
|
922
|
+
path_params = {
|
|
923
|
+
'org': org,
|
|
924
|
+
'issue_type_id': issue_type_id,
|
|
925
|
+
}
|
|
926
|
+
call_leaf = leaf_template.format(**path_params)
|
|
927
|
+
|
|
928
|
+
query_params = None
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
if exp_status is None:
|
|
932
|
+
exp_status = [204]
|
|
933
|
+
|
|
934
|
+
resp = client.perform_call(
|
|
935
|
+
leaf=call_leaf,
|
|
936
|
+
method="DELETE",
|
|
937
|
+
params=query_params if query_params else None,
|
|
938
|
+
body=None,
|
|
939
|
+
exp_status=exp_status,
|
|
940
|
+
headers=header_params if header_params else None,
|
|
941
|
+
context_msg=None,
|
|
942
|
+
aspects=aspects,
|
|
943
|
+
)
|
|
944
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
945
|
+
rtnval = None
|
|
946
|
+
else:
|
|
947
|
+
rtnval = resp.json()
|
|
948
|
+
return rtnval
|
|
949
|
+
|
|
950
|
+
def delete_webhook(self, org: str, hook_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
951
|
+
"""
|
|
952
|
+
Delete an organization webhook
|
|
953
|
+
|
|
954
|
+
Delete a webhook for an organization.
|
|
955
|
+
|
|
956
|
+
The authenticated user must be an organization owner to use this endpoint.
|
|
957
|
+
|
|
958
|
+
OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
|
|
959
|
+
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
|
|
960
|
+
"""
|
|
961
|
+
client = self.client
|
|
962
|
+
if aspects is None:
|
|
963
|
+
aspects = client.aspects
|
|
964
|
+
|
|
965
|
+
header_params = client.headers
|
|
966
|
+
if headers is not None:
|
|
967
|
+
header_params = headers
|
|
968
|
+
|
|
969
|
+
leaf_template = "/orgs/{org}/hooks/{hook_id}"
|
|
970
|
+
path_params = {
|
|
971
|
+
'org': org,
|
|
972
|
+
'hook_id': hook_id,
|
|
973
|
+
}
|
|
974
|
+
call_leaf = leaf_template.format(**path_params)
|
|
975
|
+
|
|
976
|
+
query_params = None
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
if exp_status is None:
|
|
980
|
+
exp_status = [204]
|
|
981
|
+
|
|
982
|
+
resp = client.perform_call(
|
|
983
|
+
leaf=call_leaf,
|
|
984
|
+
method="DELETE",
|
|
985
|
+
params=query_params if query_params else None,
|
|
986
|
+
body=None,
|
|
987
|
+
exp_status=exp_status,
|
|
988
|
+
headers=header_params if header_params else None,
|
|
989
|
+
context_msg=None,
|
|
990
|
+
aspects=aspects,
|
|
991
|
+
)
|
|
992
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
993
|
+
rtnval = None
|
|
994
|
+
else:
|
|
995
|
+
rtnval = resp.json()
|
|
996
|
+
return rtnval
|
|
997
|
+
|
|
998
|
+
def enable_or_disable_security_product_on_all_org_repos(self, org: str, security_product: str, enablement: str, body: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
999
|
+
"""
|
|
1000
|
+
Enable or disable a security feature for an organization
|
|
1001
|
+
|
|
1002
|
+
> [!WARNING]
|
|
1003
|
+
> **Closing down notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).
|
|
1004
|
+
|
|
1005
|
+
Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."
|
|
1006
|
+
|
|
1007
|
+
The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.
|
|
1008
|
+
|
|
1009
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint.
|
|
1010
|
+
"""
|
|
1011
|
+
client = self.client
|
|
1012
|
+
if aspects is None:
|
|
1013
|
+
aspects = client.aspects
|
|
1014
|
+
|
|
1015
|
+
header_params = client.headers
|
|
1016
|
+
if headers is not None:
|
|
1017
|
+
header_params = headers
|
|
1018
|
+
|
|
1019
|
+
leaf_template = "/orgs/{org}/{security_product}/{enablement}"
|
|
1020
|
+
path_params = {
|
|
1021
|
+
'org': org,
|
|
1022
|
+
'security_product': security_product,
|
|
1023
|
+
'enablement': enablement,
|
|
1024
|
+
}
|
|
1025
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1026
|
+
|
|
1027
|
+
query_params = None
|
|
1028
|
+
|
|
1029
|
+
|
|
1030
|
+
if exp_status is None:
|
|
1031
|
+
exp_status = [204]
|
|
1032
|
+
|
|
1033
|
+
resp = client.perform_call(
|
|
1034
|
+
leaf=call_leaf,
|
|
1035
|
+
method="POST",
|
|
1036
|
+
params=query_params if query_params else None,
|
|
1037
|
+
body=body,
|
|
1038
|
+
exp_status=exp_status,
|
|
1039
|
+
headers=header_params if header_params else None,
|
|
1040
|
+
context_msg=None,
|
|
1041
|
+
aspects=aspects,
|
|
1042
|
+
)
|
|
1043
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1044
|
+
rtnval = None
|
|
1045
|
+
else:
|
|
1046
|
+
rtnval = resp.json()
|
|
1047
|
+
return rtnval
|
|
1048
|
+
|
|
1049
|
+
def get(self, org: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> OrganizationFull:
|
|
1050
|
+
"""
|
|
1051
|
+
Get an organization
|
|
1052
|
+
|
|
1053
|
+
Gets information about an organization.
|
|
1054
|
+
|
|
1055
|
+
When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, outside collaborators, guest collaborators, repository collaborators, or everyone with access to any repository within the organization to enable [two-factor authentication](https://docs.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/).
|
|
1056
|
+
|
|
1057
|
+
To see the full details about an organization, the authenticated user must be an organization owner.
|
|
1058
|
+
|
|
1059
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization.
|
|
1060
|
+
|
|
1061
|
+
To see information about an organization's GitHub plan, GitHub Apps need the `Organization plan` permission.
|
|
1062
|
+
"""
|
|
1063
|
+
client = self.client
|
|
1064
|
+
if aspects is None:
|
|
1065
|
+
aspects = client.aspects
|
|
1066
|
+
|
|
1067
|
+
header_params = client.headers
|
|
1068
|
+
if headers is not None:
|
|
1069
|
+
header_params = headers
|
|
1070
|
+
|
|
1071
|
+
leaf_template = "/orgs/{org}"
|
|
1072
|
+
path_params = {
|
|
1073
|
+
'org': org,
|
|
1074
|
+
}
|
|
1075
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1076
|
+
|
|
1077
|
+
query_params = None
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
if exp_status is None:
|
|
1081
|
+
exp_status = [200]
|
|
1082
|
+
|
|
1083
|
+
resp = client.perform_call(
|
|
1084
|
+
leaf=call_leaf,
|
|
1085
|
+
method="GET",
|
|
1086
|
+
params=query_params if query_params else None,
|
|
1087
|
+
body=None,
|
|
1088
|
+
exp_status=exp_status,
|
|
1089
|
+
headers=header_params if header_params else None,
|
|
1090
|
+
context_msg=None,
|
|
1091
|
+
aspects=aspects,
|
|
1092
|
+
)
|
|
1093
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1094
|
+
rtnobj = None
|
|
1095
|
+
else:
|
|
1096
|
+
raw_data = resp.json()
|
|
1097
|
+
rtnobj = OrganizationFull.from_dict(raw_data)
|
|
1098
|
+
return rtnobj
|
|
1099
|
+
|
|
1100
|
+
def get_custom_property(self, org: str, custom_property_name: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> CustomProperty:
|
|
1101
|
+
"""
|
|
1102
|
+
Get a custom property for an organization
|
|
1103
|
+
|
|
1104
|
+
Gets a custom property that is defined for an organization.
|
|
1105
|
+
Organization members can read these properties.
|
|
1106
|
+
"""
|
|
1107
|
+
client = self.client
|
|
1108
|
+
if aspects is None:
|
|
1109
|
+
aspects = client.aspects
|
|
1110
|
+
|
|
1111
|
+
header_params = client.headers
|
|
1112
|
+
if headers is not None:
|
|
1113
|
+
header_params = headers
|
|
1114
|
+
|
|
1115
|
+
leaf_template = "/orgs/{org}/properties/schema/{custom_property_name}"
|
|
1116
|
+
path_params = {
|
|
1117
|
+
'org': org,
|
|
1118
|
+
'custom_property_name': custom_property_name,
|
|
1119
|
+
}
|
|
1120
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1121
|
+
|
|
1122
|
+
query_params = None
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
if exp_status is None:
|
|
1126
|
+
exp_status = [200]
|
|
1127
|
+
|
|
1128
|
+
resp = client.perform_call(
|
|
1129
|
+
leaf=call_leaf,
|
|
1130
|
+
method="GET",
|
|
1131
|
+
params=query_params if query_params else None,
|
|
1132
|
+
body=None,
|
|
1133
|
+
exp_status=exp_status,
|
|
1134
|
+
headers=header_params if header_params else None,
|
|
1135
|
+
context_msg=None,
|
|
1136
|
+
aspects=aspects,
|
|
1137
|
+
)
|
|
1138
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1139
|
+
rtnobj = None
|
|
1140
|
+
else:
|
|
1141
|
+
raw_data = resp.json()
|
|
1142
|
+
rtnobj = CustomProperty.from_dict(raw_data)
|
|
1143
|
+
return rtnobj
|
|
1144
|
+
|
|
1145
|
+
def get_membership_for_authenticated_user(self, org: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> OrgMembership:
|
|
1146
|
+
"""
|
|
1147
|
+
Get an organization membership for the authenticated user
|
|
1148
|
+
|
|
1149
|
+
If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization.
|
|
1150
|
+
"""
|
|
1151
|
+
client = self.client
|
|
1152
|
+
if aspects is None:
|
|
1153
|
+
aspects = client.aspects
|
|
1154
|
+
|
|
1155
|
+
header_params = client.headers
|
|
1156
|
+
if headers is not None:
|
|
1157
|
+
header_params = headers
|
|
1158
|
+
|
|
1159
|
+
leaf_template = "/user/memberships/orgs/{org}"
|
|
1160
|
+
path_params = {
|
|
1161
|
+
'org': org,
|
|
1162
|
+
}
|
|
1163
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1164
|
+
|
|
1165
|
+
query_params = None
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
if exp_status is None:
|
|
1169
|
+
exp_status = [200]
|
|
1170
|
+
|
|
1171
|
+
resp = client.perform_call(
|
|
1172
|
+
leaf=call_leaf,
|
|
1173
|
+
method="GET",
|
|
1174
|
+
params=query_params if query_params else None,
|
|
1175
|
+
body=None,
|
|
1176
|
+
exp_status=exp_status,
|
|
1177
|
+
headers=header_params if header_params else None,
|
|
1178
|
+
context_msg=None,
|
|
1179
|
+
aspects=aspects,
|
|
1180
|
+
)
|
|
1181
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1182
|
+
rtnobj = None
|
|
1183
|
+
else:
|
|
1184
|
+
raw_data = resp.json()
|
|
1185
|
+
rtnobj = OrgMembership.from_dict(raw_data)
|
|
1186
|
+
return rtnobj
|
|
1187
|
+
|
|
1188
|
+
def get_membership_for_user(self, org: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> OrgMembership:
|
|
1189
|
+
"""
|
|
1190
|
+
Get organization membership for a user
|
|
1191
|
+
|
|
1192
|
+
In order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status.
|
|
1193
|
+
"""
|
|
1194
|
+
client = self.client
|
|
1195
|
+
if aspects is None:
|
|
1196
|
+
aspects = client.aspects
|
|
1197
|
+
|
|
1198
|
+
header_params = client.headers
|
|
1199
|
+
if headers is not None:
|
|
1200
|
+
header_params = headers
|
|
1201
|
+
|
|
1202
|
+
leaf_template = "/orgs/{org}/memberships/{username}"
|
|
1203
|
+
path_params = {
|
|
1204
|
+
'org': org,
|
|
1205
|
+
'username': username,
|
|
1206
|
+
}
|
|
1207
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1208
|
+
|
|
1209
|
+
query_params = None
|
|
1210
|
+
|
|
1211
|
+
|
|
1212
|
+
if exp_status is None:
|
|
1213
|
+
exp_status = [200]
|
|
1214
|
+
|
|
1215
|
+
resp = client.perform_call(
|
|
1216
|
+
leaf=call_leaf,
|
|
1217
|
+
method="GET",
|
|
1218
|
+
params=query_params if query_params else None,
|
|
1219
|
+
body=None,
|
|
1220
|
+
exp_status=exp_status,
|
|
1221
|
+
headers=header_params if header_params else None,
|
|
1222
|
+
context_msg=None,
|
|
1223
|
+
aspects=aspects,
|
|
1224
|
+
)
|
|
1225
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1226
|
+
rtnobj = None
|
|
1227
|
+
else:
|
|
1228
|
+
raw_data = resp.json()
|
|
1229
|
+
rtnobj = OrgMembership.from_dict(raw_data)
|
|
1230
|
+
return rtnobj
|
|
1231
|
+
|
|
1232
|
+
def get_org_role(self, org: str, role_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> OrganizationRole:
|
|
1233
|
+
"""
|
|
1234
|
+
Get an organization role
|
|
1235
|
+
|
|
1236
|
+
Gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
|
|
1237
|
+
|
|
1238
|
+
To use this endpoint, the authenticated user must be one of:
|
|
1239
|
+
|
|
1240
|
+
- An administrator for the organization.
|
|
1241
|
+
- A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.
|
|
1242
|
+
|
|
1243
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
|
|
1244
|
+
"""
|
|
1245
|
+
client = self.client
|
|
1246
|
+
if aspects is None:
|
|
1247
|
+
aspects = client.aspects
|
|
1248
|
+
|
|
1249
|
+
header_params = client.headers
|
|
1250
|
+
if headers is not None:
|
|
1251
|
+
header_params = headers
|
|
1252
|
+
|
|
1253
|
+
leaf_template = "/orgs/{org}/organization-roles/{role_id}"
|
|
1254
|
+
path_params = {
|
|
1255
|
+
'org': org,
|
|
1256
|
+
'role_id': role_id,
|
|
1257
|
+
}
|
|
1258
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1259
|
+
|
|
1260
|
+
query_params = None
|
|
1261
|
+
|
|
1262
|
+
|
|
1263
|
+
if exp_status is None:
|
|
1264
|
+
exp_status = [200]
|
|
1265
|
+
|
|
1266
|
+
resp = client.perform_call(
|
|
1267
|
+
leaf=call_leaf,
|
|
1268
|
+
method="GET",
|
|
1269
|
+
params=query_params if query_params else None,
|
|
1270
|
+
body=None,
|
|
1271
|
+
exp_status=exp_status,
|
|
1272
|
+
headers=header_params if header_params else None,
|
|
1273
|
+
context_msg=None,
|
|
1274
|
+
aspects=aspects,
|
|
1275
|
+
)
|
|
1276
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1277
|
+
rtnobj = None
|
|
1278
|
+
else:
|
|
1279
|
+
raw_data = resp.json()
|
|
1280
|
+
rtnobj = OrganizationRole.from_dict(raw_data)
|
|
1281
|
+
return rtnobj
|
|
1282
|
+
|
|
1283
|
+
def get_org_ruleset_version(self, org: str, ruleset_id: int, version_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> str:
|
|
1284
|
+
"""
|
|
1285
|
+
Get organization ruleset version
|
|
1286
|
+
|
|
1287
|
+
Get a version of an organization ruleset.
|
|
1288
|
+
"""
|
|
1289
|
+
client = self.client
|
|
1290
|
+
if aspects is None:
|
|
1291
|
+
aspects = client.aspects
|
|
1292
|
+
|
|
1293
|
+
header_params = client.headers
|
|
1294
|
+
if headers is not None:
|
|
1295
|
+
header_params = headers
|
|
1296
|
+
|
|
1297
|
+
leaf_template = "/orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"
|
|
1298
|
+
path_params = {
|
|
1299
|
+
'org': org,
|
|
1300
|
+
'ruleset_id': ruleset_id,
|
|
1301
|
+
'version_id': version_id,
|
|
1302
|
+
}
|
|
1303
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1304
|
+
|
|
1305
|
+
query_params = None
|
|
1306
|
+
|
|
1307
|
+
|
|
1308
|
+
if exp_status is None:
|
|
1309
|
+
exp_status = [200]
|
|
1310
|
+
|
|
1311
|
+
resp = client.perform_call(
|
|
1312
|
+
leaf=call_leaf,
|
|
1313
|
+
method="GET",
|
|
1314
|
+
params=query_params if query_params else None,
|
|
1315
|
+
body=None,
|
|
1316
|
+
exp_status=exp_status,
|
|
1317
|
+
headers=header_params if header_params else None,
|
|
1318
|
+
context_msg=None,
|
|
1319
|
+
aspects=aspects,
|
|
1320
|
+
)
|
|
1321
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1322
|
+
rtnobj = None
|
|
1323
|
+
else:
|
|
1324
|
+
raw_data = resp.json()
|
|
1325
|
+
rtnobj = str.from_dict(raw_data)
|
|
1326
|
+
return rtnobj
|
|
1327
|
+
|
|
1328
|
+
def get_webhook(self, org: str, hook_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> OrgHook:
|
|
1329
|
+
"""
|
|
1330
|
+
Get an organization webhook
|
|
1331
|
+
|
|
1332
|
+
Returns a webhook configured in an organization. To get only the webhook
|
|
1333
|
+
`config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization).
|
|
1334
|
+
|
|
1335
|
+
You must be an organization owner to use this endpoint.
|
|
1336
|
+
|
|
1337
|
+
OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
|
|
1338
|
+
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
|
|
1339
|
+
"""
|
|
1340
|
+
client = self.client
|
|
1341
|
+
if aspects is None:
|
|
1342
|
+
aspects = client.aspects
|
|
1343
|
+
|
|
1344
|
+
header_params = client.headers
|
|
1345
|
+
if headers is not None:
|
|
1346
|
+
header_params = headers
|
|
1347
|
+
|
|
1348
|
+
leaf_template = "/orgs/{org}/hooks/{hook_id}"
|
|
1349
|
+
path_params = {
|
|
1350
|
+
'org': org,
|
|
1351
|
+
'hook_id': hook_id,
|
|
1352
|
+
}
|
|
1353
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1354
|
+
|
|
1355
|
+
query_params = None
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
if exp_status is None:
|
|
1359
|
+
exp_status = [200]
|
|
1360
|
+
|
|
1361
|
+
resp = client.perform_call(
|
|
1362
|
+
leaf=call_leaf,
|
|
1363
|
+
method="GET",
|
|
1364
|
+
params=query_params if query_params else None,
|
|
1365
|
+
body=None,
|
|
1366
|
+
exp_status=exp_status,
|
|
1367
|
+
headers=header_params if header_params else None,
|
|
1368
|
+
context_msg=None,
|
|
1369
|
+
aspects=aspects,
|
|
1370
|
+
)
|
|
1371
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1372
|
+
rtnobj = None
|
|
1373
|
+
else:
|
|
1374
|
+
raw_data = resp.json()
|
|
1375
|
+
rtnobj = OrgHook.from_dict(raw_data)
|
|
1376
|
+
return rtnobj
|
|
1377
|
+
|
|
1378
|
+
def get_webhook_config_for_org(self, org: str, hook_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> WebhookConfig:
|
|
1379
|
+
"""
|
|
1380
|
+
Get a webhook configuration for an organization
|
|
1381
|
+
|
|
1382
|
+
Returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)."
|
|
1383
|
+
|
|
1384
|
+
You must be an organization owner to use this endpoint.
|
|
1385
|
+
|
|
1386
|
+
OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
|
|
1387
|
+
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
|
|
1388
|
+
"""
|
|
1389
|
+
client = self.client
|
|
1390
|
+
if aspects is None:
|
|
1391
|
+
aspects = client.aspects
|
|
1392
|
+
|
|
1393
|
+
header_params = client.headers
|
|
1394
|
+
if headers is not None:
|
|
1395
|
+
header_params = headers
|
|
1396
|
+
|
|
1397
|
+
leaf_template = "/orgs/{org}/hooks/{hook_id}/config"
|
|
1398
|
+
path_params = {
|
|
1399
|
+
'org': org,
|
|
1400
|
+
'hook_id': hook_id,
|
|
1401
|
+
}
|
|
1402
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1403
|
+
|
|
1404
|
+
query_params = None
|
|
1405
|
+
|
|
1406
|
+
|
|
1407
|
+
if exp_status is None:
|
|
1408
|
+
exp_status = [200]
|
|
1409
|
+
|
|
1410
|
+
resp = client.perform_call(
|
|
1411
|
+
leaf=call_leaf,
|
|
1412
|
+
method="GET",
|
|
1413
|
+
params=query_params if query_params else None,
|
|
1414
|
+
body=None,
|
|
1415
|
+
exp_status=exp_status,
|
|
1416
|
+
headers=header_params if header_params else None,
|
|
1417
|
+
context_msg=None,
|
|
1418
|
+
aspects=aspects,
|
|
1419
|
+
)
|
|
1420
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1421
|
+
rtnobj = None
|
|
1422
|
+
else:
|
|
1423
|
+
raw_data = resp.json()
|
|
1424
|
+
rtnobj = WebhookConfig.from_dict(raw_data)
|
|
1425
|
+
return rtnobj
|
|
1426
|
+
|
|
1427
|
+
def get_webhook_delivery(self, org: str, hook_id: int, delivery_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> HookDelivery:
|
|
1428
|
+
"""
|
|
1429
|
+
Get a webhook delivery for an organization webhook
|
|
1430
|
+
|
|
1431
|
+
Returns a delivery for a webhook configured in an organization.
|
|
1432
|
+
|
|
1433
|
+
You must be an organization owner to use this endpoint.
|
|
1434
|
+
|
|
1435
|
+
OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
|
|
1436
|
+
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
|
|
1437
|
+
"""
|
|
1438
|
+
client = self.client
|
|
1439
|
+
if aspects is None:
|
|
1440
|
+
aspects = client.aspects
|
|
1441
|
+
|
|
1442
|
+
header_params = client.headers
|
|
1443
|
+
if headers is not None:
|
|
1444
|
+
header_params = headers
|
|
1445
|
+
|
|
1446
|
+
leaf_template = "/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"
|
|
1447
|
+
path_params = {
|
|
1448
|
+
'org': org,
|
|
1449
|
+
'hook_id': hook_id,
|
|
1450
|
+
'delivery_id': delivery_id,
|
|
1451
|
+
}
|
|
1452
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1453
|
+
|
|
1454
|
+
query_params = None
|
|
1455
|
+
|
|
1456
|
+
|
|
1457
|
+
if exp_status is None:
|
|
1458
|
+
exp_status = [200]
|
|
1459
|
+
|
|
1460
|
+
resp = client.perform_call(
|
|
1461
|
+
leaf=call_leaf,
|
|
1462
|
+
method="GET",
|
|
1463
|
+
params=query_params if query_params else None,
|
|
1464
|
+
body=None,
|
|
1465
|
+
exp_status=exp_status,
|
|
1466
|
+
headers=header_params if header_params else None,
|
|
1467
|
+
context_msg=None,
|
|
1468
|
+
aspects=aspects,
|
|
1469
|
+
)
|
|
1470
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1471
|
+
rtnobj = None
|
|
1472
|
+
else:
|
|
1473
|
+
raw_data = resp.json()
|
|
1474
|
+
rtnobj = HookDelivery.from_dict(raw_data)
|
|
1475
|
+
return rtnobj
|
|
1476
|
+
|
|
1477
|
+
def list(self, *, since: Optional[int] = None, per_page: Optional[int] = 30, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[OrganizationSimple]:
|
|
1478
|
+
"""
|
|
1479
|
+
List organizations
|
|
1480
|
+
|
|
1481
|
+
Lists all organizations, in the order that they were created.
|
|
1482
|
+
|
|
1483
|
+
> [!NOTE]
|
|
1484
|
+
> Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of organizations.
|
|
1485
|
+
"""
|
|
1486
|
+
client = self.client
|
|
1487
|
+
if aspects is None:
|
|
1488
|
+
aspects = client.aspects
|
|
1489
|
+
|
|
1490
|
+
header_params = client.headers
|
|
1491
|
+
if headers is not None:
|
|
1492
|
+
header_params = headers
|
|
1493
|
+
|
|
1494
|
+
call_leaf = "/organizations"
|
|
1495
|
+
|
|
1496
|
+
query_params = {}
|
|
1497
|
+
if since is not None:
|
|
1498
|
+
query_params['since'] = since
|
|
1499
|
+
if per_page is not None:
|
|
1500
|
+
query_params['per_page'] = per_page
|
|
1501
|
+
|
|
1502
|
+
|
|
1503
|
+
if exp_status is None:
|
|
1504
|
+
exp_status = [200]
|
|
1505
|
+
|
|
1506
|
+
resp = client.perform_call(
|
|
1507
|
+
leaf=call_leaf,
|
|
1508
|
+
method="GET",
|
|
1509
|
+
params=query_params if query_params else None,
|
|
1510
|
+
body=None,
|
|
1511
|
+
exp_status=exp_status,
|
|
1512
|
+
headers=header_params if header_params else None,
|
|
1513
|
+
context_msg=None,
|
|
1514
|
+
aspects=aspects,
|
|
1515
|
+
)
|
|
1516
|
+
raw_data = resp.json()
|
|
1517
|
+
items = [self._parse_item(item, OrganizationSimple) for item in raw_data]
|
|
1518
|
+
rtnval = PagedList[OrganizationSimple](items, dict(resp.headers), raw_data)
|
|
1519
|
+
return rtnval
|
|
1520
|
+
|
|
1521
|
+
def list_app_installations(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) -> Dict[str, Any]:
|
|
1522
|
+
"""
|
|
1523
|
+
List app installations for an organization
|
|
1524
|
+
|
|
1525
|
+
Lists all GitHub Apps in an organization. The installation count includes
|
|
1526
|
+
all GitHub Apps installed on repositories in the organization.
|
|
1527
|
+
|
|
1528
|
+
The authenticated user must be an organization owner to use this endpoint.
|
|
1529
|
+
|
|
1530
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint.
|
|
1531
|
+
"""
|
|
1532
|
+
client = self.client
|
|
1533
|
+
if aspects is None:
|
|
1534
|
+
aspects = client.aspects
|
|
1535
|
+
|
|
1536
|
+
header_params = client.headers
|
|
1537
|
+
if headers is not None:
|
|
1538
|
+
header_params = headers
|
|
1539
|
+
|
|
1540
|
+
leaf_template = "/orgs/{org}/installations"
|
|
1541
|
+
path_params = {
|
|
1542
|
+
'org': org,
|
|
1543
|
+
}
|
|
1544
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1545
|
+
|
|
1546
|
+
query_params = {}
|
|
1547
|
+
if per_page is not None:
|
|
1548
|
+
query_params['per_page'] = per_page
|
|
1549
|
+
if page is not None:
|
|
1550
|
+
query_params['page'] = page
|
|
1551
|
+
|
|
1552
|
+
|
|
1553
|
+
if exp_status is None:
|
|
1554
|
+
exp_status = [200]
|
|
1555
|
+
|
|
1556
|
+
resp = client.perform_call(
|
|
1557
|
+
leaf=call_leaf,
|
|
1558
|
+
method="GET",
|
|
1559
|
+
params=query_params if query_params else None,
|
|
1560
|
+
body=None,
|
|
1561
|
+
exp_status=exp_status,
|
|
1562
|
+
headers=header_params if header_params else None,
|
|
1563
|
+
context_msg=None,
|
|
1564
|
+
aspects=aspects,
|
|
1565
|
+
)
|
|
1566
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1567
|
+
rtnval = None
|
|
1568
|
+
else:
|
|
1569
|
+
raw_data = resp.json()
|
|
1570
|
+
rtnval = self._parse_item(raw_data, Dict[str, Any])
|
|
1571
|
+
return rtnval
|
|
1572
|
+
|
|
1573
|
+
def list_attestations(self, org: str, subject_digest: str, *, per_page: Optional[int] = 30, before: Optional[str] = None, after: Optional[str] = None, predicate_type: Optional[str] = None, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Dict[str, Any]:
|
|
1574
|
+
"""
|
|
1575
|
+
List attestations
|
|
1576
|
+
|
|
1577
|
+
List a collection of artifact attestations with a given subject digest that are associated with repositories owned by an organization.
|
|
1578
|
+
|
|
1579
|
+
The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.
|
|
1580
|
+
|
|
1581
|
+
**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
|
|
1582
|
+
"""
|
|
1583
|
+
client = self.client
|
|
1584
|
+
if aspects is None:
|
|
1585
|
+
aspects = client.aspects
|
|
1586
|
+
|
|
1587
|
+
header_params = client.headers
|
|
1588
|
+
if headers is not None:
|
|
1589
|
+
header_params = headers
|
|
1590
|
+
|
|
1591
|
+
leaf_template = "/orgs/{org}/attestations/{subject_digest}"
|
|
1592
|
+
path_params = {
|
|
1593
|
+
'org': org,
|
|
1594
|
+
'subject_digest': subject_digest,
|
|
1595
|
+
}
|
|
1596
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1597
|
+
|
|
1598
|
+
query_params = {}
|
|
1599
|
+
if per_page is not None:
|
|
1600
|
+
query_params['per_page'] = per_page
|
|
1601
|
+
if before is not None:
|
|
1602
|
+
query_params['before'] = before
|
|
1603
|
+
if after is not None:
|
|
1604
|
+
query_params['after'] = after
|
|
1605
|
+
if predicate_type is not None:
|
|
1606
|
+
query_params['predicate_type'] = predicate_type
|
|
1607
|
+
|
|
1608
|
+
|
|
1609
|
+
if exp_status is None:
|
|
1610
|
+
exp_status = [200]
|
|
1611
|
+
|
|
1612
|
+
resp = client.perform_call(
|
|
1613
|
+
leaf=call_leaf,
|
|
1614
|
+
method="GET",
|
|
1615
|
+
params=query_params if query_params else None,
|
|
1616
|
+
body=None,
|
|
1617
|
+
exp_status=exp_status,
|
|
1618
|
+
headers=header_params if header_params else None,
|
|
1619
|
+
context_msg=None,
|
|
1620
|
+
aspects=aspects,
|
|
1621
|
+
)
|
|
1622
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1623
|
+
rtnval = None
|
|
1624
|
+
else:
|
|
1625
|
+
raw_data = resp.json()
|
|
1626
|
+
rtnval = self._parse_item(raw_data, Dict[str, Any])
|
|
1627
|
+
return rtnval
|
|
1628
|
+
|
|
1629
|
+
def list_attestations_bulk(self, org: str, body: Dict[str, Any], *, per_page: Optional[int] = 30, before: Optional[str] = None, after: Optional[str] = None, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Dict[str, Any]:
|
|
1630
|
+
"""
|
|
1631
|
+
List attestations by bulk subject digests
|
|
1632
|
+
|
|
1633
|
+
List a collection of artifact attestations associated with any entry in a list of subject digests owned by an organization.
|
|
1634
|
+
|
|
1635
|
+
The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the `attestations:read` permission is required.
|
|
1636
|
+
|
|
1637
|
+
**Please note:** in order to offer meaningful security benefits, an attestation's signature and timestamps **must** be cryptographically verified, and the identity of the attestation signer **must** be validated. Attestations can be verified using the [GitHub CLI `attestation verify` command](https://cli.github.com/manual/gh_attestation_verify). For more information, see [our guide on how to use artifact attestations to establish a build's provenance](https://docs.github.com/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
|
|
1638
|
+
"""
|
|
1639
|
+
client = self.client
|
|
1640
|
+
if aspects is None:
|
|
1641
|
+
aspects = client.aspects
|
|
1642
|
+
|
|
1643
|
+
header_params = client.headers
|
|
1644
|
+
if headers is not None:
|
|
1645
|
+
header_params = headers
|
|
1646
|
+
|
|
1647
|
+
leaf_template = "/orgs/{org}/attestations/bulk-list"
|
|
1648
|
+
path_params = {
|
|
1649
|
+
'org': org,
|
|
1650
|
+
}
|
|
1651
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1652
|
+
|
|
1653
|
+
query_params = {}
|
|
1654
|
+
if per_page is not None:
|
|
1655
|
+
query_params['per_page'] = per_page
|
|
1656
|
+
if before is not None:
|
|
1657
|
+
query_params['before'] = before
|
|
1658
|
+
if after is not None:
|
|
1659
|
+
query_params['after'] = after
|
|
1660
|
+
|
|
1661
|
+
|
|
1662
|
+
if exp_status is None:
|
|
1663
|
+
exp_status = [200]
|
|
1664
|
+
|
|
1665
|
+
resp = client.perform_call(
|
|
1666
|
+
leaf=call_leaf,
|
|
1667
|
+
method="POST",
|
|
1668
|
+
params=query_params if query_params else None,
|
|
1669
|
+
body=body,
|
|
1670
|
+
exp_status=exp_status,
|
|
1671
|
+
headers=header_params if header_params else None,
|
|
1672
|
+
context_msg=None,
|
|
1673
|
+
aspects=aspects,
|
|
1674
|
+
)
|
|
1675
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
1676
|
+
rtnval = None
|
|
1677
|
+
else:
|
|
1678
|
+
raw_data = resp.json()
|
|
1679
|
+
rtnval = self._parse_item(raw_data, Dict[str, Any])
|
|
1680
|
+
return rtnval
|
|
1681
|
+
|
|
1682
|
+
def list_blocked_users(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[SimpleUser]:
|
|
1683
|
+
"""
|
|
1684
|
+
List users blocked by an organization
|
|
1685
|
+
|
|
1686
|
+
List the users blocked by an organization.
|
|
1687
|
+
"""
|
|
1688
|
+
client = self.client
|
|
1689
|
+
if aspects is None:
|
|
1690
|
+
aspects = client.aspects
|
|
1691
|
+
|
|
1692
|
+
header_params = client.headers
|
|
1693
|
+
if headers is not None:
|
|
1694
|
+
header_params = headers
|
|
1695
|
+
|
|
1696
|
+
leaf_template = "/orgs/{org}/blocks"
|
|
1697
|
+
path_params = {
|
|
1698
|
+
'org': org,
|
|
1699
|
+
}
|
|
1700
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1701
|
+
|
|
1702
|
+
query_params = {}
|
|
1703
|
+
if per_page is not None:
|
|
1704
|
+
query_params['per_page'] = per_page
|
|
1705
|
+
if page is not None:
|
|
1706
|
+
query_params['page'] = page
|
|
1707
|
+
|
|
1708
|
+
|
|
1709
|
+
if exp_status is None:
|
|
1710
|
+
exp_status = [200]
|
|
1711
|
+
|
|
1712
|
+
resp = client.perform_call(
|
|
1713
|
+
leaf=call_leaf,
|
|
1714
|
+
method="GET",
|
|
1715
|
+
params=query_params if query_params else None,
|
|
1716
|
+
body=None,
|
|
1717
|
+
exp_status=exp_status,
|
|
1718
|
+
headers=header_params if header_params else None,
|
|
1719
|
+
context_msg=None,
|
|
1720
|
+
aspects=aspects,
|
|
1721
|
+
)
|
|
1722
|
+
raw_data = resp.json()
|
|
1723
|
+
items = [self._parse_item(item, SimpleUser) for item in raw_data]
|
|
1724
|
+
rtnval = PagedList[SimpleUser](items, dict(resp.headers), raw_data)
|
|
1725
|
+
return rtnval
|
|
1726
|
+
|
|
1727
|
+
def list_custom_properties(self, org: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> List[CustomProperty]:
|
|
1728
|
+
"""
|
|
1729
|
+
Get all custom properties for an organization
|
|
1730
|
+
|
|
1731
|
+
Gets all custom properties defined for an organization.
|
|
1732
|
+
Organization members can read these properties.
|
|
1733
|
+
"""
|
|
1734
|
+
client = self.client
|
|
1735
|
+
if aspects is None:
|
|
1736
|
+
aspects = client.aspects
|
|
1737
|
+
|
|
1738
|
+
header_params = client.headers
|
|
1739
|
+
if headers is not None:
|
|
1740
|
+
header_params = headers
|
|
1741
|
+
|
|
1742
|
+
leaf_template = "/orgs/{org}/properties/schema"
|
|
1743
|
+
path_params = {
|
|
1744
|
+
'org': org,
|
|
1745
|
+
}
|
|
1746
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1747
|
+
|
|
1748
|
+
query_params = None
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
if exp_status is None:
|
|
1752
|
+
exp_status = [200]
|
|
1753
|
+
|
|
1754
|
+
resp = client.perform_call(
|
|
1755
|
+
leaf=call_leaf,
|
|
1756
|
+
method="GET",
|
|
1757
|
+
params=query_params if query_params else None,
|
|
1758
|
+
body=None,
|
|
1759
|
+
exp_status=exp_status,
|
|
1760
|
+
headers=header_params if header_params else None,
|
|
1761
|
+
context_msg=None,
|
|
1762
|
+
aspects=aspects,
|
|
1763
|
+
)
|
|
1764
|
+
raw_data = resp.json()
|
|
1765
|
+
items = [self._parse_item(item, CustomProperty) for item in raw_data]
|
|
1766
|
+
return items
|
|
1767
|
+
|
|
1768
|
+
def list_custom_properties_values_for_repos(self, org: str, *, per_page: Optional[int] = 30, page: Optional[int] = 1, repository_query: Optional[str] = None, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[OrgRepoCustomPropertyValues]:
|
|
1769
|
+
"""
|
|
1770
|
+
List custom property values for organization repositories
|
|
1771
|
+
|
|
1772
|
+
Lists organization repositories with all of their custom property values.
|
|
1773
|
+
Organization members can read these properties.
|
|
1774
|
+
"""
|
|
1775
|
+
client = self.client
|
|
1776
|
+
if aspects is None:
|
|
1777
|
+
aspects = client.aspects
|
|
1778
|
+
|
|
1779
|
+
header_params = client.headers
|
|
1780
|
+
if headers is not None:
|
|
1781
|
+
header_params = headers
|
|
1782
|
+
|
|
1783
|
+
leaf_template = "/orgs/{org}/properties/values"
|
|
1784
|
+
path_params = {
|
|
1785
|
+
'org': org,
|
|
1786
|
+
}
|
|
1787
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1788
|
+
|
|
1789
|
+
query_params = {}
|
|
1790
|
+
if per_page is not None:
|
|
1791
|
+
query_params['per_page'] = per_page
|
|
1792
|
+
if page is not None:
|
|
1793
|
+
query_params['page'] = page
|
|
1794
|
+
if repository_query is not None:
|
|
1795
|
+
query_params['repository_query'] = repository_query
|
|
1796
|
+
|
|
1797
|
+
|
|
1798
|
+
if exp_status is None:
|
|
1799
|
+
exp_status = [200]
|
|
1800
|
+
|
|
1801
|
+
resp = client.perform_call(
|
|
1802
|
+
leaf=call_leaf,
|
|
1803
|
+
method="GET",
|
|
1804
|
+
params=query_params if query_params else None,
|
|
1805
|
+
body=None,
|
|
1806
|
+
exp_status=exp_status,
|
|
1807
|
+
headers=header_params if header_params else None,
|
|
1808
|
+
context_msg=None,
|
|
1809
|
+
aspects=aspects,
|
|
1810
|
+
)
|
|
1811
|
+
raw_data = resp.json()
|
|
1812
|
+
items = [self._parse_item(item, OrgRepoCustomPropertyValues) for item in raw_data]
|
|
1813
|
+
rtnval = PagedList[OrgRepoCustomPropertyValues](items, dict(resp.headers), raw_data)
|
|
1814
|
+
return rtnval
|
|
1815
|
+
|
|
1816
|
+
def list_failed_invitations(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[OrganizationInvitation]:
|
|
1817
|
+
"""
|
|
1818
|
+
List failed organization invitations
|
|
1819
|
+
|
|
1820
|
+
The return hash contains `failed_at` and `failed_reason` fields which represent the time at which the invitation failed and the reason for the failure.
|
|
1821
|
+
"""
|
|
1822
|
+
client = self.client
|
|
1823
|
+
if aspects is None:
|
|
1824
|
+
aspects = client.aspects
|
|
1825
|
+
|
|
1826
|
+
header_params = client.headers
|
|
1827
|
+
if headers is not None:
|
|
1828
|
+
header_params = headers
|
|
1829
|
+
|
|
1830
|
+
leaf_template = "/orgs/{org}/failed_invitations"
|
|
1831
|
+
path_params = {
|
|
1832
|
+
'org': org,
|
|
1833
|
+
}
|
|
1834
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1835
|
+
|
|
1836
|
+
query_params = {}
|
|
1837
|
+
if per_page is not None:
|
|
1838
|
+
query_params['per_page'] = per_page
|
|
1839
|
+
if page is not None:
|
|
1840
|
+
query_params['page'] = page
|
|
1841
|
+
|
|
1842
|
+
|
|
1843
|
+
if exp_status is None:
|
|
1844
|
+
exp_status = [200]
|
|
1845
|
+
|
|
1846
|
+
resp = client.perform_call(
|
|
1847
|
+
leaf=call_leaf,
|
|
1848
|
+
method="GET",
|
|
1849
|
+
params=query_params if query_params else None,
|
|
1850
|
+
body=None,
|
|
1851
|
+
exp_status=exp_status,
|
|
1852
|
+
headers=header_params if header_params else None,
|
|
1853
|
+
context_msg=None,
|
|
1854
|
+
aspects=aspects,
|
|
1855
|
+
)
|
|
1856
|
+
raw_data = resp.json()
|
|
1857
|
+
items = [self._parse_item(item, OrganizationInvitation) for item in raw_data]
|
|
1858
|
+
rtnval = PagedList[OrganizationInvitation](items, dict(resp.headers), raw_data)
|
|
1859
|
+
return rtnval
|
|
1860
|
+
|
|
1861
|
+
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[OrganizationSimple]:
|
|
1862
|
+
"""
|
|
1863
|
+
List organizations for the authenticated user
|
|
1864
|
+
|
|
1865
|
+
List organizations for the authenticated user.
|
|
1866
|
+
|
|
1867
|
+
For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response.
|
|
1868
|
+
|
|
1869
|
+
> [!NOTE]
|
|
1870
|
+
> Requests using a fine-grained access token will receive a `200 Success` response with an empty list.
|
|
1871
|
+
"""
|
|
1872
|
+
client = self.client
|
|
1873
|
+
if aspects is None:
|
|
1874
|
+
aspects = client.aspects
|
|
1875
|
+
|
|
1876
|
+
header_params = client.headers
|
|
1877
|
+
if headers is not None:
|
|
1878
|
+
header_params = headers
|
|
1879
|
+
|
|
1880
|
+
call_leaf = "/user/orgs"
|
|
1881
|
+
|
|
1882
|
+
query_params = {}
|
|
1883
|
+
if per_page is not None:
|
|
1884
|
+
query_params['per_page'] = per_page
|
|
1885
|
+
if page is not None:
|
|
1886
|
+
query_params['page'] = page
|
|
1887
|
+
|
|
1888
|
+
|
|
1889
|
+
if exp_status is None:
|
|
1890
|
+
exp_status = [200]
|
|
1891
|
+
|
|
1892
|
+
resp = client.perform_call(
|
|
1893
|
+
leaf=call_leaf,
|
|
1894
|
+
method="GET",
|
|
1895
|
+
params=query_params if query_params else None,
|
|
1896
|
+
body=None,
|
|
1897
|
+
exp_status=exp_status,
|
|
1898
|
+
headers=header_params if header_params else None,
|
|
1899
|
+
context_msg=None,
|
|
1900
|
+
aspects=aspects,
|
|
1901
|
+
)
|
|
1902
|
+
raw_data = resp.json()
|
|
1903
|
+
items = [self._parse_item(item, OrganizationSimple) for item in raw_data]
|
|
1904
|
+
rtnval = PagedList[OrganizationSimple](items, dict(resp.headers), raw_data)
|
|
1905
|
+
return rtnval
|
|
1906
|
+
|
|
1907
|
+
def list_for_user(self, username: 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[OrganizationSimple]:
|
|
1908
|
+
"""
|
|
1909
|
+
List organizations for a user
|
|
1910
|
+
|
|
1911
|
+
List [public organization memberships](https://docs.github.com/articles/publicizing-or-concealing-organization-membership) for the specified user.
|
|
1912
|
+
|
|
1913
|
+
This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user) API instead.
|
|
1914
|
+
"""
|
|
1915
|
+
client = self.client
|
|
1916
|
+
if aspects is None:
|
|
1917
|
+
aspects = client.aspects
|
|
1918
|
+
|
|
1919
|
+
header_params = client.headers
|
|
1920
|
+
if headers is not None:
|
|
1921
|
+
header_params = headers
|
|
1922
|
+
|
|
1923
|
+
leaf_template = "/users/{username}/orgs"
|
|
1924
|
+
path_params = {
|
|
1925
|
+
'username': username,
|
|
1926
|
+
}
|
|
1927
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1928
|
+
|
|
1929
|
+
query_params = {}
|
|
1930
|
+
if per_page is not None:
|
|
1931
|
+
query_params['per_page'] = per_page
|
|
1932
|
+
if page is not None:
|
|
1933
|
+
query_params['page'] = page
|
|
1934
|
+
|
|
1935
|
+
|
|
1936
|
+
if exp_status is None:
|
|
1937
|
+
exp_status = [200]
|
|
1938
|
+
|
|
1939
|
+
resp = client.perform_call(
|
|
1940
|
+
leaf=call_leaf,
|
|
1941
|
+
method="GET",
|
|
1942
|
+
params=query_params if query_params else None,
|
|
1943
|
+
body=None,
|
|
1944
|
+
exp_status=exp_status,
|
|
1945
|
+
headers=header_params if header_params else None,
|
|
1946
|
+
context_msg=None,
|
|
1947
|
+
aspects=aspects,
|
|
1948
|
+
)
|
|
1949
|
+
raw_data = resp.json()
|
|
1950
|
+
items = [self._parse_item(item, OrganizationSimple) for item in raw_data]
|
|
1951
|
+
rtnval = PagedList[OrganizationSimple](items, dict(resp.headers), raw_data)
|
|
1952
|
+
return rtnval
|
|
1953
|
+
|
|
1954
|
+
def list_invitation_teams(self, org: str, invitation_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]:
|
|
1955
|
+
"""
|
|
1956
|
+
List organization invitation teams
|
|
1957
|
+
|
|
1958
|
+
List all teams associated with an invitation. In order to see invitations in an organization, the authenticated user must be an organization owner.
|
|
1959
|
+
"""
|
|
1960
|
+
client = self.client
|
|
1961
|
+
if aspects is None:
|
|
1962
|
+
aspects = client.aspects
|
|
1963
|
+
|
|
1964
|
+
header_params = client.headers
|
|
1965
|
+
if headers is not None:
|
|
1966
|
+
header_params = headers
|
|
1967
|
+
|
|
1968
|
+
leaf_template = "/orgs/{org}/invitations/{invitation_id}/teams"
|
|
1969
|
+
path_params = {
|
|
1970
|
+
'org': org,
|
|
1971
|
+
'invitation_id': invitation_id,
|
|
1972
|
+
}
|
|
1973
|
+
call_leaf = leaf_template.format(**path_params)
|
|
1974
|
+
|
|
1975
|
+
query_params = {}
|
|
1976
|
+
if per_page is not None:
|
|
1977
|
+
query_params['per_page'] = per_page
|
|
1978
|
+
if page is not None:
|
|
1979
|
+
query_params['page'] = page
|
|
1980
|
+
|
|
1981
|
+
|
|
1982
|
+
if exp_status is None:
|
|
1983
|
+
exp_status = [200]
|
|
1984
|
+
|
|
1985
|
+
resp = client.perform_call(
|
|
1986
|
+
leaf=call_leaf,
|
|
1987
|
+
method="GET",
|
|
1988
|
+
params=query_params if query_params else None,
|
|
1989
|
+
body=None,
|
|
1990
|
+
exp_status=exp_status,
|
|
1991
|
+
headers=header_params if header_params else None,
|
|
1992
|
+
context_msg=None,
|
|
1993
|
+
aspects=aspects,
|
|
1994
|
+
)
|
|
1995
|
+
raw_data = resp.json()
|
|
1996
|
+
items = [self._parse_item(item, Team) for item in raw_data]
|
|
1997
|
+
rtnval = PagedList[Team](items, dict(resp.headers), raw_data)
|
|
1998
|
+
return rtnval
|
|
1999
|
+
|
|
2000
|
+
def list_issue_types(self, org: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> List[IssueType]:
|
|
2001
|
+
"""
|
|
2002
|
+
List issue types for an organization
|
|
2003
|
+
|
|
2004
|
+
Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.
|
|
2005
|
+
"""
|
|
2006
|
+
client = self.client
|
|
2007
|
+
if aspects is None:
|
|
2008
|
+
aspects = client.aspects
|
|
2009
|
+
|
|
2010
|
+
header_params = client.headers
|
|
2011
|
+
if headers is not None:
|
|
2012
|
+
header_params = headers
|
|
2013
|
+
|
|
2014
|
+
leaf_template = "/orgs/{org}/issue-types"
|
|
2015
|
+
path_params = {
|
|
2016
|
+
'org': org,
|
|
2017
|
+
}
|
|
2018
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2019
|
+
|
|
2020
|
+
query_params = None
|
|
2021
|
+
|
|
2022
|
+
|
|
2023
|
+
if exp_status is None:
|
|
2024
|
+
exp_status = [200]
|
|
2025
|
+
|
|
2026
|
+
resp = client.perform_call(
|
|
2027
|
+
leaf=call_leaf,
|
|
2028
|
+
method="GET",
|
|
2029
|
+
params=query_params if query_params else None,
|
|
2030
|
+
body=None,
|
|
2031
|
+
exp_status=exp_status,
|
|
2032
|
+
headers=header_params if header_params else None,
|
|
2033
|
+
context_msg=None,
|
|
2034
|
+
aspects=aspects,
|
|
2035
|
+
)
|
|
2036
|
+
raw_data = resp.json()
|
|
2037
|
+
items = [self._parse_item(item, IssueType) for item in raw_data]
|
|
2038
|
+
return items
|
|
2039
|
+
|
|
2040
|
+
def list_members(self, org: str, *, filter: Optional[str] = "all", 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]:
|
|
2041
|
+
"""
|
|
2042
|
+
List organization members
|
|
2043
|
+
|
|
2044
|
+
List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.
|
|
2045
|
+
"""
|
|
2046
|
+
client = self.client
|
|
2047
|
+
if aspects is None:
|
|
2048
|
+
aspects = client.aspects
|
|
2049
|
+
|
|
2050
|
+
header_params = client.headers
|
|
2051
|
+
if headers is not None:
|
|
2052
|
+
header_params = headers
|
|
2053
|
+
|
|
2054
|
+
leaf_template = "/orgs/{org}/members"
|
|
2055
|
+
path_params = {
|
|
2056
|
+
'org': org,
|
|
2057
|
+
}
|
|
2058
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2059
|
+
|
|
2060
|
+
query_params = {}
|
|
2061
|
+
if filter is not None:
|
|
2062
|
+
query_params['filter'] = filter
|
|
2063
|
+
if role is not None:
|
|
2064
|
+
query_params['role'] = role
|
|
2065
|
+
if per_page is not None:
|
|
2066
|
+
query_params['per_page'] = per_page
|
|
2067
|
+
if page is not None:
|
|
2068
|
+
query_params['page'] = page
|
|
2069
|
+
|
|
2070
|
+
|
|
2071
|
+
if exp_status is None:
|
|
2072
|
+
exp_status = [200]
|
|
2073
|
+
|
|
2074
|
+
resp = client.perform_call(
|
|
2075
|
+
leaf=call_leaf,
|
|
2076
|
+
method="GET",
|
|
2077
|
+
params=query_params if query_params else None,
|
|
2078
|
+
body=None,
|
|
2079
|
+
exp_status=exp_status,
|
|
2080
|
+
headers=header_params if header_params else None,
|
|
2081
|
+
context_msg=None,
|
|
2082
|
+
aspects=aspects,
|
|
2083
|
+
)
|
|
2084
|
+
raw_data = resp.json()
|
|
2085
|
+
items = [self._parse_item(item, SimpleUser) for item in raw_data]
|
|
2086
|
+
rtnval = PagedList[SimpleUser](items, dict(resp.headers), raw_data)
|
|
2087
|
+
return rtnval
|
|
2088
|
+
|
|
2089
|
+
def list_memberships_for_authenticated_user(self, *, state: Optional[str] = None, 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[OrgMembership]:
|
|
2090
|
+
"""
|
|
2091
|
+
List organization memberships for the authenticated user
|
|
2092
|
+
|
|
2093
|
+
Lists all of the authenticated user's organization memberships.
|
|
2094
|
+
"""
|
|
2095
|
+
client = self.client
|
|
2096
|
+
if aspects is None:
|
|
2097
|
+
aspects = client.aspects
|
|
2098
|
+
|
|
2099
|
+
header_params = client.headers
|
|
2100
|
+
if headers is not None:
|
|
2101
|
+
header_params = headers
|
|
2102
|
+
|
|
2103
|
+
call_leaf = "/user/memberships/orgs"
|
|
2104
|
+
|
|
2105
|
+
query_params = {}
|
|
2106
|
+
if state is not None:
|
|
2107
|
+
query_params['state'] = state
|
|
2108
|
+
if per_page is not None:
|
|
2109
|
+
query_params['per_page'] = per_page
|
|
2110
|
+
if page is not None:
|
|
2111
|
+
query_params['page'] = page
|
|
2112
|
+
|
|
2113
|
+
|
|
2114
|
+
if exp_status is None:
|
|
2115
|
+
exp_status = [200]
|
|
2116
|
+
|
|
2117
|
+
resp = client.perform_call(
|
|
2118
|
+
leaf=call_leaf,
|
|
2119
|
+
method="GET",
|
|
2120
|
+
params=query_params if query_params else None,
|
|
2121
|
+
body=None,
|
|
2122
|
+
exp_status=exp_status,
|
|
2123
|
+
headers=header_params if header_params else None,
|
|
2124
|
+
context_msg=None,
|
|
2125
|
+
aspects=aspects,
|
|
2126
|
+
)
|
|
2127
|
+
raw_data = resp.json()
|
|
2128
|
+
items = [self._parse_item(item, OrgMembership) for item in raw_data]
|
|
2129
|
+
rtnval = PagedList[OrgMembership](items, dict(resp.headers), raw_data)
|
|
2130
|
+
return rtnval
|
|
2131
|
+
|
|
2132
|
+
def list_org_role_teams(self, org: str, role_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[TeamRoleAssignment]:
|
|
2133
|
+
"""
|
|
2134
|
+
List teams that are assigned to an organization role
|
|
2135
|
+
|
|
2136
|
+
Lists the teams that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
|
|
2137
|
+
|
|
2138
|
+
To use this endpoint, you must be an administrator for the organization.
|
|
2139
|
+
|
|
2140
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
|
|
2141
|
+
"""
|
|
2142
|
+
client = self.client
|
|
2143
|
+
if aspects is None:
|
|
2144
|
+
aspects = client.aspects
|
|
2145
|
+
|
|
2146
|
+
header_params = client.headers
|
|
2147
|
+
if headers is not None:
|
|
2148
|
+
header_params = headers
|
|
2149
|
+
|
|
2150
|
+
leaf_template = "/orgs/{org}/organization-roles/{role_id}/teams"
|
|
2151
|
+
path_params = {
|
|
2152
|
+
'org': org,
|
|
2153
|
+
'role_id': role_id,
|
|
2154
|
+
}
|
|
2155
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2156
|
+
|
|
2157
|
+
query_params = {}
|
|
2158
|
+
if per_page is not None:
|
|
2159
|
+
query_params['per_page'] = per_page
|
|
2160
|
+
if page is not None:
|
|
2161
|
+
query_params['page'] = page
|
|
2162
|
+
|
|
2163
|
+
|
|
2164
|
+
if exp_status is None:
|
|
2165
|
+
exp_status = [200]
|
|
2166
|
+
|
|
2167
|
+
resp = client.perform_call(
|
|
2168
|
+
leaf=call_leaf,
|
|
2169
|
+
method="GET",
|
|
2170
|
+
params=query_params if query_params else None,
|
|
2171
|
+
body=None,
|
|
2172
|
+
exp_status=exp_status,
|
|
2173
|
+
headers=header_params if header_params else None,
|
|
2174
|
+
context_msg=None,
|
|
2175
|
+
aspects=aspects,
|
|
2176
|
+
)
|
|
2177
|
+
raw_data = resp.json()
|
|
2178
|
+
items = [self._parse_item(item, TeamRoleAssignment) for item in raw_data]
|
|
2179
|
+
rtnval = PagedList[TeamRoleAssignment](items, dict(resp.headers), raw_data)
|
|
2180
|
+
return rtnval
|
|
2181
|
+
|
|
2182
|
+
def list_org_role_users(self, org: str, role_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[UserRoleAssignment]:
|
|
2183
|
+
"""
|
|
2184
|
+
List users that are assigned to an organization role
|
|
2185
|
+
|
|
2186
|
+
Lists organization members that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
|
|
2187
|
+
|
|
2188
|
+
To use this endpoint, you must be an administrator for the organization.
|
|
2189
|
+
|
|
2190
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
|
|
2191
|
+
"""
|
|
2192
|
+
client = self.client
|
|
2193
|
+
if aspects is None:
|
|
2194
|
+
aspects = client.aspects
|
|
2195
|
+
|
|
2196
|
+
header_params = client.headers
|
|
2197
|
+
if headers is not None:
|
|
2198
|
+
header_params = headers
|
|
2199
|
+
|
|
2200
|
+
leaf_template = "/orgs/{org}/organization-roles/{role_id}/users"
|
|
2201
|
+
path_params = {
|
|
2202
|
+
'org': org,
|
|
2203
|
+
'role_id': role_id,
|
|
2204
|
+
}
|
|
2205
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2206
|
+
|
|
2207
|
+
query_params = {}
|
|
2208
|
+
if per_page is not None:
|
|
2209
|
+
query_params['per_page'] = per_page
|
|
2210
|
+
if page is not None:
|
|
2211
|
+
query_params['page'] = page
|
|
2212
|
+
|
|
2213
|
+
|
|
2214
|
+
if exp_status is None:
|
|
2215
|
+
exp_status = [200]
|
|
2216
|
+
|
|
2217
|
+
resp = client.perform_call(
|
|
2218
|
+
leaf=call_leaf,
|
|
2219
|
+
method="GET",
|
|
2220
|
+
params=query_params if query_params else None,
|
|
2221
|
+
body=None,
|
|
2222
|
+
exp_status=exp_status,
|
|
2223
|
+
headers=header_params if header_params else None,
|
|
2224
|
+
context_msg=None,
|
|
2225
|
+
aspects=aspects,
|
|
2226
|
+
)
|
|
2227
|
+
raw_data = resp.json()
|
|
2228
|
+
items = [self._parse_item(item, UserRoleAssignment) for item in raw_data]
|
|
2229
|
+
rtnval = PagedList[UserRoleAssignment](items, dict(resp.headers), raw_data)
|
|
2230
|
+
return rtnval
|
|
2231
|
+
|
|
2232
|
+
def list_org_roles(self, org: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Dict[str, Any]:
|
|
2233
|
+
"""
|
|
2234
|
+
Get all organization roles for an organization
|
|
2235
|
+
|
|
2236
|
+
Lists the organization roles available in this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
|
|
2237
|
+
|
|
2238
|
+
To use this endpoint, the authenticated user must be one of:
|
|
2239
|
+
|
|
2240
|
+
- An administrator for the organization.
|
|
2241
|
+
- A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.
|
|
2242
|
+
|
|
2243
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
|
|
2244
|
+
"""
|
|
2245
|
+
client = self.client
|
|
2246
|
+
if aspects is None:
|
|
2247
|
+
aspects = client.aspects
|
|
2248
|
+
|
|
2249
|
+
header_params = client.headers
|
|
2250
|
+
if headers is not None:
|
|
2251
|
+
header_params = headers
|
|
2252
|
+
|
|
2253
|
+
leaf_template = "/orgs/{org}/organization-roles"
|
|
2254
|
+
path_params = {
|
|
2255
|
+
'org': org,
|
|
2256
|
+
}
|
|
2257
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2258
|
+
|
|
2259
|
+
query_params = None
|
|
2260
|
+
|
|
2261
|
+
|
|
2262
|
+
if exp_status is None:
|
|
2263
|
+
exp_status = [200]
|
|
2264
|
+
|
|
2265
|
+
resp = client.perform_call(
|
|
2266
|
+
leaf=call_leaf,
|
|
2267
|
+
method="GET",
|
|
2268
|
+
params=query_params if query_params else None,
|
|
2269
|
+
body=None,
|
|
2270
|
+
exp_status=exp_status,
|
|
2271
|
+
headers=header_params if header_params else None,
|
|
2272
|
+
context_msg=None,
|
|
2273
|
+
aspects=aspects,
|
|
2274
|
+
)
|
|
2275
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2276
|
+
rtnval = None
|
|
2277
|
+
else:
|
|
2278
|
+
raw_data = resp.json()
|
|
2279
|
+
rtnval = self._parse_item(raw_data, Dict[str, Any])
|
|
2280
|
+
return rtnval
|
|
2281
|
+
|
|
2282
|
+
def list_org_ruleset_history(self, org: str, ruleset_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[RulesetVersion]:
|
|
2283
|
+
"""
|
|
2284
|
+
Get organization ruleset history
|
|
2285
|
+
|
|
2286
|
+
Get the history of an organization ruleset.
|
|
2287
|
+
"""
|
|
2288
|
+
client = self.client
|
|
2289
|
+
if aspects is None:
|
|
2290
|
+
aspects = client.aspects
|
|
2291
|
+
|
|
2292
|
+
header_params = client.headers
|
|
2293
|
+
if headers is not None:
|
|
2294
|
+
header_params = headers
|
|
2295
|
+
|
|
2296
|
+
leaf_template = "/orgs/{org}/rulesets/{ruleset_id}/history"
|
|
2297
|
+
path_params = {
|
|
2298
|
+
'org': org,
|
|
2299
|
+
'ruleset_id': ruleset_id,
|
|
2300
|
+
}
|
|
2301
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2302
|
+
|
|
2303
|
+
query_params = {}
|
|
2304
|
+
if per_page is not None:
|
|
2305
|
+
query_params['per_page'] = per_page
|
|
2306
|
+
if page is not None:
|
|
2307
|
+
query_params['page'] = page
|
|
2308
|
+
|
|
2309
|
+
|
|
2310
|
+
if exp_status is None:
|
|
2311
|
+
exp_status = [200]
|
|
2312
|
+
|
|
2313
|
+
resp = client.perform_call(
|
|
2314
|
+
leaf=call_leaf,
|
|
2315
|
+
method="GET",
|
|
2316
|
+
params=query_params if query_params else None,
|
|
2317
|
+
body=None,
|
|
2318
|
+
exp_status=exp_status,
|
|
2319
|
+
headers=header_params if header_params else None,
|
|
2320
|
+
context_msg=None,
|
|
2321
|
+
aspects=aspects,
|
|
2322
|
+
)
|
|
2323
|
+
raw_data = resp.json()
|
|
2324
|
+
items = [self._parse_item(item, RulesetVersion) for item in raw_data]
|
|
2325
|
+
rtnval = PagedList[RulesetVersion](items, dict(resp.headers), raw_data)
|
|
2326
|
+
return rtnval
|
|
2327
|
+
|
|
2328
|
+
def list_outside_collaborators(self, org: str, *, filter: 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]:
|
|
2329
|
+
"""
|
|
2330
|
+
List outside collaborators for an organization
|
|
2331
|
+
|
|
2332
|
+
List all users who are outside collaborators of an organization.
|
|
2333
|
+
"""
|
|
2334
|
+
client = self.client
|
|
2335
|
+
if aspects is None:
|
|
2336
|
+
aspects = client.aspects
|
|
2337
|
+
|
|
2338
|
+
header_params = client.headers
|
|
2339
|
+
if headers is not None:
|
|
2340
|
+
header_params = headers
|
|
2341
|
+
|
|
2342
|
+
leaf_template = "/orgs/{org}/outside_collaborators"
|
|
2343
|
+
path_params = {
|
|
2344
|
+
'org': org,
|
|
2345
|
+
}
|
|
2346
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2347
|
+
|
|
2348
|
+
query_params = {}
|
|
2349
|
+
if filter is not None:
|
|
2350
|
+
query_params['filter'] = filter
|
|
2351
|
+
if per_page is not None:
|
|
2352
|
+
query_params['per_page'] = per_page
|
|
2353
|
+
if page is not None:
|
|
2354
|
+
query_params['page'] = page
|
|
2355
|
+
|
|
2356
|
+
|
|
2357
|
+
if exp_status is None:
|
|
2358
|
+
exp_status = [200]
|
|
2359
|
+
|
|
2360
|
+
resp = client.perform_call(
|
|
2361
|
+
leaf=call_leaf,
|
|
2362
|
+
method="GET",
|
|
2363
|
+
params=query_params if query_params else None,
|
|
2364
|
+
body=None,
|
|
2365
|
+
exp_status=exp_status,
|
|
2366
|
+
headers=header_params if header_params else None,
|
|
2367
|
+
context_msg=None,
|
|
2368
|
+
aspects=aspects,
|
|
2369
|
+
)
|
|
2370
|
+
raw_data = resp.json()
|
|
2371
|
+
items = [self._parse_item(item, SimpleUser) for item in raw_data]
|
|
2372
|
+
rtnval = PagedList[SimpleUser](items, dict(resp.headers), raw_data)
|
|
2373
|
+
return rtnval
|
|
2374
|
+
|
|
2375
|
+
def list_pat_grant_repositories(self, org: str, pat_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]:
|
|
2376
|
+
"""
|
|
2377
|
+
List repositories a fine-grained personal access token has access to
|
|
2378
|
+
|
|
2379
|
+
Lists the repositories a fine-grained personal access token has access to.
|
|
2380
|
+
|
|
2381
|
+
Only GitHub Apps can use this endpoint.
|
|
2382
|
+
"""
|
|
2383
|
+
client = self.client
|
|
2384
|
+
if aspects is None:
|
|
2385
|
+
aspects = client.aspects
|
|
2386
|
+
|
|
2387
|
+
header_params = client.headers
|
|
2388
|
+
if headers is not None:
|
|
2389
|
+
header_params = headers
|
|
2390
|
+
|
|
2391
|
+
leaf_template = "/orgs/{org}/personal-access-tokens/{pat_id}/repositories"
|
|
2392
|
+
path_params = {
|
|
2393
|
+
'org': org,
|
|
2394
|
+
'pat_id': pat_id,
|
|
2395
|
+
}
|
|
2396
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2397
|
+
|
|
2398
|
+
query_params = {}
|
|
2399
|
+
if per_page is not None:
|
|
2400
|
+
query_params['per_page'] = per_page
|
|
2401
|
+
if page is not None:
|
|
2402
|
+
query_params['page'] = page
|
|
2403
|
+
|
|
2404
|
+
|
|
2405
|
+
if exp_status is None:
|
|
2406
|
+
exp_status = [200]
|
|
2407
|
+
|
|
2408
|
+
resp = client.perform_call(
|
|
2409
|
+
leaf=call_leaf,
|
|
2410
|
+
method="GET",
|
|
2411
|
+
params=query_params if query_params else None,
|
|
2412
|
+
body=None,
|
|
2413
|
+
exp_status=exp_status,
|
|
2414
|
+
headers=header_params if header_params else None,
|
|
2415
|
+
context_msg=None,
|
|
2416
|
+
aspects=aspects,
|
|
2417
|
+
)
|
|
2418
|
+
raw_data = resp.json()
|
|
2419
|
+
items = [self._parse_item(item, MinimalRepository) for item in raw_data]
|
|
2420
|
+
rtnval = PagedList[MinimalRepository](items, dict(resp.headers), raw_data)
|
|
2421
|
+
return rtnval
|
|
2422
|
+
|
|
2423
|
+
def list_pat_grant_request_repositories(self, org: str, pat_request_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]:
|
|
2424
|
+
"""
|
|
2425
|
+
List repositories requested to be accessed by a fine-grained personal access token
|
|
2426
|
+
|
|
2427
|
+
Lists the repositories a fine-grained personal access token request is requesting access to.
|
|
2428
|
+
|
|
2429
|
+
Only GitHub Apps can use this endpoint.
|
|
2430
|
+
"""
|
|
2431
|
+
client = self.client
|
|
2432
|
+
if aspects is None:
|
|
2433
|
+
aspects = client.aspects
|
|
2434
|
+
|
|
2435
|
+
header_params = client.headers
|
|
2436
|
+
if headers is not None:
|
|
2437
|
+
header_params = headers
|
|
2438
|
+
|
|
2439
|
+
leaf_template = "/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"
|
|
2440
|
+
path_params = {
|
|
2441
|
+
'org': org,
|
|
2442
|
+
'pat_request_id': pat_request_id,
|
|
2443
|
+
}
|
|
2444
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2445
|
+
|
|
2446
|
+
query_params = {}
|
|
2447
|
+
if per_page is not None:
|
|
2448
|
+
query_params['per_page'] = per_page
|
|
2449
|
+
if page is not None:
|
|
2450
|
+
query_params['page'] = page
|
|
2451
|
+
|
|
2452
|
+
|
|
2453
|
+
if exp_status is None:
|
|
2454
|
+
exp_status = [200]
|
|
2455
|
+
|
|
2456
|
+
resp = client.perform_call(
|
|
2457
|
+
leaf=call_leaf,
|
|
2458
|
+
method="GET",
|
|
2459
|
+
params=query_params if query_params else None,
|
|
2460
|
+
body=None,
|
|
2461
|
+
exp_status=exp_status,
|
|
2462
|
+
headers=header_params if header_params else None,
|
|
2463
|
+
context_msg=None,
|
|
2464
|
+
aspects=aspects,
|
|
2465
|
+
)
|
|
2466
|
+
raw_data = resp.json()
|
|
2467
|
+
items = [self._parse_item(item, MinimalRepository) for item in raw_data]
|
|
2468
|
+
rtnval = PagedList[MinimalRepository](items, dict(resp.headers), raw_data)
|
|
2469
|
+
return rtnval
|
|
2470
|
+
|
|
2471
|
+
def list_pat_grant_requests(self, org: str, *, per_page: Optional[int] = 30, page: Optional[int] = 1, sort: Optional[str] = "created_at", direction: Optional[str] = "desc", owner: Optional[List[str]] = None, repository: Optional[str] = None, permission: Optional[str] = None, last_used_before: Optional[str] = None, last_used_after: Optional[str] = None, token_id: Optional[List[str]] = None, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[OrganizationProgrammaticAccessGrantRequest]:
|
|
2472
|
+
"""
|
|
2473
|
+
List requests to access organization resources with fine-grained personal access tokens
|
|
2474
|
+
|
|
2475
|
+
Lists requests from organization members to access organization resources with a fine-grained personal access token.
|
|
2476
|
+
|
|
2477
|
+
Only GitHub Apps can use this endpoint.
|
|
2478
|
+
"""
|
|
2479
|
+
client = self.client
|
|
2480
|
+
if aspects is None:
|
|
2481
|
+
aspects = client.aspects
|
|
2482
|
+
|
|
2483
|
+
header_params = client.headers
|
|
2484
|
+
if headers is not None:
|
|
2485
|
+
header_params = headers
|
|
2486
|
+
|
|
2487
|
+
leaf_template = "/orgs/{org}/personal-access-token-requests"
|
|
2488
|
+
path_params = {
|
|
2489
|
+
'org': org,
|
|
2490
|
+
}
|
|
2491
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2492
|
+
|
|
2493
|
+
query_params = {}
|
|
2494
|
+
if per_page is not None:
|
|
2495
|
+
query_params['per_page'] = per_page
|
|
2496
|
+
if page is not None:
|
|
2497
|
+
query_params['page'] = page
|
|
2498
|
+
if sort is not None:
|
|
2499
|
+
query_params['sort'] = sort
|
|
2500
|
+
if direction is not None:
|
|
2501
|
+
query_params['direction'] = direction
|
|
2502
|
+
if owner is not None:
|
|
2503
|
+
query_params['owner'] = owner
|
|
2504
|
+
if repository is not None:
|
|
2505
|
+
query_params['repository'] = repository
|
|
2506
|
+
if permission is not None:
|
|
2507
|
+
query_params['permission'] = permission
|
|
2508
|
+
if last_used_before is not None:
|
|
2509
|
+
query_params['last_used_before'] = last_used_before
|
|
2510
|
+
if last_used_after is not None:
|
|
2511
|
+
query_params['last_used_after'] = last_used_after
|
|
2512
|
+
if token_id is not None:
|
|
2513
|
+
query_params['token_id'] = token_id
|
|
2514
|
+
|
|
2515
|
+
|
|
2516
|
+
if exp_status is None:
|
|
2517
|
+
exp_status = [200]
|
|
2518
|
+
|
|
2519
|
+
resp = client.perform_call(
|
|
2520
|
+
leaf=call_leaf,
|
|
2521
|
+
method="GET",
|
|
2522
|
+
params=query_params if query_params else None,
|
|
2523
|
+
body=None,
|
|
2524
|
+
exp_status=exp_status,
|
|
2525
|
+
headers=header_params if header_params else None,
|
|
2526
|
+
context_msg=None,
|
|
2527
|
+
aspects=aspects,
|
|
2528
|
+
)
|
|
2529
|
+
raw_data = resp.json()
|
|
2530
|
+
items = [self._parse_item(item, OrganizationProgrammaticAccessGrantRequest) for item in raw_data]
|
|
2531
|
+
rtnval = PagedList[OrganizationProgrammaticAccessGrantRequest](items, dict(resp.headers), raw_data)
|
|
2532
|
+
return rtnval
|
|
2533
|
+
|
|
2534
|
+
def list_pat_grants(self, org: str, *, per_page: Optional[int] = 30, page: Optional[int] = 1, sort: Optional[str] = "created_at", direction: Optional[str] = "desc", owner: Optional[List[str]] = None, repository: Optional[str] = None, permission: Optional[str] = None, last_used_before: Optional[str] = None, last_used_after: Optional[str] = None, token_id: Optional[List[str]] = None, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[OrganizationProgrammaticAccessGrant]:
|
|
2535
|
+
"""
|
|
2536
|
+
List fine-grained personal access tokens with access to organization resources
|
|
2537
|
+
|
|
2538
|
+
Lists approved fine-grained personal access tokens owned by organization members that can access organization resources.
|
|
2539
|
+
|
|
2540
|
+
Only GitHub Apps can use this endpoint.
|
|
2541
|
+
"""
|
|
2542
|
+
client = self.client
|
|
2543
|
+
if aspects is None:
|
|
2544
|
+
aspects = client.aspects
|
|
2545
|
+
|
|
2546
|
+
header_params = client.headers
|
|
2547
|
+
if headers is not None:
|
|
2548
|
+
header_params = headers
|
|
2549
|
+
|
|
2550
|
+
leaf_template = "/orgs/{org}/personal-access-tokens"
|
|
2551
|
+
path_params = {
|
|
2552
|
+
'org': org,
|
|
2553
|
+
}
|
|
2554
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2555
|
+
|
|
2556
|
+
query_params = {}
|
|
2557
|
+
if per_page is not None:
|
|
2558
|
+
query_params['per_page'] = per_page
|
|
2559
|
+
if page is not None:
|
|
2560
|
+
query_params['page'] = page
|
|
2561
|
+
if sort is not None:
|
|
2562
|
+
query_params['sort'] = sort
|
|
2563
|
+
if direction is not None:
|
|
2564
|
+
query_params['direction'] = direction
|
|
2565
|
+
if owner is not None:
|
|
2566
|
+
query_params['owner'] = owner
|
|
2567
|
+
if repository is not None:
|
|
2568
|
+
query_params['repository'] = repository
|
|
2569
|
+
if permission is not None:
|
|
2570
|
+
query_params['permission'] = permission
|
|
2571
|
+
if last_used_before is not None:
|
|
2572
|
+
query_params['last_used_before'] = last_used_before
|
|
2573
|
+
if last_used_after is not None:
|
|
2574
|
+
query_params['last_used_after'] = last_used_after
|
|
2575
|
+
if token_id is not None:
|
|
2576
|
+
query_params['token_id'] = token_id
|
|
2577
|
+
|
|
2578
|
+
|
|
2579
|
+
if exp_status is None:
|
|
2580
|
+
exp_status = [200]
|
|
2581
|
+
|
|
2582
|
+
resp = client.perform_call(
|
|
2583
|
+
leaf=call_leaf,
|
|
2584
|
+
method="GET",
|
|
2585
|
+
params=query_params if query_params else None,
|
|
2586
|
+
body=None,
|
|
2587
|
+
exp_status=exp_status,
|
|
2588
|
+
headers=header_params if header_params else None,
|
|
2589
|
+
context_msg=None,
|
|
2590
|
+
aspects=aspects,
|
|
2591
|
+
)
|
|
2592
|
+
raw_data = resp.json()
|
|
2593
|
+
items = [self._parse_item(item, OrganizationProgrammaticAccessGrant) for item in raw_data]
|
|
2594
|
+
rtnval = PagedList[OrganizationProgrammaticAccessGrant](items, dict(resp.headers), raw_data)
|
|
2595
|
+
return rtnval
|
|
2596
|
+
|
|
2597
|
+
def list_pending_invitations(self, org: str, *, per_page: Optional[int] = 30, page: Optional[int] = 1, role: Optional[str] = "all", invitation_source: Optional[str] = "all", exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[OrganizationInvitation]:
|
|
2598
|
+
"""
|
|
2599
|
+
List pending organization invitations
|
|
2600
|
+
|
|
2601
|
+
The return hash contains a `role` field which refers to the Organization
|
|
2602
|
+
Invitation role and will be one of the following values: `direct_member`, `admin`,
|
|
2603
|
+
`billing_manager`, or `hiring_manager`. If the invitee is not a GitHub
|
|
2604
|
+
member, the `login` field in the return hash will be `null`.
|
|
2605
|
+
"""
|
|
2606
|
+
client = self.client
|
|
2607
|
+
if aspects is None:
|
|
2608
|
+
aspects = client.aspects
|
|
2609
|
+
|
|
2610
|
+
header_params = client.headers
|
|
2611
|
+
if headers is not None:
|
|
2612
|
+
header_params = headers
|
|
2613
|
+
|
|
2614
|
+
leaf_template = "/orgs/{org}/invitations"
|
|
2615
|
+
path_params = {
|
|
2616
|
+
'org': org,
|
|
2617
|
+
}
|
|
2618
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2619
|
+
|
|
2620
|
+
query_params = {}
|
|
2621
|
+
if per_page is not None:
|
|
2622
|
+
query_params['per_page'] = per_page
|
|
2623
|
+
if page is not None:
|
|
2624
|
+
query_params['page'] = page
|
|
2625
|
+
if role is not None:
|
|
2626
|
+
query_params['role'] = role
|
|
2627
|
+
if invitation_source is not None:
|
|
2628
|
+
query_params['invitation_source'] = invitation_source
|
|
2629
|
+
|
|
2630
|
+
|
|
2631
|
+
if exp_status is None:
|
|
2632
|
+
exp_status = [200]
|
|
2633
|
+
|
|
2634
|
+
resp = client.perform_call(
|
|
2635
|
+
leaf=call_leaf,
|
|
2636
|
+
method="GET",
|
|
2637
|
+
params=query_params if query_params else None,
|
|
2638
|
+
body=None,
|
|
2639
|
+
exp_status=exp_status,
|
|
2640
|
+
headers=header_params if header_params else None,
|
|
2641
|
+
context_msg=None,
|
|
2642
|
+
aspects=aspects,
|
|
2643
|
+
)
|
|
2644
|
+
raw_data = resp.json()
|
|
2645
|
+
items = [self._parse_item(item, OrganizationInvitation) for item in raw_data]
|
|
2646
|
+
rtnval = PagedList[OrganizationInvitation](items, dict(resp.headers), raw_data)
|
|
2647
|
+
return rtnval
|
|
2648
|
+
|
|
2649
|
+
def list_public_members(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[SimpleUser]:
|
|
2650
|
+
"""
|
|
2651
|
+
List public organization members
|
|
2652
|
+
|
|
2653
|
+
Members of an organization can choose to have their membership publicized or not.
|
|
2654
|
+
"""
|
|
2655
|
+
client = self.client
|
|
2656
|
+
if aspects is None:
|
|
2657
|
+
aspects = client.aspects
|
|
2658
|
+
|
|
2659
|
+
header_params = client.headers
|
|
2660
|
+
if headers is not None:
|
|
2661
|
+
header_params = headers
|
|
2662
|
+
|
|
2663
|
+
leaf_template = "/orgs/{org}/public_members"
|
|
2664
|
+
path_params = {
|
|
2665
|
+
'org': org,
|
|
2666
|
+
}
|
|
2667
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2668
|
+
|
|
2669
|
+
query_params = {}
|
|
2670
|
+
if per_page is not None:
|
|
2671
|
+
query_params['per_page'] = per_page
|
|
2672
|
+
if page is not None:
|
|
2673
|
+
query_params['page'] = page
|
|
2674
|
+
|
|
2675
|
+
|
|
2676
|
+
if exp_status is None:
|
|
2677
|
+
exp_status = [200]
|
|
2678
|
+
|
|
2679
|
+
resp = client.perform_call(
|
|
2680
|
+
leaf=call_leaf,
|
|
2681
|
+
method="GET",
|
|
2682
|
+
params=query_params if query_params else None,
|
|
2683
|
+
body=None,
|
|
2684
|
+
exp_status=exp_status,
|
|
2685
|
+
headers=header_params if header_params else None,
|
|
2686
|
+
context_msg=None,
|
|
2687
|
+
aspects=aspects,
|
|
2688
|
+
)
|
|
2689
|
+
raw_data = resp.json()
|
|
2690
|
+
items = [self._parse_item(item, SimpleUser) for item in raw_data]
|
|
2691
|
+
rtnval = PagedList[SimpleUser](items, dict(resp.headers), raw_data)
|
|
2692
|
+
return rtnval
|
|
2693
|
+
|
|
2694
|
+
def list_security_manager_teams(self, org: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> List[TeamSimple]:
|
|
2695
|
+
"""
|
|
2696
|
+
List security manager teams
|
|
2697
|
+
|
|
2698
|
+
> [!WARNING]
|
|
2699
|
+
> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.
|
|
2700
|
+
"""
|
|
2701
|
+
client = self.client
|
|
2702
|
+
if aspects is None:
|
|
2703
|
+
aspects = client.aspects
|
|
2704
|
+
|
|
2705
|
+
header_params = client.headers
|
|
2706
|
+
if headers is not None:
|
|
2707
|
+
header_params = headers
|
|
2708
|
+
|
|
2709
|
+
leaf_template = "/orgs/{org}/security-managers"
|
|
2710
|
+
path_params = {
|
|
2711
|
+
'org': org,
|
|
2712
|
+
}
|
|
2713
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2714
|
+
|
|
2715
|
+
query_params = None
|
|
2716
|
+
|
|
2717
|
+
|
|
2718
|
+
if exp_status is None:
|
|
2719
|
+
exp_status = [200]
|
|
2720
|
+
|
|
2721
|
+
resp = client.perform_call(
|
|
2722
|
+
leaf=call_leaf,
|
|
2723
|
+
method="GET",
|
|
2724
|
+
params=query_params if query_params else None,
|
|
2725
|
+
body=None,
|
|
2726
|
+
exp_status=exp_status,
|
|
2727
|
+
headers=header_params if header_params else None,
|
|
2728
|
+
context_msg=None,
|
|
2729
|
+
aspects=aspects,
|
|
2730
|
+
)
|
|
2731
|
+
raw_data = resp.json()
|
|
2732
|
+
items = [self._parse_item(item, TeamSimple) for item in raw_data]
|
|
2733
|
+
return items
|
|
2734
|
+
|
|
2735
|
+
def list_webhook_deliveries(self, org: str, hook_id: int, *, per_page: Optional[int] = 30, cursor: Optional[str] = None, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> PagedList[HookDeliveryItem]:
|
|
2736
|
+
"""
|
|
2737
|
+
List deliveries for an organization webhook
|
|
2738
|
+
|
|
2739
|
+
Returns a list of webhook deliveries for a webhook configured in an organization.
|
|
2740
|
+
|
|
2741
|
+
You must be an organization owner to use this endpoint.
|
|
2742
|
+
|
|
2743
|
+
OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
|
|
2744
|
+
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
|
|
2745
|
+
"""
|
|
2746
|
+
client = self.client
|
|
2747
|
+
if aspects is None:
|
|
2748
|
+
aspects = client.aspects
|
|
2749
|
+
|
|
2750
|
+
header_params = client.headers
|
|
2751
|
+
if headers is not None:
|
|
2752
|
+
header_params = headers
|
|
2753
|
+
|
|
2754
|
+
leaf_template = "/orgs/{org}/hooks/{hook_id}/deliveries"
|
|
2755
|
+
path_params = {
|
|
2756
|
+
'org': org,
|
|
2757
|
+
'hook_id': hook_id,
|
|
2758
|
+
}
|
|
2759
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2760
|
+
|
|
2761
|
+
query_params = {}
|
|
2762
|
+
if per_page is not None:
|
|
2763
|
+
query_params['per_page'] = per_page
|
|
2764
|
+
if cursor is not None:
|
|
2765
|
+
query_params['cursor'] = cursor
|
|
2766
|
+
|
|
2767
|
+
|
|
2768
|
+
if exp_status is None:
|
|
2769
|
+
exp_status = [200]
|
|
2770
|
+
|
|
2771
|
+
resp = client.perform_call(
|
|
2772
|
+
leaf=call_leaf,
|
|
2773
|
+
method="GET",
|
|
2774
|
+
params=query_params if query_params else None,
|
|
2775
|
+
body=None,
|
|
2776
|
+
exp_status=exp_status,
|
|
2777
|
+
headers=header_params if header_params else None,
|
|
2778
|
+
context_msg=None,
|
|
2779
|
+
aspects=aspects,
|
|
2780
|
+
)
|
|
2781
|
+
raw_data = resp.json()
|
|
2782
|
+
items = [self._parse_item(item, HookDeliveryItem) for item in raw_data]
|
|
2783
|
+
rtnval = PagedList[HookDeliveryItem](items, dict(resp.headers), raw_data)
|
|
2784
|
+
return rtnval
|
|
2785
|
+
|
|
2786
|
+
def list_webhooks(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[OrgHook]:
|
|
2787
|
+
"""
|
|
2788
|
+
List organization webhooks
|
|
2789
|
+
|
|
2790
|
+
List webhooks for an organization.
|
|
2791
|
+
|
|
2792
|
+
The authenticated user must be an organization owner to use this endpoint.
|
|
2793
|
+
|
|
2794
|
+
OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
|
|
2795
|
+
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
|
|
2796
|
+
"""
|
|
2797
|
+
client = self.client
|
|
2798
|
+
if aspects is None:
|
|
2799
|
+
aspects = client.aspects
|
|
2800
|
+
|
|
2801
|
+
header_params = client.headers
|
|
2802
|
+
if headers is not None:
|
|
2803
|
+
header_params = headers
|
|
2804
|
+
|
|
2805
|
+
leaf_template = "/orgs/{org}/hooks"
|
|
2806
|
+
path_params = {
|
|
2807
|
+
'org': org,
|
|
2808
|
+
}
|
|
2809
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2810
|
+
|
|
2811
|
+
query_params = {}
|
|
2812
|
+
if per_page is not None:
|
|
2813
|
+
query_params['per_page'] = per_page
|
|
2814
|
+
if page is not None:
|
|
2815
|
+
query_params['page'] = page
|
|
2816
|
+
|
|
2817
|
+
|
|
2818
|
+
if exp_status is None:
|
|
2819
|
+
exp_status = [200]
|
|
2820
|
+
|
|
2821
|
+
resp = client.perform_call(
|
|
2822
|
+
leaf=call_leaf,
|
|
2823
|
+
method="GET",
|
|
2824
|
+
params=query_params if query_params else None,
|
|
2825
|
+
body=None,
|
|
2826
|
+
exp_status=exp_status,
|
|
2827
|
+
headers=header_params if header_params else None,
|
|
2828
|
+
context_msg=None,
|
|
2829
|
+
aspects=aspects,
|
|
2830
|
+
)
|
|
2831
|
+
raw_data = resp.json()
|
|
2832
|
+
items = [self._parse_item(item, OrgHook) for item in raw_data]
|
|
2833
|
+
rtnval = PagedList[OrgHook](items, dict(resp.headers), raw_data)
|
|
2834
|
+
return rtnval
|
|
2835
|
+
|
|
2836
|
+
def ping_webhook(self, org: str, hook_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
2837
|
+
"""
|
|
2838
|
+
Ping an organization webhook
|
|
2839
|
+
|
|
2840
|
+
This will trigger a [ping event](https://docs.github.com/webhooks/#ping-event)
|
|
2841
|
+
to be sent to the hook.
|
|
2842
|
+
|
|
2843
|
+
You must be an organization owner to use this endpoint.
|
|
2844
|
+
|
|
2845
|
+
OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
|
|
2846
|
+
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
|
|
2847
|
+
"""
|
|
2848
|
+
client = self.client
|
|
2849
|
+
if aspects is None:
|
|
2850
|
+
aspects = client.aspects
|
|
2851
|
+
|
|
2852
|
+
header_params = client.headers
|
|
2853
|
+
if headers is not None:
|
|
2854
|
+
header_params = headers
|
|
2855
|
+
|
|
2856
|
+
leaf_template = "/orgs/{org}/hooks/{hook_id}/pings"
|
|
2857
|
+
path_params = {
|
|
2858
|
+
'org': org,
|
|
2859
|
+
'hook_id': hook_id,
|
|
2860
|
+
}
|
|
2861
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2862
|
+
|
|
2863
|
+
query_params = None
|
|
2864
|
+
|
|
2865
|
+
|
|
2866
|
+
if exp_status is None:
|
|
2867
|
+
exp_status = [204]
|
|
2868
|
+
|
|
2869
|
+
resp = client.perform_call(
|
|
2870
|
+
leaf=call_leaf,
|
|
2871
|
+
method="POST",
|
|
2872
|
+
params=query_params if query_params else None,
|
|
2873
|
+
body=None,
|
|
2874
|
+
exp_status=exp_status,
|
|
2875
|
+
headers=header_params if header_params else None,
|
|
2876
|
+
context_msg=None,
|
|
2877
|
+
aspects=aspects,
|
|
2878
|
+
)
|
|
2879
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2880
|
+
rtnval = None
|
|
2881
|
+
else:
|
|
2882
|
+
rtnval = resp.json()
|
|
2883
|
+
return rtnval
|
|
2884
|
+
|
|
2885
|
+
def redeliver_webhook_delivery(self, org: str, hook_id: int, delivery_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
2886
|
+
"""
|
|
2887
|
+
Redeliver a delivery for an organization webhook
|
|
2888
|
+
|
|
2889
|
+
Redeliver a delivery for a webhook configured in an organization.
|
|
2890
|
+
|
|
2891
|
+
You must be an organization owner to use this endpoint.
|
|
2892
|
+
|
|
2893
|
+
OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
|
|
2894
|
+
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
|
|
2895
|
+
"""
|
|
2896
|
+
client = self.client
|
|
2897
|
+
if aspects is None:
|
|
2898
|
+
aspects = client.aspects
|
|
2899
|
+
|
|
2900
|
+
header_params = client.headers
|
|
2901
|
+
if headers is not None:
|
|
2902
|
+
header_params = headers
|
|
2903
|
+
|
|
2904
|
+
leaf_template = "/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"
|
|
2905
|
+
path_params = {
|
|
2906
|
+
'org': org,
|
|
2907
|
+
'hook_id': hook_id,
|
|
2908
|
+
'delivery_id': delivery_id,
|
|
2909
|
+
}
|
|
2910
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2911
|
+
|
|
2912
|
+
query_params = None
|
|
2913
|
+
|
|
2914
|
+
|
|
2915
|
+
if exp_status is None:
|
|
2916
|
+
exp_status = [202]
|
|
2917
|
+
|
|
2918
|
+
resp = client.perform_call(
|
|
2919
|
+
leaf=call_leaf,
|
|
2920
|
+
method="POST",
|
|
2921
|
+
params=query_params if query_params else None,
|
|
2922
|
+
body=None,
|
|
2923
|
+
exp_status=exp_status,
|
|
2924
|
+
headers=header_params if header_params else None,
|
|
2925
|
+
context_msg=None,
|
|
2926
|
+
aspects=aspects,
|
|
2927
|
+
)
|
|
2928
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2929
|
+
rtnval = None
|
|
2930
|
+
else:
|
|
2931
|
+
rtnval = resp.json()
|
|
2932
|
+
return rtnval
|
|
2933
|
+
|
|
2934
|
+
def remove_custom_property(self, org: str, custom_property_name: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
2935
|
+
"""
|
|
2936
|
+
Remove a custom property for an organization
|
|
2937
|
+
|
|
2938
|
+
Removes a custom property that is defined for an organization.
|
|
2939
|
+
|
|
2940
|
+
To use this endpoint, the authenticated user must be one of:
|
|
2941
|
+
- An administrator for the organization.
|
|
2942
|
+
- A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization.
|
|
2943
|
+
"""
|
|
2944
|
+
client = self.client
|
|
2945
|
+
if aspects is None:
|
|
2946
|
+
aspects = client.aspects
|
|
2947
|
+
|
|
2948
|
+
header_params = client.headers
|
|
2949
|
+
if headers is not None:
|
|
2950
|
+
header_params = headers
|
|
2951
|
+
|
|
2952
|
+
leaf_template = "/orgs/{org}/properties/schema/{custom_property_name}"
|
|
2953
|
+
path_params = {
|
|
2954
|
+
'org': org,
|
|
2955
|
+
'custom_property_name': custom_property_name,
|
|
2956
|
+
}
|
|
2957
|
+
call_leaf = leaf_template.format(**path_params)
|
|
2958
|
+
|
|
2959
|
+
query_params = None
|
|
2960
|
+
|
|
2961
|
+
|
|
2962
|
+
if exp_status is None:
|
|
2963
|
+
exp_status = [204]
|
|
2964
|
+
|
|
2965
|
+
resp = client.perform_call(
|
|
2966
|
+
leaf=call_leaf,
|
|
2967
|
+
method="DELETE",
|
|
2968
|
+
params=query_params if query_params else None,
|
|
2969
|
+
body=None,
|
|
2970
|
+
exp_status=exp_status,
|
|
2971
|
+
headers=header_params if header_params else None,
|
|
2972
|
+
context_msg=None,
|
|
2973
|
+
aspects=aspects,
|
|
2974
|
+
)
|
|
2975
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
2976
|
+
rtnval = None
|
|
2977
|
+
else:
|
|
2978
|
+
rtnval = resp.json()
|
|
2979
|
+
return rtnval
|
|
2980
|
+
|
|
2981
|
+
def remove_member(self, org: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
2982
|
+
"""
|
|
2983
|
+
Remove an organization member
|
|
2984
|
+
|
|
2985
|
+
Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.
|
|
2986
|
+
|
|
2987
|
+
> [!NOTE]
|
|
2988
|
+
> If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team.
|
|
2989
|
+
"""
|
|
2990
|
+
client = self.client
|
|
2991
|
+
if aspects is None:
|
|
2992
|
+
aspects = client.aspects
|
|
2993
|
+
|
|
2994
|
+
header_params = client.headers
|
|
2995
|
+
if headers is not None:
|
|
2996
|
+
header_params = headers
|
|
2997
|
+
|
|
2998
|
+
leaf_template = "/orgs/{org}/members/{username}"
|
|
2999
|
+
path_params = {
|
|
3000
|
+
'org': org,
|
|
3001
|
+
'username': username,
|
|
3002
|
+
}
|
|
3003
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3004
|
+
|
|
3005
|
+
query_params = None
|
|
3006
|
+
|
|
3007
|
+
|
|
3008
|
+
if exp_status is None:
|
|
3009
|
+
exp_status = [204]
|
|
3010
|
+
|
|
3011
|
+
resp = client.perform_call(
|
|
3012
|
+
leaf=call_leaf,
|
|
3013
|
+
method="DELETE",
|
|
3014
|
+
params=query_params if query_params else None,
|
|
3015
|
+
body=None,
|
|
3016
|
+
exp_status=exp_status,
|
|
3017
|
+
headers=header_params if header_params else None,
|
|
3018
|
+
context_msg=None,
|
|
3019
|
+
aspects=aspects,
|
|
3020
|
+
)
|
|
3021
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3022
|
+
rtnval = None
|
|
3023
|
+
else:
|
|
3024
|
+
rtnval = resp.json()
|
|
3025
|
+
return rtnval
|
|
3026
|
+
|
|
3027
|
+
def remove_membership_for_user(self, org: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3028
|
+
"""
|
|
3029
|
+
Remove organization membership for a user
|
|
3030
|
+
|
|
3031
|
+
In order to remove a user's membership with an organization, the authenticated user must be an organization owner.
|
|
3032
|
+
|
|
3033
|
+
If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases.
|
|
3034
|
+
|
|
3035
|
+
> [!NOTE]
|
|
3036
|
+
> If a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team.
|
|
3037
|
+
"""
|
|
3038
|
+
client = self.client
|
|
3039
|
+
if aspects is None:
|
|
3040
|
+
aspects = client.aspects
|
|
3041
|
+
|
|
3042
|
+
header_params = client.headers
|
|
3043
|
+
if headers is not None:
|
|
3044
|
+
header_params = headers
|
|
3045
|
+
|
|
3046
|
+
leaf_template = "/orgs/{org}/memberships/{username}"
|
|
3047
|
+
path_params = {
|
|
3048
|
+
'org': org,
|
|
3049
|
+
'username': username,
|
|
3050
|
+
}
|
|
3051
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3052
|
+
|
|
3053
|
+
query_params = None
|
|
3054
|
+
|
|
3055
|
+
|
|
3056
|
+
if exp_status is None:
|
|
3057
|
+
exp_status = [204]
|
|
3058
|
+
|
|
3059
|
+
resp = client.perform_call(
|
|
3060
|
+
leaf=call_leaf,
|
|
3061
|
+
method="DELETE",
|
|
3062
|
+
params=query_params if query_params else None,
|
|
3063
|
+
body=None,
|
|
3064
|
+
exp_status=exp_status,
|
|
3065
|
+
headers=header_params if header_params else None,
|
|
3066
|
+
context_msg=None,
|
|
3067
|
+
aspects=aspects,
|
|
3068
|
+
)
|
|
3069
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3070
|
+
rtnval = None
|
|
3071
|
+
else:
|
|
3072
|
+
rtnval = resp.json()
|
|
3073
|
+
return rtnval
|
|
3074
|
+
|
|
3075
|
+
def remove_outside_collaborator(self, org: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3076
|
+
"""
|
|
3077
|
+
Remove outside collaborator from an organization
|
|
3078
|
+
|
|
3079
|
+
Removing a user from this list will remove them from all the organization's repositories.
|
|
3080
|
+
"""
|
|
3081
|
+
client = self.client
|
|
3082
|
+
if aspects is None:
|
|
3083
|
+
aspects = client.aspects
|
|
3084
|
+
|
|
3085
|
+
header_params = client.headers
|
|
3086
|
+
if headers is not None:
|
|
3087
|
+
header_params = headers
|
|
3088
|
+
|
|
3089
|
+
leaf_template = "/orgs/{org}/outside_collaborators/{username}"
|
|
3090
|
+
path_params = {
|
|
3091
|
+
'org': org,
|
|
3092
|
+
'username': username,
|
|
3093
|
+
}
|
|
3094
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3095
|
+
|
|
3096
|
+
query_params = None
|
|
3097
|
+
|
|
3098
|
+
|
|
3099
|
+
if exp_status is None:
|
|
3100
|
+
exp_status = [204]
|
|
3101
|
+
|
|
3102
|
+
resp = client.perform_call(
|
|
3103
|
+
leaf=call_leaf,
|
|
3104
|
+
method="DELETE",
|
|
3105
|
+
params=query_params if query_params else None,
|
|
3106
|
+
body=None,
|
|
3107
|
+
exp_status=exp_status,
|
|
3108
|
+
headers=header_params if header_params else None,
|
|
3109
|
+
context_msg=None,
|
|
3110
|
+
aspects=aspects,
|
|
3111
|
+
)
|
|
3112
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3113
|
+
rtnval = None
|
|
3114
|
+
else:
|
|
3115
|
+
rtnval = resp.json()
|
|
3116
|
+
return rtnval
|
|
3117
|
+
|
|
3118
|
+
def remove_public_membership_for_authenticated_user(self, org: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3119
|
+
"""
|
|
3120
|
+
Remove public organization membership for the authenticated user
|
|
3121
|
+
|
|
3122
|
+
Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default.
|
|
3123
|
+
"""
|
|
3124
|
+
client = self.client
|
|
3125
|
+
if aspects is None:
|
|
3126
|
+
aspects = client.aspects
|
|
3127
|
+
|
|
3128
|
+
header_params = client.headers
|
|
3129
|
+
if headers is not None:
|
|
3130
|
+
header_params = headers
|
|
3131
|
+
|
|
3132
|
+
leaf_template = "/orgs/{org}/public_members/{username}"
|
|
3133
|
+
path_params = {
|
|
3134
|
+
'org': org,
|
|
3135
|
+
'username': username,
|
|
3136
|
+
}
|
|
3137
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3138
|
+
|
|
3139
|
+
query_params = None
|
|
3140
|
+
|
|
3141
|
+
|
|
3142
|
+
if exp_status is None:
|
|
3143
|
+
exp_status = [204]
|
|
3144
|
+
|
|
3145
|
+
resp = client.perform_call(
|
|
3146
|
+
leaf=call_leaf,
|
|
3147
|
+
method="DELETE",
|
|
3148
|
+
params=query_params if query_params else None,
|
|
3149
|
+
body=None,
|
|
3150
|
+
exp_status=exp_status,
|
|
3151
|
+
headers=header_params if header_params else None,
|
|
3152
|
+
context_msg=None,
|
|
3153
|
+
aspects=aspects,
|
|
3154
|
+
)
|
|
3155
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3156
|
+
rtnval = None
|
|
3157
|
+
else:
|
|
3158
|
+
rtnval = resp.json()
|
|
3159
|
+
return rtnval
|
|
3160
|
+
|
|
3161
|
+
def remove_security_manager_team(self, org: str, team_slug: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3162
|
+
"""
|
|
3163
|
+
Remove a security manager team
|
|
3164
|
+
|
|
3165
|
+
> [!WARNING]
|
|
3166
|
+
> **Closing down notice:** This operation is closing down and will be removed starting January 1, 2026. Please use the "[Organization Roles](https://docs.github.com/rest/orgs/organization-roles)" endpoints instead.
|
|
3167
|
+
"""
|
|
3168
|
+
client = self.client
|
|
3169
|
+
if aspects is None:
|
|
3170
|
+
aspects = client.aspects
|
|
3171
|
+
|
|
3172
|
+
header_params = client.headers
|
|
3173
|
+
if headers is not None:
|
|
3174
|
+
header_params = headers
|
|
3175
|
+
|
|
3176
|
+
leaf_template = "/orgs/{org}/security-managers/teams/{team_slug}"
|
|
3177
|
+
path_params = {
|
|
3178
|
+
'org': org,
|
|
3179
|
+
'team_slug': team_slug,
|
|
3180
|
+
}
|
|
3181
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3182
|
+
|
|
3183
|
+
query_params = None
|
|
3184
|
+
|
|
3185
|
+
|
|
3186
|
+
if exp_status is None:
|
|
3187
|
+
exp_status = [204]
|
|
3188
|
+
|
|
3189
|
+
resp = client.perform_call(
|
|
3190
|
+
leaf=call_leaf,
|
|
3191
|
+
method="DELETE",
|
|
3192
|
+
params=query_params if query_params else None,
|
|
3193
|
+
body=None,
|
|
3194
|
+
exp_status=exp_status,
|
|
3195
|
+
headers=header_params if header_params else None,
|
|
3196
|
+
context_msg=None,
|
|
3197
|
+
aspects=aspects,
|
|
3198
|
+
)
|
|
3199
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3200
|
+
rtnval = None
|
|
3201
|
+
else:
|
|
3202
|
+
rtnval = resp.json()
|
|
3203
|
+
return rtnval
|
|
3204
|
+
|
|
3205
|
+
def review_pat_grant_request(self, org: str, pat_request_id: int, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3206
|
+
"""
|
|
3207
|
+
Review a request to access organization resources with a fine-grained personal access token
|
|
3208
|
+
|
|
3209
|
+
Approves or denies a pending request to access organization resources via a fine-grained personal access token.
|
|
3210
|
+
|
|
3211
|
+
Only GitHub Apps can use this endpoint.
|
|
3212
|
+
"""
|
|
3213
|
+
client = self.client
|
|
3214
|
+
if aspects is None:
|
|
3215
|
+
aspects = client.aspects
|
|
3216
|
+
|
|
3217
|
+
header_params = client.headers
|
|
3218
|
+
if headers is not None:
|
|
3219
|
+
header_params = headers
|
|
3220
|
+
|
|
3221
|
+
leaf_template = "/orgs/{org}/personal-access-token-requests/{pat_request_id}"
|
|
3222
|
+
path_params = {
|
|
3223
|
+
'org': org,
|
|
3224
|
+
'pat_request_id': pat_request_id,
|
|
3225
|
+
}
|
|
3226
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3227
|
+
|
|
3228
|
+
query_params = None
|
|
3229
|
+
|
|
3230
|
+
|
|
3231
|
+
if exp_status is None:
|
|
3232
|
+
exp_status = [204]
|
|
3233
|
+
|
|
3234
|
+
resp = client.perform_call(
|
|
3235
|
+
leaf=call_leaf,
|
|
3236
|
+
method="POST",
|
|
3237
|
+
params=query_params if query_params else None,
|
|
3238
|
+
body=body,
|
|
3239
|
+
exp_status=exp_status,
|
|
3240
|
+
headers=header_params if header_params else None,
|
|
3241
|
+
context_msg=None,
|
|
3242
|
+
aspects=aspects,
|
|
3243
|
+
)
|
|
3244
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3245
|
+
rtnval = None
|
|
3246
|
+
else:
|
|
3247
|
+
rtnval = resp.json()
|
|
3248
|
+
return rtnval
|
|
3249
|
+
|
|
3250
|
+
def review_pat_grant_requests_in_bulk(self, org: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3251
|
+
"""
|
|
3252
|
+
Review requests to access organization resources with fine-grained personal access tokens
|
|
3253
|
+
|
|
3254
|
+
Approves or denies multiple pending requests to access organization resources via a fine-grained personal access token.
|
|
3255
|
+
|
|
3256
|
+
Only GitHub Apps can use this endpoint.
|
|
3257
|
+
"""
|
|
3258
|
+
client = self.client
|
|
3259
|
+
if aspects is None:
|
|
3260
|
+
aspects = client.aspects
|
|
3261
|
+
|
|
3262
|
+
header_params = client.headers
|
|
3263
|
+
if headers is not None:
|
|
3264
|
+
header_params = headers
|
|
3265
|
+
|
|
3266
|
+
leaf_template = "/orgs/{org}/personal-access-token-requests"
|
|
3267
|
+
path_params = {
|
|
3268
|
+
'org': org,
|
|
3269
|
+
}
|
|
3270
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3271
|
+
|
|
3272
|
+
query_params = None
|
|
3273
|
+
|
|
3274
|
+
|
|
3275
|
+
if exp_status is None:
|
|
3276
|
+
exp_status = [202]
|
|
3277
|
+
|
|
3278
|
+
resp = client.perform_call(
|
|
3279
|
+
leaf=call_leaf,
|
|
3280
|
+
method="POST",
|
|
3281
|
+
params=query_params if query_params else None,
|
|
3282
|
+
body=body,
|
|
3283
|
+
exp_status=exp_status,
|
|
3284
|
+
headers=header_params if header_params else None,
|
|
3285
|
+
context_msg=None,
|
|
3286
|
+
aspects=aspects,
|
|
3287
|
+
)
|
|
3288
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3289
|
+
rtnval = None
|
|
3290
|
+
else:
|
|
3291
|
+
rtnval = resp.json()
|
|
3292
|
+
return rtnval
|
|
3293
|
+
|
|
3294
|
+
def revoke_all_org_roles_team(self, org: str, team_slug: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3295
|
+
"""
|
|
3296
|
+
Remove all organization roles for a team
|
|
3297
|
+
|
|
3298
|
+
Removes all assigned organization roles from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
|
|
3299
|
+
|
|
3300
|
+
The authenticated user must be an administrator for the organization to use this endpoint.
|
|
3301
|
+
|
|
3302
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
|
|
3303
|
+
"""
|
|
3304
|
+
client = self.client
|
|
3305
|
+
if aspects is None:
|
|
3306
|
+
aspects = client.aspects
|
|
3307
|
+
|
|
3308
|
+
header_params = client.headers
|
|
3309
|
+
if headers is not None:
|
|
3310
|
+
header_params = headers
|
|
3311
|
+
|
|
3312
|
+
leaf_template = "/orgs/{org}/organization-roles/teams/{team_slug}"
|
|
3313
|
+
path_params = {
|
|
3314
|
+
'org': org,
|
|
3315
|
+
'team_slug': team_slug,
|
|
3316
|
+
}
|
|
3317
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3318
|
+
|
|
3319
|
+
query_params = None
|
|
3320
|
+
|
|
3321
|
+
|
|
3322
|
+
if exp_status is None:
|
|
3323
|
+
exp_status = [204]
|
|
3324
|
+
|
|
3325
|
+
resp = client.perform_call(
|
|
3326
|
+
leaf=call_leaf,
|
|
3327
|
+
method="DELETE",
|
|
3328
|
+
params=query_params if query_params else None,
|
|
3329
|
+
body=None,
|
|
3330
|
+
exp_status=exp_status,
|
|
3331
|
+
headers=header_params if header_params else None,
|
|
3332
|
+
context_msg=None,
|
|
3333
|
+
aspects=aspects,
|
|
3334
|
+
)
|
|
3335
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3336
|
+
rtnval = None
|
|
3337
|
+
else:
|
|
3338
|
+
rtnval = resp.json()
|
|
3339
|
+
return rtnval
|
|
3340
|
+
|
|
3341
|
+
def revoke_all_org_roles_user(self, org: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3342
|
+
"""
|
|
3343
|
+
Remove all organization roles for a user
|
|
3344
|
+
|
|
3345
|
+
Revokes all assigned organization roles from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
|
|
3346
|
+
|
|
3347
|
+
The authenticated user must be an administrator for the organization to use this endpoint.
|
|
3348
|
+
|
|
3349
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
|
|
3350
|
+
"""
|
|
3351
|
+
client = self.client
|
|
3352
|
+
if aspects is None:
|
|
3353
|
+
aspects = client.aspects
|
|
3354
|
+
|
|
3355
|
+
header_params = client.headers
|
|
3356
|
+
if headers is not None:
|
|
3357
|
+
header_params = headers
|
|
3358
|
+
|
|
3359
|
+
leaf_template = "/orgs/{org}/organization-roles/users/{username}"
|
|
3360
|
+
path_params = {
|
|
3361
|
+
'org': org,
|
|
3362
|
+
'username': username,
|
|
3363
|
+
}
|
|
3364
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3365
|
+
|
|
3366
|
+
query_params = None
|
|
3367
|
+
|
|
3368
|
+
|
|
3369
|
+
if exp_status is None:
|
|
3370
|
+
exp_status = [204]
|
|
3371
|
+
|
|
3372
|
+
resp = client.perform_call(
|
|
3373
|
+
leaf=call_leaf,
|
|
3374
|
+
method="DELETE",
|
|
3375
|
+
params=query_params if query_params else None,
|
|
3376
|
+
body=None,
|
|
3377
|
+
exp_status=exp_status,
|
|
3378
|
+
headers=header_params if header_params else None,
|
|
3379
|
+
context_msg=None,
|
|
3380
|
+
aspects=aspects,
|
|
3381
|
+
)
|
|
3382
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3383
|
+
rtnval = None
|
|
3384
|
+
else:
|
|
3385
|
+
rtnval = resp.json()
|
|
3386
|
+
return rtnval
|
|
3387
|
+
|
|
3388
|
+
def revoke_org_role_team(self, org: str, team_slug: str, role_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3389
|
+
"""
|
|
3390
|
+
Remove an organization role from a team
|
|
3391
|
+
|
|
3392
|
+
Removes an organization role from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
|
|
3393
|
+
|
|
3394
|
+
The authenticated user must be an administrator for the organization to use this endpoint.
|
|
3395
|
+
|
|
3396
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
|
|
3397
|
+
"""
|
|
3398
|
+
client = self.client
|
|
3399
|
+
if aspects is None:
|
|
3400
|
+
aspects = client.aspects
|
|
3401
|
+
|
|
3402
|
+
header_params = client.headers
|
|
3403
|
+
if headers is not None:
|
|
3404
|
+
header_params = headers
|
|
3405
|
+
|
|
3406
|
+
leaf_template = "/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"
|
|
3407
|
+
path_params = {
|
|
3408
|
+
'org': org,
|
|
3409
|
+
'team_slug': team_slug,
|
|
3410
|
+
'role_id': role_id,
|
|
3411
|
+
}
|
|
3412
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3413
|
+
|
|
3414
|
+
query_params = None
|
|
3415
|
+
|
|
3416
|
+
|
|
3417
|
+
if exp_status is None:
|
|
3418
|
+
exp_status = [204]
|
|
3419
|
+
|
|
3420
|
+
resp = client.perform_call(
|
|
3421
|
+
leaf=call_leaf,
|
|
3422
|
+
method="DELETE",
|
|
3423
|
+
params=query_params if query_params else None,
|
|
3424
|
+
body=None,
|
|
3425
|
+
exp_status=exp_status,
|
|
3426
|
+
headers=header_params if header_params else None,
|
|
3427
|
+
context_msg=None,
|
|
3428
|
+
aspects=aspects,
|
|
3429
|
+
)
|
|
3430
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3431
|
+
rtnval = None
|
|
3432
|
+
else:
|
|
3433
|
+
rtnval = resp.json()
|
|
3434
|
+
return rtnval
|
|
3435
|
+
|
|
3436
|
+
def revoke_org_role_user(self, org: str, username: str, role_id: int, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3437
|
+
"""
|
|
3438
|
+
Remove an organization role from a user
|
|
3439
|
+
|
|
3440
|
+
Remove an organization role from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."
|
|
3441
|
+
|
|
3442
|
+
The authenticated user must be an administrator for the organization to use this endpoint.
|
|
3443
|
+
|
|
3444
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
|
|
3445
|
+
"""
|
|
3446
|
+
client = self.client
|
|
3447
|
+
if aspects is None:
|
|
3448
|
+
aspects = client.aspects
|
|
3449
|
+
|
|
3450
|
+
header_params = client.headers
|
|
3451
|
+
if headers is not None:
|
|
3452
|
+
header_params = headers
|
|
3453
|
+
|
|
3454
|
+
leaf_template = "/orgs/{org}/organization-roles/users/{username}/{role_id}"
|
|
3455
|
+
path_params = {
|
|
3456
|
+
'org': org,
|
|
3457
|
+
'username': username,
|
|
3458
|
+
'role_id': role_id,
|
|
3459
|
+
}
|
|
3460
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3461
|
+
|
|
3462
|
+
query_params = None
|
|
3463
|
+
|
|
3464
|
+
|
|
3465
|
+
if exp_status is None:
|
|
3466
|
+
exp_status = [204]
|
|
3467
|
+
|
|
3468
|
+
resp = client.perform_call(
|
|
3469
|
+
leaf=call_leaf,
|
|
3470
|
+
method="DELETE",
|
|
3471
|
+
params=query_params if query_params else None,
|
|
3472
|
+
body=None,
|
|
3473
|
+
exp_status=exp_status,
|
|
3474
|
+
headers=header_params if header_params else None,
|
|
3475
|
+
context_msg=None,
|
|
3476
|
+
aspects=aspects,
|
|
3477
|
+
)
|
|
3478
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3479
|
+
rtnval = None
|
|
3480
|
+
else:
|
|
3481
|
+
rtnval = resp.json()
|
|
3482
|
+
return rtnval
|
|
3483
|
+
|
|
3484
|
+
def set_membership_for_user(self, org: str, username: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> OrgMembership:
|
|
3485
|
+
"""
|
|
3486
|
+
Set organization membership for a user
|
|
3487
|
+
|
|
3488
|
+
Only authenticated organization owners can add a member to the organization or update the member's role.
|
|
3489
|
+
|
|
3490
|
+
* If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user) will be `pending` until they accept the invitation.
|
|
3491
|
+
|
|
3492
|
+
* Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent.
|
|
3493
|
+
|
|
3494
|
+
**Rate limits**
|
|
3495
|
+
|
|
3496
|
+
To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period.
|
|
3497
|
+
"""
|
|
3498
|
+
client = self.client
|
|
3499
|
+
if aspects is None:
|
|
3500
|
+
aspects = client.aspects
|
|
3501
|
+
|
|
3502
|
+
header_params = client.headers
|
|
3503
|
+
if headers is not None:
|
|
3504
|
+
header_params = headers
|
|
3505
|
+
|
|
3506
|
+
leaf_template = "/orgs/{org}/memberships/{username}"
|
|
3507
|
+
path_params = {
|
|
3508
|
+
'org': org,
|
|
3509
|
+
'username': username,
|
|
3510
|
+
}
|
|
3511
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3512
|
+
|
|
3513
|
+
query_params = None
|
|
3514
|
+
|
|
3515
|
+
|
|
3516
|
+
if exp_status is None:
|
|
3517
|
+
exp_status = [200]
|
|
3518
|
+
|
|
3519
|
+
resp = client.perform_call(
|
|
3520
|
+
leaf=call_leaf,
|
|
3521
|
+
method="PUT",
|
|
3522
|
+
params=query_params if query_params else None,
|
|
3523
|
+
body=body,
|
|
3524
|
+
exp_status=exp_status,
|
|
3525
|
+
headers=header_params if header_params else None,
|
|
3526
|
+
context_msg=None,
|
|
3527
|
+
aspects=aspects,
|
|
3528
|
+
)
|
|
3529
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3530
|
+
rtnobj = None
|
|
3531
|
+
else:
|
|
3532
|
+
raw_data = resp.json()
|
|
3533
|
+
rtnobj = OrgMembership.from_dict(raw_data)
|
|
3534
|
+
return rtnobj
|
|
3535
|
+
|
|
3536
|
+
def set_public_membership_for_authenticated_user(self, org: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3537
|
+
"""
|
|
3538
|
+
Set public organization membership for the authenticated user
|
|
3539
|
+
|
|
3540
|
+
The user can publicize their own membership. (A user cannot publicize the membership for another user.)
|
|
3541
|
+
|
|
3542
|
+
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)."
|
|
3543
|
+
"""
|
|
3544
|
+
client = self.client
|
|
3545
|
+
if aspects is None:
|
|
3546
|
+
aspects = client.aspects
|
|
3547
|
+
|
|
3548
|
+
header_params = client.headers
|
|
3549
|
+
if headers is not None:
|
|
3550
|
+
header_params = headers
|
|
3551
|
+
|
|
3552
|
+
leaf_template = "/orgs/{org}/public_members/{username}"
|
|
3553
|
+
path_params = {
|
|
3554
|
+
'org': org,
|
|
3555
|
+
'username': username,
|
|
3556
|
+
}
|
|
3557
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3558
|
+
|
|
3559
|
+
query_params = None
|
|
3560
|
+
|
|
3561
|
+
|
|
3562
|
+
if exp_status is None:
|
|
3563
|
+
exp_status = [204]
|
|
3564
|
+
|
|
3565
|
+
resp = client.perform_call(
|
|
3566
|
+
leaf=call_leaf,
|
|
3567
|
+
method="PUT",
|
|
3568
|
+
params=query_params if query_params else None,
|
|
3569
|
+
body=None,
|
|
3570
|
+
exp_status=exp_status,
|
|
3571
|
+
headers=header_params if header_params else None,
|
|
3572
|
+
context_msg=None,
|
|
3573
|
+
aspects=aspects,
|
|
3574
|
+
)
|
|
3575
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3576
|
+
rtnval = None
|
|
3577
|
+
else:
|
|
3578
|
+
rtnval = resp.json()
|
|
3579
|
+
return rtnval
|
|
3580
|
+
|
|
3581
|
+
def unblock_user(self, org: str, username: str, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3582
|
+
"""
|
|
3583
|
+
Unblock a user from an organization
|
|
3584
|
+
|
|
3585
|
+
Unblocks the given user on behalf of the specified organization.
|
|
3586
|
+
"""
|
|
3587
|
+
client = self.client
|
|
3588
|
+
if aspects is None:
|
|
3589
|
+
aspects = client.aspects
|
|
3590
|
+
|
|
3591
|
+
header_params = client.headers
|
|
3592
|
+
if headers is not None:
|
|
3593
|
+
header_params = headers
|
|
3594
|
+
|
|
3595
|
+
leaf_template = "/orgs/{org}/blocks/{username}"
|
|
3596
|
+
path_params = {
|
|
3597
|
+
'org': org,
|
|
3598
|
+
'username': username,
|
|
3599
|
+
}
|
|
3600
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3601
|
+
|
|
3602
|
+
query_params = None
|
|
3603
|
+
|
|
3604
|
+
|
|
3605
|
+
if exp_status is None:
|
|
3606
|
+
exp_status = [204]
|
|
3607
|
+
|
|
3608
|
+
resp = client.perform_call(
|
|
3609
|
+
leaf=call_leaf,
|
|
3610
|
+
method="DELETE",
|
|
3611
|
+
params=query_params if query_params else None,
|
|
3612
|
+
body=None,
|
|
3613
|
+
exp_status=exp_status,
|
|
3614
|
+
headers=header_params if header_params else None,
|
|
3615
|
+
context_msg=None,
|
|
3616
|
+
aspects=aspects,
|
|
3617
|
+
)
|
|
3618
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3619
|
+
rtnval = None
|
|
3620
|
+
else:
|
|
3621
|
+
rtnval = resp.json()
|
|
3622
|
+
return rtnval
|
|
3623
|
+
|
|
3624
|
+
def update(self, org: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> OrganizationFull:
|
|
3625
|
+
"""
|
|
3626
|
+
Update an organization
|
|
3627
|
+
|
|
3628
|
+
> [!WARNING]
|
|
3629
|
+
> **Closing down notice:** GitHub will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes).
|
|
3630
|
+
|
|
3631
|
+
> [!WARNING]
|
|
3632
|
+
> **Closing down notice:** Code security product enablement for new repositories through the organization API is closing down. Please use [code security configurations](https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization) to set defaults instead. For more information on setting a default security configuration, see the [changelog](https://github.blog/changelog/2024-07-09-sunsetting-security-settings-defaults-parameters-in-the-organizations-rest-api/).
|
|
3633
|
+
|
|
3634
|
+
Updates the organization's profile and member privileges.
|
|
3635
|
+
|
|
3636
|
+
The authenticated user must be an organization owner to use this endpoint.
|
|
3637
|
+
|
|
3638
|
+
OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint.
|
|
3639
|
+
"""
|
|
3640
|
+
client = self.client
|
|
3641
|
+
if aspects is None:
|
|
3642
|
+
aspects = client.aspects
|
|
3643
|
+
|
|
3644
|
+
header_params = client.headers
|
|
3645
|
+
if headers is not None:
|
|
3646
|
+
header_params = headers
|
|
3647
|
+
|
|
3648
|
+
leaf_template = "/orgs/{org}"
|
|
3649
|
+
path_params = {
|
|
3650
|
+
'org': org,
|
|
3651
|
+
}
|
|
3652
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3653
|
+
|
|
3654
|
+
query_params = None
|
|
3655
|
+
|
|
3656
|
+
|
|
3657
|
+
if exp_status is None:
|
|
3658
|
+
exp_status = [200]
|
|
3659
|
+
|
|
3660
|
+
resp = client.perform_call(
|
|
3661
|
+
leaf=call_leaf,
|
|
3662
|
+
method="PATCH",
|
|
3663
|
+
params=query_params if query_params else None,
|
|
3664
|
+
body=body,
|
|
3665
|
+
exp_status=exp_status,
|
|
3666
|
+
headers=header_params if header_params else None,
|
|
3667
|
+
context_msg=None,
|
|
3668
|
+
aspects=aspects,
|
|
3669
|
+
)
|
|
3670
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3671
|
+
rtnobj = None
|
|
3672
|
+
else:
|
|
3673
|
+
raw_data = resp.json()
|
|
3674
|
+
rtnobj = OrganizationFull.from_dict(raw_data)
|
|
3675
|
+
return rtnobj
|
|
3676
|
+
|
|
3677
|
+
def update_issue_type(self, org: str, issue_type_id: int, body: OrganizationUpdateIssueType, *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> IssueType:
|
|
3678
|
+
"""
|
|
3679
|
+
Update issue type for an organization
|
|
3680
|
+
|
|
3681
|
+
Updates an issue type for an organization.
|
|
3682
|
+
|
|
3683
|
+
You can find out more about issue types in [Managing issue types in an organization](https://docs.github.com/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization).
|
|
3684
|
+
|
|
3685
|
+
To use this endpoint, the authenticated user must be an administrator for the organization. OAuth app tokens and
|
|
3686
|
+
personal access tokens (classic) need the `admin:org` scope to use this endpoint.
|
|
3687
|
+
"""
|
|
3688
|
+
client = self.client
|
|
3689
|
+
if aspects is None:
|
|
3690
|
+
aspects = client.aspects
|
|
3691
|
+
|
|
3692
|
+
header_params = client.headers
|
|
3693
|
+
if headers is not None:
|
|
3694
|
+
header_params = headers
|
|
3695
|
+
|
|
3696
|
+
leaf_template = "/orgs/{org}/issue-types/{issue_type_id}"
|
|
3697
|
+
path_params = {
|
|
3698
|
+
'org': org,
|
|
3699
|
+
'issue_type_id': issue_type_id,
|
|
3700
|
+
}
|
|
3701
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3702
|
+
|
|
3703
|
+
query_params = None
|
|
3704
|
+
|
|
3705
|
+
|
|
3706
|
+
if exp_status is None:
|
|
3707
|
+
exp_status = [200]
|
|
3708
|
+
|
|
3709
|
+
resp = client.perform_call(
|
|
3710
|
+
leaf=call_leaf,
|
|
3711
|
+
method="PUT",
|
|
3712
|
+
params=query_params if query_params else None,
|
|
3713
|
+
body=body,
|
|
3714
|
+
exp_status=exp_status,
|
|
3715
|
+
headers=header_params if header_params else None,
|
|
3716
|
+
context_msg=None,
|
|
3717
|
+
aspects=aspects,
|
|
3718
|
+
)
|
|
3719
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3720
|
+
rtnobj = None
|
|
3721
|
+
else:
|
|
3722
|
+
raw_data = resp.json()
|
|
3723
|
+
rtnobj = IssueType.from_dict(raw_data)
|
|
3724
|
+
return rtnobj
|
|
3725
|
+
|
|
3726
|
+
def update_membership_for_authenticated_user(self, org: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> OrgMembership:
|
|
3727
|
+
"""
|
|
3728
|
+
Update an organization membership for the authenticated user
|
|
3729
|
+
|
|
3730
|
+
Converts the authenticated user to an active member of the organization, if that user has a pending invitation from the organization.
|
|
3731
|
+
"""
|
|
3732
|
+
client = self.client
|
|
3733
|
+
if aspects is None:
|
|
3734
|
+
aspects = client.aspects
|
|
3735
|
+
|
|
3736
|
+
header_params = client.headers
|
|
3737
|
+
if headers is not None:
|
|
3738
|
+
header_params = headers
|
|
3739
|
+
|
|
3740
|
+
leaf_template = "/user/memberships/orgs/{org}"
|
|
3741
|
+
path_params = {
|
|
3742
|
+
'org': org,
|
|
3743
|
+
}
|
|
3744
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3745
|
+
|
|
3746
|
+
query_params = None
|
|
3747
|
+
|
|
3748
|
+
|
|
3749
|
+
if exp_status is None:
|
|
3750
|
+
exp_status = [200]
|
|
3751
|
+
|
|
3752
|
+
resp = client.perform_call(
|
|
3753
|
+
leaf=call_leaf,
|
|
3754
|
+
method="PATCH",
|
|
3755
|
+
params=query_params if query_params else None,
|
|
3756
|
+
body=body,
|
|
3757
|
+
exp_status=exp_status,
|
|
3758
|
+
headers=header_params if header_params else None,
|
|
3759
|
+
context_msg=None,
|
|
3760
|
+
aspects=aspects,
|
|
3761
|
+
)
|
|
3762
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3763
|
+
rtnobj = None
|
|
3764
|
+
else:
|
|
3765
|
+
raw_data = resp.json()
|
|
3766
|
+
rtnobj = OrgMembership.from_dict(raw_data)
|
|
3767
|
+
return rtnobj
|
|
3768
|
+
|
|
3769
|
+
def update_pat_access(self, org: str, pat_id: int, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3770
|
+
"""
|
|
3771
|
+
Update the access a fine-grained personal access token has to organization resources
|
|
3772
|
+
|
|
3773
|
+
Updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access.
|
|
3774
|
+
|
|
3775
|
+
Only GitHub Apps can use this endpoint.
|
|
3776
|
+
"""
|
|
3777
|
+
client = self.client
|
|
3778
|
+
if aspects is None:
|
|
3779
|
+
aspects = client.aspects
|
|
3780
|
+
|
|
3781
|
+
header_params = client.headers
|
|
3782
|
+
if headers is not None:
|
|
3783
|
+
header_params = headers
|
|
3784
|
+
|
|
3785
|
+
leaf_template = "/orgs/{org}/personal-access-tokens/{pat_id}"
|
|
3786
|
+
path_params = {
|
|
3787
|
+
'org': org,
|
|
3788
|
+
'pat_id': pat_id,
|
|
3789
|
+
}
|
|
3790
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3791
|
+
|
|
3792
|
+
query_params = None
|
|
3793
|
+
|
|
3794
|
+
|
|
3795
|
+
if exp_status is None:
|
|
3796
|
+
exp_status = [204]
|
|
3797
|
+
|
|
3798
|
+
resp = client.perform_call(
|
|
3799
|
+
leaf=call_leaf,
|
|
3800
|
+
method="POST",
|
|
3801
|
+
params=query_params if query_params else None,
|
|
3802
|
+
body=body,
|
|
3803
|
+
exp_status=exp_status,
|
|
3804
|
+
headers=header_params if header_params else None,
|
|
3805
|
+
context_msg=None,
|
|
3806
|
+
aspects=aspects,
|
|
3807
|
+
)
|
|
3808
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3809
|
+
rtnval = None
|
|
3810
|
+
else:
|
|
3811
|
+
rtnval = resp.json()
|
|
3812
|
+
return rtnval
|
|
3813
|
+
|
|
3814
|
+
def update_pat_accesses(self, org: str, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> Any:
|
|
3815
|
+
"""
|
|
3816
|
+
Update the access to organization resources via fine-grained personal access tokens
|
|
3817
|
+
|
|
3818
|
+
Updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access.
|
|
3819
|
+
|
|
3820
|
+
Only GitHub Apps can use this endpoint.
|
|
3821
|
+
"""
|
|
3822
|
+
client = self.client
|
|
3823
|
+
if aspects is None:
|
|
3824
|
+
aspects = client.aspects
|
|
3825
|
+
|
|
3826
|
+
header_params = client.headers
|
|
3827
|
+
if headers is not None:
|
|
3828
|
+
header_params = headers
|
|
3829
|
+
|
|
3830
|
+
leaf_template = "/orgs/{org}/personal-access-tokens"
|
|
3831
|
+
path_params = {
|
|
3832
|
+
'org': org,
|
|
3833
|
+
}
|
|
3834
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3835
|
+
|
|
3836
|
+
query_params = None
|
|
3837
|
+
|
|
3838
|
+
|
|
3839
|
+
if exp_status is None:
|
|
3840
|
+
exp_status = [202]
|
|
3841
|
+
|
|
3842
|
+
resp = client.perform_call(
|
|
3843
|
+
leaf=call_leaf,
|
|
3844
|
+
method="POST",
|
|
3845
|
+
params=query_params if query_params else None,
|
|
3846
|
+
body=body,
|
|
3847
|
+
exp_status=exp_status,
|
|
3848
|
+
headers=header_params if header_params else None,
|
|
3849
|
+
context_msg=None,
|
|
3850
|
+
aspects=aspects,
|
|
3851
|
+
)
|
|
3852
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3853
|
+
rtnval = None
|
|
3854
|
+
else:
|
|
3855
|
+
rtnval = resp.json()
|
|
3856
|
+
return rtnval
|
|
3857
|
+
|
|
3858
|
+
def update_webhook(self, org: str, hook_id: int, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> OrgHook:
|
|
3859
|
+
"""
|
|
3860
|
+
Update an organization webhook
|
|
3861
|
+
|
|
3862
|
+
Updates a webhook configured in an organization. When you update a webhook,
|
|
3863
|
+
the `secret` will be overwritten. If you previously had a `secret` set, you must
|
|
3864
|
+
provide the same `secret` or set a new `secret` or the secret will be removed. If
|
|
3865
|
+
you are only updating individual webhook `config` properties, use "[Update a webhook
|
|
3866
|
+
configuration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)".
|
|
3867
|
+
|
|
3868
|
+
You must be an organization owner to use this endpoint.
|
|
3869
|
+
|
|
3870
|
+
OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
|
|
3871
|
+
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
|
|
3872
|
+
"""
|
|
3873
|
+
client = self.client
|
|
3874
|
+
if aspects is None:
|
|
3875
|
+
aspects = client.aspects
|
|
3876
|
+
|
|
3877
|
+
header_params = client.headers
|
|
3878
|
+
if headers is not None:
|
|
3879
|
+
header_params = headers
|
|
3880
|
+
|
|
3881
|
+
leaf_template = "/orgs/{org}/hooks/{hook_id}"
|
|
3882
|
+
path_params = {
|
|
3883
|
+
'org': org,
|
|
3884
|
+
'hook_id': hook_id,
|
|
3885
|
+
}
|
|
3886
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3887
|
+
|
|
3888
|
+
query_params = None
|
|
3889
|
+
|
|
3890
|
+
|
|
3891
|
+
if exp_status is None:
|
|
3892
|
+
exp_status = [200]
|
|
3893
|
+
|
|
3894
|
+
resp = client.perform_call(
|
|
3895
|
+
leaf=call_leaf,
|
|
3896
|
+
method="PATCH",
|
|
3897
|
+
params=query_params if query_params else None,
|
|
3898
|
+
body=body,
|
|
3899
|
+
exp_status=exp_status,
|
|
3900
|
+
headers=header_params if header_params else None,
|
|
3901
|
+
context_msg=None,
|
|
3902
|
+
aspects=aspects,
|
|
3903
|
+
)
|
|
3904
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3905
|
+
rtnobj = None
|
|
3906
|
+
else:
|
|
3907
|
+
raw_data = resp.json()
|
|
3908
|
+
rtnobj = OrgHook.from_dict(raw_data)
|
|
3909
|
+
return rtnobj
|
|
3910
|
+
|
|
3911
|
+
def update_webhook_config_for_org(self, org: str, hook_id: int, body: Dict[str, Any], *, exp_status: Optional[List[int]] = None, headers: Optional[Dict[str, str]] = None, aspects: Optional[AspectsRest] = None) -> WebhookConfig:
|
|
3912
|
+
"""
|
|
3913
|
+
Update a webhook configuration for an organization
|
|
3914
|
+
|
|
3915
|
+
Updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)."
|
|
3916
|
+
|
|
3917
|
+
You must be an organization owner to use this endpoint.
|
|
3918
|
+
|
|
3919
|
+
OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or edit
|
|
3920
|
+
webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.
|
|
3921
|
+
"""
|
|
3922
|
+
client = self.client
|
|
3923
|
+
if aspects is None:
|
|
3924
|
+
aspects = client.aspects
|
|
3925
|
+
|
|
3926
|
+
header_params = client.headers
|
|
3927
|
+
if headers is not None:
|
|
3928
|
+
header_params = headers
|
|
3929
|
+
|
|
3930
|
+
leaf_template = "/orgs/{org}/hooks/{hook_id}/config"
|
|
3931
|
+
path_params = {
|
|
3932
|
+
'org': org,
|
|
3933
|
+
'hook_id': hook_id,
|
|
3934
|
+
}
|
|
3935
|
+
call_leaf = leaf_template.format(**path_params)
|
|
3936
|
+
|
|
3937
|
+
query_params = None
|
|
3938
|
+
|
|
3939
|
+
|
|
3940
|
+
if exp_status is None:
|
|
3941
|
+
exp_status = [200]
|
|
3942
|
+
|
|
3943
|
+
resp = client.perform_call(
|
|
3944
|
+
leaf=call_leaf,
|
|
3945
|
+
method="PATCH",
|
|
3946
|
+
params=query_params if query_params else None,
|
|
3947
|
+
body=body,
|
|
3948
|
+
exp_status=exp_status,
|
|
3949
|
+
headers=header_params if header_params else None,
|
|
3950
|
+
context_msg=None,
|
|
3951
|
+
aspects=aspects,
|
|
3952
|
+
)
|
|
3953
|
+
if resp.status_code in (204, 205) or (resp.status_code == 202 and len(resp.content) == 0):
|
|
3954
|
+
rtnobj = None
|
|
3955
|
+
else:
|
|
3956
|
+
raw_data = resp.json()
|
|
3957
|
+
rtnobj = WebhookConfig.from_dict(raw_data)
|
|
3958
|
+
return rtnobj
|