GitHubKit 0.11.12__py3-none-any.whl → 0.11.14__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of GitHubKit might be problematic. Click here for more details.

Files changed (78) hide show
  1. githubkit/config.py +3 -0
  2. githubkit/core.py +5 -0
  3. githubkit/github.py +3 -0
  4. githubkit/versions/ghec_v2022_11_28/models/group_0051.py +5 -1
  5. githubkit/versions/ghec_v2022_11_28/models/group_0088.py +0 -1
  6. githubkit/versions/ghec_v2022_11_28/models/group_0098.py +4 -0
  7. githubkit/versions/ghec_v2022_11_28/models/group_1010.py +3 -1
  8. githubkit/versions/ghec_v2022_11_28/rest/actions.py +652 -472
  9. githubkit/versions/ghec_v2022_11_28/rest/activity.py +60 -44
  10. githubkit/versions/ghec_v2022_11_28/rest/apps.py +102 -74
  11. githubkit/versions/ghec_v2022_11_28/rest/billing.py +40 -32
  12. githubkit/versions/ghec_v2022_11_28/rest/checks.py +83 -66
  13. githubkit/versions/ghec_v2022_11_28/rest/code_scanning.py +74 -58
  14. githubkit/versions/ghec_v2022_11_28/rest/code_security.py +86 -66
  15. githubkit/versions/ghec_v2022_11_28/rest/codespaces.py +218 -154
  16. githubkit/versions/ghec_v2022_11_28/rest/copilot.py +72 -40
  17. githubkit/versions/ghec_v2022_11_28/rest/dependabot.py +68 -52
  18. githubkit/versions/ghec_v2022_11_28/rest/dependency_graph.py +14 -10
  19. githubkit/versions/ghec_v2022_11_28/rest/enterprise_admin.py +278 -208
  20. githubkit/versions/ghec_v2022_11_28/rest/gists.py +56 -40
  21. githubkit/versions/ghec_v2022_11_28/rest/git.py +84 -60
  22. githubkit/versions/ghec_v2022_11_28/rest/interactions.py +42 -30
  23. githubkit/versions/ghec_v2022_11_28/rest/issues.py +250 -198
  24. githubkit/versions/ghec_v2022_11_28/rest/markdown.py +34 -26
  25. githubkit/versions/ghec_v2022_11_28/rest/migrations.py +92 -60
  26. githubkit/versions/ghec_v2022_11_28/rest/oidc.py +14 -10
  27. githubkit/versions/ghec_v2022_11_28/rest/orgs.py +362 -246
  28. githubkit/versions/ghec_v2022_11_28/rest/projects.py +170 -126
  29. githubkit/versions/ghec_v2022_11_28/rest/pulls.py +234 -170
  30. githubkit/versions/ghec_v2022_11_28/rest/reactions.py +166 -130
  31. githubkit/versions/ghec_v2022_11_28/rest/repos.py +1035 -800
  32. githubkit/versions/ghec_v2022_11_28/rest/scim.py +50 -34
  33. githubkit/versions/ghec_v2022_11_28/rest/secret_scanning.py +36 -28
  34. githubkit/versions/ghec_v2022_11_28/rest/security_advisories.py +42 -30
  35. githubkit/versions/ghec_v2022_11_28/rest/teams.py +324 -238
  36. githubkit/versions/ghec_v2022_11_28/rest/users.py +154 -118
  37. githubkit/versions/ghec_v2022_11_28/types/group_0051.py +2 -1
  38. githubkit/versions/ghec_v2022_11_28/types/group_0088.py +0 -1
  39. githubkit/versions/ghec_v2022_11_28/types/group_0098.py +1 -0
  40. githubkit/versions/ghec_v2022_11_28/types/group_1010.py +3 -1
  41. githubkit/versions/v2022_11_28/models/group_0030.py +5 -1
  42. githubkit/versions/v2022_11_28/models/group_0060.py +0 -1
  43. githubkit/versions/v2022_11_28/models/group_0082.py +4 -0
  44. githubkit/versions/v2022_11_28/models/group_0936.py +3 -1
  45. githubkit/versions/v2022_11_28/rest/actions.py +534 -386
  46. githubkit/versions/v2022_11_28/rest/activity.py +60 -44
  47. githubkit/versions/v2022_11_28/rest/apps.py +102 -74
  48. githubkit/versions/v2022_11_28/rest/checks.py +83 -66
  49. githubkit/versions/v2022_11_28/rest/code_scanning.py +74 -58
  50. githubkit/versions/v2022_11_28/rest/code_security.py +86 -66
  51. githubkit/versions/v2022_11_28/rest/codespaces.py +218 -154
  52. githubkit/versions/v2022_11_28/rest/copilot.py +72 -40
  53. githubkit/versions/v2022_11_28/rest/dependabot.py +68 -52
  54. githubkit/versions/v2022_11_28/rest/dependency_graph.py +14 -10
  55. githubkit/versions/v2022_11_28/rest/gists.py +56 -40
  56. githubkit/versions/v2022_11_28/rest/git.py +84 -60
  57. githubkit/versions/v2022_11_28/rest/interactions.py +42 -30
  58. githubkit/versions/v2022_11_28/rest/issues.py +250 -198
  59. githubkit/versions/v2022_11_28/rest/markdown.py +34 -26
  60. githubkit/versions/v2022_11_28/rest/migrations.py +92 -60
  61. githubkit/versions/v2022_11_28/rest/oidc.py +14 -10
  62. githubkit/versions/v2022_11_28/rest/orgs.py +240 -168
  63. githubkit/versions/v2022_11_28/rest/projects.py +170 -126
  64. githubkit/versions/v2022_11_28/rest/pulls.py +234 -170
  65. githubkit/versions/v2022_11_28/rest/reactions.py +166 -130
  66. githubkit/versions/v2022_11_28/rest/repos.py +1035 -800
  67. githubkit/versions/v2022_11_28/rest/secret_scanning.py +36 -28
  68. githubkit/versions/v2022_11_28/rest/security_advisories.py +42 -30
  69. githubkit/versions/v2022_11_28/rest/teams.py +274 -204
  70. githubkit/versions/v2022_11_28/rest/users.py +154 -118
  71. githubkit/versions/v2022_11_28/types/group_0030.py +2 -1
  72. githubkit/versions/v2022_11_28/types/group_0060.py +0 -1
  73. githubkit/versions/v2022_11_28/types/group_0082.py +1 -0
  74. githubkit/versions/v2022_11_28/types/group_0936.py +3 -1
  75. {githubkit-0.11.12.dist-info → githubkit-0.11.14.dist-info}/METADATA +3 -2
  76. {githubkit-0.11.12.dist-info → githubkit-0.11.14.dist-info}/RECORD +78 -78
  77. {githubkit-0.11.12.dist-info → githubkit-0.11.14.dist-info}/WHEEL +1 -1
  78. {githubkit-0.11.12.dist-info → githubkit-0.11.14.dist-info}/LICENSE +0 -0
@@ -10,10 +10,9 @@ See https://github.com/github/rest-api-description for more information.
10
10
  from __future__ import annotations
11
11
 
12
12
  from weakref import ref
13
- from typing_extensions import Annotated
14
13
  from typing import TYPE_CHECKING, Dict, Literal, Optional, overload
15
14
 
16
- from pydantic import Field, BaseModel
15
+ from pydantic import BaseModel
17
16
 
18
17
  from githubkit.typing import Missing, UnsetType
19
18
  from githubkit.utils import UNSET, exclude_unset
@@ -124,7 +123,9 @@ class ChecksClient:
124
123
  head_sha: str,
125
124
  details_url: Missing[str] = UNSET,
126
125
  external_id: Missing[str] = UNSET,
127
- status: Missing[Literal["queued", "in_progress"]] = UNSET,
126
+ status: Missing[
127
+ Literal["queued", "in_progress", "waiting", "requested", "pending"]
128
+ ] = UNSET,
128
129
  started_at: Missing[datetime] = UNSET,
129
130
  conclusion: Missing[
130
131
  Literal[
@@ -171,22 +172,21 @@ class ChecksClient:
171
172
 
172
173
  url = f"/repos/{owner}/{repo}/check-runs"
173
174
 
174
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
175
-
176
- if not kwargs:
177
- kwargs = UNSET
175
+ headers = {
176
+ "Content-Type": "application/json",
177
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
178
+ **(headers or {}),
179
+ }
178
180
 
179
181
  json = kwargs if data is UNSET else data
180
- json = type_validate_python(
181
- Annotated[
182
+ if self._github.config.rest_api_validate_body:
183
+ json = type_validate_python(
182
184
  Union[
183
185
  ReposOwnerRepoCheckRunsPostBodyOneof0,
184
186
  ReposOwnerRepoCheckRunsPostBodyOneof1,
185
187
  ],
186
- Field(discriminator="status"),
187
- ],
188
- json,
189
- )
188
+ json,
189
+ )
190
190
  json = model_dump(json) if isinstance(json, BaseModel) else json
191
191
 
192
192
  return self._github.request(
@@ -253,7 +253,9 @@ class ChecksClient:
253
253
  head_sha: str,
254
254
  details_url: Missing[str] = UNSET,
255
255
  external_id: Missing[str] = UNSET,
256
- status: Missing[Literal["queued", "in_progress"]] = UNSET,
256
+ status: Missing[
257
+ Literal["queued", "in_progress", "waiting", "requested", "pending"]
258
+ ] = UNSET,
257
259
  started_at: Missing[datetime] = UNSET,
258
260
  conclusion: Missing[
259
261
  Literal[
@@ -300,22 +302,21 @@ class ChecksClient:
300
302
 
301
303
  url = f"/repos/{owner}/{repo}/check-runs"
302
304
 
303
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
304
-
305
- if not kwargs:
306
- kwargs = UNSET
305
+ headers = {
306
+ "Content-Type": "application/json",
307
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
308
+ **(headers or {}),
309
+ }
307
310
 
308
311
  json = kwargs if data is UNSET else data
309
- json = type_validate_python(
310
- Annotated[
312
+ if self._github.config.rest_api_validate_body:
313
+ json = type_validate_python(
311
314
  Union[
312
315
  ReposOwnerRepoCheckRunsPostBodyOneof0,
313
316
  ReposOwnerRepoCheckRunsPostBodyOneof1,
314
317
  ],
315
- Field(discriminator="status"),
316
- ],
317
- json,
318
- )
318
+ json,
319
+ )
319
320
  json = model_dump(json) if isinstance(json, BaseModel) else json
320
321
 
321
322
  return await self._github.arequest(
@@ -481,19 +482,21 @@ class ChecksClient:
481
482
 
482
483
  url = f"/repos/{owner}/{repo}/check-runs/{check_run_id}"
483
484
 
484
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
485
-
486
- if not kwargs:
487
- kwargs = UNSET
485
+ headers = {
486
+ "Content-Type": "application/json",
487
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
488
+ **(headers or {}),
489
+ }
488
490
 
489
491
  json = kwargs if data is UNSET else data
490
- json = type_validate_python(
491
- Union[
492
- ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0,
493
- ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1,
494
- ],
495
- json,
496
- )
492
+ if self._github.config.rest_api_validate_body:
493
+ json = type_validate_python(
494
+ Union[
495
+ ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0,
496
+ ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1,
497
+ ],
498
+ json,
499
+ )
497
500
  json = model_dump(json) if isinstance(json, BaseModel) else json
498
501
 
499
502
  return self._github.request(
@@ -613,19 +616,21 @@ class ChecksClient:
613
616
 
614
617
  url = f"/repos/{owner}/{repo}/check-runs/{check_run_id}"
615
618
 
616
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
617
-
618
- if not kwargs:
619
- kwargs = UNSET
619
+ headers = {
620
+ "Content-Type": "application/json",
621
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
622
+ **(headers or {}),
623
+ }
620
624
 
621
625
  json = kwargs if data is UNSET else data
622
- json = type_validate_python(
623
- Union[
624
- ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0,
625
- ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1,
626
- ],
627
- json,
628
- )
626
+ if self._github.config.rest_api_validate_body:
627
+ json = type_validate_python(
628
+ Union[
629
+ ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0,
630
+ ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1,
631
+ ],
632
+ json,
633
+ )
629
634
  json = model_dump(json) if isinstance(json, BaseModel) else json
630
635
 
631
636
  return await self._github.arequest(
@@ -794,13 +799,15 @@ class ChecksClient:
794
799
 
795
800
  url = f"/repos/{owner}/{repo}/check-suites"
796
801
 
797
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
798
-
799
- if not kwargs:
800
- kwargs = UNSET
802
+ headers = {
803
+ "Content-Type": "application/json",
804
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
805
+ **(headers or {}),
806
+ }
801
807
 
802
808
  json = kwargs if data is UNSET else data
803
- json = type_validate_python(ReposOwnerRepoCheckSuitesPostBody, json)
809
+ if self._github.config.rest_api_validate_body:
810
+ json = type_validate_python(ReposOwnerRepoCheckSuitesPostBody, json)
804
811
  json = model_dump(json) if isinstance(json, BaseModel) else json
805
812
 
806
813
  return self._github.request(
@@ -847,13 +854,15 @@ class ChecksClient:
847
854
 
848
855
  url = f"/repos/{owner}/{repo}/check-suites"
849
856
 
850
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
851
-
852
- if not kwargs:
853
- kwargs = UNSET
857
+ headers = {
858
+ "Content-Type": "application/json",
859
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
860
+ **(headers or {}),
861
+ }
854
862
 
855
863
  json = kwargs if data is UNSET else data
856
- json = type_validate_python(ReposOwnerRepoCheckSuitesPostBody, json)
864
+ if self._github.config.rest_api_validate_body:
865
+ json = type_validate_python(ReposOwnerRepoCheckSuitesPostBody, json)
857
866
  json = model_dump(json) if isinstance(json, BaseModel) else json
858
867
 
859
868
  return await self._github.arequest(
@@ -907,13 +916,17 @@ class ChecksClient:
907
916
 
908
917
  url = f"/repos/{owner}/{repo}/check-suites/preferences"
909
918
 
910
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
911
-
912
- if not kwargs:
913
- kwargs = UNSET
919
+ headers = {
920
+ "Content-Type": "application/json",
921
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
922
+ **(headers or {}),
923
+ }
914
924
 
915
925
  json = kwargs if data is UNSET else data
916
- json = type_validate_python(ReposOwnerRepoCheckSuitesPreferencesPatchBody, json)
926
+ if self._github.config.rest_api_validate_body:
927
+ json = type_validate_python(
928
+ ReposOwnerRepoCheckSuitesPreferencesPatchBody, json
929
+ )
917
930
  json = model_dump(json) if isinstance(json, BaseModel) else json
918
931
 
919
932
  return self._github.request(
@@ -967,13 +980,17 @@ class ChecksClient:
967
980
 
968
981
  url = f"/repos/{owner}/{repo}/check-suites/preferences"
969
982
 
970
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
971
-
972
- if not kwargs:
973
- kwargs = UNSET
983
+ headers = {
984
+ "Content-Type": "application/json",
985
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
986
+ **(headers or {}),
987
+ }
974
988
 
975
989
  json = kwargs if data is UNSET else data
976
- json = type_validate_python(ReposOwnerRepoCheckSuitesPreferencesPatchBody, json)
990
+ if self._github.config.rest_api_validate_body:
991
+ json = type_validate_python(
992
+ ReposOwnerRepoCheckSuitesPreferencesPatchBody, json
993
+ )
977
994
  json = model_dump(json) if isinstance(json, BaseModel) else json
978
995
 
979
996
  return await self._github.arequest(
@@ -411,15 +411,17 @@ class CodeScanningClient:
411
411
 
412
412
  url = f"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
413
413
 
414
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
415
-
416
- if not kwargs:
417
- kwargs = UNSET
414
+ headers = {
415
+ "Content-Type": "application/json",
416
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
417
+ **(headers or {}),
418
+ }
418
419
 
419
420
  json = kwargs if data is UNSET else data
420
- json = type_validate_python(
421
- ReposOwnerRepoCodeScanningAlertsAlertNumberPatchBody, json
422
- )
421
+ if self._github.config.rest_api_validate_body:
422
+ json = type_validate_python(
423
+ ReposOwnerRepoCodeScanningAlertsAlertNumberPatchBody, json
424
+ )
423
425
  json = model_dump(json) if isinstance(json, BaseModel) else json
424
426
 
425
427
  return self._github.request(
@@ -483,15 +485,17 @@ class CodeScanningClient:
483
485
 
484
486
  url = f"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
485
487
 
486
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
487
-
488
- if not kwargs:
489
- kwargs = UNSET
488
+ headers = {
489
+ "Content-Type": "application/json",
490
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
491
+ **(headers or {}),
492
+ }
490
493
 
491
494
  json = kwargs if data is UNSET else data
492
- json = type_validate_python(
493
- ReposOwnerRepoCodeScanningAlertsAlertNumberPatchBody, json
494
- )
495
+ if self._github.config.rest_api_validate_body:
496
+ json = type_validate_python(
497
+ ReposOwnerRepoCodeScanningAlertsAlertNumberPatchBody, json
498
+ )
495
499
  json = model_dump(json) if isinstance(json, BaseModel) else json
496
500
 
497
501
  return await self._github.arequest(
@@ -1076,20 +1080,22 @@ class CodeScanningClient:
1076
1080
 
1077
1081
  url = f"/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"
1078
1082
 
1079
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1080
-
1081
- if not kwargs:
1082
- kwargs = UNSET
1083
+ headers = {
1084
+ "Content-Type": "application/json",
1085
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1086
+ **(headers or {}),
1087
+ }
1083
1088
 
1084
1089
  json = kwargs if data is UNSET else data
1085
- json = type_validate_python(
1086
- Union[
1087
- ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof0,
1088
- ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof1,
1089
- ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof2,
1090
- ],
1091
- json,
1092
- )
1090
+ if self._github.config.rest_api_validate_body:
1091
+ json = type_validate_python(
1092
+ Union[
1093
+ ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof0,
1094
+ ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof1,
1095
+ ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof2,
1096
+ ],
1097
+ json,
1098
+ )
1093
1099
  json = model_dump(json) if isinstance(json, BaseModel) else json
1094
1100
 
1095
1101
  return self._github.request(
@@ -1200,20 +1206,22 @@ class CodeScanningClient:
1200
1206
 
1201
1207
  url = f"/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"
1202
1208
 
1203
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1204
-
1205
- if not kwargs:
1206
- kwargs = UNSET
1209
+ headers = {
1210
+ "Content-Type": "application/json",
1211
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1212
+ **(headers or {}),
1213
+ }
1207
1214
 
1208
1215
  json = kwargs if data is UNSET else data
1209
- json = type_validate_python(
1210
- Union[
1211
- ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof0,
1212
- ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof1,
1213
- ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof2,
1214
- ],
1215
- json,
1216
- )
1216
+ if self._github.config.rest_api_validate_body:
1217
+ json = type_validate_python(
1218
+ Union[
1219
+ ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof0,
1220
+ ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof1,
1221
+ ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof2,
1222
+ ],
1223
+ json,
1224
+ )
1217
1225
  json = model_dump(json) if isinstance(json, BaseModel) else json
1218
1226
 
1219
1227
  return await self._github.arequest(
@@ -1475,13 +1483,15 @@ class CodeScanningClient:
1475
1483
 
1476
1484
  url = f"/repos/{owner}/{repo}/code-scanning/default-setup"
1477
1485
 
1478
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1479
-
1480
- if not kwargs:
1481
- kwargs = UNSET
1486
+ headers = {
1487
+ "Content-Type": "application/json",
1488
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1489
+ **(headers or {}),
1490
+ }
1482
1491
 
1483
1492
  json = kwargs if data is UNSET else data
1484
- json = type_validate_python(CodeScanningDefaultSetupUpdate, json)
1493
+ if self._github.config.rest_api_validate_body:
1494
+ json = type_validate_python(CodeScanningDefaultSetupUpdate, json)
1485
1495
  json = model_dump(json) if isinstance(json, BaseModel) else json
1486
1496
 
1487
1497
  return self._github.request(
@@ -1554,13 +1564,15 @@ class CodeScanningClient:
1554
1564
 
1555
1565
  url = f"/repos/{owner}/{repo}/code-scanning/default-setup"
1556
1566
 
1557
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1558
-
1559
- if not kwargs:
1560
- kwargs = UNSET
1567
+ headers = {
1568
+ "Content-Type": "application/json",
1569
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1570
+ **(headers or {}),
1571
+ }
1561
1572
 
1562
1573
  json = kwargs if data is UNSET else data
1563
- json = type_validate_python(CodeScanningDefaultSetupUpdate, json)
1574
+ if self._github.config.rest_api_validate_body:
1575
+ json = type_validate_python(CodeScanningDefaultSetupUpdate, json)
1564
1576
  json = model_dump(json) if isinstance(json, BaseModel) else json
1565
1577
 
1566
1578
  return await self._github.arequest(
@@ -1624,13 +1636,15 @@ class CodeScanningClient:
1624
1636
 
1625
1637
  url = f"/repos/{owner}/{repo}/code-scanning/sarifs"
1626
1638
 
1627
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1628
-
1629
- if not kwargs:
1630
- kwargs = UNSET
1639
+ headers = {
1640
+ "Content-Type": "application/json",
1641
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1642
+ **(headers or {}),
1643
+ }
1631
1644
 
1632
1645
  json = kwargs if data is UNSET else data
1633
- json = type_validate_python(ReposOwnerRepoCodeScanningSarifsPostBody, json)
1646
+ if self._github.config.rest_api_validate_body:
1647
+ json = type_validate_python(ReposOwnerRepoCodeScanningSarifsPostBody, json)
1634
1648
  json = model_dump(json) if isinstance(json, BaseModel) else json
1635
1649
 
1636
1650
  return self._github.request(
@@ -1693,13 +1707,15 @@ class CodeScanningClient:
1693
1707
 
1694
1708
  url = f"/repos/{owner}/{repo}/code-scanning/sarifs"
1695
1709
 
1696
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1697
-
1698
- if not kwargs:
1699
- kwargs = UNSET
1710
+ headers = {
1711
+ "Content-Type": "application/json",
1712
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1713
+ **(headers or {}),
1714
+ }
1700
1715
 
1701
1716
  json = kwargs if data is UNSET else data
1702
- json = type_validate_python(ReposOwnerRepoCodeScanningSarifsPostBody, json)
1717
+ if self._github.config.rest_api_validate_body:
1718
+ json = type_validate_python(ReposOwnerRepoCodeScanningSarifsPostBody, json)
1703
1719
  json = model_dump(json) if isinstance(json, BaseModel) else json
1704
1720
 
1705
1721
  return await self._github.arequest(