Adding feature for enterprise consumed license (#2626)

Co-authored-by: Enrico Minack <github@enrico.minack.dev>
This commit is contained in:
YugoHino
2023-08-17 21:21:20 +02:00
committed by GitHub
co-authored by Enrico Minack
parent eadc241e07
commit a7bfdf2d65
13 changed files with 560 additions and 3 deletions
+12
View File
@@ -28,6 +28,7 @@
# Copyright 2018 itsbruce <it.is.bruce@gmail.com> #
# Copyright 2019 Tomas Tomecek <tomas@tomecek.net> #
# Copyright 2019 Rigas Papathanasopoulos <rigaspapas@gmail.com> #
# Copyright 2023 Yugo Hino <henom06@gmail.com> #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
@@ -55,6 +56,7 @@ from typing import List
import urllib3
import github.ApplicationOAuth
import github.Enterprise
import github.Event
import github.Gist
import github.GithubObject
@@ -341,6 +343,16 @@ class Github:
url_parameters,
)
def get_enterprise(self, enterprise):
"""
:calls: `GET /enterprises/{enterprise} <https://docs.github.com/en/enterprise-cloud@latest/rest/enterprise-admin>`_
:param enterprise: string
:rtype: :class:`Enterprise`
"""
assert isinstance(enterprise, str), enterprise
# There is no native "/enterprises/{enterprise}" api, so this function is a hub for apis that start with "/enterprise/{enterprise}".
return github.Enterprise.Enterprise(self.__requester, enterprise)
def get_repo(self, full_name_or_id, lazy=False):
"""
:calls: `GET /repos/{owner}/{repo} <https://docs.github.com/en/rest/reference/repos>`_ or `GET /repositories/{id} <https://docs.github.com/en/rest/reference/repos>`_