diff --git a/codegen/parser/data.py b/codegen/parser/data.py index 8c94cd15c..db3ea7189 100644 --- a/codegen/parser/data.py +++ b/codegen/parser/data.py @@ -62,6 +62,7 @@ class RequestBodyData: type: Literal["form", "json", "file", "raw"] body_schema: SchemaData + content_type: str | None = None required: bool = False @property diff --git a/codegen/parser/endpoints/request_body.py b/codegen/parser/endpoints/request_body.py index 86d4ffbfa..48b431e3a 100644 --- a/codegen/parser/endpoints/request_body.py +++ b/codegen/parser/endpoints/request_body.py @@ -10,6 +10,13 @@ from ...source import Source +DEFAULT_JSON_CONTENT_TYPE = "application/json" +DEFAULT_FORM_CONTENT_TYPE = "application/x-www-form-urlencoded" +DEFAULT_MULTIPART_CONTENT_TYPE = "multipart/form-data" +DEFAULT_TEXT_CONTENT_TYPE = "text/plain" +DEFAULT_BINARY_CONTENT_TYPE = "application/octet-stream" + + def build_request_body(source: "Source", prefix: str) -> RequestBodyData: data = type_ref_from_source(source, oas.RequestBody) @@ -19,53 +26,78 @@ def build_request_body(source: "Source", prefix: str) -> RequestBodyData: media_types = list(data.content.keys()) if json_types := [type for type in media_types if "json" in type]: - json_type = json_types[0] + json_type = ( + DEFAULT_JSON_CONTENT_TYPE + if DEFAULT_JSON_CONTENT_TYPE in json_types + else json_types[0] + ) return RequestBodyData( type="json", body_schema=parse_schema( source / "content" / json_type / "schema", concat_snake_name(prefix, "body"), ), + content_type=json_type, required=data.required, ) - elif form_types := [type for type in media_types if "form" in type]: - form_type = form_types[0] + elif file_types := [type for type in media_types if "multipart" in type]: + file_type = ( + DEFAULT_MULTIPART_CONTENT_TYPE + if DEFAULT_MULTIPART_CONTENT_TYPE in file_types + else file_types[0] + ) return RequestBodyData( - type="form", + type="file", body_schema=parse_schema( - source / "content" / form_type / "schema", + source / "content" / file_type / "schema", concat_snake_name(prefix, "body"), ), + content_type=file_type, required=data.required, ) - elif file_types := [type for type in media_types if "multipart" in type]: - file_type = file_types[0] + elif form_types := [type for type in media_types if "form" in type]: + form_type = ( + DEFAULT_FORM_CONTENT_TYPE + if DEFAULT_FORM_CONTENT_TYPE in form_types + else form_types[0] + ) return RequestBodyData( - type="file", + type="form", body_schema=parse_schema( - source / "content" / file_type / "schema", + source / "content" / form_type / "schema", concat_snake_name(prefix, "body"), ), + content_type=form_type, required=data.required, ) elif text_types := [type for type in media_types if "text" in type]: - text_type = text_types[0] + text_type = ( + DEFAULT_TEXT_CONTENT_TYPE + if DEFAULT_TEXT_CONTENT_TYPE in text_types + else text_types[0] + ) return RequestBodyData( type="raw", body_schema=parse_schema( source / "content" / text_type / "schema", concat_snake_name(prefix, "body"), ), + content_type=text_type, required=data.required, ) elif binary_types := [type for type in media_types if "octet-stream" in type]: - binary_type = binary_types[0] + binary_type = ( + DEFAULT_BINARY_CONTENT_TYPE + if DEFAULT_BINARY_CONTENT_TYPE in binary_types + else binary_types[0] + ) return RequestBodyData( type="raw", body_schema=parse_schema( source / "content" / binary_type / "schema", concat_snake_name(prefix, "body"), ), + content_type=binary_type, required=data.required, ) elif "*/*" in media_types: @@ -75,6 +107,7 @@ def build_request_body(source: "Source", prefix: str) -> RequestBodyData: source / "content" / "*/*" / "schema", concat_snake_name(prefix, "body"), ), + content_type=None, required=data.required, ) diff --git a/codegen/templates/rest/_request.py.jinja b/codegen/templates/rest/_request.py.jinja index e8bb5ed20..cea4ff758 100644 --- a/codegen/templates/rest/_request.py.jinja +++ b/codegen/templates/rest/_request.py.jinja @@ -20,11 +20,14 @@ params = { {% endif %} {% endmacro %} -{% macro build_header(params) %} +{% macro build_header(params, request_body) %} headers = { {% for param in params %} "{{ param.name }}": {{ param.prop_name }}, {% endfor %} + {% if request_body and request_body.content_type %} + "Content-Type": "{{ request_body.content_type }}", + {% endif %} "X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {}) } @@ -79,7 +82,7 @@ if self._github.config.rest_api_body_validation: {{ build_path(endpoint) }} {{ build_query(endpoint.query_params) }} -{{ build_header(endpoint.header_params) }} +{{ build_header(endpoint.header_params, endpoint.request_body) }} {{ build_cookie(endpoint.cookie_params) }} {% if endpoint.request_body %} {{ build_body(endpoint.request_body) }} diff --git a/githubkit/versions/ghec_v2022_11_28/rest/actions.py b/githubkit/versions/ghec_v2022_11_28/rest/actions.py index 0e58cd0b3..26068e33c 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/actions.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/actions.py @@ -215,7 +215,11 @@ def set_actions_oidc_custom_issuer_policy_for_enterprise( url = f"/enterprises/{enterprise}/actions/oidc/customization/issuer" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -264,7 +268,11 @@ async def async_set_actions_oidc_custom_issuer_policy_for_enterprise( url = f"/enterprises/{enterprise}/actions/oidc/customization/issuer" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -356,7 +364,11 @@ def set_github_actions_default_workflow_permissions_enterprise( url = f"/enterprises/{enterprise}/actions/permissions/workflow" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -404,7 +416,11 @@ async def async_set_github_actions_default_workflow_permissions_enterprise( url = f"/enterprises/{enterprise}/actions/permissions/workflow" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -465,7 +481,11 @@ def generate_runner_jitconfig_for_enterprise( url = f"/enterprises/{enterprise}/actions/runners/generate-jitconfig" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -533,7 +553,11 @@ async def async_generate_runner_jitconfig_for_enterprise( url = f"/enterprises/{enterprise}/actions/runners/generate-jitconfig" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -730,7 +754,11 @@ def set_github_actions_permissions_organization( url = f"/orgs/{org}/actions/permissions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -778,7 +806,11 @@ async def async_set_github_actions_permissions_organization( url = f"/orgs/{org}/actions/permissions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -883,7 +915,11 @@ def set_selected_repositories_enabled_github_actions_organization( url = f"/orgs/{org}/actions/permissions/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -932,7 +968,11 @@ async def async_set_selected_repositories_enabled_github_actions_organization( url = f"/orgs/{org}/actions/permissions/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1101,7 +1141,11 @@ def set_allowed_actions_organization( url = f"/orgs/{org}/actions/permissions/selected-actions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1150,7 +1194,11 @@ async def async_set_allowed_actions_organization( url = f"/orgs/{org}/actions/permissions/selected-actions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1240,7 +1288,11 @@ def set_github_actions_default_workflow_permissions_organization( url = f"/orgs/{org}/actions/permissions/workflow" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1289,7 +1341,11 @@ async def async_set_github_actions_default_workflow_permissions_organization( url = f"/orgs/{org}/actions/permissions/workflow" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1405,7 +1461,11 @@ def create_self_hosted_runner_group_for_org( url = f"/orgs/{org}/actions/runner-groups" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1459,7 +1519,11 @@ async def async_create_self_hosted_runner_group_for_org( url = f"/orgs/{org}/actions/runner-groups" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1599,7 +1663,11 @@ def update_self_hosted_runner_group_for_org( url = f"/orgs/{org}/actions/runner-groups/{runner_group_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1659,7 +1727,11 @@ async def async_update_self_hosted_runner_group_for_org( url = f"/orgs/{org}/actions/runner-groups/{runner_group_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1778,7 +1850,11 @@ def set_repo_access_to_self_hosted_runner_group_in_org( url = f"/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1832,7 +1908,11 @@ async def async_set_repo_access_to_self_hosted_runner_group_in_org( url = f"/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2030,7 +2110,11 @@ def set_self_hosted_runners_in_group_for_org( url = f"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2084,7 +2168,11 @@ async def async_set_self_hosted_runners_in_group_for_org( url = f"/orgs/{org}/actions/runner-groups/{runner_group_id}/runners" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2333,7 +2421,11 @@ def generate_runner_jitconfig_for_org( url = f"/orgs/{org}/actions/runners/generate-jitconfig" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2399,7 +2491,11 @@ async def async_generate_runner_jitconfig_for_org( url = f"/orgs/{org}/actions/runners/generate-jitconfig" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2683,7 +2779,11 @@ def set_custom_labels_for_self_hosted_runner_for_org( url = f"/orgs/{org}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2745,7 +2845,11 @@ async def async_set_custom_labels_for_self_hosted_runner_for_org( url = f"/orgs/{org}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2807,7 +2911,11 @@ def add_custom_labels_to_self_hosted_runner_for_org( url = f"/orgs/{org}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2869,7 +2977,11 @@ async def async_add_custom_labels_to_self_hosted_runner_for_org( url = f"/orgs/{org}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3191,7 +3303,11 @@ def create_or_update_org_secret( url = f"/orgs/{org}/actions/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3245,7 +3361,11 @@ async def async_create_or_update_org_secret( url = f"/orgs/{org}/actions/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3394,7 +3514,11 @@ def set_selected_repos_for_org_secret( url = f"/orgs/{org}/actions/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3446,7 +3570,11 @@ async def async_set_selected_repos_for_org_secret( url = f"/orgs/{org}/actions/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3640,7 +3768,11 @@ def create_org_variable( url = f"/orgs/{org}/actions/variables" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3691,7 +3823,11 @@ async def async_create_org_variable( url = f"/orgs/{org}/actions/variables" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3826,7 +3962,11 @@ def update_org_variable( url = f"/orgs/{org}/actions/variables/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3878,7 +4018,11 @@ async def async_update_org_variable( url = f"/orgs/{org}/actions/variables/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3990,7 +4134,11 @@ def set_selected_repos_for_org_variable( url = f"/orgs/{org}/actions/variables/{name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4043,7 +4191,11 @@ async def async_set_selected_repos_for_org_variable( url = f"/orgs/{org}/actions/variables/{name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4705,7 +4857,11 @@ def re_run_job_for_workflow_run( url = f"/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4774,7 +4930,11 @@ async def async_re_run_job_for_workflow_run( url = f"/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4888,7 +5048,11 @@ def set_custom_oidc_sub_claim_for_repo( url = f"/repos/{owner}/{repo}/actions/oidc/customization/sub" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4952,7 +5116,11 @@ async def async_set_custom_oidc_sub_claim_for_repo( url = f"/repos/{owner}/{repo}/actions/oidc/customization/sub" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5175,7 +5343,11 @@ def set_github_actions_permissions_repository( url = f"/repos/{owner}/{repo}/actions/permissions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5226,7 +5398,11 @@ async def async_set_github_actions_permissions_repository( url = f"/repos/{owner}/{repo}/actions/permissions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5320,7 +5496,11 @@ def set_workflow_access_to_repository( url = f"/repos/{owner}/{repo}/actions/permissions/access" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5370,7 +5550,11 @@ async def async_set_workflow_access_to_repository( url = f"/repos/{owner}/{repo}/actions/permissions/access" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5466,7 +5650,11 @@ def set_allowed_actions_repository( url = f"/repos/{owner}/{repo}/actions/permissions/selected-actions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5518,7 +5706,11 @@ async def async_set_allowed_actions_repository( url = f"/repos/{owner}/{repo}/actions/permissions/selected-actions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5613,7 +5805,11 @@ def set_github_actions_default_workflow_permissions_repository( url = f"/repos/{owner}/{repo}/actions/permissions/workflow" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5665,7 +5861,11 @@ async def async_set_github_actions_default_workflow_permissions_repository( url = f"/repos/{owner}/{repo}/actions/permissions/workflow" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5842,7 +6042,11 @@ def generate_runner_jitconfig_for_repo( url = f"/repos/{owner}/{repo}/actions/runners/generate-jitconfig" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5913,7 +6117,11 @@ async def async_generate_runner_jitconfig_for_repo( url = f"/repos/{owner}/{repo}/actions/runners/generate-jitconfig" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6210,7 +6418,11 @@ def set_custom_labels_for_self_hosted_runner_for_repo( url = f"/repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6275,7 +6487,11 @@ async def async_set_custom_labels_for_self_hosted_runner_for_repo( url = f"/repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6340,7 +6556,11 @@ def add_custom_labels_to_self_hosted_runner_for_repo( url = f"/repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6405,7 +6625,11 @@ async def async_add_custom_labels_to_self_hosted_runner_for_repo( url = f"/repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7241,7 +7465,11 @@ def review_custom_gates_for_run( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7323,7 +7551,11 @@ async def async_review_custom_gates_for_run( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7648,7 +7880,11 @@ def review_pending_deployments_for_run( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7713,7 +7949,11 @@ async def async_review_pending_deployments_for_run( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7775,7 +8015,11 @@ def re_run_workflow( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/rerun" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7837,7 +8081,11 @@ async def async_re_run_workflow( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/rerun" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7902,7 +8150,11 @@ def re_run_workflow_failed_jobs( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7967,7 +8219,11 @@ async def async_re_run_workflow_failed_jobs( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8220,7 +8476,11 @@ def create_or_update_repo_secret( url = f"/repos/{owner}/{repo}/actions/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8277,7 +8537,11 @@ async def async_create_or_update_repo_secret( url = f"/repos/{owner}/{repo}/actions/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8431,7 +8695,11 @@ def create_repo_variable( url = f"/repos/{owner}/{repo}/actions/variables" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8483,7 +8751,11 @@ async def async_create_repo_variable( url = f"/repos/{owner}/{repo}/actions/variables" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8623,7 +8895,11 @@ def update_repo_variable( url = f"/repos/{owner}/{repo}/actions/variables/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8678,7 +8954,11 @@ async def async_update_repo_variable( url = f"/repos/{owner}/{repo}/actions/variables/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8884,7 +9164,11 @@ def create_workflow_dispatch( url = f"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8944,7 +9228,11 @@ async def async_create_workflow_dispatch( url = f"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9386,7 +9674,11 @@ def create_or_update_environment_secret( url = f"/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9451,7 +9743,11 @@ async def async_create_or_update_environment_secret( url = f"/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9621,7 +9917,11 @@ def create_environment_variable( url = f"/repos/{owner}/{repo}/environments/{environment_name}/variables" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9683,7 +9983,11 @@ async def async_create_environment_variable( url = f"/repos/{owner}/{repo}/environments/{environment_name}/variables" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9836,7 +10140,11 @@ def update_environment_variable( url = f"/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9898,7 +10206,11 @@ async def async_update_environment_variable( url = f"/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/activity.py b/githubkit/versions/ghec_v2022_11_28/rest/activity.py index e52db8b9b..c65b44434 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/activity.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/activity.py @@ -373,7 +373,11 @@ def mark_notifications_as_read( url = "/notifications" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -427,7 +431,11 @@ async def async_mark_notifications_as_read( url = "/notifications" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -665,7 +673,11 @@ def set_thread_subscription( url = f"/notifications/threads/{thread_id}/subscription" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -723,7 +735,11 @@ async def async_set_thread_subscription( url = f"/notifications/threads/{thread_id}/subscription" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1037,7 +1053,11 @@ def mark_repo_notifications_as_read( url = f"/repos/{owner}/{repo}/notifications" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1091,7 +1111,11 @@ async def async_mark_repo_notifications_as_read( url = f"/repos/{owner}/{repo}/notifications" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1327,7 +1351,11 @@ def set_repo_subscription( url = f"/repos/{owner}/{repo}/subscription" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1379,7 +1407,11 @@ async def async_set_repo_subscription( url = f"/repos/{owner}/{repo}/subscription" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/apps.py b/githubkit/versions/ghec_v2022_11_28/rest/apps.py index bfc0cd59b..43208b99e 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/apps.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/apps.py @@ -247,7 +247,11 @@ def update_webhook_config_for_app( url = "/app/hook/config" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -295,7 +299,11 @@ async def async_update_webhook_config_for_app( url = "/app/hook/config" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -758,7 +766,11 @@ def create_installation_access_token( url = f"/app/installations/{installation_id}/access_tokens" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -821,7 +833,11 @@ async def async_create_installation_access_token( url = f"/app/installations/{installation_id}/access_tokens" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -969,7 +985,11 @@ def delete_authorization( url = f"/applications/{client_id}/grant" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1019,7 +1039,11 @@ async def async_delete_authorization( url = f"/applications/{client_id}/grant" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1074,7 +1098,11 @@ def check_token( url = f"/applications/{client_id}/token" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1131,7 +1159,11 @@ async def async_check_token( url = f"/applications/{client_id}/token" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1183,7 +1215,11 @@ def delete_token( url = f"/applications/{client_id}/token" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1233,7 +1269,11 @@ async def async_delete_token( url = f"/applications/{client_id}/token" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1287,7 +1327,11 @@ def reset_token( url = f"/applications/{client_id}/token" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1342,7 +1386,11 @@ async def async_reset_token( url = f"/applications/{client_id}/token" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1403,7 +1451,11 @@ def scope_token( url = f"/applications/{client_id}/token/scoped" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1467,7 +1519,11 @@ async def async_scope_token( url = f"/applications/{client_id}/token/scoped" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/billing.py b/githubkit/versions/ghec_v2022_11_28/rest/billing.py index 82702e9fa..8cb2eec7d 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/billing.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/billing.py @@ -268,7 +268,11 @@ def add_resource_to_cost_center( url = f"/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -342,7 +346,11 @@ async def async_add_resource_to_cost_center( url = f"/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -416,7 +424,11 @@ def remove_resource_from_cost_center( url = f"/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -489,7 +501,11 @@ async def async_remove_resource_from_cost_center( url = f"/enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/checks.py b/githubkit/versions/ghec_v2022_11_28/rest/checks.py index 8a2767fb6..9bbc79bf3 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/checks.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/checks.py @@ -172,7 +172,11 @@ def create( url = f"/repos/{owner}/{repo}/check-runs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -298,7 +302,11 @@ async def async_create( url = f"/repos/{owner}/{repo}/check-runs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -474,7 +482,11 @@ def update( url = f"/repos/{owner}/{repo}/check-runs/{check_run_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -604,7 +616,11 @@ async def async_update( url = f"/repos/{owner}/{repo}/check-runs/{check_run_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -783,7 +799,11 @@ def create_suite( url = f"/repos/{owner}/{repo}/check-suites" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -834,7 +854,11 @@ async def async_create_suite( url = f"/repos/{owner}/{repo}/check-suites" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -892,7 +916,11 @@ def set_suites_preferences( url = f"/repos/{owner}/{repo}/check-suites/preferences" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -952,7 +980,11 @@ async def async_set_suites_preferences( url = f"/repos/{owner}/{repo}/check-suites/preferences" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/code_scanning.py b/githubkit/versions/ghec_v2022_11_28/rest/code_scanning.py index eaa66d326..4a9927eac 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/code_scanning.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/code_scanning.py @@ -517,7 +517,11 @@ def update_alert( url = f"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -587,7 +591,11 @@ async def async_update_alert( url = f"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1178,7 +1186,11 @@ def create_variant_analysis( url = f"/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1300,7 +1312,11 @@ async def async_create_variant_analysis( url = f"/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1573,7 +1589,11 @@ def update_default_setup( url = f"/repos/{owner}/{repo}/code-scanning/default-setup" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1650,7 +1670,11 @@ async def async_update_default_setup( url = f"/repos/{owner}/{repo}/code-scanning/default-setup" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1718,7 +1742,11 @@ def upload_sarif( url = f"/repos/{owner}/{repo}/code-scanning/sarifs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1785,7 +1813,11 @@ async def async_upload_sarif( url = f"/repos/{owner}/{repo}/code-scanning/sarifs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/code_security.py b/githubkit/versions/ghec_v2022_11_28/rest/code_security.py index 1ccca6598..502bb445d 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/code_security.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/code_security.py @@ -204,7 +204,11 @@ def create_configuration( url = f"/orgs/{org}/code-security/configurations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -285,7 +289,11 @@ async def async_create_configuration( url = f"/orgs/{org}/code-security/configurations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -390,7 +398,11 @@ def detach_configuration( url = f"/orgs/{org}/code-security/configurations/detach" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -448,7 +460,11 @@ async def async_detach_configuration( url = f"/orgs/{org}/code-security/configurations/detach" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -647,7 +663,11 @@ def update_configuration( url = f"/orgs/{org}/code-security/configurations/{configuration_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -735,7 +755,11 @@ async def async_update_configuration( url = f"/orgs/{org}/code-security/configurations/{configuration_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -794,7 +818,11 @@ def attach_configuration( url = f"/orgs/{org}/code-security/configurations/{configuration_id}/attach" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -853,7 +881,11 @@ async def async_attach_configuration( url = f"/orgs/{org}/code-security/configurations/{configuration_id}/attach" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -920,7 +952,11 @@ def set_configuration_as_default( url = f"/orgs/{org}/code-security/configurations/{configuration_id}/defaults" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -991,7 +1027,11 @@ async def async_set_configuration_as_default( url = f"/orgs/{org}/code-security/configurations/{configuration_id}/defaults" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/codespaces.py b/githubkit/versions/ghec_v2022_11_28/rest/codespaces.py index c90a0441c..4cc96c17e 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/codespaces.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/codespaces.py @@ -195,7 +195,11 @@ def set_codespaces_access( url = f"/orgs/{org}/codespaces/access" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -253,7 +257,11 @@ async def async_set_codespaces_access( url = f"/orgs/{org}/codespaces/access" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -309,7 +317,11 @@ def set_codespaces_access_users( url = f"/orgs/{org}/codespaces/access/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -367,7 +379,11 @@ async def async_set_codespaces_access_users( url = f"/orgs/{org}/codespaces/access/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -425,7 +441,11 @@ def delete_codespaces_access_users( url = f"/orgs/{org}/codespaces/access/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -483,7 +503,11 @@ async def async_delete_codespaces_access_users( url = f"/orgs/{org}/codespaces/access/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -692,7 +716,11 @@ def create_or_update_org_secret( url = f"/orgs/{org}/codespaces/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -755,7 +783,11 @@ async def async_create_or_update_org_secret( url = f"/orgs/{org}/codespaces/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -935,7 +967,11 @@ def set_selected_repos_for_org_secret( url = f"/orgs/{org}/codespaces/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -995,7 +1031,11 @@ async def async_set_selected_repos_for_org_secret( url = f"/orgs/{org}/codespaces/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1447,7 +1487,11 @@ def create_with_repo_for_authenticated_user( url = f"/repos/{owner}/{repo}/codespaces" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1526,7 +1570,11 @@ async def async_create_with_repo_for_authenticated_user( url = f"/repos/{owner}/{repo}/codespaces" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2053,7 +2101,11 @@ def create_or_update_repo_secret( url = f"/repos/{owner}/{repo}/codespaces/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2113,7 +2165,11 @@ async def async_create_or_update_repo_secret( url = f"/repos/{owner}/{repo}/codespaces/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2229,7 +2285,11 @@ def create_with_pr_for_authenticated_user( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/codespaces" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2311,7 +2371,11 @@ async def async_create_with_pr_for_authenticated_user( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/codespaces" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2476,7 +2540,11 @@ def create_for_authenticated_user( url = "/user/codespaces" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2569,7 +2637,11 @@ async def async_create_for_authenticated_user( url = "/user/codespaces" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2770,7 +2842,11 @@ def create_or_update_secret_for_authenticated_user( url = f"/user/codespaces/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2829,7 +2905,11 @@ async def async_create_or_update_secret_for_authenticated_user( url = f"/user/codespaces/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2980,7 +3060,11 @@ def set_repositories_for_secret_for_authenticated_user( url = f"/user/codespaces/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3038,7 +3122,11 @@ async def async_set_repositories_for_secret_for_authenticated_user( url = f"/user/codespaces/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3317,7 +3405,11 @@ def update_for_authenticated_user( url = f"/user/codespaces/{codespace_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3372,7 +3464,11 @@ async def async_update_for_authenticated_user( url = f"/user/codespaces/{codespace_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3597,7 +3693,11 @@ def publish_for_authenticated_user( url = f"/user/codespaces/{codespace_name}/publish" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3659,7 +3759,11 @@ async def async_publish_for_authenticated_user( url = f"/user/codespaces/{codespace_name}/publish" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/copilot.py b/githubkit/versions/ghec_v2022_11_28/rest/copilot.py index ba041431d..52b3faccd 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/copilot.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/copilot.py @@ -463,7 +463,11 @@ def add_copilot_seats_for_teams( url = f"/orgs/{org}/copilot/billing/selected_teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -523,7 +527,11 @@ async def async_add_copilot_seats_for_teams( url = f"/orgs/{org}/copilot/billing/selected_teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -583,7 +591,11 @@ def cancel_copilot_seat_assignment_for_teams( url = f"/orgs/{org}/copilot/billing/selected_teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -643,7 +655,11 @@ async def async_cancel_copilot_seat_assignment_for_teams( url = f"/orgs/{org}/copilot/billing/selected_teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -703,7 +719,11 @@ def add_copilot_seats_for_users( url = f"/orgs/{org}/copilot/billing/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -763,7 +783,11 @@ async def async_add_copilot_seats_for_users( url = f"/orgs/{org}/copilot/billing/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -823,7 +847,11 @@ def cancel_copilot_seat_assignment_for_users( url = f"/orgs/{org}/copilot/billing/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -883,7 +911,11 @@ async def async_cancel_copilot_seat_assignment_for_users( url = f"/orgs/{org}/copilot/billing/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/dependabot.py b/githubkit/versions/ghec_v2022_11_28/rest/dependabot.py index 7fa8b24d1..5b061813c 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/dependabot.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/dependabot.py @@ -485,7 +485,11 @@ def create_or_update_org_secret( url = f"/orgs/{org}/dependabot/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -539,7 +543,11 @@ async def async_create_or_update_org_secret( url = f"/orgs/{org}/dependabot/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -694,7 +702,11 @@ def set_selected_repos_for_org_secret( url = f"/orgs/{org}/dependabot/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -748,7 +760,11 @@ async def async_set_selected_repos_for_org_secret( url = f"/orgs/{org}/dependabot/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1088,7 +1104,11 @@ def update_alert( url = f"/repos/{owner}/{repo}/dependabot/alerts/{alert_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1166,7 +1186,11 @@ async def async_update_alert( url = f"/repos/{owner}/{repo}/dependabot/alerts/{alert_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1383,7 +1407,11 @@ def create_or_update_repo_secret( url = f"/repos/{owner}/{repo}/dependabot/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1443,7 +1471,11 @@ async def async_create_or_update_repo_secret( url = f"/repos/{owner}/{repo}/dependabot/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/dependency_graph.py b/githubkit/versions/ghec_v2022_11_28/rest/dependency_graph.py index c84408994..19e779e23 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/dependency_graph.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/dependency_graph.py @@ -224,7 +224,11 @@ def create_repository_snapshot( url = f"/repos/{owner}/{repo}/dependency-graph/snapshots" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -285,7 +289,11 @@ async def async_create_repository_snapshot( url = f"/repos/{owner}/{repo}/dependency-graph/snapshots" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/enterprise_admin.py b/githubkit/versions/ghec_v2022_11_28/rest/enterprise_admin.py index 9496361a0..a9951534f 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/enterprise_admin.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/enterprise_admin.py @@ -165,7 +165,11 @@ def set_github_actions_permissions_enterprise( url = f"/enterprises/{enterprise}/actions/permissions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -215,7 +219,11 @@ async def async_set_github_actions_permissions_enterprise( url = f"/enterprises/{enterprise}/actions/permissions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -328,7 +336,11 @@ def set_selected_organizations_enabled_github_actions_enterprise( url = f"/enterprises/{enterprise}/actions/permissions/organizations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -379,7 +391,11 @@ async def async_set_selected_organizations_enabled_github_actions_enterprise( url = f"/enterprises/{enterprise}/actions/permissions/organizations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -548,7 +564,11 @@ def set_allowed_actions_enterprise( url = f"/enterprises/{enterprise}/actions/permissions/selected-actions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -597,7 +617,11 @@ async def async_set_allowed_actions_enterprise( url = f"/enterprises/{enterprise}/actions/permissions/selected-actions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -715,7 +739,11 @@ def create_self_hosted_runner_group_for_enterprise( url = f"/enterprises/{enterprise}/actions/runner-groups" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -774,7 +802,11 @@ async def async_create_self_hosted_runner_group_for_enterprise( url = f"/enterprises/{enterprise}/actions/runner-groups" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -920,7 +952,11 @@ def update_self_hosted_runner_group_for_enterprise( url = f"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -984,7 +1020,11 @@ async def async_update_self_hosted_runner_group_for_enterprise( url = f"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1109,7 +1149,11 @@ def set_org_access_to_self_hosted_runner_group_in_enterprise( url = f"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1166,7 +1210,11 @@ async def async_set_org_access_to_self_hosted_runner_group_in_enterprise( url = f"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1377,7 +1425,11 @@ def set_self_hosted_runners_in_group_for_enterprise( f"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners" ) - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1436,7 +1488,11 @@ async def async_set_self_hosted_runners_in_group_for_enterprise( f"/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners" ) - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1906,7 +1962,11 @@ def set_custom_labels_for_self_hosted_runner_for_enterprise( url = f"/enterprises/{enterprise}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1970,7 +2030,11 @@ async def async_set_custom_labels_for_self_hosted_runner_for_enterprise( url = f"/enterprises/{enterprise}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2034,7 +2098,11 @@ def add_custom_labels_to_self_hosted_runner_for_enterprise( url = f"/enterprises/{enterprise}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2098,7 +2166,11 @@ async def async_add_custom_labels_to_self_hosted_runner_for_enterprise( url = f"/enterprises/{enterprise}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2353,7 +2425,11 @@ def set_announcement_banner_for_enterprise( url = f"/enterprises/{enterprise}/announcement" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2402,7 +2478,11 @@ async def async_set_announcement_banner_for_enterprise( url = f"/enterprises/{enterprise}/announcement" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2597,7 +2677,11 @@ def patch_security_analysis_settings_for_enterprise( url = f"/enterprises/{enterprise}/code_security_and_analysis" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2666,7 +2750,11 @@ async def async_patch_security_analysis_settings_for_enterprise( url = f"/enterprises/{enterprise}/code_security_and_analysis" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2961,7 +3049,11 @@ def provision_enterprise_group( url = f"/scim/v2/enterprises/{enterprise}/Groups" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3017,7 +3109,11 @@ async def async_provision_enterprise_group( url = f"/scim/v2/enterprises/{enterprise}/Groups" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3144,7 +3240,11 @@ def set_information_for_provisioned_enterprise_group( url = f"/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3204,7 +3304,11 @@ async def async_set_information_for_provisioned_enterprise_group( url = f"/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3316,7 +3420,11 @@ def update_attribute_for_enterprise_group( url = f"/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3373,7 +3481,11 @@ async def async_update_attribute_for_enterprise_group( url = f"/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3505,7 +3617,11 @@ def provision_enterprise_user( url = f"/scim/v2/enterprises/{enterprise}/Users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3565,7 +3681,11 @@ async def async_provision_enterprise_user( url = f"/scim/v2/enterprises/{enterprise}/Users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3684,7 +3804,11 @@ def set_information_for_provisioned_enterprise_user( url = f"/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3748,7 +3872,11 @@ async def async_set_information_for_provisioned_enterprise_user( url = f"/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3865,7 +3993,11 @@ def update_attribute_for_enterprise_user( url = f"/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3928,7 +4060,11 @@ async def async_update_attribute_for_enterprise_user( url = f"/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/gists.py b/githubkit/versions/ghec_v2022_11_28/rest/gists.py index ee8c24318..33ce043cb 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/gists.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/gists.py @@ -152,7 +152,11 @@ def create( url = "/gists" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -201,7 +205,11 @@ async def async_create( url = "/gists" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -504,7 +512,11 @@ def update( url = f"/gists/{gist_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -564,7 +576,11 @@ async def async_update( url = f"/gists/{gist_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -686,7 +702,11 @@ def create_comment( url = f"/gists/{gist_id}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -738,7 +758,11 @@ async def async_create_comment( url = f"/gists/{gist_id}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -899,7 +923,11 @@ def update_comment( url = f"/gists/{gist_id}/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -957,7 +985,11 @@ async def async_update_comment( url = f"/gists/{gist_id}/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/git.py b/githubkit/versions/ghec_v2022_11_28/rest/git.py index 69783395c..73031da76 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/git.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/git.py @@ -101,7 +101,11 @@ def create_blob( url = f"/repos/{owner}/{repo}/git/blobs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -167,7 +171,11 @@ async def async_create_blob( url = f"/repos/{owner}/{repo}/git/blobs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -292,7 +300,11 @@ def create_commit( url = f"/repos/{owner}/{repo}/git/commits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -358,7 +370,11 @@ async def async_create_commit( url = f"/repos/{owner}/{repo}/git/commits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -584,7 +600,11 @@ def create_ref( url = f"/repos/{owner}/{repo}/git/refs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -645,7 +665,11 @@ async def async_create_ref( url = f"/repos/{owner}/{repo}/git/refs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -761,7 +785,11 @@ def update_ref( url = f"/repos/{owner}/{repo}/git/refs/{ref}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -825,7 +853,11 @@ async def async_update_ref( url = f"/repos/{owner}/{repo}/git/refs/{ref}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -889,7 +921,11 @@ def create_tag( url = f"/repos/{owner}/{repo}/git/tags" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -953,7 +989,11 @@ async def async_create_tag( url = f"/repos/{owner}/{repo}/git/tags" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1068,7 +1108,11 @@ def create_tree( url = f"/repos/{owner}/{repo}/git/trees" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1131,7 +1175,11 @@ async def async_create_tree( url = f"/repos/{owner}/{repo}/git/trees" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/interactions.py b/githubkit/versions/ghec_v2022_11_28/rest/interactions.py index d8ca75646..d598b7edc 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/interactions.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/interactions.py @@ -146,7 +146,11 @@ def set_restrictions_for_org( url = f"/orgs/{org}/interaction-limits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -200,7 +204,11 @@ async def async_set_restrictions_for_org( url = f"/orgs/{org}/interaction-limits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -363,7 +371,11 @@ def set_restrictions_for_repo( url = f"/repos/{owner}/{repo}/interaction-limits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -418,7 +430,11 @@ async def async_set_restrictions_for_repo( url = f"/repos/{owner}/{repo}/interaction-limits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -562,7 +578,11 @@ def set_restrictions_for_authenticated_user( url = "/user/interaction-limits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -610,7 +630,11 @@ async def async_set_restrictions_for_authenticated_user( url = "/user/interaction-limits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/issues.py b/githubkit/versions/ghec_v2022_11_28/rest/issues.py index 4b010cfb4..49836847c 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/issues.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/issues.py @@ -585,7 +585,11 @@ def create( url = f"/repos/{owner}/{repo}/issues" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -657,7 +661,11 @@ async def async_create( url = f"/repos/{owner}/{repo}/issues" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -899,7 +907,11 @@ def update_comment( url = f"/repos/{owner}/{repo}/issues/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -962,7 +974,11 @@ async def async_update_comment( url = f"/repos/{owner}/{repo}/issues/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1223,7 +1239,11 @@ def update( url = f"/repos/{owner}/{repo}/issues/{issue_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1306,7 +1326,11 @@ async def async_update( url = f"/repos/{owner}/{repo}/issues/{issue_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1367,7 +1391,11 @@ def add_assignees( url = f"/repos/{owner}/{repo}/issues/{issue_number}/assignees" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1423,7 +1451,11 @@ async def async_add_assignees( url = f"/repos/{owner}/{repo}/issues/{issue_number}/assignees" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1479,7 +1511,11 @@ def remove_assignees( url = f"/repos/{owner}/{repo}/issues/{issue_number}/assignees" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1535,7 +1571,11 @@ async def async_remove_assignees( url = f"/repos/{owner}/{repo}/issues/{issue_number}/assignees" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1726,7 +1766,11 @@ def create_comment( url = f"/repos/{owner}/{repo}/issues/{issue_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1793,7 +1837,11 @@ async def async_create_comment( url = f"/repos/{owner}/{repo}/issues/{issue_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2152,7 +2200,11 @@ def set_labels( url = f"/repos/{owner}/{repo}/issues/{issue_number}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2264,7 +2316,11 @@ async def async_set_labels( url = f"/repos/{owner}/{repo}/issues/{issue_number}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2376,7 +2432,11 @@ def add_labels( url = f"/repos/{owner}/{repo}/issues/{issue_number}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2488,7 +2548,11 @@ async def async_add_labels( url = f"/repos/{owner}/{repo}/issues/{issue_number}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2683,7 +2747,11 @@ def lock( url = f"/repos/{owner}/{repo}/issues/{issue_number}/lock" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2756,7 +2824,11 @@ async def async_lock( url = f"/repos/{owner}/{repo}/issues/{issue_number}/lock" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3169,7 +3241,11 @@ def create_label( url = f"/repos/{owner}/{repo}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3231,7 +3307,11 @@ async def async_create_label( url = f"/repos/{owner}/{repo}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3383,7 +3463,11 @@ def update_label( url = f"/repos/{owner}/{repo}/labels/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3439,7 +3523,11 @@ async def async_update_label( url = f"/repos/{owner}/{repo}/labels/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3580,7 +3668,11 @@ def create_milestone( url = f"/repos/{owner}/{repo}/milestones" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3643,7 +3735,11 @@ async def async_create_milestone( url = f"/repos/{owner}/{repo}/milestones" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3806,7 +3902,11 @@ def update_milestone( url = f"/repos/{owner}/{repo}/milestones/{milestone_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3865,7 +3965,11 @@ async def async_update_milestone( url = f"/repos/{owner}/{repo}/milestones/{milestone_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/markdown.py b/githubkit/versions/ghec_v2022_11_28/rest/markdown.py index f5002027e..b168bd6dc 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/markdown.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/markdown.py @@ -73,7 +73,11 @@ def render( url = "/markdown" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -117,7 +121,11 @@ async def async_render( url = "/markdown" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -142,7 +150,11 @@ def render_raw( url = "/markdown/raw" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "text/plain", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } content = data @@ -164,7 +176,11 @@ async def async_render_raw( url = "/markdown/raw" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "text/plain", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } content = data diff --git a/githubkit/versions/ghec_v2022_11_28/rest/migrations.py b/githubkit/versions/ghec_v2022_11_28/rest/migrations.py index 545f3b184..366847ca4 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/migrations.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/migrations.py @@ -170,7 +170,11 @@ def start_for_org( url = f"/orgs/{org}/migrations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -235,7 +239,11 @@ async def async_start_for_org( url = f"/orgs/{org}/migrations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -629,7 +637,11 @@ def start_import( url = f"/repos/{owner}/{repo}/import" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -694,7 +706,11 @@ async def async_start_import( url = f"/repos/{owner}/{repo}/import" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -803,7 +819,11 @@ def update_import( url = f"/repos/{owner}/{repo}/import" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -864,7 +884,11 @@ async def async_update_import( url = f"/repos/{owner}/{repo}/import" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -997,7 +1021,11 @@ def map_commit_author( url = f"/repos/{owner}/{repo}/import/authors/{author_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1064,7 +1092,11 @@ async def async_map_commit_author( url = f"/repos/{owner}/{repo}/import/authors/{author_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1181,7 +1213,11 @@ def set_lfs_preference( url = f"/repos/{owner}/{repo}/import/lfs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1241,7 +1277,11 @@ async def async_set_lfs_preference( url = f"/repos/{owner}/{repo}/import/lfs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1371,7 +1411,11 @@ def start_for_authenticated_user( url = "/user/migrations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1434,7 +1478,11 @@ async def async_start_for_authenticated_user( url = "/user/migrations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/oidc.py b/githubkit/versions/ghec_v2022_11_28/rest/oidc.py index 96077e682..644322239 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/oidc.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/oidc.py @@ -118,7 +118,11 @@ def update_oidc_custom_sub_template_for_org( url = f"/orgs/{org}/actions/oidc/customization/sub" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -170,7 +174,11 @@ async def async_update_oidc_custom_sub_template_for_org( url = f"/orgs/{org}/actions/oidc/customization/sub" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/orgs.py b/githubkit/versions/ghec_v2022_11_28/rest/orgs.py index b36b6f396..cbbd37a5b 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/orgs.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/orgs.py @@ -387,7 +387,11 @@ def update( url = f"/orgs/{org}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -482,7 +486,11 @@ async def async_update( url = f"/orgs/{org}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -613,7 +621,11 @@ def set_announcement_banner_for_org( url = f"/orgs/{org}/announcement" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -662,7 +674,11 @@ async def async_set_announcement_banner_for_org( url = f"/orgs/{org}/announcement" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1212,7 +1228,11 @@ def create_custom_repo_role( url = f"/orgs/{org}/custom-repository-roles" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1274,7 +1294,11 @@ async def async_create_custom_repo_role( url = f"/orgs/{org}/custom-repository-roles" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1427,7 +1451,11 @@ def update_custom_repo_role( url = f"/orgs/{org}/custom-repository-roles/{role_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1492,7 +1520,11 @@ async def async_update_custom_repo_role( url = f"/orgs/{org}/custom-repository-roles/{role_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1554,7 +1586,11 @@ def create_custom_role( url = f"/orgs/{org}/custom_roles" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1616,7 +1652,11 @@ async def async_create_custom_role( url = f"/orgs/{org}/custom_roles" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1769,7 +1809,11 @@ def update_custom_role( url = f"/orgs/{org}/custom_roles/{role_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1834,7 +1878,11 @@ async def async_update_custom_role( url = f"/orgs/{org}/custom_roles/{role_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2073,7 +2121,11 @@ def create_webhook( url = f"/orgs/{org}/hooks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2128,7 +2180,11 @@ async def async_create_webhook( url = f"/orgs/{org}/hooks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2289,7 +2345,11 @@ def update_webhook( url = f"/orgs/{org}/hooks/{hook_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2352,7 +2412,11 @@ async def async_update_webhook( url = f"/orgs/{org}/hooks/{hook_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2454,7 +2518,11 @@ def update_webhook_config_for_org( url = f"/orgs/{org}/hooks/{hook_id}/config" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2508,7 +2576,11 @@ async def async_update_webhook_config_for_org( url = f"/orgs/{org}/hooks/{hook_id}/config" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2948,7 +3020,11 @@ def create_invitation( url = f"/orgs/{org}/invitations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3010,7 +3086,11 @@ async def async_create_invitation( url = f"/orgs/{org}/invitations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3406,7 +3486,11 @@ def set_membership_for_user( url = f"/orgs/{org}/memberships/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3466,7 +3550,11 @@ async def async_set_membership_for_user( url = f"/orgs/{org}/memberships/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3698,7 +3786,11 @@ def create_custom_organization_role( url = f"/orgs/{org}/organization-roles" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3763,7 +3855,11 @@ async def async_create_custom_organization_role( url = f"/orgs/{org}/organization-roles" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4161,7 +4257,11 @@ def patch_custom_organization_role( url = f"/orgs/{org}/organization-roles/{role_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4229,7 +4329,11 @@ async def async_patch_custom_organization_role( url = f"/orgs/{org}/organization-roles/{role_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4489,7 +4593,11 @@ def convert_member_to_outside_collaborator( url = f"/orgs/{org}/outside_collaborators/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4549,7 +4657,11 @@ async def async_convert_member_to_outside_collaborator( url = f"/orgs/{org}/outside_collaborators/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4767,7 +4879,11 @@ def review_pat_grant_requests_in_bulk( url = f"/orgs/{org}/personal-access-token-requests" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4830,7 +4946,11 @@ async def async_review_pat_grant_requests_in_bulk( url = f"/orgs/{org}/personal-access-token-requests" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4896,7 +5016,11 @@ def review_pat_grant_request( url = f"/orgs/{org}/personal-access-token-requests/{pat_request_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4961,7 +5085,11 @@ async def async_review_pat_grant_request( url = f"/orgs/{org}/personal-access-token-requests/{pat_request_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5210,7 +5338,11 @@ def update_pat_accesses( url = f"/orgs/{org}/personal-access-tokens" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5270,7 +5402,11 @@ async def async_update_pat_accesses( url = f"/orgs/{org}/personal-access-tokens" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5331,7 +5467,11 @@ def update_pat_access( url = f"/orgs/{org}/personal-access-tokens/{pat_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5391,7 +5531,11 @@ async def async_update_pat_access( url = f"/orgs/{org}/personal-access-tokens/{pat_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5578,7 +5722,11 @@ def create_or_update_custom_properties( url = f"/orgs/{org}/properties/schema" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5636,7 +5784,11 @@ async def async_create_or_update_custom_properties( url = f"/orgs/{org}/properties/schema" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5751,7 +5903,11 @@ def create_or_update_custom_property( url = f"/orgs/{org}/properties/schema/{custom_property_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5816,7 +5972,11 @@ async def async_create_or_update_custom_property( url = f"/orgs/{org}/properties/schema/{custom_property_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5999,7 +6159,11 @@ def create_or_update_custom_properties_values_for_repos( url = f"/orgs/{org}/properties/values" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6056,7 +6220,11 @@ async def async_create_or_update_custom_properties_values_for_repos( url = f"/orgs/{org}/properties/values" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6494,7 +6662,11 @@ def enable_or_disable_security_product_on_all_org_repos( url = f"/orgs/{org}/{security_product}/{enablement}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6572,7 +6744,11 @@ async def async_enable_or_disable_security_product_on_all_org_repos( url = f"/orgs/{org}/{security_product}/{enablement}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6749,7 +6925,11 @@ def update_membership_for_authenticated_user( url = f"/user/memberships/orgs/{org}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6807,7 +6987,11 @@ async def async_update_membership_for_authenticated_user( url = f"/user/memberships/orgs/{org}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/projects.py b/githubkit/versions/ghec_v2022_11_28/rest/projects.py index ff5505ab3..69f153280 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/projects.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/projects.py @@ -177,7 +177,11 @@ def create_for_org( url = f"/orgs/{org}/projects" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -238,7 +242,11 @@ async def async_create_for_org( url = f"/orgs/{org}/projects" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -401,7 +409,11 @@ def update_card( url = f"/projects/columns/cards/{card_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -461,7 +473,11 @@ async def async_update_card( url = f"/projects/columns/cards/{card_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -523,7 +539,11 @@ def move_card( url = f"/projects/columns/cards/{card_id}/moves" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -585,7 +605,11 @@ async def async_move_card( url = f"/projects/columns/cards/{card_id}/moves" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -739,7 +763,11 @@ def update_column( url = f"/projects/columns/{column_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -791,7 +819,11 @@ async def async_update_column( url = f"/projects/columns/{column_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -946,7 +978,11 @@ def create_card( url = f"/projects/columns/{column_id}/cards" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1035,7 +1071,11 @@ async def async_create_card( url = f"/projects/columns/{column_id}/cards" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1100,7 +1140,11 @@ def move_column( url = f"/projects/columns/{column_id}/moves" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1158,7 +1202,11 @@ async def async_move_column( url = f"/projects/columns/{column_id}/moves" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1325,7 +1373,11 @@ def update( url = f"/projects/{project_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1391,7 +1443,11 @@ async def async_update( url = f"/projects/{project_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1536,7 +1592,11 @@ def add_collaborator( url = f"/projects/{project_id}/collaborators/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1604,7 +1664,11 @@ async def async_add_collaborator( url = f"/projects/{project_id}/collaborators/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1844,7 +1908,11 @@ def create_column( url = f"/projects/{project_id}/columns" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1902,7 +1970,11 @@ async def async_create_column( url = f"/projects/{project_id}/columns" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2046,7 +2118,11 @@ def create_for_repo( url = f"/repos/{owner}/{repo}/projects" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2110,7 +2186,11 @@ async def async_create_for_repo( url = f"/repos/{owner}/{repo}/projects" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2168,7 +2248,11 @@ def create_for_authenticated_user( url = "/user/projects" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2224,7 +2308,11 @@ async def async_create_for_authenticated_user( url = "/user/projects" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/pulls.py b/githubkit/versions/ghec_v2022_11_28/rest/pulls.py index 1c162dfb9..6cf25467e 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/pulls.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/pulls.py @@ -215,7 +215,11 @@ def create( url = f"/repos/{owner}/{repo}/pulls" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -282,7 +286,11 @@ async def async_create( url = f"/repos/{owner}/{repo}/pulls" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -521,7 +529,11 @@ def update_review_comment( url = f"/repos/{owner}/{repo}/pulls/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -580,7 +592,11 @@ async def async_update_review_comment( url = f"/repos/{owner}/{repo}/pulls/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -711,7 +727,11 @@ def update( url = f"/repos/{owner}/{repo}/pulls/{pull_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -778,7 +798,11 @@ async def async_update( url = f"/repos/{owner}/{repo}/pulls/{pull_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -928,7 +952,11 @@ def create_review_comment( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1002,7 +1030,11 @@ async def async_create_review_comment( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1071,7 +1103,11 @@ def create_reply_for_review_comment( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1139,7 +1175,11 @@ async def async_create_reply_for_review_comment( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1408,7 +1448,11 @@ def merge( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/merge" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1487,7 +1531,11 @@ async def async_merge( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/merge" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1627,7 +1675,11 @@ def request_reviewers( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1721,7 +1773,11 @@ async def async_request_reviewers( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1791,7 +1847,11 @@ def remove_requested_reviewers( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1857,7 +1917,11 @@ async def async_remove_requested_reviewers( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1992,7 +2056,11 @@ def create_review( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2062,7 +2130,11 @@ async def async_create_review( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2183,7 +2255,11 @@ def update_review( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2249,7 +2325,11 @@ async def async_update_review( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2451,7 +2531,11 @@ def dismiss_review( f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals" ) - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2524,7 +2608,11 @@ async def async_dismiss_review( f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals" ) - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2595,7 +2683,11 @@ def submit_review( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2667,7 +2759,11 @@ async def async_submit_review( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2739,7 +2835,11 @@ def update_branch( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/update-branch" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2810,7 +2910,11 @@ async def async_update_branch( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/update-branch" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/reactions.py b/githubkit/versions/ghec_v2022_11_28/rest/reactions.py index 22603cbd0..0d0c2e385 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/reactions.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/reactions.py @@ -184,7 +184,11 @@ def create_for_team_discussion_comment_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -251,7 +255,11 @@ async def async_create_for_team_discussion_comment_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -437,7 +445,11 @@ def create_for_team_discussion_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -500,7 +512,11 @@ async def async_create_for_team_discussion_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -688,7 +704,11 @@ def create_for_commit_comment( url = f"/repos/{owner}/{repo}/comments/{comment_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -753,7 +773,11 @@ async def async_create_for_commit_comment( url = f"/repos/{owner}/{repo}/comments/{comment_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -946,7 +970,11 @@ def create_for_issue_comment( url = f"/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1013,7 +1041,11 @@ async def async_create_for_issue_comment( url = f"/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1206,7 +1238,11 @@ def create_for_issue( url = f"/repos/{owner}/{repo}/issues/{issue_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1271,7 +1307,11 @@ async def async_create_for_issue( url = f"/repos/{owner}/{repo}/issues/{issue_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1464,7 +1504,11 @@ def create_for_pull_request_review_comment( url = f"/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1531,7 +1575,11 @@ async def async_create_for_pull_request_review_comment( url = f"/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1720,7 +1768,11 @@ def create_for_release( url = f"/repos/{owner}/{repo}/releases/{release_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1783,7 +1835,11 @@ async def async_create_for_release( url = f"/repos/{owner}/{repo}/releases/{release_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1969,7 +2025,11 @@ def create_for_team_discussion_comment_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2033,7 +2093,11 @@ async def async_create_for_team_discussion_comment_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2170,7 +2234,11 @@ def create_for_team_discussion_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2230,7 +2298,11 @@ async def async_create_for_team_discussion_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/repos.py b/githubkit/versions/ghec_v2022_11_28/rest/repos.py index 496d3994a..749c25c60 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/repos.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/repos.py @@ -400,7 +400,11 @@ def create_in_org( url = f"/orgs/{org}/repos" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -487,7 +491,11 @@ async def async_create_in_org( url = f"/orgs/{org}/repos" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -650,7 +658,11 @@ def create_org_ruleset( url = f"/orgs/{org}/rulesets" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -739,7 +751,11 @@ async def async_create_org_ruleset( url = f"/orgs/{org}/rulesets" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1029,7 +1045,11 @@ def update_org_ruleset( url = f"/orgs/{org}/rulesets/{ruleset_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1125,7 +1145,11 @@ async def async_update_org_ruleset( url = f"/orgs/{org}/rulesets/{ruleset_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1367,7 +1391,11 @@ def update( url = f"/repos/{owner}/{repo}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1458,7 +1486,11 @@ async def async_update( url = f"/repos/{owner}/{repo}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1635,7 +1667,11 @@ def create_attestation( url = f"/repos/{owner}/{repo}/attestations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1695,7 +1731,11 @@ async def async_create_attestation( url = f"/repos/{owner}/{repo}/attestations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1866,7 +1906,11 @@ def create_autolink( url = f"/repos/{owner}/{repo}/autolinks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1922,7 +1966,11 @@ async def async_create_autolink( url = f"/repos/{owner}/{repo}/autolinks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2404,7 +2452,11 @@ def update_branch_protection( url = f"/repos/{owner}/{repo}/branches/{branch}/protection" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2488,7 +2540,11 @@ async def async_update_branch_protection( url = f"/repos/{owner}/{repo}/branches/{branch}/protection" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2854,7 +2910,11 @@ def update_pull_request_review_protection( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2931,7 +2991,11 @@ async def async_update_pull_request_review_protection( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3262,7 +3326,11 @@ def update_status_check_protection( f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" ) - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3340,7 +3408,11 @@ async def async_update_status_check_protection( f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" ) - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3473,7 +3545,11 @@ def set_status_check_contexts( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3553,7 +3629,11 @@ async def async_set_status_check_contexts( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3633,7 +3713,11 @@ def add_status_check_contexts( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3714,7 +3798,11 @@ async def async_add_status_check_contexts( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3795,7 +3883,11 @@ def remove_status_check_contexts( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3875,7 +3967,11 @@ async def async_remove_status_check_contexts( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4095,7 +4191,11 @@ def set_app_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4162,7 +4262,11 @@ async def async_set_app_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4229,7 +4333,11 @@ def add_app_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4296,7 +4404,11 @@ async def async_add_app_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4363,7 +4475,11 @@ def remove_app_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4430,7 +4546,11 @@ async def async_remove_app_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4561,7 +4681,11 @@ def set_team_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4640,7 +4764,11 @@ async def async_set_team_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4719,7 +4847,11 @@ def add_team_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4798,7 +4930,11 @@ async def async_add_team_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4877,7 +5013,11 @@ def remove_team_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4956,7 +5096,11 @@ async def async_remove_team_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5083,7 +5227,11 @@ def set_user_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5150,7 +5298,11 @@ async def async_set_user_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5217,7 +5369,11 @@ def add_user_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5284,7 +5440,11 @@ async def async_add_user_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5351,7 +5511,11 @@ def remove_user_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5418,7 +5582,11 @@ async def async_remove_user_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5482,7 +5650,11 @@ def rename_branch( url = f"/repos/{owner}/{repo}/branches/{branch}/rename" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5548,7 +5720,11 @@ async def async_rename_branch( url = f"/repos/{owner}/{repo}/branches/{branch}/rename" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5796,7 +5972,11 @@ def add_collaborator( url = f"/repos/{owner}/{repo}/collaborators/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5861,7 +6041,11 @@ async def async_add_collaborator( url = f"/repos/{owner}/{repo}/collaborators/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6195,7 +6379,11 @@ def update_commit_comment( url = f"/repos/{owner}/{repo}/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6256,7 +6444,11 @@ async def async_update_commit_comment( url = f"/repos/{owner}/{repo}/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6545,7 +6737,11 @@ def create_commit_comment( url = f"/repos/{owner}/{repo}/commits/{commit_sha}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6613,7 +6809,11 @@ async def async_create_commit_comment( url = f"/repos/{owner}/{repo}/commits/{commit_sha}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7202,7 +7402,11 @@ def create_or_update_file_contents( url = f"/repos/{owner}/{repo}/contents/{path}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7274,7 +7478,11 @@ async def async_create_or_update_file_contents( url = f"/repos/{owner}/{repo}/contents/{path}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7345,7 +7553,11 @@ def delete_file( url = f"/repos/{owner}/{repo}/contents/{path}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7417,7 +7629,11 @@ async def async_delete_file( url = f"/repos/{owner}/{repo}/contents/{path}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7644,7 +7860,11 @@ def create_deployment( url = f"/repos/{owner}/{repo}/deployments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7712,7 +7932,11 @@ async def async_create_deployment( url = f"/repos/{owner}/{repo}/deployments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7965,7 +8189,11 @@ def create_deployment_status( url = f"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8044,7 +8272,11 @@ async def async_create_deployment_status( url = f"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8161,7 +8393,11 @@ def create_dispatch_event( url = f"/repos/{owner}/{repo}/dispatches" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8222,7 +8458,11 @@ async def async_create_dispatch_event( url = f"/repos/{owner}/{repo}/dispatches" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8407,7 +8647,11 @@ def create_or_update_environment( url = f"/repos/{owner}/{repo}/environments/{environment_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8488,7 +8732,11 @@ async def async_create_or_update_environment( url = f"/repos/{owner}/{repo}/environments/{environment_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8661,7 +8909,11 @@ def create_deployment_branch_policy( url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8720,7 +8972,11 @@ async def async_create_deployment_branch_policy( url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8826,7 +9082,11 @@ def update_deployment_branch_policy( url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8883,7 +9143,11 @@ async def async_update_deployment_branch_policy( url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9038,7 +9302,11 @@ def create_deployment_protection_rule( url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9100,7 +9368,11 @@ async def async_create_deployment_protection_rule( url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9397,7 +9669,11 @@ def create_fork( url = f"/repos/{owner}/{repo}/forks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9463,7 +9739,11 @@ async def async_create_fork( url = f"/repos/{owner}/{repo}/forks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9600,7 +9880,11 @@ def create_webhook( url = f"/repos/{owner}/{repo}/hooks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9666,7 +9950,11 @@ async def async_create_webhook( url = f"/repos/{owner}/{repo}/hooks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9836,7 +10124,11 @@ def update_webhook( url = f"/repos/{owner}/{repo}/hooks/{hook_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9903,7 +10195,11 @@ async def async_update_webhook( url = f"/repos/{owner}/{repo}/hooks/{hook_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -10010,7 +10306,11 @@ def update_webhook_config_for_repo( url = f"/repos/{owner}/{repo}/hooks/{hook_id}/config" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -10067,7 +10367,11 @@ async def async_update_webhook_config_for_repo( url = f"/repos/{owner}/{repo}/hooks/{hook_id}/config" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -10528,7 +10832,11 @@ def update_invitation( url = f"/repos/{owner}/{repo}/invitations/{invitation_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -10589,7 +10897,11 @@ async def async_update_invitation( url = f"/repos/{owner}/{repo}/invitations/{invitation_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -10708,7 +11020,11 @@ def create_deploy_key( url = f"/repos/{owner}/{repo}/keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -10764,7 +11080,11 @@ async def async_create_deploy_key( url = f"/repos/{owner}/{repo}/keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11038,7 +11358,11 @@ def merge_upstream( url = f"/repos/{owner}/{repo}/merge-upstream" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11090,7 +11414,11 @@ async def async_merge_upstream( url = f"/repos/{owner}/{repo}/merge-upstream" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11149,7 +11477,11 @@ def merge( url = f"/repos/{owner}/{repo}/merges" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11211,7 +11543,11 @@ async def async_merge( url = f"/repos/{owner}/{repo}/merges" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11427,7 +11763,11 @@ def update_information_about_pages_site( url = f"/repos/{owner}/{repo}/pages" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11602,7 +11942,11 @@ async def async_update_information_about_pages_site( url = f"/repos/{owner}/{repo}/pages" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11699,7 +12043,11 @@ def create_pages_site( url = f"/repos/{owner}/{repo}/pages" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11795,7 +12143,11 @@ async def async_create_pages_site( url = f"/repos/{owner}/{repo}/pages" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -12117,7 +12469,11 @@ def create_pages_deployment( url = f"/repos/{owner}/{repo}/pages/deployments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -12182,7 +12538,11 @@ async def async_create_pages_deployment( url = f"/repos/{owner}/{repo}/pages/deployments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -12602,7 +12962,11 @@ def create_or_update_custom_properties_values( url = f"/repos/{owner}/{repo}/properties/values" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -12661,7 +13025,11 @@ async def async_create_or_update_custom_properties_values( url = f"/repos/{owner}/{repo}/properties/values" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -12929,7 +13297,11 @@ def create_release( url = f"/repos/{owner}/{repo}/releases" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -12997,7 +13369,11 @@ async def async_create_release( url = f"/repos/{owner}/{repo}/releases" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13149,7 +13525,11 @@ def update_release_asset( url = f"/repos/{owner}/{repo}/releases/assets/{asset_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13207,7 +13587,11 @@ async def async_update_release_asset( url = f"/repos/{owner}/{repo}/releases/assets/{asset_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13267,7 +13651,11 @@ def generate_release_notes( url = f"/repos/{owner}/{repo}/releases/generate-notes" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13330,7 +13718,11 @@ async def async_generate_release_notes( url = f"/repos/{owner}/{repo}/releases/generate-notes" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13584,7 +13976,11 @@ def update_release( url = f"/repos/{owner}/{repo}/releases/{release_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13652,7 +14048,11 @@ async def async_update_release( url = f"/repos/{owner}/{repo}/releases/{release_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13758,7 +14158,11 @@ def upload_release_asset( "label": label, } - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/octet-stream", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } content = data @@ -13794,7 +14198,11 @@ async def async_upload_release_asset( "label": label, } - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/octet-stream", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } content = data @@ -14145,7 +14553,11 @@ def create_repo_ruleset( url = f"/repos/{owner}/{repo}/rulesets" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -14235,7 +14647,11 @@ async def async_create_repo_ruleset( url = f"/repos/{owner}/{repo}/rulesets" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -14536,7 +14952,11 @@ def update_repo_ruleset( url = f"/repos/{owner}/{repo}/rulesets/{ruleset_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -14629,7 +15049,11 @@ async def async_update_repo_ruleset( url = f"/repos/{owner}/{repo}/rulesets/{ruleset_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -14978,7 +15402,11 @@ def create_commit_status( url = f"/repos/{owner}/{repo}/statuses/{sha}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -15035,7 +15463,11 @@ async def async_create_commit_status( url = f"/repos/{owner}/{repo}/statuses/{sha}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -15210,7 +15642,11 @@ def create_tag_protection( url = f"/repos/{owner}/{repo}/tags/protection" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -15269,7 +15705,11 @@ async def async_create_tag_protection( url = f"/repos/{owner}/{repo}/tags/protection" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -15557,7 +15997,11 @@ def replace_all_topics( url = f"/repos/{owner}/{repo}/topics" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -15617,7 +16061,11 @@ async def async_replace_all_topics( url = f"/repos/{owner}/{repo}/topics" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -15906,7 +16354,11 @@ def transfer( url = f"/repos/{owner}/{repo}/transfer" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -15959,7 +16411,11 @@ async def async_transfer( url = f"/repos/{owner}/{repo}/transfer" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -16173,7 +16629,11 @@ def create_using_template( url = f"/repos/{template_owner}/{template_repo}/generate" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -16233,7 +16693,11 @@ async def async_create_using_template( url = f"/repos/{template_owner}/{template_repo}/generate" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -16468,7 +16932,11 @@ def create_for_authenticated_user( url = "/user/repos" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -16548,7 +17016,11 @@ async def async_create_for_authenticated_user( url = "/user/repos" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/scim.py b/githubkit/versions/ghec_v2022_11_28/rest/scim.py index 22573f605..1f0fac5da 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/scim.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/scim.py @@ -168,7 +168,11 @@ def provision_and_invite_user( url = f"/scim/v2/organizations/{org}/Users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -230,7 +234,11 @@ async def async_provision_and_invite_user( url = f"/scim/v2/organizations/{org}/Users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -351,7 +359,11 @@ def set_information_for_provisioned_user( url = f"/scim/v2/organizations/{org}/Users/{scim_user_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -419,7 +431,11 @@ async def async_set_information_for_provisioned_user( url = f"/scim/v2/organizations/{org}/Users/{scim_user_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -534,7 +550,11 @@ def update_attribute_for_user( url = f"/scim/v2/organizations/{org}/Users/{scim_user_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -601,7 +621,11 @@ async def async_update_attribute_for_user( url = f"/scim/v2/organizations/{org}/Users/{scim_user_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/secret_scanning.py b/githubkit/versions/ghec_v2022_11_28/rest/secret_scanning.py index ce1eb6317..57a5b2476 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/secret_scanning.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/secret_scanning.py @@ -486,7 +486,11 @@ def update_alert( url = f"/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -557,7 +561,11 @@ async def async_update_alert( url = f"/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -698,7 +706,11 @@ def create_push_protection_bypass( url = f"/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -761,7 +773,11 @@ async def async_create_push_protection_bypass( url = f"/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/security_advisories.py b/githubkit/versions/ghec_v2022_11_28/rest/security_advisories.py index 1018117c1..bed000bb3 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/security_advisories.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/security_advisories.py @@ -506,7 +506,11 @@ def create_repository_advisory( url = f"/repos/{owner}/{repo}/security-advisories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -579,7 +583,11 @@ async def async_create_repository_advisory( url = f"/repos/{owner}/{repo}/security-advisories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -652,7 +660,11 @@ def create_private_vulnerability_report( url = f"/repos/{owner}/{repo}/security-advisories/reports" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -725,7 +737,11 @@ async def async_create_private_vulnerability_report( url = f"/repos/{owner}/{repo}/security-advisories/reports" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -859,7 +875,11 @@ def update_repository_advisory( url = f"/repos/{owner}/{repo}/security-advisories/{ghsa_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -939,7 +959,11 @@ async def async_update_repository_advisory( url = f"/repos/{owner}/{repo}/security-advisories/{ghsa_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/teams.py b/githubkit/versions/ghec_v2022_11_28/rest/teams.py index 79b2bb84c..5d00c93d8 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/teams.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/teams.py @@ -376,7 +376,11 @@ def create( url = f"/orgs/{org}/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -437,7 +441,11 @@ async def async_create( url = f"/orgs/{org}/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -592,7 +600,11 @@ def update_in_org( url = f"/orgs/{org}/teams/{team_slug}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -660,7 +672,11 @@ async def async_update_in_org( url = f"/orgs/{org}/teams/{team_slug}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -790,7 +806,11 @@ def create_discussion_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -843,7 +863,11 @@ async def async_create_discussion_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -991,7 +1015,11 @@ def update_discussion_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1055,7 +1083,11 @@ async def async_update_discussion_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1186,7 +1218,11 @@ def create_discussion_comment_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1247,7 +1283,11 @@ async def async_create_discussion_comment_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1401,7 +1441,11 @@ def update_discussion_comment_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1466,7 +1510,11 @@ async def async_update_discussion_comment_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1602,7 +1650,11 @@ def link_external_idp_group_to_team_for_org( url = f"/orgs/{org}/teams/{team_slug}/external-groups" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1655,7 +1707,11 @@ async def async_link_external_idp_group_to_team_for_org( url = f"/orgs/{org}/teams/{team_slug}/external-groups" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1894,7 +1950,11 @@ def add_or_update_membership_for_user_in_org( url = f"/orgs/{org}/teams/{team_slug}/memberships/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1954,7 +2014,11 @@ async def async_add_or_update_membership_for_user_in_org( url = f"/orgs/{org}/teams/{team_slug}/memberships/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2174,7 +2238,11 @@ def add_or_update_project_permissions_in_org( url = f"/orgs/{org}/teams/{team_slug}/projects/{project_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2241,7 +2309,11 @@ async def async_add_or_update_project_permissions_in_org( url = f"/orgs/{org}/teams/{team_slug}/projects/{project_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2456,7 +2528,11 @@ def add_or_update_repo_permissions_in_org( url = f"/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2512,7 +2588,11 @@ async def async_add_or_update_repo_permissions_in_org( url = f"/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2653,7 +2733,11 @@ def create_or_update_idp_group_connections_in_org( url = f"/orgs/{org}/teams/{team_slug}/team-sync/group-mappings" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2711,7 +2795,11 @@ async def async_create_or_update_idp_group_connections_in_org( url = f"/orgs/{org}/teams/{team_slug}/team-sync/group-mappings" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2928,7 +3016,11 @@ def update_legacy( url = f"/teams/{team_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2988,7 +3080,11 @@ async def async_update_legacy( url = f"/teams/{team_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3109,7 +3205,11 @@ def create_discussion_legacy( url = f"/teams/{team_id}/discussions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3159,7 +3259,11 @@ async def async_create_discussion_legacy( url = f"/teams/{team_id}/discussions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3296,7 +3400,11 @@ def update_discussion_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3353,7 +3461,11 @@ async def async_update_discussion_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3479,7 +3591,11 @@ def create_discussion_comment_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3537,7 +3653,11 @@ async def async_create_discussion_comment_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3684,7 +3804,11 @@ def update_discussion_comment_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3746,7 +3870,11 @@ async def async_update_discussion_comment_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4116,7 +4244,11 @@ def add_or_update_membership_for_user_legacy( url = f"/teams/{team_id}/memberships/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4174,7 +4306,11 @@ async def async_add_or_update_membership_for_user_legacy( url = f"/teams/{team_id}/memberships/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4387,7 +4523,11 @@ def add_or_update_project_permissions_legacy( url = f"/teams/{team_id}/projects/{project_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4447,7 +4587,11 @@ async def async_add_or_update_project_permissions_legacy( url = f"/teams/{team_id}/projects/{project_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4675,7 +4819,11 @@ def add_or_update_repo_permissions_legacy( url = f"/teams/{team_id}/repos/{owner}/{repo}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4736,7 +4884,11 @@ async def async_add_or_update_repo_permissions_legacy( url = f"/teams/{team_id}/repos/{owner}/{repo}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4883,7 +5035,11 @@ def create_or_update_idp_group_connections_legacy( url = f"/teams/{team_id}/team-sync/group-mappings" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4941,7 +5097,11 @@ async def async_create_or_update_idp_group_connections_legacy( url = f"/teams/{team_id}/team-sync/group-mappings" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/ghec_v2022_11_28/rest/users.py b/githubkit/versions/ghec_v2022_11_28/rest/users.py index cd9dbb153..5b8484665 100644 --- a/githubkit/versions/ghec_v2022_11_28/rest/users.py +++ b/githubkit/versions/ghec_v2022_11_28/rest/users.py @@ -157,7 +157,11 @@ def update_authenticated( url = "/user" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -215,7 +219,11 @@ async def async_update_authenticated( url = "/user" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -495,7 +503,11 @@ def set_primary_email_visibility_for_authenticated_user( url = "/user/email/visibility" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -553,7 +565,11 @@ async def async_set_primary_email_visibility_for_authenticated_user( url = "/user/email/visibility" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -683,7 +699,11 @@ def add_email_for_authenticated_user( url = "/user/emails" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -750,7 +770,11 @@ async def async_add_email_for_authenticated_user( url = "/user/emails" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -812,7 +836,11 @@ def delete_email_for_authenticated_user( url = "/user/emails" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -873,7 +901,11 @@ async def async_delete_email_for_authenticated_user( url = "/user/emails" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1284,7 +1316,11 @@ def create_gpg_key_for_authenticated_user( url = "/user/gpg_keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1333,7 +1369,11 @@ async def async_create_gpg_key_for_authenticated_user( url = "/user/gpg_keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1556,7 +1596,11 @@ def create_public_ssh_key_for_authenticated_user( url = "/user/keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1605,7 +1649,11 @@ async def async_create_public_ssh_key_for_authenticated_user( url = "/user/keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1905,7 +1953,11 @@ def add_social_account_for_authenticated_user( url = "/user/social_accounts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1963,7 +2015,11 @@ async def async_add_social_account_for_authenticated_user( url = "/user/social_accounts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2014,7 +2070,11 @@ def delete_social_account_for_authenticated_user( url = "/user/social_accounts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2064,7 +2124,11 @@ async def async_delete_social_account_for_authenticated_user( url = "/user/social_accounts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2190,7 +2254,11 @@ def create_ssh_signing_key_for_authenticated_user( url = "/user/ssh_signing_keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2247,7 +2315,11 @@ async def async_create_ssh_signing_key_for_authenticated_user( url = "/user/ssh_signing_keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/actions.py b/githubkit/versions/v2022_11_28/rest/actions.py index ad1ebafab..43887d7ac 100644 --- a/githubkit/versions/v2022_11_28/rest/actions.py +++ b/githubkit/versions/v2022_11_28/rest/actions.py @@ -306,7 +306,11 @@ def set_github_actions_permissions_organization( url = f"/orgs/{org}/actions/permissions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -354,7 +358,11 @@ async def async_set_github_actions_permissions_organization( url = f"/orgs/{org}/actions/permissions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -459,7 +467,11 @@ def set_selected_repositories_enabled_github_actions_organization( url = f"/orgs/{org}/actions/permissions/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -508,7 +520,11 @@ async def async_set_selected_repositories_enabled_github_actions_organization( url = f"/orgs/{org}/actions/permissions/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -677,7 +693,11 @@ def set_allowed_actions_organization( url = f"/orgs/{org}/actions/permissions/selected-actions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -726,7 +746,11 @@ async def async_set_allowed_actions_organization( url = f"/orgs/{org}/actions/permissions/selected-actions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -816,7 +840,11 @@ def set_github_actions_default_workflow_permissions_organization( url = f"/orgs/{org}/actions/permissions/workflow" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -864,7 +892,11 @@ async def async_set_github_actions_default_workflow_permissions_organization( url = f"/orgs/{org}/actions/permissions/workflow" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1027,7 +1059,11 @@ def generate_runner_jitconfig_for_org( url = f"/orgs/{org}/actions/runners/generate-jitconfig" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1089,7 +1125,11 @@ async def async_generate_runner_jitconfig_for_org( url = f"/orgs/{org}/actions/runners/generate-jitconfig" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1373,7 +1413,11 @@ def set_custom_labels_for_self_hosted_runner_for_org( url = f"/orgs/{org}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1435,7 +1479,11 @@ async def async_set_custom_labels_for_self_hosted_runner_for_org( url = f"/orgs/{org}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1497,7 +1545,11 @@ def add_custom_labels_to_self_hosted_runner_for_org( url = f"/orgs/{org}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1559,7 +1611,11 @@ async def async_add_custom_labels_to_self_hosted_runner_for_org( url = f"/orgs/{org}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1881,7 +1937,11 @@ def create_or_update_org_secret( url = f"/orgs/{org}/actions/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1935,7 +1995,11 @@ async def async_create_or_update_org_secret( url = f"/orgs/{org}/actions/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2084,7 +2148,11 @@ def set_selected_repos_for_org_secret( url = f"/orgs/{org}/actions/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2136,7 +2204,11 @@ async def async_set_selected_repos_for_org_secret( url = f"/orgs/{org}/actions/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2330,7 +2402,11 @@ def create_org_variable( url = f"/orgs/{org}/actions/variables" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2381,7 +2457,11 @@ async def async_create_org_variable( url = f"/orgs/{org}/actions/variables" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2516,7 +2596,11 @@ def update_org_variable( url = f"/orgs/{org}/actions/variables/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2568,7 +2652,11 @@ async def async_update_org_variable( url = f"/orgs/{org}/actions/variables/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2680,7 +2768,11 @@ def set_selected_repos_for_org_variable( url = f"/orgs/{org}/actions/variables/{name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2733,7 +2825,11 @@ async def async_set_selected_repos_for_org_variable( url = f"/orgs/{org}/actions/variables/{name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3395,7 +3491,11 @@ def re_run_job_for_workflow_run( url = f"/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3464,7 +3564,11 @@ async def async_re_run_job_for_workflow_run( url = f"/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3578,7 +3682,11 @@ def set_custom_oidc_sub_claim_for_repo( url = f"/repos/{owner}/{repo}/actions/oidc/customization/sub" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3642,7 +3750,11 @@ async def async_set_custom_oidc_sub_claim_for_repo( url = f"/repos/{owner}/{repo}/actions/oidc/customization/sub" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3865,7 +3977,11 @@ def set_github_actions_permissions_repository( url = f"/repos/{owner}/{repo}/actions/permissions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3916,7 +4032,11 @@ async def async_set_github_actions_permissions_repository( url = f"/repos/{owner}/{repo}/actions/permissions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4010,7 +4130,11 @@ def set_workflow_access_to_repository( url = f"/repos/{owner}/{repo}/actions/permissions/access" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4060,7 +4184,11 @@ async def async_set_workflow_access_to_repository( url = f"/repos/{owner}/{repo}/actions/permissions/access" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4156,7 +4284,11 @@ def set_allowed_actions_repository( url = f"/repos/{owner}/{repo}/actions/permissions/selected-actions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4208,7 +4340,11 @@ async def async_set_allowed_actions_repository( url = f"/repos/{owner}/{repo}/actions/permissions/selected-actions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4303,7 +4439,11 @@ def set_github_actions_default_workflow_permissions_repository( url = f"/repos/{owner}/{repo}/actions/permissions/workflow" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4355,7 +4495,11 @@ async def async_set_github_actions_default_workflow_permissions_repository( url = f"/repos/{owner}/{repo}/actions/permissions/workflow" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4528,7 +4672,11 @@ def generate_runner_jitconfig_for_repo( url = f"/repos/{owner}/{repo}/actions/runners/generate-jitconfig" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4595,7 +4743,11 @@ async def async_generate_runner_jitconfig_for_repo( url = f"/repos/{owner}/{repo}/actions/runners/generate-jitconfig" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4892,7 +5044,11 @@ def set_custom_labels_for_self_hosted_runner_for_repo( url = f"/repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4957,7 +5113,11 @@ async def async_set_custom_labels_for_self_hosted_runner_for_repo( url = f"/repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5022,7 +5182,11 @@ def add_custom_labels_to_self_hosted_runner_for_repo( url = f"/repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5087,7 +5251,11 @@ async def async_add_custom_labels_to_self_hosted_runner_for_repo( url = f"/repos/{owner}/{repo}/actions/runners/{runner_id}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5923,7 +6091,11 @@ def review_custom_gates_for_run( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6005,7 +6177,11 @@ async def async_review_custom_gates_for_run( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6330,7 +6506,11 @@ def review_pending_deployments_for_run( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6395,7 +6575,11 @@ async def async_review_pending_deployments_for_run( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6457,7 +6641,11 @@ def re_run_workflow( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/rerun" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6519,7 +6707,11 @@ async def async_re_run_workflow( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/rerun" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6584,7 +6776,11 @@ def re_run_workflow_failed_jobs( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6649,7 +6845,11 @@ async def async_re_run_workflow_failed_jobs( url = f"/repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6902,7 +7102,11 @@ def create_or_update_repo_secret( url = f"/repos/{owner}/{repo}/actions/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6959,7 +7163,11 @@ async def async_create_or_update_repo_secret( url = f"/repos/{owner}/{repo}/actions/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7113,7 +7321,11 @@ def create_repo_variable( url = f"/repos/{owner}/{repo}/actions/variables" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7165,7 +7377,11 @@ async def async_create_repo_variable( url = f"/repos/{owner}/{repo}/actions/variables" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7305,7 +7521,11 @@ def update_repo_variable( url = f"/repos/{owner}/{repo}/actions/variables/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7360,7 +7580,11 @@ async def async_update_repo_variable( url = f"/repos/{owner}/{repo}/actions/variables/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7566,7 +7790,11 @@ def create_workflow_dispatch( url = f"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7626,7 +7854,11 @@ async def async_create_workflow_dispatch( url = f"/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8068,7 +8300,11 @@ def create_or_update_environment_secret( url = f"/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8133,7 +8369,11 @@ async def async_create_or_update_environment_secret( url = f"/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8303,7 +8543,11 @@ def create_environment_variable( url = f"/repos/{owner}/{repo}/environments/{environment_name}/variables" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8365,7 +8609,11 @@ async def async_create_environment_variable( url = f"/repos/{owner}/{repo}/environments/{environment_name}/variables" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8518,7 +8766,11 @@ def update_environment_variable( url = f"/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8580,7 +8832,11 @@ async def async_update_environment_variable( url = f"/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/activity.py b/githubkit/versions/v2022_11_28/rest/activity.py index 7b9e01f51..2e3d0cf90 100644 --- a/githubkit/versions/v2022_11_28/rest/activity.py +++ b/githubkit/versions/v2022_11_28/rest/activity.py @@ -373,7 +373,11 @@ def mark_notifications_as_read( url = "/notifications" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -427,7 +431,11 @@ async def async_mark_notifications_as_read( url = "/notifications" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -665,7 +673,11 @@ def set_thread_subscription( url = f"/notifications/threads/{thread_id}/subscription" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -723,7 +735,11 @@ async def async_set_thread_subscription( url = f"/notifications/threads/{thread_id}/subscription" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1037,7 +1053,11 @@ def mark_repo_notifications_as_read( url = f"/repos/{owner}/{repo}/notifications" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1091,7 +1111,11 @@ async def async_mark_repo_notifications_as_read( url = f"/repos/{owner}/{repo}/notifications" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1327,7 +1351,11 @@ def set_repo_subscription( url = f"/repos/{owner}/{repo}/subscription" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1379,7 +1407,11 @@ async def async_set_repo_subscription( url = f"/repos/{owner}/{repo}/subscription" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/apps.py b/githubkit/versions/v2022_11_28/rest/apps.py index eeceb356c..3e0f4068a 100644 --- a/githubkit/versions/v2022_11_28/rest/apps.py +++ b/githubkit/versions/v2022_11_28/rest/apps.py @@ -247,7 +247,11 @@ def update_webhook_config_for_app( url = "/app/hook/config" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -295,7 +299,11 @@ async def async_update_webhook_config_for_app( url = "/app/hook/config" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -758,7 +766,11 @@ def create_installation_access_token( url = f"/app/installations/{installation_id}/access_tokens" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -821,7 +833,11 @@ async def async_create_installation_access_token( url = f"/app/installations/{installation_id}/access_tokens" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -969,7 +985,11 @@ def delete_authorization( url = f"/applications/{client_id}/grant" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1019,7 +1039,11 @@ async def async_delete_authorization( url = f"/applications/{client_id}/grant" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1074,7 +1098,11 @@ def check_token( url = f"/applications/{client_id}/token" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1131,7 +1159,11 @@ async def async_check_token( url = f"/applications/{client_id}/token" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1183,7 +1215,11 @@ def delete_token( url = f"/applications/{client_id}/token" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1233,7 +1269,11 @@ async def async_delete_token( url = f"/applications/{client_id}/token" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1287,7 +1327,11 @@ def reset_token( url = f"/applications/{client_id}/token" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1342,7 +1386,11 @@ async def async_reset_token( url = f"/applications/{client_id}/token" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1403,7 +1451,11 @@ def scope_token( url = f"/applications/{client_id}/token/scoped" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1467,7 +1519,11 @@ async def async_scope_token( url = f"/applications/{client_id}/token/scoped" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/checks.py b/githubkit/versions/v2022_11_28/rest/checks.py index cafabb711..ff8973ec3 100644 --- a/githubkit/versions/v2022_11_28/rest/checks.py +++ b/githubkit/versions/v2022_11_28/rest/checks.py @@ -172,7 +172,11 @@ def create( url = f"/repos/{owner}/{repo}/check-runs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -298,7 +302,11 @@ async def async_create( url = f"/repos/{owner}/{repo}/check-runs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -474,7 +482,11 @@ def update( url = f"/repos/{owner}/{repo}/check-runs/{check_run_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -604,7 +616,11 @@ async def async_update( url = f"/repos/{owner}/{repo}/check-runs/{check_run_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -783,7 +799,11 @@ def create_suite( url = f"/repos/{owner}/{repo}/check-suites" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -834,7 +854,11 @@ async def async_create_suite( url = f"/repos/{owner}/{repo}/check-suites" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -892,7 +916,11 @@ def set_suites_preferences( url = f"/repos/{owner}/{repo}/check-suites/preferences" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -952,7 +980,11 @@ async def async_set_suites_preferences( url = f"/repos/{owner}/{repo}/check-suites/preferences" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/code_scanning.py b/githubkit/versions/v2022_11_28/rest/code_scanning.py index 44975b1c8..aa761a57d 100644 --- a/githubkit/versions/v2022_11_28/rest/code_scanning.py +++ b/githubkit/versions/v2022_11_28/rest/code_scanning.py @@ -411,7 +411,11 @@ def update_alert( url = f"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -481,7 +485,11 @@ async def async_update_alert( url = f"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1072,7 +1080,11 @@ def create_variant_analysis( url = f"/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1194,7 +1206,11 @@ async def async_create_variant_analysis( url = f"/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1467,7 +1483,11 @@ def update_default_setup( url = f"/repos/{owner}/{repo}/code-scanning/default-setup" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1544,7 +1564,11 @@ async def async_update_default_setup( url = f"/repos/{owner}/{repo}/code-scanning/default-setup" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1612,7 +1636,11 @@ def upload_sarif( url = f"/repos/{owner}/{repo}/code-scanning/sarifs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1679,7 +1707,11 @@ async def async_upload_sarif( url = f"/repos/{owner}/{repo}/code-scanning/sarifs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/code_security.py b/githubkit/versions/v2022_11_28/rest/code_security.py index d173dbb70..a856edc5d 100644 --- a/githubkit/versions/v2022_11_28/rest/code_security.py +++ b/githubkit/versions/v2022_11_28/rest/code_security.py @@ -204,7 +204,11 @@ def create_configuration( url = f"/orgs/{org}/code-security/configurations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -285,7 +289,11 @@ async def async_create_configuration( url = f"/orgs/{org}/code-security/configurations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -390,7 +398,11 @@ def detach_configuration( url = f"/orgs/{org}/code-security/configurations/detach" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -448,7 +460,11 @@ async def async_detach_configuration( url = f"/orgs/{org}/code-security/configurations/detach" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -647,7 +663,11 @@ def update_configuration( url = f"/orgs/{org}/code-security/configurations/{configuration_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -735,7 +755,11 @@ async def async_update_configuration( url = f"/orgs/{org}/code-security/configurations/{configuration_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -794,7 +818,11 @@ def attach_configuration( url = f"/orgs/{org}/code-security/configurations/{configuration_id}/attach" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -853,7 +881,11 @@ async def async_attach_configuration( url = f"/orgs/{org}/code-security/configurations/{configuration_id}/attach" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -920,7 +952,11 @@ def set_configuration_as_default( url = f"/orgs/{org}/code-security/configurations/{configuration_id}/defaults" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -991,7 +1027,11 @@ async def async_set_configuration_as_default( url = f"/orgs/{org}/code-security/configurations/{configuration_id}/defaults" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/codespaces.py b/githubkit/versions/v2022_11_28/rest/codespaces.py index 1a8898017..d8fae30d9 100644 --- a/githubkit/versions/v2022_11_28/rest/codespaces.py +++ b/githubkit/versions/v2022_11_28/rest/codespaces.py @@ -195,7 +195,11 @@ def set_codespaces_access( url = f"/orgs/{org}/codespaces/access" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -253,7 +257,11 @@ async def async_set_codespaces_access( url = f"/orgs/{org}/codespaces/access" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -309,7 +317,11 @@ def set_codespaces_access_users( url = f"/orgs/{org}/codespaces/access/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -367,7 +379,11 @@ async def async_set_codespaces_access_users( url = f"/orgs/{org}/codespaces/access/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -425,7 +441,11 @@ def delete_codespaces_access_users( url = f"/orgs/{org}/codespaces/access/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -483,7 +503,11 @@ async def async_delete_codespaces_access_users( url = f"/orgs/{org}/codespaces/access/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -692,7 +716,11 @@ def create_or_update_org_secret( url = f"/orgs/{org}/codespaces/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -755,7 +783,11 @@ async def async_create_or_update_org_secret( url = f"/orgs/{org}/codespaces/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -935,7 +967,11 @@ def set_selected_repos_for_org_secret( url = f"/orgs/{org}/codespaces/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -995,7 +1031,11 @@ async def async_set_selected_repos_for_org_secret( url = f"/orgs/{org}/codespaces/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1447,7 +1487,11 @@ def create_with_repo_for_authenticated_user( url = f"/repos/{owner}/{repo}/codespaces" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1526,7 +1570,11 @@ async def async_create_with_repo_for_authenticated_user( url = f"/repos/{owner}/{repo}/codespaces" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2053,7 +2101,11 @@ def create_or_update_repo_secret( url = f"/repos/{owner}/{repo}/codespaces/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2113,7 +2165,11 @@ async def async_create_or_update_repo_secret( url = f"/repos/{owner}/{repo}/codespaces/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2229,7 +2285,11 @@ def create_with_pr_for_authenticated_user( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/codespaces" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2311,7 +2371,11 @@ async def async_create_with_pr_for_authenticated_user( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/codespaces" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2476,7 +2540,11 @@ def create_for_authenticated_user( url = "/user/codespaces" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2569,7 +2637,11 @@ async def async_create_for_authenticated_user( url = "/user/codespaces" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2770,7 +2842,11 @@ def create_or_update_secret_for_authenticated_user( url = f"/user/codespaces/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2829,7 +2905,11 @@ async def async_create_or_update_secret_for_authenticated_user( url = f"/user/codespaces/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2980,7 +3060,11 @@ def set_repositories_for_secret_for_authenticated_user( url = f"/user/codespaces/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3038,7 +3122,11 @@ async def async_set_repositories_for_secret_for_authenticated_user( url = f"/user/codespaces/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3317,7 +3405,11 @@ def update_for_authenticated_user( url = f"/user/codespaces/{codespace_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3372,7 +3464,11 @@ async def async_update_for_authenticated_user( url = f"/user/codespaces/{codespace_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3597,7 +3693,11 @@ def publish_for_authenticated_user( url = f"/user/codespaces/{codespace_name}/publish" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3659,7 +3759,11 @@ async def async_publish_for_authenticated_user( url = f"/user/codespaces/{codespace_name}/publish" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/copilot.py b/githubkit/versions/v2022_11_28/rest/copilot.py index 9d620b400..451dedef7 100644 --- a/githubkit/versions/v2022_11_28/rest/copilot.py +++ b/githubkit/versions/v2022_11_28/rest/copilot.py @@ -463,7 +463,11 @@ def add_copilot_seats_for_teams( url = f"/orgs/{org}/copilot/billing/selected_teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -523,7 +527,11 @@ async def async_add_copilot_seats_for_teams( url = f"/orgs/{org}/copilot/billing/selected_teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -583,7 +591,11 @@ def cancel_copilot_seat_assignment_for_teams( url = f"/orgs/{org}/copilot/billing/selected_teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -643,7 +655,11 @@ async def async_cancel_copilot_seat_assignment_for_teams( url = f"/orgs/{org}/copilot/billing/selected_teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -703,7 +719,11 @@ def add_copilot_seats_for_users( url = f"/orgs/{org}/copilot/billing/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -763,7 +783,11 @@ async def async_add_copilot_seats_for_users( url = f"/orgs/{org}/copilot/billing/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -823,7 +847,11 @@ def cancel_copilot_seat_assignment_for_users( url = f"/orgs/{org}/copilot/billing/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -883,7 +911,11 @@ async def async_cancel_copilot_seat_assignment_for_users( url = f"/orgs/{org}/copilot/billing/selected_users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/dependabot.py b/githubkit/versions/v2022_11_28/rest/dependabot.py index 98ed2f106..8ffcda93f 100644 --- a/githubkit/versions/v2022_11_28/rest/dependabot.py +++ b/githubkit/versions/v2022_11_28/rest/dependabot.py @@ -485,7 +485,11 @@ def create_or_update_org_secret( url = f"/orgs/{org}/dependabot/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -539,7 +543,11 @@ async def async_create_or_update_org_secret( url = f"/orgs/{org}/dependabot/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -694,7 +702,11 @@ def set_selected_repos_for_org_secret( url = f"/orgs/{org}/dependabot/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -748,7 +760,11 @@ async def async_set_selected_repos_for_org_secret( url = f"/orgs/{org}/dependabot/secrets/{secret_name}/repositories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1088,7 +1104,11 @@ def update_alert( url = f"/repos/{owner}/{repo}/dependabot/alerts/{alert_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1166,7 +1186,11 @@ async def async_update_alert( url = f"/repos/{owner}/{repo}/dependabot/alerts/{alert_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1383,7 +1407,11 @@ def create_or_update_repo_secret( url = f"/repos/{owner}/{repo}/dependabot/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1443,7 +1471,11 @@ async def async_create_or_update_repo_secret( url = f"/repos/{owner}/{repo}/dependabot/secrets/{secret_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/dependency_graph.py b/githubkit/versions/v2022_11_28/rest/dependency_graph.py index 691d2326f..e70da0903 100644 --- a/githubkit/versions/v2022_11_28/rest/dependency_graph.py +++ b/githubkit/versions/v2022_11_28/rest/dependency_graph.py @@ -224,7 +224,11 @@ def create_repository_snapshot( url = f"/repos/{owner}/{repo}/dependency-graph/snapshots" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -285,7 +289,11 @@ async def async_create_repository_snapshot( url = f"/repos/{owner}/{repo}/dependency-graph/snapshots" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/gists.py b/githubkit/versions/v2022_11_28/rest/gists.py index f3ebd8281..143d0837d 100644 --- a/githubkit/versions/v2022_11_28/rest/gists.py +++ b/githubkit/versions/v2022_11_28/rest/gists.py @@ -152,7 +152,11 @@ def create( url = "/gists" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -201,7 +205,11 @@ async def async_create( url = "/gists" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -504,7 +512,11 @@ def update( url = f"/gists/{gist_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -564,7 +576,11 @@ async def async_update( url = f"/gists/{gist_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -686,7 +702,11 @@ def create_comment( url = f"/gists/{gist_id}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -738,7 +758,11 @@ async def async_create_comment( url = f"/gists/{gist_id}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -899,7 +923,11 @@ def update_comment( url = f"/gists/{gist_id}/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -957,7 +985,11 @@ async def async_update_comment( url = f"/gists/{gist_id}/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/git.py b/githubkit/versions/v2022_11_28/rest/git.py index 5050e444c..f1c12fdb3 100644 --- a/githubkit/versions/v2022_11_28/rest/git.py +++ b/githubkit/versions/v2022_11_28/rest/git.py @@ -101,7 +101,11 @@ def create_blob( url = f"/repos/{owner}/{repo}/git/blobs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -167,7 +171,11 @@ async def async_create_blob( url = f"/repos/{owner}/{repo}/git/blobs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -292,7 +300,11 @@ def create_commit( url = f"/repos/{owner}/{repo}/git/commits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -358,7 +370,11 @@ async def async_create_commit( url = f"/repos/{owner}/{repo}/git/commits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -584,7 +600,11 @@ def create_ref( url = f"/repos/{owner}/{repo}/git/refs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -645,7 +665,11 @@ async def async_create_ref( url = f"/repos/{owner}/{repo}/git/refs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -761,7 +785,11 @@ def update_ref( url = f"/repos/{owner}/{repo}/git/refs/{ref}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -825,7 +853,11 @@ async def async_update_ref( url = f"/repos/{owner}/{repo}/git/refs/{ref}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -889,7 +921,11 @@ def create_tag( url = f"/repos/{owner}/{repo}/git/tags" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -953,7 +989,11 @@ async def async_create_tag( url = f"/repos/{owner}/{repo}/git/tags" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1068,7 +1108,11 @@ def create_tree( url = f"/repos/{owner}/{repo}/git/trees" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1131,7 +1175,11 @@ async def async_create_tree( url = f"/repos/{owner}/{repo}/git/trees" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/interactions.py b/githubkit/versions/v2022_11_28/rest/interactions.py index 4bd88b123..a29169c39 100644 --- a/githubkit/versions/v2022_11_28/rest/interactions.py +++ b/githubkit/versions/v2022_11_28/rest/interactions.py @@ -146,7 +146,11 @@ def set_restrictions_for_org( url = f"/orgs/{org}/interaction-limits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -200,7 +204,11 @@ async def async_set_restrictions_for_org( url = f"/orgs/{org}/interaction-limits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -363,7 +371,11 @@ def set_restrictions_for_repo( url = f"/repos/{owner}/{repo}/interaction-limits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -418,7 +430,11 @@ async def async_set_restrictions_for_repo( url = f"/repos/{owner}/{repo}/interaction-limits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -562,7 +578,11 @@ def set_restrictions_for_authenticated_user( url = "/user/interaction-limits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -610,7 +630,11 @@ async def async_set_restrictions_for_authenticated_user( url = "/user/interaction-limits" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/issues.py b/githubkit/versions/v2022_11_28/rest/issues.py index b8f1930dd..390736c21 100644 --- a/githubkit/versions/v2022_11_28/rest/issues.py +++ b/githubkit/versions/v2022_11_28/rest/issues.py @@ -585,7 +585,11 @@ def create( url = f"/repos/{owner}/{repo}/issues" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -657,7 +661,11 @@ async def async_create( url = f"/repos/{owner}/{repo}/issues" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -899,7 +907,11 @@ def update_comment( url = f"/repos/{owner}/{repo}/issues/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -962,7 +974,11 @@ async def async_update_comment( url = f"/repos/{owner}/{repo}/issues/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1223,7 +1239,11 @@ def update( url = f"/repos/{owner}/{repo}/issues/{issue_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1306,7 +1326,11 @@ async def async_update( url = f"/repos/{owner}/{repo}/issues/{issue_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1367,7 +1391,11 @@ def add_assignees( url = f"/repos/{owner}/{repo}/issues/{issue_number}/assignees" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1423,7 +1451,11 @@ async def async_add_assignees( url = f"/repos/{owner}/{repo}/issues/{issue_number}/assignees" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1479,7 +1511,11 @@ def remove_assignees( url = f"/repos/{owner}/{repo}/issues/{issue_number}/assignees" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1535,7 +1571,11 @@ async def async_remove_assignees( url = f"/repos/{owner}/{repo}/issues/{issue_number}/assignees" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1726,7 +1766,11 @@ def create_comment( url = f"/repos/{owner}/{repo}/issues/{issue_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1793,7 +1837,11 @@ async def async_create_comment( url = f"/repos/{owner}/{repo}/issues/{issue_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2152,7 +2200,11 @@ def set_labels( url = f"/repos/{owner}/{repo}/issues/{issue_number}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2264,7 +2316,11 @@ async def async_set_labels( url = f"/repos/{owner}/{repo}/issues/{issue_number}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2376,7 +2432,11 @@ def add_labels( url = f"/repos/{owner}/{repo}/issues/{issue_number}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2488,7 +2548,11 @@ async def async_add_labels( url = f"/repos/{owner}/{repo}/issues/{issue_number}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2683,7 +2747,11 @@ def lock( url = f"/repos/{owner}/{repo}/issues/{issue_number}/lock" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2756,7 +2824,11 @@ async def async_lock( url = f"/repos/{owner}/{repo}/issues/{issue_number}/lock" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3169,7 +3241,11 @@ def create_label( url = f"/repos/{owner}/{repo}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3231,7 +3307,11 @@ async def async_create_label( url = f"/repos/{owner}/{repo}/labels" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3383,7 +3463,11 @@ def update_label( url = f"/repos/{owner}/{repo}/labels/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3439,7 +3523,11 @@ async def async_update_label( url = f"/repos/{owner}/{repo}/labels/{name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3580,7 +3668,11 @@ def create_milestone( url = f"/repos/{owner}/{repo}/milestones" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3643,7 +3735,11 @@ async def async_create_milestone( url = f"/repos/{owner}/{repo}/milestones" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3806,7 +3902,11 @@ def update_milestone( url = f"/repos/{owner}/{repo}/milestones/{milestone_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3865,7 +3965,11 @@ async def async_update_milestone( url = f"/repos/{owner}/{repo}/milestones/{milestone_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/markdown.py b/githubkit/versions/v2022_11_28/rest/markdown.py index b4a3ec7be..623a20a76 100644 --- a/githubkit/versions/v2022_11_28/rest/markdown.py +++ b/githubkit/versions/v2022_11_28/rest/markdown.py @@ -73,7 +73,11 @@ def render( url = "/markdown" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -117,7 +121,11 @@ async def async_render( url = "/markdown" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -142,7 +150,11 @@ def render_raw( url = "/markdown/raw" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "text/plain", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } content = data @@ -164,7 +176,11 @@ async def async_render_raw( url = "/markdown/raw" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "text/plain", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } content = data diff --git a/githubkit/versions/v2022_11_28/rest/migrations.py b/githubkit/versions/v2022_11_28/rest/migrations.py index 3b463411a..6af7268bd 100644 --- a/githubkit/versions/v2022_11_28/rest/migrations.py +++ b/githubkit/versions/v2022_11_28/rest/migrations.py @@ -170,7 +170,11 @@ def start_for_org( url = f"/orgs/{org}/migrations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -235,7 +239,11 @@ async def async_start_for_org( url = f"/orgs/{org}/migrations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -629,7 +637,11 @@ def start_import( url = f"/repos/{owner}/{repo}/import" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -694,7 +706,11 @@ async def async_start_import( url = f"/repos/{owner}/{repo}/import" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -803,7 +819,11 @@ def update_import( url = f"/repos/{owner}/{repo}/import" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -864,7 +884,11 @@ async def async_update_import( url = f"/repos/{owner}/{repo}/import" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -997,7 +1021,11 @@ def map_commit_author( url = f"/repos/{owner}/{repo}/import/authors/{author_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1064,7 +1092,11 @@ async def async_map_commit_author( url = f"/repos/{owner}/{repo}/import/authors/{author_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1181,7 +1213,11 @@ def set_lfs_preference( url = f"/repos/{owner}/{repo}/import/lfs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1241,7 +1277,11 @@ async def async_set_lfs_preference( url = f"/repos/{owner}/{repo}/import/lfs" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1371,7 +1411,11 @@ def start_for_authenticated_user( url = "/user/migrations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1434,7 +1478,11 @@ async def async_start_for_authenticated_user( url = "/user/migrations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/oidc.py b/githubkit/versions/v2022_11_28/rest/oidc.py index 79f493e71..79f056f3a 100644 --- a/githubkit/versions/v2022_11_28/rest/oidc.py +++ b/githubkit/versions/v2022_11_28/rest/oidc.py @@ -118,7 +118,11 @@ def update_oidc_custom_sub_template_for_org( url = f"/orgs/{org}/actions/oidc/customization/sub" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -170,7 +174,11 @@ async def async_update_oidc_custom_sub_template_for_org( url = f"/orgs/{org}/actions/oidc/customization/sub" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/orgs.py b/githubkit/versions/v2022_11_28/rest/orgs.py index 8029d1d4d..3f35c3d51 100644 --- a/githubkit/versions/v2022_11_28/rest/orgs.py +++ b/githubkit/versions/v2022_11_28/rest/orgs.py @@ -331,7 +331,11 @@ def update( url = f"/orgs/{org}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -425,7 +429,11 @@ async def async_update( url = f"/orgs/{org}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -876,7 +884,11 @@ def create_webhook( url = f"/orgs/{org}/hooks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -931,7 +943,11 @@ async def async_create_webhook( url = f"/orgs/{org}/hooks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1092,7 +1108,11 @@ def update_webhook( url = f"/orgs/{org}/hooks/{hook_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1155,7 +1175,11 @@ async def async_update_webhook( url = f"/orgs/{org}/hooks/{hook_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1257,7 +1281,11 @@ def update_webhook_config_for_org( url = f"/orgs/{org}/hooks/{hook_id}/config" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1311,7 +1339,11 @@ async def async_update_webhook_config_for_org( url = f"/orgs/{org}/hooks/{hook_id}/config" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1751,7 +1783,11 @@ def create_invitation( url = f"/orgs/{org}/invitations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1813,7 +1849,11 @@ async def async_create_invitation( url = f"/orgs/{org}/invitations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2209,7 +2249,11 @@ def set_membership_for_user( url = f"/orgs/{org}/memberships/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2269,7 +2313,11 @@ async def async_set_membership_for_user( url = f"/orgs/{org}/memberships/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2926,7 +2974,11 @@ def convert_member_to_outside_collaborator( url = f"/orgs/{org}/outside_collaborators/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2986,7 +3038,11 @@ async def async_convert_member_to_outside_collaborator( url = f"/orgs/{org}/outside_collaborators/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3204,7 +3260,11 @@ def review_pat_grant_requests_in_bulk( url = f"/orgs/{org}/personal-access-token-requests" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3267,7 +3327,11 @@ async def async_review_pat_grant_requests_in_bulk( url = f"/orgs/{org}/personal-access-token-requests" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3333,7 +3397,11 @@ def review_pat_grant_request( url = f"/orgs/{org}/personal-access-token-requests/{pat_request_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3398,7 +3466,11 @@ async def async_review_pat_grant_request( url = f"/orgs/{org}/personal-access-token-requests/{pat_request_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3647,7 +3719,11 @@ def update_pat_accesses( url = f"/orgs/{org}/personal-access-tokens" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3707,7 +3783,11 @@ async def async_update_pat_accesses( url = f"/orgs/{org}/personal-access-tokens" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3768,7 +3848,11 @@ def update_pat_access( url = f"/orgs/{org}/personal-access-tokens/{pat_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3828,7 +3912,11 @@ async def async_update_pat_access( url = f"/orgs/{org}/personal-access-tokens/{pat_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4015,7 +4103,11 @@ def create_or_update_custom_properties( url = f"/orgs/{org}/properties/schema" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4073,7 +4165,11 @@ async def async_create_or_update_custom_properties( url = f"/orgs/{org}/properties/schema" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4188,7 +4284,11 @@ def create_or_update_custom_property( url = f"/orgs/{org}/properties/schema/{custom_property_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4253,7 +4353,11 @@ async def async_create_or_update_custom_property( url = f"/orgs/{org}/properties/schema/{custom_property_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4436,7 +4540,11 @@ def create_or_update_custom_properties_values_for_repos( url = f"/orgs/{org}/properties/values" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4493,7 +4601,11 @@ async def async_create_or_update_custom_properties_values_for_repos( url = f"/orgs/{org}/properties/values" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4885,7 +4997,11 @@ def enable_or_disable_security_product_on_all_org_repos( url = f"/orgs/{org}/{security_product}/{enablement}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4963,7 +5079,11 @@ async def async_enable_or_disable_security_product_on_all_org_repos( url = f"/orgs/{org}/{security_product}/{enablement}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5140,7 +5260,11 @@ def update_membership_for_authenticated_user( url = f"/user/memberships/orgs/{org}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5198,7 +5322,11 @@ async def async_update_membership_for_authenticated_user( url = f"/user/memberships/orgs/{org}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/projects.py b/githubkit/versions/v2022_11_28/rest/projects.py index b66b99dd4..c0acadb2b 100644 --- a/githubkit/versions/v2022_11_28/rest/projects.py +++ b/githubkit/versions/v2022_11_28/rest/projects.py @@ -177,7 +177,11 @@ def create_for_org( url = f"/orgs/{org}/projects" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -238,7 +242,11 @@ async def async_create_for_org( url = f"/orgs/{org}/projects" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -401,7 +409,11 @@ def update_card( url = f"/projects/columns/cards/{card_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -461,7 +473,11 @@ async def async_update_card( url = f"/projects/columns/cards/{card_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -523,7 +539,11 @@ def move_card( url = f"/projects/columns/cards/{card_id}/moves" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -585,7 +605,11 @@ async def async_move_card( url = f"/projects/columns/cards/{card_id}/moves" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -739,7 +763,11 @@ def update_column( url = f"/projects/columns/{column_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -791,7 +819,11 @@ async def async_update_column( url = f"/projects/columns/{column_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -946,7 +978,11 @@ def create_card( url = f"/projects/columns/{column_id}/cards" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1035,7 +1071,11 @@ async def async_create_card( url = f"/projects/columns/{column_id}/cards" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1100,7 +1140,11 @@ def move_column( url = f"/projects/columns/{column_id}/moves" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1158,7 +1202,11 @@ async def async_move_column( url = f"/projects/columns/{column_id}/moves" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1325,7 +1373,11 @@ def update( url = f"/projects/{project_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1391,7 +1443,11 @@ async def async_update( url = f"/projects/{project_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1536,7 +1592,11 @@ def add_collaborator( url = f"/projects/{project_id}/collaborators/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1604,7 +1664,11 @@ async def async_add_collaborator( url = f"/projects/{project_id}/collaborators/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1844,7 +1908,11 @@ def create_column( url = f"/projects/{project_id}/columns" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1902,7 +1970,11 @@ async def async_create_column( url = f"/projects/{project_id}/columns" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2046,7 +2118,11 @@ def create_for_repo( url = f"/repos/{owner}/{repo}/projects" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2110,7 +2186,11 @@ async def async_create_for_repo( url = f"/repos/{owner}/{repo}/projects" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2168,7 +2248,11 @@ def create_for_authenticated_user( url = "/user/projects" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2224,7 +2308,11 @@ async def async_create_for_authenticated_user( url = "/user/projects" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/pulls.py b/githubkit/versions/v2022_11_28/rest/pulls.py index d94bd7556..9b066179b 100644 --- a/githubkit/versions/v2022_11_28/rest/pulls.py +++ b/githubkit/versions/v2022_11_28/rest/pulls.py @@ -215,7 +215,11 @@ def create( url = f"/repos/{owner}/{repo}/pulls" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -282,7 +286,11 @@ async def async_create( url = f"/repos/{owner}/{repo}/pulls" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -521,7 +529,11 @@ def update_review_comment( url = f"/repos/{owner}/{repo}/pulls/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -580,7 +592,11 @@ async def async_update_review_comment( url = f"/repos/{owner}/{repo}/pulls/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -711,7 +727,11 @@ def update( url = f"/repos/{owner}/{repo}/pulls/{pull_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -778,7 +798,11 @@ async def async_update( url = f"/repos/{owner}/{repo}/pulls/{pull_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -928,7 +952,11 @@ def create_review_comment( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1002,7 +1030,11 @@ async def async_create_review_comment( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1071,7 +1103,11 @@ def create_reply_for_review_comment( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1139,7 +1175,11 @@ async def async_create_reply_for_review_comment( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1408,7 +1448,11 @@ def merge( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/merge" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1487,7 +1531,11 @@ async def async_merge( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/merge" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1627,7 +1675,11 @@ def request_reviewers( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1721,7 +1773,11 @@ async def async_request_reviewers( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1791,7 +1847,11 @@ def remove_requested_reviewers( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1857,7 +1917,11 @@ async def async_remove_requested_reviewers( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1992,7 +2056,11 @@ def create_review( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2062,7 +2130,11 @@ async def async_create_review( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2183,7 +2255,11 @@ def update_review( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2249,7 +2325,11 @@ async def async_update_review( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2451,7 +2531,11 @@ def dismiss_review( f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals" ) - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2524,7 +2608,11 @@ async def async_dismiss_review( f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals" ) - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2595,7 +2683,11 @@ def submit_review( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2667,7 +2759,11 @@ async def async_submit_review( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2739,7 +2835,11 @@ def update_branch( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/update-branch" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2810,7 +2910,11 @@ async def async_update_branch( url = f"/repos/{owner}/{repo}/pulls/{pull_number}/update-branch" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/reactions.py b/githubkit/versions/v2022_11_28/rest/reactions.py index e67261872..e79de2b4a 100644 --- a/githubkit/versions/v2022_11_28/rest/reactions.py +++ b/githubkit/versions/v2022_11_28/rest/reactions.py @@ -184,7 +184,11 @@ def create_for_team_discussion_comment_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -251,7 +255,11 @@ async def async_create_for_team_discussion_comment_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -437,7 +445,11 @@ def create_for_team_discussion_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -500,7 +512,11 @@ async def async_create_for_team_discussion_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -688,7 +704,11 @@ def create_for_commit_comment( url = f"/repos/{owner}/{repo}/comments/{comment_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -753,7 +773,11 @@ async def async_create_for_commit_comment( url = f"/repos/{owner}/{repo}/comments/{comment_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -946,7 +970,11 @@ def create_for_issue_comment( url = f"/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1013,7 +1041,11 @@ async def async_create_for_issue_comment( url = f"/repos/{owner}/{repo}/issues/comments/{comment_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1206,7 +1238,11 @@ def create_for_issue( url = f"/repos/{owner}/{repo}/issues/{issue_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1271,7 +1307,11 @@ async def async_create_for_issue( url = f"/repos/{owner}/{repo}/issues/{issue_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1464,7 +1504,11 @@ def create_for_pull_request_review_comment( url = f"/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1531,7 +1575,11 @@ async def async_create_for_pull_request_review_comment( url = f"/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1720,7 +1768,11 @@ def create_for_release( url = f"/repos/{owner}/{repo}/releases/{release_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1783,7 +1835,11 @@ async def async_create_for_release( url = f"/repos/{owner}/{repo}/releases/{release_id}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1969,7 +2025,11 @@ def create_for_team_discussion_comment_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2033,7 +2093,11 @@ async def async_create_for_team_discussion_comment_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2170,7 +2234,11 @@ def create_for_team_discussion_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2230,7 +2298,11 @@ async def async_create_for_team_discussion_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/reactions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/repos.py b/githubkit/versions/v2022_11_28/rest/repos.py index a6539d818..cf77fe719 100644 --- a/githubkit/versions/v2022_11_28/rest/repos.py +++ b/githubkit/versions/v2022_11_28/rest/repos.py @@ -400,7 +400,11 @@ def create_in_org( url = f"/orgs/{org}/repos" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -487,7 +491,11 @@ async def async_create_in_org( url = f"/orgs/{org}/repos" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -650,7 +658,11 @@ def create_org_ruleset( url = f"/orgs/{org}/rulesets" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -739,7 +751,11 @@ async def async_create_org_ruleset( url = f"/orgs/{org}/rulesets" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1029,7 +1045,11 @@ def update_org_ruleset( url = f"/orgs/{org}/rulesets/{ruleset_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1125,7 +1145,11 @@ async def async_update_org_ruleset( url = f"/orgs/{org}/rulesets/{ruleset_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1367,7 +1391,11 @@ def update( url = f"/repos/{owner}/{repo}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1458,7 +1486,11 @@ async def async_update( url = f"/repos/{owner}/{repo}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1635,7 +1667,11 @@ def create_attestation( url = f"/repos/{owner}/{repo}/attestations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1695,7 +1731,11 @@ async def async_create_attestation( url = f"/repos/{owner}/{repo}/attestations" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1866,7 +1906,11 @@ def create_autolink( url = f"/repos/{owner}/{repo}/autolinks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1922,7 +1966,11 @@ async def async_create_autolink( url = f"/repos/{owner}/{repo}/autolinks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2404,7 +2452,11 @@ def update_branch_protection( url = f"/repos/{owner}/{repo}/branches/{branch}/protection" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2488,7 +2540,11 @@ async def async_update_branch_protection( url = f"/repos/{owner}/{repo}/branches/{branch}/protection" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2854,7 +2910,11 @@ def update_pull_request_review_protection( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2931,7 +2991,11 @@ async def async_update_pull_request_review_protection( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3262,7 +3326,11 @@ def update_status_check_protection( f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" ) - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3340,7 +3408,11 @@ async def async_update_status_check_protection( f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" ) - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3473,7 +3545,11 @@ def set_status_check_contexts( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3553,7 +3629,11 @@ async def async_set_status_check_contexts( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3633,7 +3713,11 @@ def add_status_check_contexts( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3714,7 +3798,11 @@ async def async_add_status_check_contexts( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3795,7 +3883,11 @@ def remove_status_check_contexts( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3875,7 +3967,11 @@ async def async_remove_status_check_contexts( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4095,7 +4191,11 @@ def set_app_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4162,7 +4262,11 @@ async def async_set_app_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4229,7 +4333,11 @@ def add_app_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4296,7 +4404,11 @@ async def async_add_app_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4363,7 +4475,11 @@ def remove_app_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4430,7 +4546,11 @@ async def async_remove_app_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4561,7 +4681,11 @@ def set_team_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4640,7 +4764,11 @@ async def async_set_team_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4719,7 +4847,11 @@ def add_team_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4798,7 +4930,11 @@ async def async_add_team_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4877,7 +5013,11 @@ def remove_team_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4956,7 +5096,11 @@ async def async_remove_team_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5083,7 +5227,11 @@ def set_user_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5150,7 +5298,11 @@ async def async_set_user_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5217,7 +5369,11 @@ def add_user_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5284,7 +5440,11 @@ async def async_add_user_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5351,7 +5511,11 @@ def remove_user_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5418,7 +5582,11 @@ async def async_remove_user_access_restrictions( url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5482,7 +5650,11 @@ def rename_branch( url = f"/repos/{owner}/{repo}/branches/{branch}/rename" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5548,7 +5720,11 @@ async def async_rename_branch( url = f"/repos/{owner}/{repo}/branches/{branch}/rename" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5796,7 +5972,11 @@ def add_collaborator( url = f"/repos/{owner}/{repo}/collaborators/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -5861,7 +6041,11 @@ async def async_add_collaborator( url = f"/repos/{owner}/{repo}/collaborators/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6195,7 +6379,11 @@ def update_commit_comment( url = f"/repos/{owner}/{repo}/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6256,7 +6444,11 @@ async def async_update_commit_comment( url = f"/repos/{owner}/{repo}/comments/{comment_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6545,7 +6737,11 @@ def create_commit_comment( url = f"/repos/{owner}/{repo}/commits/{commit_sha}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -6613,7 +6809,11 @@ async def async_create_commit_comment( url = f"/repos/{owner}/{repo}/commits/{commit_sha}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7202,7 +7402,11 @@ def create_or_update_file_contents( url = f"/repos/{owner}/{repo}/contents/{path}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7274,7 +7478,11 @@ async def async_create_or_update_file_contents( url = f"/repos/{owner}/{repo}/contents/{path}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7345,7 +7553,11 @@ def delete_file( url = f"/repos/{owner}/{repo}/contents/{path}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7417,7 +7629,11 @@ async def async_delete_file( url = f"/repos/{owner}/{repo}/contents/{path}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7644,7 +7860,11 @@ def create_deployment( url = f"/repos/{owner}/{repo}/deployments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7712,7 +7932,11 @@ async def async_create_deployment( url = f"/repos/{owner}/{repo}/deployments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -7965,7 +8189,11 @@ def create_deployment_status( url = f"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8044,7 +8272,11 @@ async def async_create_deployment_status( url = f"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8161,7 +8393,11 @@ def create_dispatch_event( url = f"/repos/{owner}/{repo}/dispatches" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8222,7 +8458,11 @@ async def async_create_dispatch_event( url = f"/repos/{owner}/{repo}/dispatches" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8407,7 +8647,11 @@ def create_or_update_environment( url = f"/repos/{owner}/{repo}/environments/{environment_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8488,7 +8732,11 @@ async def async_create_or_update_environment( url = f"/repos/{owner}/{repo}/environments/{environment_name}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8661,7 +8909,11 @@ def create_deployment_branch_policy( url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8720,7 +8972,11 @@ async def async_create_deployment_branch_policy( url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8826,7 +9082,11 @@ def update_deployment_branch_policy( url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -8883,7 +9143,11 @@ async def async_update_deployment_branch_policy( url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9038,7 +9302,11 @@ def create_deployment_protection_rule( url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9100,7 +9368,11 @@ async def async_create_deployment_protection_rule( url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9397,7 +9669,11 @@ def create_fork( url = f"/repos/{owner}/{repo}/forks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9463,7 +9739,11 @@ async def async_create_fork( url = f"/repos/{owner}/{repo}/forks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9600,7 +9880,11 @@ def create_webhook( url = f"/repos/{owner}/{repo}/hooks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9666,7 +9950,11 @@ async def async_create_webhook( url = f"/repos/{owner}/{repo}/hooks" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9836,7 +10124,11 @@ def update_webhook( url = f"/repos/{owner}/{repo}/hooks/{hook_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -9903,7 +10195,11 @@ async def async_update_webhook( url = f"/repos/{owner}/{repo}/hooks/{hook_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -10010,7 +10306,11 @@ def update_webhook_config_for_repo( url = f"/repos/{owner}/{repo}/hooks/{hook_id}/config" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -10067,7 +10367,11 @@ async def async_update_webhook_config_for_repo( url = f"/repos/{owner}/{repo}/hooks/{hook_id}/config" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -10528,7 +10832,11 @@ def update_invitation( url = f"/repos/{owner}/{repo}/invitations/{invitation_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -10589,7 +10897,11 @@ async def async_update_invitation( url = f"/repos/{owner}/{repo}/invitations/{invitation_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -10708,7 +11020,11 @@ def create_deploy_key( url = f"/repos/{owner}/{repo}/keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -10764,7 +11080,11 @@ async def async_create_deploy_key( url = f"/repos/{owner}/{repo}/keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -10954,7 +11274,11 @@ def merge_upstream( url = f"/repos/{owner}/{repo}/merge-upstream" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11006,7 +11330,11 @@ async def async_merge_upstream( url = f"/repos/{owner}/{repo}/merge-upstream" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11065,7 +11393,11 @@ def merge( url = f"/repos/{owner}/{repo}/merges" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11127,7 +11459,11 @@ async def async_merge( url = f"/repos/{owner}/{repo}/merges" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11338,7 +11674,11 @@ def update_information_about_pages_site( url = f"/repos/{owner}/{repo}/pages" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11508,7 +11848,11 @@ async def async_update_information_about_pages_site( url = f"/repos/{owner}/{repo}/pages" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11605,7 +11949,11 @@ def create_pages_site( url = f"/repos/{owner}/{repo}/pages" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -11701,7 +12049,11 @@ async def async_create_pages_site( url = f"/repos/{owner}/{repo}/pages" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -12023,7 +12375,11 @@ def create_pages_deployment( url = f"/repos/{owner}/{repo}/pages/deployments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -12088,7 +12444,11 @@ async def async_create_pages_deployment( url = f"/repos/{owner}/{repo}/pages/deployments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -12508,7 +12868,11 @@ def create_or_update_custom_properties_values( url = f"/repos/{owner}/{repo}/properties/values" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -12567,7 +12931,11 @@ async def async_create_or_update_custom_properties_values( url = f"/repos/{owner}/{repo}/properties/values" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -12835,7 +13203,11 @@ def create_release( url = f"/repos/{owner}/{repo}/releases" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -12903,7 +13275,11 @@ async def async_create_release( url = f"/repos/{owner}/{repo}/releases" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13055,7 +13431,11 @@ def update_release_asset( url = f"/repos/{owner}/{repo}/releases/assets/{asset_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13113,7 +13493,11 @@ async def async_update_release_asset( url = f"/repos/{owner}/{repo}/releases/assets/{asset_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13173,7 +13557,11 @@ def generate_release_notes( url = f"/repos/{owner}/{repo}/releases/generate-notes" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13236,7 +13624,11 @@ async def async_generate_release_notes( url = f"/repos/{owner}/{repo}/releases/generate-notes" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13490,7 +13882,11 @@ def update_release( url = f"/repos/{owner}/{repo}/releases/{release_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13558,7 +13954,11 @@ async def async_update_release( url = f"/repos/{owner}/{repo}/releases/{release_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -13664,7 +14064,11 @@ def upload_release_asset( "label": label, } - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/octet-stream", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } content = data @@ -13700,7 +14104,11 @@ async def async_upload_release_asset( "label": label, } - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/octet-stream", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } content = data @@ -14051,7 +14459,11 @@ def create_repo_ruleset( url = f"/repos/{owner}/{repo}/rulesets" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -14141,7 +14553,11 @@ async def async_create_repo_ruleset( url = f"/repos/{owner}/{repo}/rulesets" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -14442,7 +14858,11 @@ def update_repo_ruleset( url = f"/repos/{owner}/{repo}/rulesets/{ruleset_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -14535,7 +14955,11 @@ async def async_update_repo_ruleset( url = f"/repos/{owner}/{repo}/rulesets/{ruleset_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -14884,7 +15308,11 @@ def create_commit_status( url = f"/repos/{owner}/{repo}/statuses/{sha}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -14941,7 +15369,11 @@ async def async_create_commit_status( url = f"/repos/{owner}/{repo}/statuses/{sha}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -15116,7 +15548,11 @@ def create_tag_protection( url = f"/repos/{owner}/{repo}/tags/protection" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -15175,7 +15611,11 @@ async def async_create_tag_protection( url = f"/repos/{owner}/{repo}/tags/protection" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -15463,7 +15903,11 @@ def replace_all_topics( url = f"/repos/{owner}/{repo}/topics" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -15523,7 +15967,11 @@ async def async_replace_all_topics( url = f"/repos/{owner}/{repo}/topics" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -15812,7 +16260,11 @@ def transfer( url = f"/repos/{owner}/{repo}/transfer" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -15865,7 +16317,11 @@ async def async_transfer( url = f"/repos/{owner}/{repo}/transfer" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -16079,7 +16535,11 @@ def create_using_template( url = f"/repos/{template_owner}/{template_repo}/generate" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -16139,7 +16599,11 @@ async def async_create_using_template( url = f"/repos/{template_owner}/{template_repo}/generate" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -16374,7 +16838,11 @@ def create_for_authenticated_user( url = "/user/repos" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -16454,7 +16922,11 @@ async def async_create_for_authenticated_user( url = "/user/repos" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/secret_scanning.py b/githubkit/versions/v2022_11_28/rest/secret_scanning.py index 76affc929..f1087b5b4 100644 --- a/githubkit/versions/v2022_11_28/rest/secret_scanning.py +++ b/githubkit/versions/v2022_11_28/rest/secret_scanning.py @@ -486,7 +486,11 @@ def update_alert( url = f"/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -557,7 +561,11 @@ async def async_update_alert( url = f"/repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -698,7 +706,11 @@ def create_push_protection_bypass( url = f"/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -761,7 +773,11 @@ async def async_create_push_protection_bypass( url = f"/repos/{owner}/{repo}/secret-scanning/push-protection-bypasses" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/security_advisories.py b/githubkit/versions/v2022_11_28/rest/security_advisories.py index 78e98b7ef..edeab0270 100644 --- a/githubkit/versions/v2022_11_28/rest/security_advisories.py +++ b/githubkit/versions/v2022_11_28/rest/security_advisories.py @@ -506,7 +506,11 @@ def create_repository_advisory( url = f"/repos/{owner}/{repo}/security-advisories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -579,7 +583,11 @@ async def async_create_repository_advisory( url = f"/repos/{owner}/{repo}/security-advisories" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -652,7 +660,11 @@ def create_private_vulnerability_report( url = f"/repos/{owner}/{repo}/security-advisories/reports" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -725,7 +737,11 @@ async def async_create_private_vulnerability_report( url = f"/repos/{owner}/{repo}/security-advisories/reports" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -859,7 +875,11 @@ def update_repository_advisory( url = f"/repos/{owner}/{repo}/security-advisories/{ghsa_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -939,7 +959,11 @@ async def async_update_repository_advisory( url = f"/repos/{owner}/{repo}/security-advisories/{ghsa_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/teams.py b/githubkit/versions/v2022_11_28/rest/teams.py index be572cf64..b1c16b099 100644 --- a/githubkit/versions/v2022_11_28/rest/teams.py +++ b/githubkit/versions/v2022_11_28/rest/teams.py @@ -184,7 +184,11 @@ def create( url = f"/orgs/{org}/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -245,7 +249,11 @@ async def async_create( url = f"/orgs/{org}/teams" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -400,7 +408,11 @@ def update_in_org( url = f"/orgs/{org}/teams/{team_slug}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -468,7 +480,11 @@ async def async_update_in_org( url = f"/orgs/{org}/teams/{team_slug}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -598,7 +614,11 @@ def create_discussion_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -651,7 +671,11 @@ async def async_create_discussion_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -799,7 +823,11 @@ def update_discussion_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -863,7 +891,11 @@ async def async_update_discussion_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -994,7 +1026,11 @@ def create_discussion_comment_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1055,7 +1091,11 @@ async def async_create_discussion_comment_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1209,7 +1249,11 @@ def update_discussion_comment_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1274,7 +1318,11 @@ async def async_update_discussion_comment_in_org( url = f"/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1514,7 +1562,11 @@ def add_or_update_membership_for_user_in_org( url = f"/orgs/{org}/teams/{team_slug}/memberships/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1574,7 +1626,11 @@ async def async_add_or_update_membership_for_user_in_org( url = f"/orgs/{org}/teams/{team_slug}/memberships/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1794,7 +1850,11 @@ def add_or_update_project_permissions_in_org( url = f"/orgs/{org}/teams/{team_slug}/projects/{project_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1861,7 +1921,11 @@ async def async_add_or_update_project_permissions_in_org( url = f"/orgs/{org}/teams/{team_slug}/projects/{project_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2076,7 +2140,11 @@ def add_or_update_repo_permissions_in_org( url = f"/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2132,7 +2200,11 @@ async def async_add_or_update_repo_permissions_in_org( url = f"/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2388,7 +2460,11 @@ def update_legacy( url = f"/teams/{team_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2448,7 +2524,11 @@ async def async_update_legacy( url = f"/teams/{team_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2569,7 +2649,11 @@ def create_discussion_legacy( url = f"/teams/{team_id}/discussions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2619,7 +2703,11 @@ async def async_create_discussion_legacy( url = f"/teams/{team_id}/discussions" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2756,7 +2844,11 @@ def update_discussion_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2813,7 +2905,11 @@ async def async_update_discussion_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2939,7 +3035,11 @@ def create_discussion_comment_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2997,7 +3097,11 @@ async def async_create_discussion_comment_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/comments" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3144,7 +3248,11 @@ def update_discussion_comment_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3206,7 +3314,11 @@ async def async_update_discussion_comment_legacy( url = f"/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3576,7 +3688,11 @@ def add_or_update_membership_for_user_legacy( url = f"/teams/{team_id}/memberships/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3634,7 +3750,11 @@ async def async_add_or_update_membership_for_user_legacy( url = f"/teams/{team_id}/memberships/{username}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3847,7 +3967,11 @@ def add_or_update_project_permissions_legacy( url = f"/teams/{team_id}/projects/{project_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -3907,7 +4031,11 @@ async def async_add_or_update_project_permissions_legacy( url = f"/teams/{team_id}/projects/{project_id}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4135,7 +4263,11 @@ def add_or_update_repo_permissions_legacy( url = f"/teams/{team_id}/repos/{owner}/{repo}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -4196,7 +4328,11 @@ async def async_add_or_update_repo_permissions_legacy( url = f"/teams/{team_id}/repos/{owner}/{repo}" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/githubkit/versions/v2022_11_28/rest/users.py b/githubkit/versions/v2022_11_28/rest/users.py index c4c56a52a..a38e0b564 100644 --- a/githubkit/versions/v2022_11_28/rest/users.py +++ b/githubkit/versions/v2022_11_28/rest/users.py @@ -157,7 +157,11 @@ def update_authenticated( url = "/user" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -215,7 +219,11 @@ async def async_update_authenticated( url = "/user" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -495,7 +503,11 @@ def set_primary_email_visibility_for_authenticated_user( url = "/user/email/visibility" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -553,7 +565,11 @@ async def async_set_primary_email_visibility_for_authenticated_user( url = "/user/email/visibility" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -683,7 +699,11 @@ def add_email_for_authenticated_user( url = "/user/emails" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -750,7 +770,11 @@ async def async_add_email_for_authenticated_user( url = "/user/emails" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -812,7 +836,11 @@ def delete_email_for_authenticated_user( url = "/user/emails" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -873,7 +901,11 @@ async def async_delete_email_for_authenticated_user( url = "/user/emails" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1284,7 +1316,11 @@ def create_gpg_key_for_authenticated_user( url = "/user/gpg_keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1333,7 +1369,11 @@ async def async_create_gpg_key_for_authenticated_user( url = "/user/gpg_keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1556,7 +1596,11 @@ def create_public_ssh_key_for_authenticated_user( url = "/user/keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1605,7 +1649,11 @@ async def async_create_public_ssh_key_for_authenticated_user( url = "/user/keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1905,7 +1953,11 @@ def add_social_account_for_authenticated_user( url = "/user/social_accounts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -1963,7 +2015,11 @@ async def async_add_social_account_for_authenticated_user( url = "/user/social_accounts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2014,7 +2070,11 @@ def delete_social_account_for_authenticated_user( url = "/user/social_accounts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2064,7 +2124,11 @@ async def async_delete_social_account_for_authenticated_user( url = "/user/social_accounts" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2190,7 +2254,11 @@ def create_ssh_signing_key_for_authenticated_user( url = "/user/ssh_signing_keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: @@ -2247,7 +2315,11 @@ async def async_create_ssh_signing_key_for_authenticated_user( url = "/user/ssh_signing_keys" - headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})} + headers = { + "Content-Type": "application/json", + "X-GitHub-Api-Version": self._REST_API_VERSION, + **(headers or {}), + } json = kwargs if data is UNSET else data if self._github.config.rest_api_body_validation: diff --git a/tests/test_rest/test_call.py b/tests/test_rest/test_call.py index d0a04fc08..ecfe25f2d 100644 --- a/tests/test_rest/test_call.py +++ b/tests/test_rest/test_call.py @@ -32,21 +32,21 @@ async def test_versioned_async_call(g: GitHub): def test_call_with_body(g: GitHub): resp = g.rest.markdown.render(text="Hello **world**") - assert isinstance(resp.parsed_data, str) + assert isinstance(resp.text, str) @pytest.mark.anyio async def test_async_call_with_body(g: GitHub): resp = await g.rest.markdown.async_render(text="Hello **world**") - assert isinstance(resp.parsed_data, str) + assert isinstance(resp.text, str) def test_call_with_raw_body(g: GitHub): resp = g.rest.markdown.render_raw(data="Hello **world**") - assert isinstance(resp.parsed_data, str) + assert isinstance(resp.text, str) @pytest.mark.anyio async def test_async_call_with_raw_body(g: GitHub): resp = await g.rest.markdown.async_render_raw(data="Hello **world**") - assert isinstance(resp.parsed_data, str) + assert isinstance(resp.text, str)