Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: copilot seat details schema fixed #68

Merged
merged 3 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions githubkit/rest/code_scanning.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ def update_default_setup(
*,
data: Literal[UNSET] = UNSET,
headers: Optional[Dict[str, str]] = None,
state: Literal["configured", "not-configured"],
state: Missing[Literal["configured", "not-configured"]] = UNSET,
query_suite: Missing[Literal["default", "extended"]] = UNSET,
languages: Missing[
List[
Expand Down Expand Up @@ -911,7 +911,7 @@ async def async_update_default_setup(
*,
data: Literal[UNSET] = UNSET,
headers: Optional[Dict[str, str]] = None,
state: Literal["configured", "not-configured"],
state: Missing[Literal["configured", "not-configured"]] = UNSET,
query_suite: Missing[Literal["default", "extended"]] = UNSET,
languages: Missing[
List[
Expand Down
67 changes: 67 additions & 0 deletions githubkit/rest/codespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
OrgsOrgCodespacesSecretsGetResponse200,
ReposOwnerRepoCodespacesGetResponse200,
UserCodespacesSecretsSecretNamePutBody,
CodespacesPermissionsCheckForDevcontainer,
OrgsOrgCodespacesSecretsSecretNamePutBody,
ReposOwnerRepoCodespacesNewGetResponse200,
UserCodespacesCodespaceNamePublishPostBody,
Expand Down Expand Up @@ -1595,6 +1596,72 @@ async def async_pre_flight_with_repo_for_authenticated_user(
},
)

def check_permissions_for_devcontainer(
self,
owner: str,
repo: str,
ref: str,
devcontainer_path: str,
*,
headers: Optional[Dict[str, str]] = None,
) -> "Response[CodespacesPermissionsCheckForDevcontainer]":
url = f"/repos/{owner}/{repo}/codespaces/permissions_check"

params = {
"ref": ref,
"devcontainer_path": devcontainer_path,
}

headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}

return self._github.request(
"GET",
url,
params=exclude_unset(params),
headers=exclude_unset(headers),
response_model=CodespacesPermissionsCheckForDevcontainer,
error_models={
"401": BasicError,
"403": BasicError,
"404": BasicError,
"422": ValidationError,
"503": EnterprisesEnterpriseSecretScanningAlertsGetResponse503,
},
)

async def async_check_permissions_for_devcontainer(
self,
owner: str,
repo: str,
ref: str,
devcontainer_path: str,
*,
headers: Optional[Dict[str, str]] = None,
) -> "Response[CodespacesPermissionsCheckForDevcontainer]":
url = f"/repos/{owner}/{repo}/codespaces/permissions_check"

params = {
"ref": ref,
"devcontainer_path": devcontainer_path,
}

headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}

return await self._github.arequest(
"GET",
url,
params=exclude_unset(params),
headers=exclude_unset(headers),
response_model=CodespacesPermissionsCheckForDevcontainer,
error_models={
"401": BasicError,
"403": BasicError,
"404": BasicError,
"422": ValidationError,
"503": EnterprisesEnterpriseSecretScanningAlertsGetResponse503,
},
)

def list_repo_secrets(
self,
owner: str,
Expand Down
4 changes: 2 additions & 2 deletions githubkit/rest/copilot.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ async def async_cancel_copilot_seat_assignment_for_users(
},
)

def get_copilot_seat_assignment_details_for_user(
def get_copilot_seat_details_for_user(
self,
org: str,
username: str,
Expand All @@ -626,7 +626,7 @@ def get_copilot_seat_assignment_details_for_user(
},
)

async def async_get_copilot_seat_assignment_details_for_user(
async def async_get_copilot_seat_details_for_user(
self,
org: str,
username: str,
Expand Down
6 changes: 6 additions & 0 deletions githubkit/rest/licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ def get_for_repo(
url,
headers=exclude_unset(headers),
response_model=LicenseContent,
error_models={
"404": BasicError,
},
)

async def async_get_for_repo(
Expand All @@ -155,4 +158,7 @@ async def async_get_for_repo(
url,
headers=exclude_unset(headers),
response_model=LicenseContent,
error_models={
"404": BasicError,
},
)
Loading