GitHubKit 0.11.13__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 (66) 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_0088.py +0 -1
  5. githubkit/versions/ghec_v2022_11_28/rest/actions.py +652 -472
  6. githubkit/versions/ghec_v2022_11_28/rest/activity.py +60 -44
  7. githubkit/versions/ghec_v2022_11_28/rest/apps.py +102 -74
  8. githubkit/versions/ghec_v2022_11_28/rest/billing.py +40 -32
  9. githubkit/versions/ghec_v2022_11_28/rest/checks.py +84 -64
  10. githubkit/versions/ghec_v2022_11_28/rest/code_scanning.py +74 -58
  11. githubkit/versions/ghec_v2022_11_28/rest/code_security.py +86 -66
  12. githubkit/versions/ghec_v2022_11_28/rest/codespaces.py +218 -154
  13. githubkit/versions/ghec_v2022_11_28/rest/copilot.py +72 -40
  14. githubkit/versions/ghec_v2022_11_28/rest/dependabot.py +68 -52
  15. githubkit/versions/ghec_v2022_11_28/rest/dependency_graph.py +14 -10
  16. githubkit/versions/ghec_v2022_11_28/rest/enterprise_admin.py +278 -208
  17. githubkit/versions/ghec_v2022_11_28/rest/gists.py +56 -40
  18. githubkit/versions/ghec_v2022_11_28/rest/git.py +84 -60
  19. githubkit/versions/ghec_v2022_11_28/rest/interactions.py +42 -30
  20. githubkit/versions/ghec_v2022_11_28/rest/issues.py +250 -198
  21. githubkit/versions/ghec_v2022_11_28/rest/markdown.py +34 -26
  22. githubkit/versions/ghec_v2022_11_28/rest/migrations.py +92 -60
  23. githubkit/versions/ghec_v2022_11_28/rest/oidc.py +14 -10
  24. githubkit/versions/ghec_v2022_11_28/rest/orgs.py +362 -246
  25. githubkit/versions/ghec_v2022_11_28/rest/projects.py +170 -126
  26. githubkit/versions/ghec_v2022_11_28/rest/pulls.py +234 -170
  27. githubkit/versions/ghec_v2022_11_28/rest/reactions.py +166 -130
  28. githubkit/versions/ghec_v2022_11_28/rest/repos.py +1020 -766
  29. githubkit/versions/ghec_v2022_11_28/rest/scim.py +50 -34
  30. githubkit/versions/ghec_v2022_11_28/rest/secret_scanning.py +36 -28
  31. githubkit/versions/ghec_v2022_11_28/rest/security_advisories.py +42 -30
  32. githubkit/versions/ghec_v2022_11_28/rest/teams.py +324 -238
  33. githubkit/versions/ghec_v2022_11_28/rest/users.py +154 -118
  34. githubkit/versions/ghec_v2022_11_28/types/group_0088.py +0 -1
  35. githubkit/versions/v2022_11_28/models/group_0060.py +0 -1
  36. githubkit/versions/v2022_11_28/rest/actions.py +534 -386
  37. githubkit/versions/v2022_11_28/rest/activity.py +60 -44
  38. githubkit/versions/v2022_11_28/rest/apps.py +102 -74
  39. githubkit/versions/v2022_11_28/rest/checks.py +84 -64
  40. githubkit/versions/v2022_11_28/rest/code_scanning.py +74 -58
  41. githubkit/versions/v2022_11_28/rest/code_security.py +86 -66
  42. githubkit/versions/v2022_11_28/rest/codespaces.py +218 -154
  43. githubkit/versions/v2022_11_28/rest/copilot.py +72 -40
  44. githubkit/versions/v2022_11_28/rest/dependabot.py +68 -52
  45. githubkit/versions/v2022_11_28/rest/dependency_graph.py +14 -10
  46. githubkit/versions/v2022_11_28/rest/gists.py +56 -40
  47. githubkit/versions/v2022_11_28/rest/git.py +84 -60
  48. githubkit/versions/v2022_11_28/rest/interactions.py +42 -30
  49. githubkit/versions/v2022_11_28/rest/issues.py +250 -198
  50. githubkit/versions/v2022_11_28/rest/markdown.py +34 -26
  51. githubkit/versions/v2022_11_28/rest/migrations.py +92 -60
  52. githubkit/versions/v2022_11_28/rest/oidc.py +14 -10
  53. githubkit/versions/v2022_11_28/rest/orgs.py +240 -168
  54. githubkit/versions/v2022_11_28/rest/projects.py +170 -126
  55. githubkit/versions/v2022_11_28/rest/pulls.py +234 -170
  56. githubkit/versions/v2022_11_28/rest/reactions.py +166 -130
  57. githubkit/versions/v2022_11_28/rest/repos.py +1020 -766
  58. githubkit/versions/v2022_11_28/rest/secret_scanning.py +36 -28
  59. githubkit/versions/v2022_11_28/rest/security_advisories.py +42 -30
  60. githubkit/versions/v2022_11_28/rest/teams.py +274 -204
  61. githubkit/versions/v2022_11_28/rest/users.py +154 -118
  62. githubkit/versions/v2022_11_28/types/group_0060.py +0 -1
  63. {githubkit-0.11.13.dist-info → githubkit-0.11.14.dist-info}/METADATA +2 -1
  64. {githubkit-0.11.13.dist-info → githubkit-0.11.14.dist-info}/RECORD +66 -66
  65. {githubkit-0.11.13.dist-info → githubkit-0.11.14.dist-info}/WHEEL +1 -1
  66. {githubkit-0.11.13.dist-info → githubkit-0.11.14.dist-info}/LICENSE +0 -0
@@ -172,19 +172,21 @@ class ChecksClient:
172
172
 
173
173
  url = f"/repos/{owner}/{repo}/check-runs"
174
174
 
175
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
176
-
177
- if not kwargs:
178
- kwargs = UNSET
175
+ headers = {
176
+ "Content-Type": "application/json",
177
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
178
+ **(headers or {}),
179
+ }
179
180
 
180
181
  json = kwargs if data is UNSET else data
181
- json = type_validate_python(
182
- Union[
183
- ReposOwnerRepoCheckRunsPostBodyOneof0,
184
- ReposOwnerRepoCheckRunsPostBodyOneof1,
185
- ],
186
- json,
187
- )
182
+ if self._github.config.rest_api_validate_body:
183
+ json = type_validate_python(
184
+ Union[
185
+ ReposOwnerRepoCheckRunsPostBodyOneof0,
186
+ ReposOwnerRepoCheckRunsPostBodyOneof1,
187
+ ],
188
+ json,
189
+ )
188
190
  json = model_dump(json) if isinstance(json, BaseModel) else json
189
191
 
190
192
  return self._github.request(
@@ -300,19 +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
- Union[
311
- ReposOwnerRepoCheckRunsPostBodyOneof0,
312
- ReposOwnerRepoCheckRunsPostBodyOneof1,
313
- ],
314
- json,
315
- )
312
+ if self._github.config.rest_api_validate_body:
313
+ json = type_validate_python(
314
+ Union[
315
+ ReposOwnerRepoCheckRunsPostBodyOneof0,
316
+ ReposOwnerRepoCheckRunsPostBodyOneof1,
317
+ ],
318
+ json,
319
+ )
316
320
  json = model_dump(json) if isinstance(json, BaseModel) else json
317
321
 
318
322
  return await self._github.arequest(
@@ -478,19 +482,21 @@ class ChecksClient:
478
482
 
479
483
  url = f"/repos/{owner}/{repo}/check-runs/{check_run_id}"
480
484
 
481
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
482
-
483
- if not kwargs:
484
- kwargs = UNSET
485
+ headers = {
486
+ "Content-Type": "application/json",
487
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
488
+ **(headers or {}),
489
+ }
485
490
 
486
491
  json = kwargs if data is UNSET else data
487
- json = type_validate_python(
488
- Union[
489
- ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0,
490
- ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1,
491
- ],
492
- json,
493
- )
492
+ if self._github.config.rest_api_validate_body:
493
+ json = type_validate_python(
494
+ Union[
495
+ ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0,
496
+ ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1,
497
+ ],
498
+ json,
499
+ )
494
500
  json = model_dump(json) if isinstance(json, BaseModel) else json
495
501
 
496
502
  return self._github.request(
@@ -610,19 +616,21 @@ class ChecksClient:
610
616
 
611
617
  url = f"/repos/{owner}/{repo}/check-runs/{check_run_id}"
612
618
 
613
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
614
-
615
- if not kwargs:
616
- kwargs = UNSET
619
+ headers = {
620
+ "Content-Type": "application/json",
621
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
622
+ **(headers or {}),
623
+ }
617
624
 
618
625
  json = kwargs if data is UNSET else data
619
- json = type_validate_python(
620
- Union[
621
- ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0,
622
- ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1,
623
- ],
624
- json,
625
- )
626
+ if self._github.config.rest_api_validate_body:
627
+ json = type_validate_python(
628
+ Union[
629
+ ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof0,
630
+ ReposOwnerRepoCheckRunsCheckRunIdPatchBodyAnyof1,
631
+ ],
632
+ json,
633
+ )
626
634
  json = model_dump(json) if isinstance(json, BaseModel) else json
627
635
 
628
636
  return await self._github.arequest(
@@ -791,13 +799,15 @@ class ChecksClient:
791
799
 
792
800
  url = f"/repos/{owner}/{repo}/check-suites"
793
801
 
794
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
795
-
796
- if not kwargs:
797
- kwargs = UNSET
802
+ headers = {
803
+ "Content-Type": "application/json",
804
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
805
+ **(headers or {}),
806
+ }
798
807
 
799
808
  json = kwargs if data is UNSET else data
800
- json = type_validate_python(ReposOwnerRepoCheckSuitesPostBody, json)
809
+ if self._github.config.rest_api_validate_body:
810
+ json = type_validate_python(ReposOwnerRepoCheckSuitesPostBody, json)
801
811
  json = model_dump(json) if isinstance(json, BaseModel) else json
802
812
 
803
813
  return self._github.request(
@@ -844,13 +854,15 @@ class ChecksClient:
844
854
 
845
855
  url = f"/repos/{owner}/{repo}/check-suites"
846
856
 
847
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
848
-
849
- if not kwargs:
850
- kwargs = UNSET
857
+ headers = {
858
+ "Content-Type": "application/json",
859
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
860
+ **(headers or {}),
861
+ }
851
862
 
852
863
  json = kwargs if data is UNSET else data
853
- json = type_validate_python(ReposOwnerRepoCheckSuitesPostBody, json)
864
+ if self._github.config.rest_api_validate_body:
865
+ json = type_validate_python(ReposOwnerRepoCheckSuitesPostBody, json)
854
866
  json = model_dump(json) if isinstance(json, BaseModel) else json
855
867
 
856
868
  return await self._github.arequest(
@@ -904,13 +916,17 @@ class ChecksClient:
904
916
 
905
917
  url = f"/repos/{owner}/{repo}/check-suites/preferences"
906
918
 
907
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
908
-
909
- if not kwargs:
910
- kwargs = UNSET
919
+ headers = {
920
+ "Content-Type": "application/json",
921
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
922
+ **(headers or {}),
923
+ }
911
924
 
912
925
  json = kwargs if data is UNSET else data
913
- json = type_validate_python(ReposOwnerRepoCheckSuitesPreferencesPatchBody, json)
926
+ if self._github.config.rest_api_validate_body:
927
+ json = type_validate_python(
928
+ ReposOwnerRepoCheckSuitesPreferencesPatchBody, json
929
+ )
914
930
  json = model_dump(json) if isinstance(json, BaseModel) else json
915
931
 
916
932
  return self._github.request(
@@ -964,13 +980,17 @@ class ChecksClient:
964
980
 
965
981
  url = f"/repos/{owner}/{repo}/check-suites/preferences"
966
982
 
967
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
968
-
969
- if not kwargs:
970
- kwargs = UNSET
983
+ headers = {
984
+ "Content-Type": "application/json",
985
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
986
+ **(headers or {}),
987
+ }
971
988
 
972
989
  json = kwargs if data is UNSET else data
973
- json = type_validate_python(ReposOwnerRepoCheckSuitesPreferencesPatchBody, json)
990
+ if self._github.config.rest_api_validate_body:
991
+ json = type_validate_python(
992
+ ReposOwnerRepoCheckSuitesPreferencesPatchBody, json
993
+ )
974
994
  json = model_dump(json) if isinstance(json, BaseModel) else json
975
995
 
976
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(
@@ -204,13 +204,15 @@ class CodeSecurityClient:
204
204
 
205
205
  url = f"/orgs/{org}/code-security/configurations"
206
206
 
207
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
208
-
209
- if not kwargs:
210
- kwargs = UNSET
207
+ headers = {
208
+ "Content-Type": "application/json",
209
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
210
+ **(headers or {}),
211
+ }
211
212
 
212
213
  json = kwargs if data is UNSET else data
213
- json = type_validate_python(OrgsOrgCodeSecurityConfigurationsPostBody, json)
214
+ if self._github.config.rest_api_validate_body:
215
+ json = type_validate_python(OrgsOrgCodeSecurityConfigurationsPostBody, json)
214
216
  json = model_dump(json) if isinstance(json, BaseModel) else json
215
217
 
216
218
  return self._github.request(
@@ -287,13 +289,15 @@ class CodeSecurityClient:
287
289
 
288
290
  url = f"/orgs/{org}/code-security/configurations"
289
291
 
290
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
291
-
292
- if not kwargs:
293
- kwargs = UNSET
292
+ headers = {
293
+ "Content-Type": "application/json",
294
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
295
+ **(headers or {}),
296
+ }
294
297
 
295
298
  json = kwargs if data is UNSET else data
296
- json = type_validate_python(OrgsOrgCodeSecurityConfigurationsPostBody, json)
299
+ if self._github.config.rest_api_validate_body:
300
+ json = type_validate_python(OrgsOrgCodeSecurityConfigurationsPostBody, json)
297
301
  json = model_dump(json) if isinstance(json, BaseModel) else json
298
302
 
299
303
  return await self._github.arequest(
@@ -394,15 +398,17 @@ class CodeSecurityClient:
394
398
 
395
399
  url = f"/orgs/{org}/code-security/configurations/detach"
396
400
 
397
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
398
-
399
- if not kwargs:
400
- kwargs = UNSET
401
+ headers = {
402
+ "Content-Type": "application/json",
403
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
404
+ **(headers or {}),
405
+ }
401
406
 
402
407
  json = kwargs if data is UNSET else data
403
- json = type_validate_python(
404
- OrgsOrgCodeSecurityConfigurationsDetachDeleteBody, json
405
- )
408
+ if self._github.config.rest_api_validate_body:
409
+ json = type_validate_python(
410
+ OrgsOrgCodeSecurityConfigurationsDetachDeleteBody, json
411
+ )
406
412
  json = model_dump(json) if isinstance(json, BaseModel) else json
407
413
 
408
414
  return self._github.request(
@@ -454,15 +460,17 @@ class CodeSecurityClient:
454
460
 
455
461
  url = f"/orgs/{org}/code-security/configurations/detach"
456
462
 
457
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
458
-
459
- if not kwargs:
460
- kwargs = UNSET
463
+ headers = {
464
+ "Content-Type": "application/json",
465
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
466
+ **(headers or {}),
467
+ }
461
468
 
462
469
  json = kwargs if data is UNSET else data
463
- json = type_validate_python(
464
- OrgsOrgCodeSecurityConfigurationsDetachDeleteBody, json
465
- )
470
+ if self._github.config.rest_api_validate_body:
471
+ json = type_validate_python(
472
+ OrgsOrgCodeSecurityConfigurationsDetachDeleteBody, json
473
+ )
466
474
  json = model_dump(json) if isinstance(json, BaseModel) else json
467
475
 
468
476
  return await self._github.arequest(
@@ -655,15 +663,17 @@ class CodeSecurityClient:
655
663
 
656
664
  url = f"/orgs/{org}/code-security/configurations/{configuration_id}"
657
665
 
658
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
659
-
660
- if not kwargs:
661
- kwargs = UNSET
666
+ headers = {
667
+ "Content-Type": "application/json",
668
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
669
+ **(headers or {}),
670
+ }
662
671
 
663
672
  json = kwargs if data is UNSET else data
664
- json = type_validate_python(
665
- OrgsOrgCodeSecurityConfigurationsConfigurationIdPatchBody, json
666
- )
673
+ if self._github.config.rest_api_validate_body:
674
+ json = type_validate_python(
675
+ OrgsOrgCodeSecurityConfigurationsConfigurationIdPatchBody, json
676
+ )
667
677
  json = model_dump(json) if isinstance(json, BaseModel) else json
668
678
 
669
679
  return self._github.request(
@@ -745,15 +755,17 @@ class CodeSecurityClient:
745
755
 
746
756
  url = f"/orgs/{org}/code-security/configurations/{configuration_id}"
747
757
 
748
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
749
-
750
- if not kwargs:
751
- kwargs = UNSET
758
+ headers = {
759
+ "Content-Type": "application/json",
760
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
761
+ **(headers or {}),
762
+ }
752
763
 
753
764
  json = kwargs if data is UNSET else data
754
- json = type_validate_python(
755
- OrgsOrgCodeSecurityConfigurationsConfigurationIdPatchBody, json
756
- )
765
+ if self._github.config.rest_api_validate_body:
766
+ json = type_validate_python(
767
+ OrgsOrgCodeSecurityConfigurationsConfigurationIdPatchBody, json
768
+ )
757
769
  json = model_dump(json) if isinstance(json, BaseModel) else json
758
770
 
759
771
  return await self._github.arequest(
@@ -806,15 +818,17 @@ class CodeSecurityClient:
806
818
 
807
819
  url = f"/orgs/{org}/code-security/configurations/{configuration_id}/attach"
808
820
 
809
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
810
-
811
- if not kwargs:
812
- kwargs = UNSET
821
+ headers = {
822
+ "Content-Type": "application/json",
823
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
824
+ **(headers or {}),
825
+ }
813
826
 
814
827
  json = kwargs if data is UNSET else data
815
- json = type_validate_python(
816
- OrgsOrgCodeSecurityConfigurationsConfigurationIdAttachPostBody, json
817
- )
828
+ if self._github.config.rest_api_validate_body:
829
+ json = type_validate_python(
830
+ OrgsOrgCodeSecurityConfigurationsConfigurationIdAttachPostBody, json
831
+ )
818
832
  json = model_dump(json) if isinstance(json, BaseModel) else json
819
833
 
820
834
  return self._github.request(
@@ -867,15 +881,17 @@ class CodeSecurityClient:
867
881
 
868
882
  url = f"/orgs/{org}/code-security/configurations/{configuration_id}/attach"
869
883
 
870
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
871
-
872
- if not kwargs:
873
- kwargs = UNSET
884
+ headers = {
885
+ "Content-Type": "application/json",
886
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
887
+ **(headers or {}),
888
+ }
874
889
 
875
890
  json = kwargs if data is UNSET else data
876
- json = type_validate_python(
877
- OrgsOrgCodeSecurityConfigurationsConfigurationIdAttachPostBody, json
878
- )
891
+ if self._github.config.rest_api_validate_body:
892
+ json = type_validate_python(
893
+ OrgsOrgCodeSecurityConfigurationsConfigurationIdAttachPostBody, json
894
+ )
879
895
  json = model_dump(json) if isinstance(json, BaseModel) else json
880
896
 
881
897
  return await self._github.arequest(
@@ -936,15 +952,17 @@ class CodeSecurityClient:
936
952
 
937
953
  url = f"/orgs/{org}/code-security/configurations/{configuration_id}/defaults"
938
954
 
939
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
940
-
941
- if not kwargs:
942
- kwargs = UNSET
955
+ headers = {
956
+ "Content-Type": "application/json",
957
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
958
+ **(headers or {}),
959
+ }
943
960
 
944
961
  json = kwargs if data is UNSET else data
945
- json = type_validate_python(
946
- OrgsOrgCodeSecurityConfigurationsConfigurationIdDefaultsPutBody, json
947
- )
962
+ if self._github.config.rest_api_validate_body:
963
+ json = type_validate_python(
964
+ OrgsOrgCodeSecurityConfigurationsConfigurationIdDefaultsPutBody, json
965
+ )
948
966
  json = model_dump(json) if isinstance(json, BaseModel) else json
949
967
 
950
968
  return self._github.request(
@@ -1009,15 +1027,17 @@ class CodeSecurityClient:
1009
1027
 
1010
1028
  url = f"/orgs/{org}/code-security/configurations/{configuration_id}/defaults"
1011
1029
 
1012
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1013
-
1014
- if not kwargs:
1015
- kwargs = UNSET
1030
+ headers = {
1031
+ "Content-Type": "application/json",
1032
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1033
+ **(headers or {}),
1034
+ }
1016
1035
 
1017
1036
  json = kwargs if data is UNSET else data
1018
- json = type_validate_python(
1019
- OrgsOrgCodeSecurityConfigurationsConfigurationIdDefaultsPutBody, json
1020
- )
1037
+ if self._github.config.rest_api_validate_body:
1038
+ json = type_validate_python(
1039
+ OrgsOrgCodeSecurityConfigurationsConfigurationIdDefaultsPutBody, json
1040
+ )
1021
1041
  json = model_dump(json) if isinstance(json, BaseModel) else json
1022
1042
 
1023
1043
  return await self._github.arequest(