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(
@@ -517,15 +517,17 @@ class CodeScanningClient:
517
517
 
518
518
  url = f"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
519
519
 
520
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
521
-
522
- if not kwargs:
523
- kwargs = UNSET
520
+ headers = {
521
+ "Content-Type": "application/json",
522
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
523
+ **(headers or {}),
524
+ }
524
525
 
525
526
  json = kwargs if data is UNSET else data
526
- json = type_validate_python(
527
- ReposOwnerRepoCodeScanningAlertsAlertNumberPatchBody, json
528
- )
527
+ if self._github.config.rest_api_validate_body:
528
+ json = type_validate_python(
529
+ ReposOwnerRepoCodeScanningAlertsAlertNumberPatchBody, json
530
+ )
529
531
  json = model_dump(json) if isinstance(json, BaseModel) else json
530
532
 
531
533
  return self._github.request(
@@ -589,15 +591,17 @@ class CodeScanningClient:
589
591
 
590
592
  url = f"/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"
591
593
 
592
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
593
-
594
- if not kwargs:
595
- kwargs = UNSET
594
+ headers = {
595
+ "Content-Type": "application/json",
596
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
597
+ **(headers or {}),
598
+ }
596
599
 
597
600
  json = kwargs if data is UNSET else data
598
- json = type_validate_python(
599
- ReposOwnerRepoCodeScanningAlertsAlertNumberPatchBody, json
600
- )
601
+ if self._github.config.rest_api_validate_body:
602
+ json = type_validate_python(
603
+ ReposOwnerRepoCodeScanningAlertsAlertNumberPatchBody, json
604
+ )
601
605
  json = model_dump(json) if isinstance(json, BaseModel) else json
602
606
 
603
607
  return await self._github.arequest(
@@ -1182,20 +1186,22 @@ class CodeScanningClient:
1182
1186
 
1183
1187
  url = f"/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"
1184
1188
 
1185
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1186
-
1187
- if not kwargs:
1188
- kwargs = UNSET
1189
+ headers = {
1190
+ "Content-Type": "application/json",
1191
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1192
+ **(headers or {}),
1193
+ }
1189
1194
 
1190
1195
  json = kwargs if data is UNSET else data
1191
- json = type_validate_python(
1192
- Union[
1193
- ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof0,
1194
- ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof1,
1195
- ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof2,
1196
- ],
1197
- json,
1198
- )
1196
+ if self._github.config.rest_api_validate_body:
1197
+ json = type_validate_python(
1198
+ Union[
1199
+ ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof0,
1200
+ ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof1,
1201
+ ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof2,
1202
+ ],
1203
+ json,
1204
+ )
1199
1205
  json = model_dump(json) if isinstance(json, BaseModel) else json
1200
1206
 
1201
1207
  return self._github.request(
@@ -1306,20 +1312,22 @@ class CodeScanningClient:
1306
1312
 
1307
1313
  url = f"/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"
1308
1314
 
1309
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1310
-
1311
- if not kwargs:
1312
- kwargs = UNSET
1315
+ headers = {
1316
+ "Content-Type": "application/json",
1317
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1318
+ **(headers or {}),
1319
+ }
1313
1320
 
1314
1321
  json = kwargs if data is UNSET else data
1315
- json = type_validate_python(
1316
- Union[
1317
- ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof0,
1318
- ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof1,
1319
- ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof2,
1320
- ],
1321
- json,
1322
- )
1322
+ if self._github.config.rest_api_validate_body:
1323
+ json = type_validate_python(
1324
+ Union[
1325
+ ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof0,
1326
+ ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof1,
1327
+ ReposOwnerRepoCodeScanningCodeqlVariantAnalysesPostBodyOneof2,
1328
+ ],
1329
+ json,
1330
+ )
1323
1331
  json = model_dump(json) if isinstance(json, BaseModel) else json
1324
1332
 
1325
1333
  return await self._github.arequest(
@@ -1581,13 +1589,15 @@ class CodeScanningClient:
1581
1589
 
1582
1590
  url = f"/repos/{owner}/{repo}/code-scanning/default-setup"
1583
1591
 
1584
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1585
-
1586
- if not kwargs:
1587
- kwargs = UNSET
1592
+ headers = {
1593
+ "Content-Type": "application/json",
1594
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1595
+ **(headers or {}),
1596
+ }
1588
1597
 
1589
1598
  json = kwargs if data is UNSET else data
1590
- json = type_validate_python(CodeScanningDefaultSetupUpdate, json)
1599
+ if self._github.config.rest_api_validate_body:
1600
+ json = type_validate_python(CodeScanningDefaultSetupUpdate, json)
1591
1601
  json = model_dump(json) if isinstance(json, BaseModel) else json
1592
1602
 
1593
1603
  return self._github.request(
@@ -1660,13 +1670,15 @@ class CodeScanningClient:
1660
1670
 
1661
1671
  url = f"/repos/{owner}/{repo}/code-scanning/default-setup"
1662
1672
 
1663
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1664
-
1665
- if not kwargs:
1666
- kwargs = UNSET
1673
+ headers = {
1674
+ "Content-Type": "application/json",
1675
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1676
+ **(headers or {}),
1677
+ }
1667
1678
 
1668
1679
  json = kwargs if data is UNSET else data
1669
- json = type_validate_python(CodeScanningDefaultSetupUpdate, json)
1680
+ if self._github.config.rest_api_validate_body:
1681
+ json = type_validate_python(CodeScanningDefaultSetupUpdate, json)
1670
1682
  json = model_dump(json) if isinstance(json, BaseModel) else json
1671
1683
 
1672
1684
  return await self._github.arequest(
@@ -1730,13 +1742,15 @@ class CodeScanningClient:
1730
1742
 
1731
1743
  url = f"/repos/{owner}/{repo}/code-scanning/sarifs"
1732
1744
 
1733
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1734
-
1735
- if not kwargs:
1736
- kwargs = UNSET
1745
+ headers = {
1746
+ "Content-Type": "application/json",
1747
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1748
+ **(headers or {}),
1749
+ }
1737
1750
 
1738
1751
  json = kwargs if data is UNSET else data
1739
- json = type_validate_python(ReposOwnerRepoCodeScanningSarifsPostBody, json)
1752
+ if self._github.config.rest_api_validate_body:
1753
+ json = type_validate_python(ReposOwnerRepoCodeScanningSarifsPostBody, json)
1740
1754
  json = model_dump(json) if isinstance(json, BaseModel) else json
1741
1755
 
1742
1756
  return self._github.request(
@@ -1799,13 +1813,15 @@ class CodeScanningClient:
1799
1813
 
1800
1814
  url = f"/repos/{owner}/{repo}/code-scanning/sarifs"
1801
1815
 
1802
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1803
-
1804
- if not kwargs:
1805
- kwargs = UNSET
1816
+ headers = {
1817
+ "Content-Type": "application/json",
1818
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1819
+ **(headers or {}),
1820
+ }
1806
1821
 
1807
1822
  json = kwargs if data is UNSET else data
1808
- json = type_validate_python(ReposOwnerRepoCodeScanningSarifsPostBody, json)
1823
+ if self._github.config.rest_api_validate_body:
1824
+ json = type_validate_python(ReposOwnerRepoCodeScanningSarifsPostBody, json)
1809
1825
  json = model_dump(json) if isinstance(json, BaseModel) else json
1810
1826
 
1811
1827
  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(