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
@@ -400,13 +400,15 @@ class ReposClient:
400
400
 
401
401
  url = f"/orgs/{org}/repos"
402
402
 
403
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
404
-
405
- if not kwargs:
406
- kwargs = UNSET
403
+ headers = {
404
+ "Content-Type": "application/json",
405
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
406
+ **(headers or {}),
407
+ }
407
408
 
408
409
  json = kwargs if data is UNSET else data
409
- json = type_validate_python(OrgsOrgReposPostBody, json)
410
+ if self._github.config.rest_api_validate_body:
411
+ json = type_validate_python(OrgsOrgReposPostBody, json)
410
412
  json = model_dump(json) if isinstance(json, BaseModel) else json
411
413
 
412
414
  return self._github.request(
@@ -489,13 +491,15 @@ class ReposClient:
489
491
 
490
492
  url = f"/orgs/{org}/repos"
491
493
 
492
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
493
-
494
- if not kwargs:
495
- kwargs = UNSET
494
+ headers = {
495
+ "Content-Type": "application/json",
496
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
497
+ **(headers or {}),
498
+ }
496
499
 
497
500
  json = kwargs if data is UNSET else data
498
- json = type_validate_python(OrgsOrgReposPostBody, json)
501
+ if self._github.config.rest_api_validate_body:
502
+ json = type_validate_python(OrgsOrgReposPostBody, json)
499
503
  json = model_dump(json) if isinstance(json, BaseModel) else json
500
504
 
501
505
  return await self._github.arequest(
@@ -515,6 +519,7 @@ class ReposClient:
515
519
  org: str,
516
520
  per_page: Missing[int] = UNSET,
517
521
  page: Missing[int] = UNSET,
522
+ targets: Missing[str] = UNSET,
518
523
  *,
519
524
  headers: Optional[Dict[str, str]] = None,
520
525
  ) -> Response[List[RepositoryRuleset]]:
@@ -529,6 +534,7 @@ class ReposClient:
529
534
  params = {
530
535
  "per_page": per_page,
531
536
  "page": page,
537
+ "targets": targets,
532
538
  }
533
539
 
534
540
  headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
@@ -550,6 +556,7 @@ class ReposClient:
550
556
  org: str,
551
557
  per_page: Missing[int] = UNSET,
552
558
  page: Missing[int] = UNSET,
559
+ targets: Missing[str] = UNSET,
553
560
  *,
554
561
  headers: Optional[Dict[str, str]] = None,
555
562
  ) -> Response[List[RepositoryRuleset]]:
@@ -564,6 +571,7 @@ class ReposClient:
564
571
  params = {
565
572
  "per_page": per_page,
566
573
  "page": page,
574
+ "targets": targets,
567
575
  }
568
576
 
569
577
  headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
@@ -650,13 +658,15 @@ class ReposClient:
650
658
 
651
659
  url = f"/orgs/{org}/rulesets"
652
660
 
653
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
654
-
655
- if not kwargs:
656
- kwargs = UNSET
661
+ headers = {
662
+ "Content-Type": "application/json",
663
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
664
+ **(headers or {}),
665
+ }
657
666
 
658
667
  json = kwargs if data is UNSET else data
659
- json = type_validate_python(OrgsOrgRulesetsPostBody, json)
668
+ if self._github.config.rest_api_validate_body:
669
+ json = type_validate_python(OrgsOrgRulesetsPostBody, json)
660
670
  json = model_dump(json) if isinstance(json, BaseModel) else json
661
671
 
662
672
  return self._github.request(
@@ -741,13 +751,15 @@ class ReposClient:
741
751
 
742
752
  url = f"/orgs/{org}/rulesets"
743
753
 
744
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
745
-
746
- if not kwargs:
747
- kwargs = UNSET
754
+ headers = {
755
+ "Content-Type": "application/json",
756
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
757
+ **(headers or {}),
758
+ }
748
759
 
749
760
  json = kwargs if data is UNSET else data
750
- json = type_validate_python(OrgsOrgRulesetsPostBody, json)
761
+ if self._github.config.rest_api_validate_body:
762
+ json = type_validate_python(OrgsOrgRulesetsPostBody, json)
751
763
  json = model_dump(json) if isinstance(json, BaseModel) else json
752
764
 
753
765
  return await self._github.arequest(
@@ -1033,13 +1045,15 @@ class ReposClient:
1033
1045
 
1034
1046
  url = f"/orgs/{org}/rulesets/{ruleset_id}"
1035
1047
 
1036
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1037
-
1038
- if not kwargs:
1039
- kwargs = UNSET
1048
+ headers = {
1049
+ "Content-Type": "application/json",
1050
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1051
+ **(headers or {}),
1052
+ }
1040
1053
 
1041
1054
  json = kwargs if data is UNSET else data
1042
- json = type_validate_python(OrgsOrgRulesetsRulesetIdPutBody, json)
1055
+ if self._github.config.rest_api_validate_body:
1056
+ json = type_validate_python(OrgsOrgRulesetsRulesetIdPutBody, json)
1043
1057
  json = model_dump(json) if isinstance(json, BaseModel) else json
1044
1058
 
1045
1059
  return self._github.request(
@@ -1131,13 +1145,15 @@ class ReposClient:
1131
1145
 
1132
1146
  url = f"/orgs/{org}/rulesets/{ruleset_id}"
1133
1147
 
1134
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1135
-
1136
- if not kwargs:
1137
- kwargs = UNSET
1148
+ headers = {
1149
+ "Content-Type": "application/json",
1150
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1151
+ **(headers or {}),
1152
+ }
1138
1153
 
1139
1154
  json = kwargs if data is UNSET else data
1140
- json = type_validate_python(OrgsOrgRulesetsRulesetIdPutBody, json)
1155
+ if self._github.config.rest_api_validate_body:
1156
+ json = type_validate_python(OrgsOrgRulesetsRulesetIdPutBody, json)
1141
1157
  json = model_dump(json) if isinstance(json, BaseModel) else json
1142
1158
 
1143
1159
  return await self._github.arequest(
@@ -1375,13 +1391,15 @@ class ReposClient:
1375
1391
 
1376
1392
  url = f"/repos/{owner}/{repo}"
1377
1393
 
1378
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1379
-
1380
- if not kwargs:
1381
- kwargs = UNSET
1394
+ headers = {
1395
+ "Content-Type": "application/json",
1396
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1397
+ **(headers or {}),
1398
+ }
1382
1399
 
1383
1400
  json = kwargs if data is UNSET else data
1384
- json = type_validate_python(ReposOwnerRepoPatchBody, json)
1401
+ if self._github.config.rest_api_validate_body:
1402
+ json = type_validate_python(ReposOwnerRepoPatchBody, json)
1385
1403
  json = model_dump(json) if isinstance(json, BaseModel) else json
1386
1404
 
1387
1405
  return self._github.request(
@@ -1468,13 +1486,15 @@ class ReposClient:
1468
1486
 
1469
1487
  url = f"/repos/{owner}/{repo}"
1470
1488
 
1471
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1472
-
1473
- if not kwargs:
1474
- kwargs = UNSET
1489
+ headers = {
1490
+ "Content-Type": "application/json",
1491
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1492
+ **(headers or {}),
1493
+ }
1475
1494
 
1476
1495
  json = kwargs if data is UNSET else data
1477
- json = type_validate_python(ReposOwnerRepoPatchBody, json)
1496
+ if self._github.config.rest_api_validate_body:
1497
+ json = type_validate_python(ReposOwnerRepoPatchBody, json)
1478
1498
  json = model_dump(json) if isinstance(json, BaseModel) else json
1479
1499
 
1480
1500
  return await self._github.arequest(
@@ -1647,13 +1667,15 @@ class ReposClient:
1647
1667
 
1648
1668
  url = f"/repos/{owner}/{repo}/attestations"
1649
1669
 
1650
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1651
-
1652
- if not kwargs:
1653
- kwargs = UNSET
1670
+ headers = {
1671
+ "Content-Type": "application/json",
1672
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1673
+ **(headers or {}),
1674
+ }
1654
1675
 
1655
1676
  json = kwargs if data is UNSET else data
1656
- json = type_validate_python(ReposOwnerRepoAttestationsPostBody, json)
1677
+ if self._github.config.rest_api_validate_body:
1678
+ json = type_validate_python(ReposOwnerRepoAttestationsPostBody, json)
1657
1679
  json = model_dump(json) if isinstance(json, BaseModel) else json
1658
1680
 
1659
1681
  return self._github.request(
@@ -1709,13 +1731,15 @@ class ReposClient:
1709
1731
 
1710
1732
  url = f"/repos/{owner}/{repo}/attestations"
1711
1733
 
1712
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1713
-
1714
- if not kwargs:
1715
- kwargs = UNSET
1734
+ headers = {
1735
+ "Content-Type": "application/json",
1736
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1737
+ **(headers or {}),
1738
+ }
1716
1739
 
1717
1740
  json = kwargs if data is UNSET else data
1718
- json = type_validate_python(ReposOwnerRepoAttestationsPostBody, json)
1741
+ if self._github.config.rest_api_validate_body:
1742
+ json = type_validate_python(ReposOwnerRepoAttestationsPostBody, json)
1719
1743
  json = model_dump(json) if isinstance(json, BaseModel) else json
1720
1744
 
1721
1745
  return await self._github.arequest(
@@ -1882,13 +1906,15 @@ class ReposClient:
1882
1906
 
1883
1907
  url = f"/repos/{owner}/{repo}/autolinks"
1884
1908
 
1885
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1886
-
1887
- if not kwargs:
1888
- kwargs = UNSET
1909
+ headers = {
1910
+ "Content-Type": "application/json",
1911
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1912
+ **(headers or {}),
1913
+ }
1889
1914
 
1890
1915
  json = kwargs if data is UNSET else data
1891
- json = type_validate_python(ReposOwnerRepoAutolinksPostBody, json)
1916
+ if self._github.config.rest_api_validate_body:
1917
+ json = type_validate_python(ReposOwnerRepoAutolinksPostBody, json)
1892
1918
  json = model_dump(json) if isinstance(json, BaseModel) else json
1893
1919
 
1894
1920
  return self._github.request(
@@ -1940,13 +1966,15 @@ class ReposClient:
1940
1966
 
1941
1967
  url = f"/repos/{owner}/{repo}/autolinks"
1942
1968
 
1943
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1944
-
1945
- if not kwargs:
1946
- kwargs = UNSET
1969
+ headers = {
1970
+ "Content-Type": "application/json",
1971
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1972
+ **(headers or {}),
1973
+ }
1947
1974
 
1948
1975
  json = kwargs if data is UNSET else data
1949
- json = type_validate_python(ReposOwnerRepoAutolinksPostBody, json)
1976
+ if self._github.config.rest_api_validate_body:
1977
+ json = type_validate_python(ReposOwnerRepoAutolinksPostBody, json)
1950
1978
  json = model_dump(json) if isinstance(json, BaseModel) else json
1951
1979
 
1952
1980
  return await self._github.arequest(
@@ -2424,13 +2452,17 @@ class ReposClient:
2424
2452
 
2425
2453
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection"
2426
2454
 
2427
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
2428
-
2429
- if not kwargs:
2430
- kwargs = UNSET
2455
+ headers = {
2456
+ "Content-Type": "application/json",
2457
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
2458
+ **(headers or {}),
2459
+ }
2431
2460
 
2432
2461
  json = kwargs if data is UNSET else data
2433
- json = type_validate_python(ReposOwnerRepoBranchesBranchProtectionPutBody, json)
2462
+ if self._github.config.rest_api_validate_body:
2463
+ json = type_validate_python(
2464
+ ReposOwnerRepoBranchesBranchProtectionPutBody, json
2465
+ )
2434
2466
  json = model_dump(json) if isinstance(json, BaseModel) else json
2435
2467
 
2436
2468
  return self._github.request(
@@ -2508,13 +2540,17 @@ class ReposClient:
2508
2540
 
2509
2541
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection"
2510
2542
 
2511
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
2512
-
2513
- if not kwargs:
2514
- kwargs = UNSET
2543
+ headers = {
2544
+ "Content-Type": "application/json",
2545
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
2546
+ **(headers or {}),
2547
+ }
2515
2548
 
2516
2549
  json = kwargs if data is UNSET else data
2517
- json = type_validate_python(ReposOwnerRepoBranchesBranchProtectionPutBody, json)
2550
+ if self._github.config.rest_api_validate_body:
2551
+ json = type_validate_python(
2552
+ ReposOwnerRepoBranchesBranchProtectionPutBody, json
2553
+ )
2518
2554
  json = model_dump(json) if isinstance(json, BaseModel) else json
2519
2555
 
2520
2556
  return await self._github.arequest(
@@ -2874,16 +2910,18 @@ class ReposClient:
2874
2910
 
2875
2911
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
2876
2912
 
2877
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
2878
-
2879
- if not kwargs:
2880
- kwargs = UNSET
2913
+ headers = {
2914
+ "Content-Type": "application/json",
2915
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
2916
+ **(headers or {}),
2917
+ }
2881
2918
 
2882
2919
  json = kwargs if data is UNSET else data
2883
- json = type_validate_python(
2884
- ReposOwnerRepoBranchesBranchProtectionRequiredPullRequestReviewsPatchBody,
2885
- json,
2886
- )
2920
+ if self._github.config.rest_api_validate_body:
2921
+ json = type_validate_python(
2922
+ ReposOwnerRepoBranchesBranchProtectionRequiredPullRequestReviewsPatchBody,
2923
+ json,
2924
+ )
2887
2925
  json = model_dump(json) if isinstance(json, BaseModel) else json
2888
2926
 
2889
2927
  return self._github.request(
@@ -2953,16 +2991,18 @@ class ReposClient:
2953
2991
 
2954
2992
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
2955
2993
 
2956
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
2957
-
2958
- if not kwargs:
2959
- kwargs = UNSET
2994
+ headers = {
2995
+ "Content-Type": "application/json",
2996
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
2997
+ **(headers or {}),
2998
+ }
2960
2999
 
2961
3000
  json = kwargs if data is UNSET else data
2962
- json = type_validate_python(
2963
- ReposOwnerRepoBranchesBranchProtectionRequiredPullRequestReviewsPatchBody,
2964
- json,
2965
- )
3001
+ if self._github.config.rest_api_validate_body:
3002
+ json = type_validate_python(
3003
+ ReposOwnerRepoBranchesBranchProtectionRequiredPullRequestReviewsPatchBody,
3004
+ json,
3005
+ )
2966
3006
  json = model_dump(json) if isinstance(json, BaseModel) else json
2967
3007
 
2968
3008
  return await self._github.arequest(
@@ -3286,15 +3326,18 @@ class ReposClient:
3286
3326
  f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
3287
3327
  )
3288
3328
 
3289
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3290
-
3291
- if not kwargs:
3292
- kwargs = UNSET
3329
+ headers = {
3330
+ "Content-Type": "application/json",
3331
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3332
+ **(headers or {}),
3333
+ }
3293
3334
 
3294
3335
  json = kwargs if data is UNSET else data
3295
- json = type_validate_python(
3296
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksPatchBody, json
3297
- )
3336
+ if self._github.config.rest_api_validate_body:
3337
+ json = type_validate_python(
3338
+ ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksPatchBody,
3339
+ json,
3340
+ )
3298
3341
  json = model_dump(json) if isinstance(json, BaseModel) else json
3299
3342
 
3300
3343
  return self._github.request(
@@ -3365,15 +3408,18 @@ class ReposClient:
3365
3408
  f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
3366
3409
  )
3367
3410
 
3368
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3369
-
3370
- if not kwargs:
3371
- kwargs = UNSET
3411
+ headers = {
3412
+ "Content-Type": "application/json",
3413
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3414
+ **(headers or {}),
3415
+ }
3372
3416
 
3373
3417
  json = kwargs if data is UNSET else data
3374
- json = type_validate_python(
3375
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksPatchBody, json
3376
- )
3418
+ if self._github.config.rest_api_validate_body:
3419
+ json = type_validate_python(
3420
+ ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksPatchBody,
3421
+ json,
3422
+ )
3377
3423
  json = model_dump(json) if isinstance(json, BaseModel) else json
3378
3424
 
3379
3425
  return await self._github.arequest(
@@ -3499,19 +3545,21 @@ class ReposClient:
3499
3545
 
3500
3546
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
3501
3547
 
3502
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3503
-
3504
- if not kwargs:
3505
- kwargs = UNSET
3548
+ headers = {
3549
+ "Content-Type": "application/json",
3550
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3551
+ **(headers or {}),
3552
+ }
3506
3553
 
3507
3554
  json = kwargs if data is UNSET else data
3508
- json = type_validate_python(
3509
- Union[
3510
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsPutBodyOneof0,
3511
- List[str],
3512
- ],
3513
- json,
3514
- )
3555
+ if self._github.config.rest_api_validate_body:
3556
+ json = type_validate_python(
3557
+ Union[
3558
+ ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsPutBodyOneof0,
3559
+ List[str],
3560
+ ],
3561
+ json,
3562
+ )
3515
3563
  json = model_dump(json) if isinstance(json, BaseModel) else json
3516
3564
 
3517
3565
  return self._github.request(
@@ -3581,19 +3629,21 @@ class ReposClient:
3581
3629
 
3582
3630
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
3583
3631
 
3584
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3585
-
3586
- if not kwargs:
3587
- kwargs = UNSET
3632
+ headers = {
3633
+ "Content-Type": "application/json",
3634
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3635
+ **(headers or {}),
3636
+ }
3588
3637
 
3589
3638
  json = kwargs if data is UNSET else data
3590
- json = type_validate_python(
3591
- Union[
3592
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsPutBodyOneof0,
3593
- List[str],
3594
- ],
3595
- json,
3596
- )
3639
+ if self._github.config.rest_api_validate_body:
3640
+ json = type_validate_python(
3641
+ Union[
3642
+ ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsPutBodyOneof0,
3643
+ List[str],
3644
+ ],
3645
+ json,
3646
+ )
3597
3647
  json = model_dump(json) if isinstance(json, BaseModel) else json
3598
3648
 
3599
3649
  return await self._github.arequest(
@@ -3663,19 +3713,21 @@ class ReposClient:
3663
3713
 
3664
3714
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
3665
3715
 
3666
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3667
-
3668
- if not kwargs:
3669
- kwargs = UNSET
3716
+ headers = {
3717
+ "Content-Type": "application/json",
3718
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3719
+ **(headers or {}),
3720
+ }
3670
3721
 
3671
3722
  json = kwargs if data is UNSET else data
3672
- json = type_validate_python(
3673
- Union[
3674
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsPostBodyOneof0,
3675
- List[str],
3676
- ],
3677
- json,
3678
- )
3723
+ if self._github.config.rest_api_validate_body:
3724
+ json = type_validate_python(
3725
+ Union[
3726
+ ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsPostBodyOneof0,
3727
+ List[str],
3728
+ ],
3729
+ json,
3730
+ )
3679
3731
  json = model_dump(json) if isinstance(json, BaseModel) else json
3680
3732
 
3681
3733
  return self._github.request(
@@ -3746,19 +3798,21 @@ class ReposClient:
3746
3798
 
3747
3799
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
3748
3800
 
3749
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3750
-
3751
- if not kwargs:
3752
- kwargs = UNSET
3801
+ headers = {
3802
+ "Content-Type": "application/json",
3803
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3804
+ **(headers or {}),
3805
+ }
3753
3806
 
3754
3807
  json = kwargs if data is UNSET else data
3755
- json = type_validate_python(
3756
- Union[
3757
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsPostBodyOneof0,
3758
- List[str],
3759
- ],
3760
- json,
3761
- )
3808
+ if self._github.config.rest_api_validate_body:
3809
+ json = type_validate_python(
3810
+ Union[
3811
+ ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsPostBodyOneof0,
3812
+ List[str],
3813
+ ],
3814
+ json,
3815
+ )
3762
3816
  json = model_dump(json) if isinstance(json, BaseModel) else json
3763
3817
 
3764
3818
  return await self._github.arequest(
@@ -3829,19 +3883,21 @@ class ReposClient:
3829
3883
 
3830
3884
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
3831
3885
 
3832
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3833
-
3834
- if not kwargs:
3835
- kwargs = UNSET
3886
+ headers = {
3887
+ "Content-Type": "application/json",
3888
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3889
+ **(headers or {}),
3890
+ }
3836
3891
 
3837
3892
  json = kwargs if data is UNSET else data
3838
- json = type_validate_python(
3839
- Union[
3840
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsDeleteBodyOneof0,
3841
- List[str],
3842
- ],
3843
- json,
3844
- )
3893
+ if self._github.config.rest_api_validate_body:
3894
+ json = type_validate_python(
3895
+ Union[
3896
+ ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsDeleteBodyOneof0,
3897
+ List[str],
3898
+ ],
3899
+ json,
3900
+ )
3845
3901
  json = model_dump(json) if isinstance(json, BaseModel) else json
3846
3902
 
3847
3903
  return self._github.request(
@@ -3911,19 +3967,21 @@ class ReposClient:
3911
3967
 
3912
3968
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
3913
3969
 
3914
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3915
-
3916
- if not kwargs:
3917
- kwargs = UNSET
3970
+ headers = {
3971
+ "Content-Type": "application/json",
3972
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3973
+ **(headers or {}),
3974
+ }
3918
3975
 
3919
3976
  json = kwargs if data is UNSET else data
3920
- json = type_validate_python(
3921
- Union[
3922
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsDeleteBodyOneof0,
3923
- List[str],
3924
- ],
3925
- json,
3926
- )
3977
+ if self._github.config.rest_api_validate_body:
3978
+ json = type_validate_python(
3979
+ Union[
3980
+ ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsDeleteBodyOneof0,
3981
+ List[str],
3982
+ ],
3983
+ json,
3984
+ )
3927
3985
  json = model_dump(json) if isinstance(json, BaseModel) else json
3928
3986
 
3929
3987
  return await self._github.arequest(
@@ -4133,15 +4191,17 @@ class ReposClient:
4133
4191
 
4134
4192
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
4135
4193
 
4136
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4137
-
4138
- if not kwargs:
4139
- kwargs = UNSET
4194
+ headers = {
4195
+ "Content-Type": "application/json",
4196
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4197
+ **(headers or {}),
4198
+ }
4140
4199
 
4141
4200
  json = kwargs if data is UNSET else data
4142
- json = type_validate_python(
4143
- ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPutBody, json
4144
- )
4201
+ if self._github.config.rest_api_validate_body:
4202
+ json = type_validate_python(
4203
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPutBody, json
4204
+ )
4145
4205
  json = model_dump(json) if isinstance(json, BaseModel) else json
4146
4206
 
4147
4207
  return self._github.request(
@@ -4202,15 +4262,17 @@ class ReposClient:
4202
4262
 
4203
4263
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
4204
4264
 
4205
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4206
-
4207
- if not kwargs:
4208
- kwargs = UNSET
4265
+ headers = {
4266
+ "Content-Type": "application/json",
4267
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4268
+ **(headers or {}),
4269
+ }
4209
4270
 
4210
4271
  json = kwargs if data is UNSET else data
4211
- json = type_validate_python(
4212
- ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPutBody, json
4213
- )
4272
+ if self._github.config.rest_api_validate_body:
4273
+ json = type_validate_python(
4274
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPutBody, json
4275
+ )
4214
4276
  json = model_dump(json) if isinstance(json, BaseModel) else json
4215
4277
 
4216
4278
  return await self._github.arequest(
@@ -4271,15 +4333,17 @@ class ReposClient:
4271
4333
 
4272
4334
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
4273
4335
 
4274
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4275
-
4276
- if not kwargs:
4277
- kwargs = UNSET
4336
+ headers = {
4337
+ "Content-Type": "application/json",
4338
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4339
+ **(headers or {}),
4340
+ }
4278
4341
 
4279
4342
  json = kwargs if data is UNSET else data
4280
- json = type_validate_python(
4281
- ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPostBody, json
4282
- )
4343
+ if self._github.config.rest_api_validate_body:
4344
+ json = type_validate_python(
4345
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPostBody, json
4346
+ )
4283
4347
  json = model_dump(json) if isinstance(json, BaseModel) else json
4284
4348
 
4285
4349
  return self._github.request(
@@ -4340,15 +4404,17 @@ class ReposClient:
4340
4404
 
4341
4405
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
4342
4406
 
4343
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4344
-
4345
- if not kwargs:
4346
- kwargs = UNSET
4407
+ headers = {
4408
+ "Content-Type": "application/json",
4409
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4410
+ **(headers or {}),
4411
+ }
4347
4412
 
4348
4413
  json = kwargs if data is UNSET else data
4349
- json = type_validate_python(
4350
- ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPostBody, json
4351
- )
4414
+ if self._github.config.rest_api_validate_body:
4415
+ json = type_validate_python(
4416
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPostBody, json
4417
+ )
4352
4418
  json = model_dump(json) if isinstance(json, BaseModel) else json
4353
4419
 
4354
4420
  return await self._github.arequest(
@@ -4409,15 +4475,17 @@ class ReposClient:
4409
4475
 
4410
4476
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
4411
4477
 
4412
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4413
-
4414
- if not kwargs:
4415
- kwargs = UNSET
4478
+ headers = {
4479
+ "Content-Type": "application/json",
4480
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4481
+ **(headers or {}),
4482
+ }
4416
4483
 
4417
4484
  json = kwargs if data is UNSET else data
4418
- json = type_validate_python(
4419
- ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsDeleteBody, json
4420
- )
4485
+ if self._github.config.rest_api_validate_body:
4486
+ json = type_validate_python(
4487
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsDeleteBody, json
4488
+ )
4421
4489
  json = model_dump(json) if isinstance(json, BaseModel) else json
4422
4490
 
4423
4491
  return self._github.request(
@@ -4478,15 +4546,17 @@ class ReposClient:
4478
4546
 
4479
4547
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
4480
4548
 
4481
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4482
-
4483
- if not kwargs:
4484
- kwargs = UNSET
4549
+ headers = {
4550
+ "Content-Type": "application/json",
4551
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4552
+ **(headers or {}),
4553
+ }
4485
4554
 
4486
4555
  json = kwargs if data is UNSET else data
4487
- json = type_validate_python(
4488
- ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsDeleteBody, json
4489
- )
4556
+ if self._github.config.rest_api_validate_body:
4557
+ json = type_validate_python(
4558
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsDeleteBody, json
4559
+ )
4490
4560
  json = model_dump(json) if isinstance(json, BaseModel) else json
4491
4561
 
4492
4562
  return await self._github.arequest(
@@ -4611,19 +4681,21 @@ class ReposClient:
4611
4681
 
4612
4682
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
4613
4683
 
4614
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4615
-
4616
- if not kwargs:
4617
- kwargs = UNSET
4684
+ headers = {
4685
+ "Content-Type": "application/json",
4686
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4687
+ **(headers or {}),
4688
+ }
4618
4689
 
4619
4690
  json = kwargs if data is UNSET else data
4620
- json = type_validate_python(
4621
- Union[
4622
- ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsPutBodyOneof0,
4623
- List[str],
4624
- ],
4625
- json,
4626
- )
4691
+ if self._github.config.rest_api_validate_body:
4692
+ json = type_validate_python(
4693
+ Union[
4694
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsPutBodyOneof0,
4695
+ List[str],
4696
+ ],
4697
+ json,
4698
+ )
4627
4699
  json = model_dump(json) if isinstance(json, BaseModel) else json
4628
4700
 
4629
4701
  return self._github.request(
@@ -4692,19 +4764,21 @@ class ReposClient:
4692
4764
 
4693
4765
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
4694
4766
 
4695
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4696
-
4697
- if not kwargs:
4698
- kwargs = UNSET
4767
+ headers = {
4768
+ "Content-Type": "application/json",
4769
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4770
+ **(headers or {}),
4771
+ }
4699
4772
 
4700
4773
  json = kwargs if data is UNSET else data
4701
- json = type_validate_python(
4702
- Union[
4703
- ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsPutBodyOneof0,
4704
- List[str],
4705
- ],
4706
- json,
4707
- )
4774
+ if self._github.config.rest_api_validate_body:
4775
+ json = type_validate_python(
4776
+ Union[
4777
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsPutBodyOneof0,
4778
+ List[str],
4779
+ ],
4780
+ json,
4781
+ )
4708
4782
  json = model_dump(json) if isinstance(json, BaseModel) else json
4709
4783
 
4710
4784
  return await self._github.arequest(
@@ -4773,19 +4847,21 @@ class ReposClient:
4773
4847
 
4774
4848
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
4775
4849
 
4776
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4777
-
4778
- if not kwargs:
4779
- kwargs = UNSET
4850
+ headers = {
4851
+ "Content-Type": "application/json",
4852
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4853
+ **(headers or {}),
4854
+ }
4780
4855
 
4781
4856
  json = kwargs if data is UNSET else data
4782
- json = type_validate_python(
4783
- Union[
4784
- ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsPostBodyOneof0,
4785
- List[str],
4786
- ],
4787
- json,
4788
- )
4857
+ if self._github.config.rest_api_validate_body:
4858
+ json = type_validate_python(
4859
+ Union[
4860
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsPostBodyOneof0,
4861
+ List[str],
4862
+ ],
4863
+ json,
4864
+ )
4789
4865
  json = model_dump(json) if isinstance(json, BaseModel) else json
4790
4866
 
4791
4867
  return self._github.request(
@@ -4854,19 +4930,21 @@ class ReposClient:
4854
4930
 
4855
4931
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
4856
4932
 
4857
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4858
-
4859
- if not kwargs:
4860
- kwargs = UNSET
4933
+ headers = {
4934
+ "Content-Type": "application/json",
4935
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4936
+ **(headers or {}),
4937
+ }
4861
4938
 
4862
4939
  json = kwargs if data is UNSET else data
4863
- json = type_validate_python(
4864
- Union[
4865
- ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsPostBodyOneof0,
4866
- List[str],
4867
- ],
4868
- json,
4869
- )
4940
+ if self._github.config.rest_api_validate_body:
4941
+ json = type_validate_python(
4942
+ Union[
4943
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsPostBodyOneof0,
4944
+ List[str],
4945
+ ],
4946
+ json,
4947
+ )
4870
4948
  json = model_dump(json) if isinstance(json, BaseModel) else json
4871
4949
 
4872
4950
  return await self._github.arequest(
@@ -4935,19 +5013,21 @@ class ReposClient:
4935
5013
 
4936
5014
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
4937
5015
 
4938
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4939
-
4940
- if not kwargs:
4941
- kwargs = UNSET
5016
+ headers = {
5017
+ "Content-Type": "application/json",
5018
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5019
+ **(headers or {}),
5020
+ }
4942
5021
 
4943
5022
  json = kwargs if data is UNSET else data
4944
- json = type_validate_python(
4945
- Union[
4946
- ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsDeleteBodyOneof0,
4947
- List[str],
4948
- ],
4949
- json,
4950
- )
5023
+ if self._github.config.rest_api_validate_body:
5024
+ json = type_validate_python(
5025
+ Union[
5026
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsDeleteBodyOneof0,
5027
+ List[str],
5028
+ ],
5029
+ json,
5030
+ )
4951
5031
  json = model_dump(json) if isinstance(json, BaseModel) else json
4952
5032
 
4953
5033
  return self._github.request(
@@ -5016,19 +5096,21 @@ class ReposClient:
5016
5096
 
5017
5097
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
5018
5098
 
5019
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5020
-
5021
- if not kwargs:
5022
- kwargs = UNSET
5099
+ headers = {
5100
+ "Content-Type": "application/json",
5101
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5102
+ **(headers or {}),
5103
+ }
5023
5104
 
5024
5105
  json = kwargs if data is UNSET else data
5025
- json = type_validate_python(
5026
- Union[
5027
- ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsDeleteBodyOneof0,
5028
- List[str],
5029
- ],
5030
- json,
5031
- )
5106
+ if self._github.config.rest_api_validate_body:
5107
+ json = type_validate_python(
5108
+ Union[
5109
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsDeleteBodyOneof0,
5110
+ List[str],
5111
+ ],
5112
+ json,
5113
+ )
5032
5114
  json = model_dump(json) if isinstance(json, BaseModel) else json
5033
5115
 
5034
5116
  return await self._github.arequest(
@@ -5145,15 +5227,17 @@ class ReposClient:
5145
5227
 
5146
5228
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
5147
5229
 
5148
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5149
-
5150
- if not kwargs:
5151
- kwargs = UNSET
5230
+ headers = {
5231
+ "Content-Type": "application/json",
5232
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5233
+ **(headers or {}),
5234
+ }
5152
5235
 
5153
5236
  json = kwargs if data is UNSET else data
5154
- json = type_validate_python(
5155
- ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPutBody, json
5156
- )
5237
+ if self._github.config.rest_api_validate_body:
5238
+ json = type_validate_python(
5239
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPutBody, json
5240
+ )
5157
5241
  json = model_dump(json) if isinstance(json, BaseModel) else json
5158
5242
 
5159
5243
  return self._github.request(
@@ -5214,15 +5298,17 @@ class ReposClient:
5214
5298
 
5215
5299
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
5216
5300
 
5217
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5218
-
5219
- if not kwargs:
5220
- kwargs = UNSET
5301
+ headers = {
5302
+ "Content-Type": "application/json",
5303
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5304
+ **(headers or {}),
5305
+ }
5221
5306
 
5222
5307
  json = kwargs if data is UNSET else data
5223
- json = type_validate_python(
5224
- ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPutBody, json
5225
- )
5308
+ if self._github.config.rest_api_validate_body:
5309
+ json = type_validate_python(
5310
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPutBody, json
5311
+ )
5226
5312
  json = model_dump(json) if isinstance(json, BaseModel) else json
5227
5313
 
5228
5314
  return await self._github.arequest(
@@ -5283,15 +5369,17 @@ class ReposClient:
5283
5369
 
5284
5370
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
5285
5371
 
5286
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5287
-
5288
- if not kwargs:
5289
- kwargs = UNSET
5372
+ headers = {
5373
+ "Content-Type": "application/json",
5374
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5375
+ **(headers or {}),
5376
+ }
5290
5377
 
5291
5378
  json = kwargs if data is UNSET else data
5292
- json = type_validate_python(
5293
- ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPostBody, json
5294
- )
5379
+ if self._github.config.rest_api_validate_body:
5380
+ json = type_validate_python(
5381
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPostBody, json
5382
+ )
5295
5383
  json = model_dump(json) if isinstance(json, BaseModel) else json
5296
5384
 
5297
5385
  return self._github.request(
@@ -5352,15 +5440,17 @@ class ReposClient:
5352
5440
 
5353
5441
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
5354
5442
 
5355
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5356
-
5357
- if not kwargs:
5358
- kwargs = UNSET
5443
+ headers = {
5444
+ "Content-Type": "application/json",
5445
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5446
+ **(headers or {}),
5447
+ }
5359
5448
 
5360
5449
  json = kwargs if data is UNSET else data
5361
- json = type_validate_python(
5362
- ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPostBody, json
5363
- )
5450
+ if self._github.config.rest_api_validate_body:
5451
+ json = type_validate_python(
5452
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPostBody, json
5453
+ )
5364
5454
  json = model_dump(json) if isinstance(json, BaseModel) else json
5365
5455
 
5366
5456
  return await self._github.arequest(
@@ -5421,15 +5511,17 @@ class ReposClient:
5421
5511
 
5422
5512
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
5423
5513
 
5424
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5425
-
5426
- if not kwargs:
5427
- kwargs = UNSET
5514
+ headers = {
5515
+ "Content-Type": "application/json",
5516
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5517
+ **(headers or {}),
5518
+ }
5428
5519
 
5429
5520
  json = kwargs if data is UNSET else data
5430
- json = type_validate_python(
5431
- ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersDeleteBody, json
5432
- )
5521
+ if self._github.config.rest_api_validate_body:
5522
+ json = type_validate_python(
5523
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersDeleteBody, json
5524
+ )
5433
5525
  json = model_dump(json) if isinstance(json, BaseModel) else json
5434
5526
 
5435
5527
  return self._github.request(
@@ -5490,15 +5582,17 @@ class ReposClient:
5490
5582
 
5491
5583
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
5492
5584
 
5493
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5494
-
5495
- if not kwargs:
5496
- kwargs = UNSET
5585
+ headers = {
5586
+ "Content-Type": "application/json",
5587
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5588
+ **(headers or {}),
5589
+ }
5497
5590
 
5498
5591
  json = kwargs if data is UNSET else data
5499
- json = type_validate_python(
5500
- ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersDeleteBody, json
5501
- )
5592
+ if self._github.config.rest_api_validate_body:
5593
+ json = type_validate_python(
5594
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersDeleteBody, json
5595
+ )
5502
5596
  json = model_dump(json) if isinstance(json, BaseModel) else json
5503
5597
 
5504
5598
  return await self._github.arequest(
@@ -5556,13 +5650,17 @@ class ReposClient:
5556
5650
 
5557
5651
  url = f"/repos/{owner}/{repo}/branches/{branch}/rename"
5558
5652
 
5559
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5560
-
5561
- if not kwargs:
5562
- kwargs = UNSET
5653
+ headers = {
5654
+ "Content-Type": "application/json",
5655
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5656
+ **(headers or {}),
5657
+ }
5563
5658
 
5564
5659
  json = kwargs if data is UNSET else data
5565
- json = type_validate_python(ReposOwnerRepoBranchesBranchRenamePostBody, json)
5660
+ if self._github.config.rest_api_validate_body:
5661
+ json = type_validate_python(
5662
+ ReposOwnerRepoBranchesBranchRenamePostBody, json
5663
+ )
5566
5664
  json = model_dump(json) if isinstance(json, BaseModel) else json
5567
5665
 
5568
5666
  return self._github.request(
@@ -5622,13 +5720,17 @@ class ReposClient:
5622
5720
 
5623
5721
  url = f"/repos/{owner}/{repo}/branches/{branch}/rename"
5624
5722
 
5625
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5626
-
5627
- if not kwargs:
5628
- kwargs = UNSET
5723
+ headers = {
5724
+ "Content-Type": "application/json",
5725
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5726
+ **(headers or {}),
5727
+ }
5629
5728
 
5630
5729
  json = kwargs if data is UNSET else data
5631
- json = type_validate_python(ReposOwnerRepoBranchesBranchRenamePostBody, json)
5730
+ if self._github.config.rest_api_validate_body:
5731
+ json = type_validate_python(
5732
+ ReposOwnerRepoBranchesBranchRenamePostBody, json
5733
+ )
5632
5734
  json = model_dump(json) if isinstance(json, BaseModel) else json
5633
5735
 
5634
5736
  return await self._github.arequest(
@@ -5870,13 +5972,17 @@ class ReposClient:
5870
5972
 
5871
5973
  url = f"/repos/{owner}/{repo}/collaborators/{username}"
5872
5974
 
5873
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5874
-
5875
- if not kwargs:
5876
- kwargs = UNSET
5975
+ headers = {
5976
+ "Content-Type": "application/json",
5977
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5978
+ **(headers or {}),
5979
+ }
5877
5980
 
5878
5981
  json = kwargs if data is UNSET else data
5879
- json = type_validate_python(ReposOwnerRepoCollaboratorsUsernamePutBody, json)
5982
+ if self._github.config.rest_api_validate_body:
5983
+ json = type_validate_python(
5984
+ ReposOwnerRepoCollaboratorsUsernamePutBody, json
5985
+ )
5880
5986
  json = model_dump(json) if isinstance(json, BaseModel) else json
5881
5987
 
5882
5988
  return self._github.request(
@@ -5935,13 +6041,17 @@ class ReposClient:
5935
6041
 
5936
6042
  url = f"/repos/{owner}/{repo}/collaborators/{username}"
5937
6043
 
5938
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5939
-
5940
- if not kwargs:
5941
- kwargs = UNSET
6044
+ headers = {
6045
+ "Content-Type": "application/json",
6046
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
6047
+ **(headers or {}),
6048
+ }
5942
6049
 
5943
6050
  json = kwargs if data is UNSET else data
5944
- json = type_validate_python(ReposOwnerRepoCollaboratorsUsernamePutBody, json)
6051
+ if self._github.config.rest_api_validate_body:
6052
+ json = type_validate_python(
6053
+ ReposOwnerRepoCollaboratorsUsernamePutBody, json
6054
+ )
5945
6055
  json = model_dump(json) if isinstance(json, BaseModel) else json
5946
6056
 
5947
6057
  return await self._github.arequest(
@@ -6269,13 +6379,15 @@ class ReposClient:
6269
6379
 
6270
6380
  url = f"/repos/{owner}/{repo}/comments/{comment_id}"
6271
6381
 
6272
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
6273
-
6274
- if not kwargs:
6275
- kwargs = UNSET
6382
+ headers = {
6383
+ "Content-Type": "application/json",
6384
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
6385
+ **(headers or {}),
6386
+ }
6276
6387
 
6277
6388
  json = kwargs if data is UNSET else data
6278
- json = type_validate_python(ReposOwnerRepoCommentsCommentIdPatchBody, json)
6389
+ if self._github.config.rest_api_validate_body:
6390
+ json = type_validate_python(ReposOwnerRepoCommentsCommentIdPatchBody, json)
6279
6391
  json = model_dump(json) if isinstance(json, BaseModel) else json
6280
6392
 
6281
6393
  return self._github.request(
@@ -6332,13 +6444,15 @@ class ReposClient:
6332
6444
 
6333
6445
  url = f"/repos/{owner}/{repo}/comments/{comment_id}"
6334
6446
 
6335
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
6336
-
6337
- if not kwargs:
6338
- kwargs = UNSET
6447
+ headers = {
6448
+ "Content-Type": "application/json",
6449
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
6450
+ **(headers or {}),
6451
+ }
6339
6452
 
6340
6453
  json = kwargs if data is UNSET else data
6341
- json = type_validate_python(ReposOwnerRepoCommentsCommentIdPatchBody, json)
6454
+ if self._github.config.rest_api_validate_body:
6455
+ json = type_validate_python(ReposOwnerRepoCommentsCommentIdPatchBody, json)
6342
6456
  json = model_dump(json) if isinstance(json, BaseModel) else json
6343
6457
 
6344
6458
  return await self._github.arequest(
@@ -6623,15 +6737,17 @@ class ReposClient:
6623
6737
 
6624
6738
  url = f"/repos/{owner}/{repo}/commits/{commit_sha}/comments"
6625
6739
 
6626
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
6627
-
6628
- if not kwargs:
6629
- kwargs = UNSET
6740
+ headers = {
6741
+ "Content-Type": "application/json",
6742
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
6743
+ **(headers or {}),
6744
+ }
6630
6745
 
6631
6746
  json = kwargs if data is UNSET else data
6632
- json = type_validate_python(
6633
- ReposOwnerRepoCommitsCommitShaCommentsPostBody, json
6634
- )
6747
+ if self._github.config.rest_api_validate_body:
6748
+ json = type_validate_python(
6749
+ ReposOwnerRepoCommitsCommitShaCommentsPostBody, json
6750
+ )
6635
6751
  json = model_dump(json) if isinstance(json, BaseModel) else json
6636
6752
 
6637
6753
  return self._github.request(
@@ -6693,15 +6809,17 @@ class ReposClient:
6693
6809
 
6694
6810
  url = f"/repos/{owner}/{repo}/commits/{commit_sha}/comments"
6695
6811
 
6696
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
6697
-
6698
- if not kwargs:
6699
- kwargs = UNSET
6812
+ headers = {
6813
+ "Content-Type": "application/json",
6814
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
6815
+ **(headers or {}),
6816
+ }
6700
6817
 
6701
6818
  json = kwargs if data is UNSET else data
6702
- json = type_validate_python(
6703
- ReposOwnerRepoCommitsCommitShaCommentsPostBody, json
6704
- )
6819
+ if self._github.config.rest_api_validate_body:
6820
+ json = type_validate_python(
6821
+ ReposOwnerRepoCommitsCommitShaCommentsPostBody, json
6822
+ )
6705
6823
  json = model_dump(json) if isinstance(json, BaseModel) else json
6706
6824
 
6707
6825
  return await self._github.arequest(
@@ -7284,13 +7402,15 @@ class ReposClient:
7284
7402
 
7285
7403
  url = f"/repos/{owner}/{repo}/contents/{path}"
7286
7404
 
7287
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
7288
-
7289
- if not kwargs:
7290
- kwargs = UNSET
7405
+ headers = {
7406
+ "Content-Type": "application/json",
7407
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
7408
+ **(headers or {}),
7409
+ }
7291
7410
 
7292
7411
  json = kwargs if data is UNSET else data
7293
- json = type_validate_python(ReposOwnerRepoContentsPathPutBody, json)
7412
+ if self._github.config.rest_api_validate_body:
7413
+ json = type_validate_python(ReposOwnerRepoContentsPathPutBody, json)
7294
7414
  json = model_dump(json) if isinstance(json, BaseModel) else json
7295
7415
 
7296
7416
  return self._github.request(
@@ -7358,13 +7478,15 @@ class ReposClient:
7358
7478
 
7359
7479
  url = f"/repos/{owner}/{repo}/contents/{path}"
7360
7480
 
7361
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
7362
-
7363
- if not kwargs:
7364
- kwargs = UNSET
7481
+ headers = {
7482
+ "Content-Type": "application/json",
7483
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
7484
+ **(headers or {}),
7485
+ }
7365
7486
 
7366
7487
  json = kwargs if data is UNSET else data
7367
- json = type_validate_python(ReposOwnerRepoContentsPathPutBody, json)
7488
+ if self._github.config.rest_api_validate_body:
7489
+ json = type_validate_python(ReposOwnerRepoContentsPathPutBody, json)
7368
7490
  json = model_dump(json) if isinstance(json, BaseModel) else json
7369
7491
 
7370
7492
  return await self._github.arequest(
@@ -7431,13 +7553,15 @@ class ReposClient:
7431
7553
 
7432
7554
  url = f"/repos/{owner}/{repo}/contents/{path}"
7433
7555
 
7434
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
7435
-
7436
- if not kwargs:
7437
- kwargs = UNSET
7556
+ headers = {
7557
+ "Content-Type": "application/json",
7558
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
7559
+ **(headers or {}),
7560
+ }
7438
7561
 
7439
7562
  json = kwargs if data is UNSET else data
7440
- json = type_validate_python(ReposOwnerRepoContentsPathDeleteBody, json)
7563
+ if self._github.config.rest_api_validate_body:
7564
+ json = type_validate_python(ReposOwnerRepoContentsPathDeleteBody, json)
7441
7565
  json = model_dump(json) if isinstance(json, BaseModel) else json
7442
7566
 
7443
7567
  return self._github.request(
@@ -7505,13 +7629,15 @@ class ReposClient:
7505
7629
 
7506
7630
  url = f"/repos/{owner}/{repo}/contents/{path}"
7507
7631
 
7508
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
7509
-
7510
- if not kwargs:
7511
- kwargs = UNSET
7632
+ headers = {
7633
+ "Content-Type": "application/json",
7634
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
7635
+ **(headers or {}),
7636
+ }
7512
7637
 
7513
7638
  json = kwargs if data is UNSET else data
7514
- json = type_validate_python(ReposOwnerRepoContentsPathDeleteBody, json)
7639
+ if self._github.config.rest_api_validate_body:
7640
+ json = type_validate_python(ReposOwnerRepoContentsPathDeleteBody, json)
7515
7641
  json = model_dump(json) if isinstance(json, BaseModel) else json
7516
7642
 
7517
7643
  return await self._github.arequest(
@@ -7734,13 +7860,15 @@ class ReposClient:
7734
7860
 
7735
7861
  url = f"/repos/{owner}/{repo}/deployments"
7736
7862
 
7737
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
7738
-
7739
- if not kwargs:
7740
- kwargs = UNSET
7863
+ headers = {
7864
+ "Content-Type": "application/json",
7865
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
7866
+ **(headers or {}),
7867
+ }
7741
7868
 
7742
7869
  json = kwargs if data is UNSET else data
7743
- json = type_validate_python(ReposOwnerRepoDeploymentsPostBody, json)
7870
+ if self._github.config.rest_api_validate_body:
7871
+ json = type_validate_python(ReposOwnerRepoDeploymentsPostBody, json)
7744
7872
  json = model_dump(json) if isinstance(json, BaseModel) else json
7745
7873
 
7746
7874
  return self._github.request(
@@ -7804,13 +7932,15 @@ class ReposClient:
7804
7932
 
7805
7933
  url = f"/repos/{owner}/{repo}/deployments"
7806
7934
 
7807
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
7808
-
7809
- if not kwargs:
7810
- kwargs = UNSET
7935
+ headers = {
7936
+ "Content-Type": "application/json",
7937
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
7938
+ **(headers or {}),
7939
+ }
7811
7940
 
7812
7941
  json = kwargs if data is UNSET else data
7813
- json = type_validate_python(ReposOwnerRepoDeploymentsPostBody, json)
7942
+ if self._github.config.rest_api_validate_body:
7943
+ json = type_validate_python(ReposOwnerRepoDeploymentsPostBody, json)
7814
7944
  json = model_dump(json) if isinstance(json, BaseModel) else json
7815
7945
 
7816
7946
  return await self._github.arequest(
@@ -8059,15 +8189,17 @@ class ReposClient:
8059
8189
 
8060
8190
  url = f"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
8061
8191
 
8062
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8063
-
8064
- if not kwargs:
8065
- kwargs = UNSET
8192
+ headers = {
8193
+ "Content-Type": "application/json",
8194
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8195
+ **(headers or {}),
8196
+ }
8066
8197
 
8067
8198
  json = kwargs if data is UNSET else data
8068
- json = type_validate_python(
8069
- ReposOwnerRepoDeploymentsDeploymentIdStatusesPostBody, json
8070
- )
8199
+ if self._github.config.rest_api_validate_body:
8200
+ json = type_validate_python(
8201
+ ReposOwnerRepoDeploymentsDeploymentIdStatusesPostBody, json
8202
+ )
8071
8203
  json = model_dump(json) if isinstance(json, BaseModel) else json
8072
8204
 
8073
8205
  return self._github.request(
@@ -8140,15 +8272,17 @@ class ReposClient:
8140
8272
 
8141
8273
  url = f"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
8142
8274
 
8143
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8144
-
8145
- if not kwargs:
8146
- kwargs = UNSET
8275
+ headers = {
8276
+ "Content-Type": "application/json",
8277
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8278
+ **(headers or {}),
8279
+ }
8147
8280
 
8148
8281
  json = kwargs if data is UNSET else data
8149
- json = type_validate_python(
8150
- ReposOwnerRepoDeploymentsDeploymentIdStatusesPostBody, json
8151
- )
8282
+ if self._github.config.rest_api_validate_body:
8283
+ json = type_validate_python(
8284
+ ReposOwnerRepoDeploymentsDeploymentIdStatusesPostBody, json
8285
+ )
8152
8286
  json = model_dump(json) if isinstance(json, BaseModel) else json
8153
8287
 
8154
8288
  return await self._github.arequest(
@@ -8259,13 +8393,15 @@ class ReposClient:
8259
8393
 
8260
8394
  url = f"/repos/{owner}/{repo}/dispatches"
8261
8395
 
8262
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8263
-
8264
- if not kwargs:
8265
- kwargs = UNSET
8396
+ headers = {
8397
+ "Content-Type": "application/json",
8398
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8399
+ **(headers or {}),
8400
+ }
8266
8401
 
8267
8402
  json = kwargs if data is UNSET else data
8268
- json = type_validate_python(ReposOwnerRepoDispatchesPostBody, json)
8403
+ if self._github.config.rest_api_validate_body:
8404
+ json = type_validate_python(ReposOwnerRepoDispatchesPostBody, json)
8269
8405
  json = model_dump(json) if isinstance(json, BaseModel) else json
8270
8406
 
8271
8407
  return self._github.request(
@@ -8322,13 +8458,15 @@ class ReposClient:
8322
8458
 
8323
8459
  url = f"/repos/{owner}/{repo}/dispatches"
8324
8460
 
8325
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8326
-
8327
- if not kwargs:
8328
- kwargs = UNSET
8461
+ headers = {
8462
+ "Content-Type": "application/json",
8463
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8464
+ **(headers or {}),
8465
+ }
8329
8466
 
8330
8467
  json = kwargs if data is UNSET else data
8331
- json = type_validate_python(ReposOwnerRepoDispatchesPostBody, json)
8468
+ if self._github.config.rest_api_validate_body:
8469
+ json = type_validate_python(ReposOwnerRepoDispatchesPostBody, json)
8332
8470
  json = model_dump(json) if isinstance(json, BaseModel) else json
8333
8471
 
8334
8472
  return await self._github.arequest(
@@ -8509,15 +8647,17 @@ class ReposClient:
8509
8647
 
8510
8648
  url = f"/repos/{owner}/{repo}/environments/{environment_name}"
8511
8649
 
8512
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8513
-
8514
- if not kwargs:
8515
- kwargs = UNSET
8650
+ headers = {
8651
+ "Content-Type": "application/json",
8652
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8653
+ **(headers or {}),
8654
+ }
8516
8655
 
8517
8656
  json = kwargs if data is UNSET else data
8518
- json = type_validate_python(
8519
- Union[ReposOwnerRepoEnvironmentsEnvironmentNamePutBody, None], json
8520
- )
8657
+ if self._github.config.rest_api_validate_body:
8658
+ json = type_validate_python(
8659
+ Union[ReposOwnerRepoEnvironmentsEnvironmentNamePutBody, None], json
8660
+ )
8521
8661
  json = model_dump(json) if isinstance(json, BaseModel) else json
8522
8662
 
8523
8663
  return self._github.request(
@@ -8592,15 +8732,17 @@ class ReposClient:
8592
8732
 
8593
8733
  url = f"/repos/{owner}/{repo}/environments/{environment_name}"
8594
8734
 
8595
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8596
-
8597
- if not kwargs:
8598
- kwargs = UNSET
8735
+ headers = {
8736
+ "Content-Type": "application/json",
8737
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8738
+ **(headers or {}),
8739
+ }
8599
8740
 
8600
8741
  json = kwargs if data is UNSET else data
8601
- json = type_validate_python(
8602
- Union[ReposOwnerRepoEnvironmentsEnvironmentNamePutBody, None], json
8603
- )
8742
+ if self._github.config.rest_api_validate_body:
8743
+ json = type_validate_python(
8744
+ Union[ReposOwnerRepoEnvironmentsEnvironmentNamePutBody, None], json
8745
+ )
8604
8746
  json = model_dump(json) if isinstance(json, BaseModel) else json
8605
8747
 
8606
8748
  return await self._github.arequest(
@@ -8767,13 +8909,15 @@ class ReposClient:
8767
8909
 
8768
8910
  url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
8769
8911
 
8770
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8771
-
8772
- if not kwargs:
8773
- kwargs = UNSET
8912
+ headers = {
8913
+ "Content-Type": "application/json",
8914
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8915
+ **(headers or {}),
8916
+ }
8774
8917
 
8775
8918
  json = kwargs if data is UNSET else data
8776
- json = type_validate_python(DeploymentBranchPolicyNamePatternWithType, json)
8919
+ if self._github.config.rest_api_validate_body:
8920
+ json = type_validate_python(DeploymentBranchPolicyNamePatternWithType, json)
8777
8921
  json = model_dump(json) if isinstance(json, BaseModel) else json
8778
8922
 
8779
8923
  return self._github.request(
@@ -8828,13 +8972,15 @@ class ReposClient:
8828
8972
 
8829
8973
  url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
8830
8974
 
8831
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8832
-
8833
- if not kwargs:
8834
- kwargs = UNSET
8975
+ headers = {
8976
+ "Content-Type": "application/json",
8977
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8978
+ **(headers or {}),
8979
+ }
8835
8980
 
8836
8981
  json = kwargs if data is UNSET else data
8837
- json = type_validate_python(DeploymentBranchPolicyNamePatternWithType, json)
8982
+ if self._github.config.rest_api_validate_body:
8983
+ json = type_validate_python(DeploymentBranchPolicyNamePatternWithType, json)
8838
8984
  json = model_dump(json) if isinstance(json, BaseModel) else json
8839
8985
 
8840
8986
  return await self._github.arequest(
@@ -8936,13 +9082,15 @@ class ReposClient:
8936
9082
 
8937
9083
  url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
8938
9084
 
8939
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8940
-
8941
- if not kwargs:
8942
- kwargs = UNSET
9085
+ headers = {
9086
+ "Content-Type": "application/json",
9087
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9088
+ **(headers or {}),
9089
+ }
8943
9090
 
8944
9091
  json = kwargs if data is UNSET else data
8945
- json = type_validate_python(DeploymentBranchPolicyNamePattern, json)
9092
+ if self._github.config.rest_api_validate_body:
9093
+ json = type_validate_python(DeploymentBranchPolicyNamePattern, json)
8946
9094
  json = model_dump(json) if isinstance(json, BaseModel) else json
8947
9095
 
8948
9096
  return self._github.request(
@@ -8995,13 +9143,15 @@ class ReposClient:
8995
9143
 
8996
9144
  url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
8997
9145
 
8998
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8999
-
9000
- if not kwargs:
9001
- kwargs = UNSET
9146
+ headers = {
9147
+ "Content-Type": "application/json",
9148
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9149
+ **(headers or {}),
9150
+ }
9002
9151
 
9003
9152
  json = kwargs if data is UNSET else data
9004
- json = type_validate_python(DeploymentBranchPolicyNamePattern, json)
9153
+ if self._github.config.rest_api_validate_body:
9154
+ json = type_validate_python(DeploymentBranchPolicyNamePattern, json)
9005
9155
  json = model_dump(json) if isinstance(json, BaseModel) else json
9006
9156
 
9007
9157
  return await self._github.arequest(
@@ -9152,16 +9302,18 @@ class ReposClient:
9152
9302
 
9153
9303
  url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
9154
9304
 
9155
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9156
-
9157
- if not kwargs:
9158
- kwargs = UNSET
9305
+ headers = {
9306
+ "Content-Type": "application/json",
9307
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9308
+ **(headers or {}),
9309
+ }
9159
9310
 
9160
9311
  json = kwargs if data is UNSET else data
9161
- json = type_validate_python(
9162
- ReposOwnerRepoEnvironmentsEnvironmentNameDeploymentProtectionRulesPostBody,
9163
- json,
9164
- )
9312
+ if self._github.config.rest_api_validate_body:
9313
+ json = type_validate_python(
9314
+ ReposOwnerRepoEnvironmentsEnvironmentNameDeploymentProtectionRulesPostBody,
9315
+ json,
9316
+ )
9165
9317
  json = model_dump(json) if isinstance(json, BaseModel) else json
9166
9318
 
9167
9319
  return self._github.request(
@@ -9216,16 +9368,18 @@ class ReposClient:
9216
9368
 
9217
9369
  url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
9218
9370
 
9219
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9220
-
9221
- if not kwargs:
9222
- kwargs = UNSET
9371
+ headers = {
9372
+ "Content-Type": "application/json",
9373
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9374
+ **(headers or {}),
9375
+ }
9223
9376
 
9224
9377
  json = kwargs if data is UNSET else data
9225
- json = type_validate_python(
9226
- ReposOwnerRepoEnvironmentsEnvironmentNameDeploymentProtectionRulesPostBody,
9227
- json,
9228
- )
9378
+ if self._github.config.rest_api_validate_body:
9379
+ json = type_validate_python(
9380
+ ReposOwnerRepoEnvironmentsEnvironmentNameDeploymentProtectionRulesPostBody,
9381
+ json,
9382
+ )
9229
9383
  json = model_dump(json) if isinstance(json, BaseModel) else json
9230
9384
 
9231
9385
  return await self._github.arequest(
@@ -9515,13 +9669,15 @@ class ReposClient:
9515
9669
 
9516
9670
  url = f"/repos/{owner}/{repo}/forks"
9517
9671
 
9518
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9519
-
9520
- if not kwargs:
9521
- kwargs = UNSET
9672
+ headers = {
9673
+ "Content-Type": "application/json",
9674
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9675
+ **(headers or {}),
9676
+ }
9522
9677
 
9523
9678
  json = kwargs if data is UNSET else data
9524
- json = type_validate_python(Union[ReposOwnerRepoForksPostBody, None], json)
9679
+ if self._github.config.rest_api_validate_body:
9680
+ json = type_validate_python(Union[ReposOwnerRepoForksPostBody, None], json)
9525
9681
  json = model_dump(json) if isinstance(json, BaseModel) else json
9526
9682
 
9527
9683
  return self._github.request(
@@ -9583,13 +9739,15 @@ class ReposClient:
9583
9739
 
9584
9740
  url = f"/repos/{owner}/{repo}/forks"
9585
9741
 
9586
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9587
-
9588
- if not kwargs:
9589
- kwargs = UNSET
9742
+ headers = {
9743
+ "Content-Type": "application/json",
9744
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9745
+ **(headers or {}),
9746
+ }
9590
9747
 
9591
9748
  json = kwargs if data is UNSET else data
9592
- json = type_validate_python(Union[ReposOwnerRepoForksPostBody, None], json)
9749
+ if self._github.config.rest_api_validate_body:
9750
+ json = type_validate_python(Union[ReposOwnerRepoForksPostBody, None], json)
9593
9751
  json = model_dump(json) if isinstance(json, BaseModel) else json
9594
9752
 
9595
9753
  return await self._github.arequest(
@@ -9722,13 +9880,15 @@ class ReposClient:
9722
9880
 
9723
9881
  url = f"/repos/{owner}/{repo}/hooks"
9724
9882
 
9725
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9726
-
9727
- if not kwargs:
9728
- kwargs = UNSET
9883
+ headers = {
9884
+ "Content-Type": "application/json",
9885
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9886
+ **(headers or {}),
9887
+ }
9729
9888
 
9730
9889
  json = kwargs if data is UNSET else data
9731
- json = type_validate_python(Union[ReposOwnerRepoHooksPostBody, None], json)
9890
+ if self._github.config.rest_api_validate_body:
9891
+ json = type_validate_python(Union[ReposOwnerRepoHooksPostBody, None], json)
9732
9892
  json = model_dump(json) if isinstance(json, BaseModel) else json
9733
9893
 
9734
9894
  return self._github.request(
@@ -9790,13 +9950,15 @@ class ReposClient:
9790
9950
 
9791
9951
  url = f"/repos/{owner}/{repo}/hooks"
9792
9952
 
9793
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9794
-
9795
- if not kwargs:
9796
- kwargs = UNSET
9953
+ headers = {
9954
+ "Content-Type": "application/json",
9955
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9956
+ **(headers or {}),
9957
+ }
9797
9958
 
9798
9959
  json = kwargs if data is UNSET else data
9799
- json = type_validate_python(Union[ReposOwnerRepoHooksPostBody, None], json)
9960
+ if self._github.config.rest_api_validate_body:
9961
+ json = type_validate_python(Union[ReposOwnerRepoHooksPostBody, None], json)
9800
9962
  json = model_dump(json) if isinstance(json, BaseModel) else json
9801
9963
 
9802
9964
  return await self._github.arequest(
@@ -9962,13 +10124,15 @@ class ReposClient:
9962
10124
 
9963
10125
  url = f"/repos/{owner}/{repo}/hooks/{hook_id}"
9964
10126
 
9965
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9966
-
9967
- if not kwargs:
9968
- kwargs = UNSET
10127
+ headers = {
10128
+ "Content-Type": "application/json",
10129
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
10130
+ **(headers or {}),
10131
+ }
9969
10132
 
9970
10133
  json = kwargs if data is UNSET else data
9971
- json = type_validate_python(ReposOwnerRepoHooksHookIdPatchBody, json)
10134
+ if self._github.config.rest_api_validate_body:
10135
+ json = type_validate_python(ReposOwnerRepoHooksHookIdPatchBody, json)
9972
10136
  json = model_dump(json) if isinstance(json, BaseModel) else json
9973
10137
 
9974
10138
  return self._github.request(
@@ -10031,13 +10195,15 @@ class ReposClient:
10031
10195
 
10032
10196
  url = f"/repos/{owner}/{repo}/hooks/{hook_id}"
10033
10197
 
10034
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10035
-
10036
- if not kwargs:
10037
- kwargs = UNSET
10198
+ headers = {
10199
+ "Content-Type": "application/json",
10200
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
10201
+ **(headers or {}),
10202
+ }
10038
10203
 
10039
10204
  json = kwargs if data is UNSET else data
10040
- json = type_validate_python(ReposOwnerRepoHooksHookIdPatchBody, json)
10205
+ if self._github.config.rest_api_validate_body:
10206
+ json = type_validate_python(ReposOwnerRepoHooksHookIdPatchBody, json)
10041
10207
  json = model_dump(json) if isinstance(json, BaseModel) else json
10042
10208
 
10043
10209
  return await self._github.arequest(
@@ -10140,13 +10306,15 @@ class ReposClient:
10140
10306
 
10141
10307
  url = f"/repos/{owner}/{repo}/hooks/{hook_id}/config"
10142
10308
 
10143
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10144
-
10145
- if not kwargs:
10146
- kwargs = UNSET
10309
+ headers = {
10310
+ "Content-Type": "application/json",
10311
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
10312
+ **(headers or {}),
10313
+ }
10147
10314
 
10148
10315
  json = kwargs if data is UNSET else data
10149
- json = type_validate_python(ReposOwnerRepoHooksHookIdConfigPatchBody, json)
10316
+ if self._github.config.rest_api_validate_body:
10317
+ json = type_validate_python(ReposOwnerRepoHooksHookIdConfigPatchBody, json)
10150
10318
  json = model_dump(json) if isinstance(json, BaseModel) else json
10151
10319
 
10152
10320
  return self._github.request(
@@ -10199,13 +10367,15 @@ class ReposClient:
10199
10367
 
10200
10368
  url = f"/repos/{owner}/{repo}/hooks/{hook_id}/config"
10201
10369
 
10202
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10203
-
10204
- if not kwargs:
10205
- kwargs = UNSET
10370
+ headers = {
10371
+ "Content-Type": "application/json",
10372
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
10373
+ **(headers or {}),
10374
+ }
10206
10375
 
10207
10376
  json = kwargs if data is UNSET else data
10208
- json = type_validate_python(ReposOwnerRepoHooksHookIdConfigPatchBody, json)
10377
+ if self._github.config.rest_api_validate_body:
10378
+ json = type_validate_python(ReposOwnerRepoHooksHookIdConfigPatchBody, json)
10209
10379
  json = model_dump(json) if isinstance(json, BaseModel) else json
10210
10380
 
10211
10381
  return await self._github.arequest(
@@ -10662,15 +10832,17 @@ class ReposClient:
10662
10832
 
10663
10833
  url = f"/repos/{owner}/{repo}/invitations/{invitation_id}"
10664
10834
 
10665
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10666
-
10667
- if not kwargs:
10668
- kwargs = UNSET
10835
+ headers = {
10836
+ "Content-Type": "application/json",
10837
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
10838
+ **(headers or {}),
10839
+ }
10669
10840
 
10670
10841
  json = kwargs if data is UNSET else data
10671
- json = type_validate_python(
10672
- ReposOwnerRepoInvitationsInvitationIdPatchBody, json
10673
- )
10842
+ if self._github.config.rest_api_validate_body:
10843
+ json = type_validate_python(
10844
+ ReposOwnerRepoInvitationsInvitationIdPatchBody, json
10845
+ )
10674
10846
  json = model_dump(json) if isinstance(json, BaseModel) else json
10675
10847
 
10676
10848
  return self._github.request(
@@ -10725,15 +10897,17 @@ class ReposClient:
10725
10897
 
10726
10898
  url = f"/repos/{owner}/{repo}/invitations/{invitation_id}"
10727
10899
 
10728
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10729
-
10730
- if not kwargs:
10731
- kwargs = UNSET
10900
+ headers = {
10901
+ "Content-Type": "application/json",
10902
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
10903
+ **(headers or {}),
10904
+ }
10732
10905
 
10733
10906
  json = kwargs if data is UNSET else data
10734
- json = type_validate_python(
10735
- ReposOwnerRepoInvitationsInvitationIdPatchBody, json
10736
- )
10907
+ if self._github.config.rest_api_validate_body:
10908
+ json = type_validate_python(
10909
+ ReposOwnerRepoInvitationsInvitationIdPatchBody, json
10910
+ )
10737
10911
  json = model_dump(json) if isinstance(json, BaseModel) else json
10738
10912
 
10739
10913
  return await self._github.arequest(
@@ -10846,13 +11020,15 @@ class ReposClient:
10846
11020
 
10847
11021
  url = f"/repos/{owner}/{repo}/keys"
10848
11022
 
10849
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10850
-
10851
- if not kwargs:
10852
- kwargs = UNSET
11023
+ headers = {
11024
+ "Content-Type": "application/json",
11025
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11026
+ **(headers or {}),
11027
+ }
10853
11028
 
10854
11029
  json = kwargs if data is UNSET else data
10855
- json = type_validate_python(ReposOwnerRepoKeysPostBody, json)
11030
+ if self._github.config.rest_api_validate_body:
11031
+ json = type_validate_python(ReposOwnerRepoKeysPostBody, json)
10856
11032
  json = model_dump(json) if isinstance(json, BaseModel) else json
10857
11033
 
10858
11034
  return self._github.request(
@@ -10904,13 +11080,15 @@ class ReposClient:
10904
11080
 
10905
11081
  url = f"/repos/{owner}/{repo}/keys"
10906
11082
 
10907
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10908
-
10909
- if not kwargs:
10910
- kwargs = UNSET
11083
+ headers = {
11084
+ "Content-Type": "application/json",
11085
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11086
+ **(headers or {}),
11087
+ }
10911
11088
 
10912
11089
  json = kwargs if data is UNSET else data
10913
- json = type_validate_python(ReposOwnerRepoKeysPostBody, json)
11090
+ if self._github.config.rest_api_validate_body:
11091
+ json = type_validate_python(ReposOwnerRepoKeysPostBody, json)
10914
11092
  json = model_dump(json) if isinstance(json, BaseModel) else json
10915
11093
 
10916
11094
  return await self._github.arequest(
@@ -11096,13 +11274,15 @@ class ReposClient:
11096
11274
 
11097
11275
  url = f"/repos/{owner}/{repo}/merge-upstream"
11098
11276
 
11099
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11100
-
11101
- if not kwargs:
11102
- kwargs = UNSET
11277
+ headers = {
11278
+ "Content-Type": "application/json",
11279
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11280
+ **(headers or {}),
11281
+ }
11103
11282
 
11104
11283
  json = kwargs if data is UNSET else data
11105
- json = type_validate_python(ReposOwnerRepoMergeUpstreamPostBody, json)
11284
+ if self._github.config.rest_api_validate_body:
11285
+ json = type_validate_python(ReposOwnerRepoMergeUpstreamPostBody, json)
11106
11286
  json = model_dump(json) if isinstance(json, BaseModel) else json
11107
11287
 
11108
11288
  return self._github.request(
@@ -11150,13 +11330,15 @@ class ReposClient:
11150
11330
 
11151
11331
  url = f"/repos/{owner}/{repo}/merge-upstream"
11152
11332
 
11153
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11154
-
11155
- if not kwargs:
11156
- kwargs = UNSET
11333
+ headers = {
11334
+ "Content-Type": "application/json",
11335
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11336
+ **(headers or {}),
11337
+ }
11157
11338
 
11158
11339
  json = kwargs if data is UNSET else data
11159
- json = type_validate_python(ReposOwnerRepoMergeUpstreamPostBody, json)
11340
+ if self._github.config.rest_api_validate_body:
11341
+ json = type_validate_python(ReposOwnerRepoMergeUpstreamPostBody, json)
11160
11342
  json = model_dump(json) if isinstance(json, BaseModel) else json
11161
11343
 
11162
11344
  return await self._github.arequest(
@@ -11211,13 +11393,15 @@ class ReposClient:
11211
11393
 
11212
11394
  url = f"/repos/{owner}/{repo}/merges"
11213
11395
 
11214
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11215
-
11216
- if not kwargs:
11217
- kwargs = UNSET
11396
+ headers = {
11397
+ "Content-Type": "application/json",
11398
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11399
+ **(headers or {}),
11400
+ }
11218
11401
 
11219
11402
  json = kwargs if data is UNSET else data
11220
- json = type_validate_python(ReposOwnerRepoMergesPostBody, json)
11403
+ if self._github.config.rest_api_validate_body:
11404
+ json = type_validate_python(ReposOwnerRepoMergesPostBody, json)
11221
11405
  json = model_dump(json) if isinstance(json, BaseModel) else json
11222
11406
 
11223
11407
  return self._github.request(
@@ -11275,13 +11459,15 @@ class ReposClient:
11275
11459
 
11276
11460
  url = f"/repos/{owner}/{repo}/merges"
11277
11461
 
11278
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11279
-
11280
- if not kwargs:
11281
- kwargs = UNSET
11462
+ headers = {
11463
+ "Content-Type": "application/json",
11464
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11465
+ **(headers or {}),
11466
+ }
11282
11467
 
11283
11468
  json = kwargs if data is UNSET else data
11284
- json = type_validate_python(ReposOwnerRepoMergesPostBody, json)
11469
+ if self._github.config.rest_api_validate_body:
11470
+ json = type_validate_python(ReposOwnerRepoMergesPostBody, json)
11285
11471
  json = model_dump(json) if isinstance(json, BaseModel) else json
11286
11472
 
11287
11473
  return await self._github.arequest(
@@ -11488,22 +11674,24 @@ class ReposClient:
11488
11674
 
11489
11675
  url = f"/repos/{owner}/{repo}/pages"
11490
11676
 
11491
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11492
-
11493
- if not kwargs:
11494
- kwargs = UNSET
11677
+ headers = {
11678
+ "Content-Type": "application/json",
11679
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11680
+ **(headers or {}),
11681
+ }
11495
11682
 
11496
11683
  json = kwargs if data is UNSET else data
11497
- json = type_validate_python(
11498
- Union[
11499
- ReposOwnerRepoPagesPutBodyAnyof0,
11500
- ReposOwnerRepoPagesPutBodyAnyof1,
11501
- ReposOwnerRepoPagesPutBodyAnyof2,
11502
- ReposOwnerRepoPagesPutBodyAnyof3,
11503
- ReposOwnerRepoPagesPutBodyAnyof4,
11504
- ],
11505
- json,
11506
- )
11684
+ if self._github.config.rest_api_validate_body:
11685
+ json = type_validate_python(
11686
+ Union[
11687
+ ReposOwnerRepoPagesPutBodyAnyof0,
11688
+ ReposOwnerRepoPagesPutBodyAnyof1,
11689
+ ReposOwnerRepoPagesPutBodyAnyof2,
11690
+ ReposOwnerRepoPagesPutBodyAnyof3,
11691
+ ReposOwnerRepoPagesPutBodyAnyof4,
11692
+ ],
11693
+ json,
11694
+ )
11507
11695
  json = model_dump(json) if isinstance(json, BaseModel) else json
11508
11696
 
11509
11697
  return self._github.request(
@@ -11660,22 +11848,24 @@ class ReposClient:
11660
11848
 
11661
11849
  url = f"/repos/{owner}/{repo}/pages"
11662
11850
 
11663
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11664
-
11665
- if not kwargs:
11666
- kwargs = UNSET
11851
+ headers = {
11852
+ "Content-Type": "application/json",
11853
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11854
+ **(headers or {}),
11855
+ }
11667
11856
 
11668
11857
  json = kwargs if data is UNSET else data
11669
- json = type_validate_python(
11670
- Union[
11671
- ReposOwnerRepoPagesPutBodyAnyof0,
11672
- ReposOwnerRepoPagesPutBodyAnyof1,
11673
- ReposOwnerRepoPagesPutBodyAnyof2,
11674
- ReposOwnerRepoPagesPutBodyAnyof3,
11675
- ReposOwnerRepoPagesPutBodyAnyof4,
11676
- ],
11677
- json,
11678
- )
11858
+ if self._github.config.rest_api_validate_body:
11859
+ json = type_validate_python(
11860
+ Union[
11861
+ ReposOwnerRepoPagesPutBodyAnyof0,
11862
+ ReposOwnerRepoPagesPutBodyAnyof1,
11863
+ ReposOwnerRepoPagesPutBodyAnyof2,
11864
+ ReposOwnerRepoPagesPutBodyAnyof3,
11865
+ ReposOwnerRepoPagesPutBodyAnyof4,
11866
+ ],
11867
+ json,
11868
+ )
11679
11869
  json = model_dump(json) if isinstance(json, BaseModel) else json
11680
11870
 
11681
11871
  return await self._github.arequest(
@@ -11759,21 +11949,23 @@ class ReposClient:
11759
11949
 
11760
11950
  url = f"/repos/{owner}/{repo}/pages"
11761
11951
 
11762
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11763
-
11764
- if not kwargs:
11765
- kwargs = UNSET
11952
+ headers = {
11953
+ "Content-Type": "application/json",
11954
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11955
+ **(headers or {}),
11956
+ }
11766
11957
 
11767
11958
  json = kwargs if data is UNSET else data
11768
- json = type_validate_python(
11769
- Union[
11770
- ReposOwnerRepoPagesPostBodyAnyof0,
11771
- None,
11772
- ReposOwnerRepoPagesPostBodyAnyof1,
11773
- None,
11774
- ],
11775
- json,
11776
- )
11959
+ if self._github.config.rest_api_validate_body:
11960
+ json = type_validate_python(
11961
+ Union[
11962
+ ReposOwnerRepoPagesPostBodyAnyof0,
11963
+ None,
11964
+ ReposOwnerRepoPagesPostBodyAnyof1,
11965
+ None,
11966
+ ],
11967
+ json,
11968
+ )
11777
11969
  json = model_dump(json) if isinstance(json, BaseModel) else json
11778
11970
 
11779
11971
  return self._github.request(
@@ -11857,21 +12049,23 @@ class ReposClient:
11857
12049
 
11858
12050
  url = f"/repos/{owner}/{repo}/pages"
11859
12051
 
11860
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11861
-
11862
- if not kwargs:
11863
- kwargs = UNSET
12052
+ headers = {
12053
+ "Content-Type": "application/json",
12054
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
12055
+ **(headers or {}),
12056
+ }
11864
12057
 
11865
12058
  json = kwargs if data is UNSET else data
11866
- json = type_validate_python(
11867
- Union[
11868
- ReposOwnerRepoPagesPostBodyAnyof0,
11869
- None,
11870
- ReposOwnerRepoPagesPostBodyAnyof1,
11871
- None,
11872
- ],
11873
- json,
11874
- )
12059
+ if self._github.config.rest_api_validate_body:
12060
+ json = type_validate_python(
12061
+ Union[
12062
+ ReposOwnerRepoPagesPostBodyAnyof0,
12063
+ None,
12064
+ ReposOwnerRepoPagesPostBodyAnyof1,
12065
+ None,
12066
+ ],
12067
+ json,
12068
+ )
11875
12069
  json = model_dump(json) if isinstance(json, BaseModel) else json
11876
12070
 
11877
12071
  return await self._github.arequest(
@@ -12181,13 +12375,15 @@ class ReposClient:
12181
12375
 
12182
12376
  url = f"/repos/{owner}/{repo}/pages/deployments"
12183
12377
 
12184
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
12185
-
12186
- if not kwargs:
12187
- kwargs = UNSET
12378
+ headers = {
12379
+ "Content-Type": "application/json",
12380
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
12381
+ **(headers or {}),
12382
+ }
12188
12383
 
12189
12384
  json = kwargs if data is UNSET else data
12190
- json = type_validate_python(ReposOwnerRepoPagesDeploymentsPostBody, json)
12385
+ if self._github.config.rest_api_validate_body:
12386
+ json = type_validate_python(ReposOwnerRepoPagesDeploymentsPostBody, json)
12191
12387
  json = model_dump(json) if isinstance(json, BaseModel) else json
12192
12388
 
12193
12389
  return self._github.request(
@@ -12248,13 +12444,15 @@ class ReposClient:
12248
12444
 
12249
12445
  url = f"/repos/{owner}/{repo}/pages/deployments"
12250
12446
 
12251
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
12252
-
12253
- if not kwargs:
12254
- kwargs = UNSET
12447
+ headers = {
12448
+ "Content-Type": "application/json",
12449
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
12450
+ **(headers or {}),
12451
+ }
12255
12452
 
12256
12453
  json = kwargs if data is UNSET else data
12257
- json = type_validate_python(ReposOwnerRepoPagesDeploymentsPostBody, json)
12454
+ if self._github.config.rest_api_validate_body:
12455
+ json = type_validate_python(ReposOwnerRepoPagesDeploymentsPostBody, json)
12258
12456
  json = model_dump(json) if isinstance(json, BaseModel) else json
12259
12457
 
12260
12458
  return await self._github.arequest(
@@ -12670,13 +12868,15 @@ class ReposClient:
12670
12868
 
12671
12869
  url = f"/repos/{owner}/{repo}/properties/values"
12672
12870
 
12673
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
12674
-
12675
- if not kwargs:
12676
- kwargs = UNSET
12871
+ headers = {
12872
+ "Content-Type": "application/json",
12873
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
12874
+ **(headers or {}),
12875
+ }
12677
12876
 
12678
12877
  json = kwargs if data is UNSET else data
12679
- json = type_validate_python(ReposOwnerRepoPropertiesValuesPatchBody, json)
12878
+ if self._github.config.rest_api_validate_body:
12879
+ json = type_validate_python(ReposOwnerRepoPropertiesValuesPatchBody, json)
12680
12880
  json = model_dump(json) if isinstance(json, BaseModel) else json
12681
12881
 
12682
12882
  return self._github.request(
@@ -12731,13 +12931,15 @@ class ReposClient:
12731
12931
 
12732
12932
  url = f"/repos/{owner}/{repo}/properties/values"
12733
12933
 
12734
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
12735
-
12736
- if not kwargs:
12737
- kwargs = UNSET
12934
+ headers = {
12935
+ "Content-Type": "application/json",
12936
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
12937
+ **(headers or {}),
12938
+ }
12738
12939
 
12739
12940
  json = kwargs if data is UNSET else data
12740
- json = type_validate_python(ReposOwnerRepoPropertiesValuesPatchBody, json)
12941
+ if self._github.config.rest_api_validate_body:
12942
+ json = type_validate_python(ReposOwnerRepoPropertiesValuesPatchBody, json)
12741
12943
  json = model_dump(json) if isinstance(json, BaseModel) else json
12742
12944
 
12743
12945
  return await self._github.arequest(
@@ -13001,13 +13203,15 @@ class ReposClient:
13001
13203
 
13002
13204
  url = f"/repos/{owner}/{repo}/releases"
13003
13205
 
13004
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13005
-
13006
- if not kwargs:
13007
- kwargs = UNSET
13206
+ headers = {
13207
+ "Content-Type": "application/json",
13208
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13209
+ **(headers or {}),
13210
+ }
13008
13211
 
13009
13212
  json = kwargs if data is UNSET else data
13010
- json = type_validate_python(ReposOwnerRepoReleasesPostBody, json)
13213
+ if self._github.config.rest_api_validate_body:
13214
+ json = type_validate_python(ReposOwnerRepoReleasesPostBody, json)
13011
13215
  json = model_dump(json) if isinstance(json, BaseModel) else json
13012
13216
 
13013
13217
  return self._github.request(
@@ -13071,13 +13275,15 @@ class ReposClient:
13071
13275
 
13072
13276
  url = f"/repos/{owner}/{repo}/releases"
13073
13277
 
13074
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13075
-
13076
- if not kwargs:
13077
- kwargs = UNSET
13278
+ headers = {
13279
+ "Content-Type": "application/json",
13280
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13281
+ **(headers or {}),
13282
+ }
13078
13283
 
13079
13284
  json = kwargs if data is UNSET else data
13080
- json = type_validate_python(ReposOwnerRepoReleasesPostBody, json)
13285
+ if self._github.config.rest_api_validate_body:
13286
+ json = type_validate_python(ReposOwnerRepoReleasesPostBody, json)
13081
13287
  json = model_dump(json) if isinstance(json, BaseModel) else json
13082
13288
 
13083
13289
  return await self._github.arequest(
@@ -13225,13 +13431,17 @@ class ReposClient:
13225
13431
 
13226
13432
  url = f"/repos/{owner}/{repo}/releases/assets/{asset_id}"
13227
13433
 
13228
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13229
-
13230
- if not kwargs:
13231
- kwargs = UNSET
13434
+ headers = {
13435
+ "Content-Type": "application/json",
13436
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13437
+ **(headers or {}),
13438
+ }
13232
13439
 
13233
13440
  json = kwargs if data is UNSET else data
13234
- json = type_validate_python(ReposOwnerRepoReleasesAssetsAssetIdPatchBody, json)
13441
+ if self._github.config.rest_api_validate_body:
13442
+ json = type_validate_python(
13443
+ ReposOwnerRepoReleasesAssetsAssetIdPatchBody, json
13444
+ )
13235
13445
  json = model_dump(json) if isinstance(json, BaseModel) else json
13236
13446
 
13237
13447
  return self._github.request(
@@ -13283,13 +13493,17 @@ class ReposClient:
13283
13493
 
13284
13494
  url = f"/repos/{owner}/{repo}/releases/assets/{asset_id}"
13285
13495
 
13286
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13287
-
13288
- if not kwargs:
13289
- kwargs = UNSET
13496
+ headers = {
13497
+ "Content-Type": "application/json",
13498
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13499
+ **(headers or {}),
13500
+ }
13290
13501
 
13291
13502
  json = kwargs if data is UNSET else data
13292
- json = type_validate_python(ReposOwnerRepoReleasesAssetsAssetIdPatchBody, json)
13503
+ if self._github.config.rest_api_validate_body:
13504
+ json = type_validate_python(
13505
+ ReposOwnerRepoReleasesAssetsAssetIdPatchBody, json
13506
+ )
13293
13507
  json = model_dump(json) if isinstance(json, BaseModel) else json
13294
13508
 
13295
13509
  return await self._github.arequest(
@@ -13343,13 +13557,17 @@ class ReposClient:
13343
13557
 
13344
13558
  url = f"/repos/{owner}/{repo}/releases/generate-notes"
13345
13559
 
13346
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13347
-
13348
- if not kwargs:
13349
- kwargs = UNSET
13560
+ headers = {
13561
+ "Content-Type": "application/json",
13562
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13563
+ **(headers or {}),
13564
+ }
13350
13565
 
13351
13566
  json = kwargs if data is UNSET else data
13352
- json = type_validate_python(ReposOwnerRepoReleasesGenerateNotesPostBody, json)
13567
+ if self._github.config.rest_api_validate_body:
13568
+ json = type_validate_python(
13569
+ ReposOwnerRepoReleasesGenerateNotesPostBody, json
13570
+ )
13353
13571
  json = model_dump(json) if isinstance(json, BaseModel) else json
13354
13572
 
13355
13573
  return self._github.request(
@@ -13406,13 +13624,17 @@ class ReposClient:
13406
13624
 
13407
13625
  url = f"/repos/{owner}/{repo}/releases/generate-notes"
13408
13626
 
13409
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13410
-
13411
- if not kwargs:
13412
- kwargs = UNSET
13627
+ headers = {
13628
+ "Content-Type": "application/json",
13629
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13630
+ **(headers or {}),
13631
+ }
13413
13632
 
13414
13633
  json = kwargs if data is UNSET else data
13415
- json = type_validate_python(ReposOwnerRepoReleasesGenerateNotesPostBody, json)
13634
+ if self._github.config.rest_api_validate_body:
13635
+ json = type_validate_python(
13636
+ ReposOwnerRepoReleasesGenerateNotesPostBody, json
13637
+ )
13416
13638
  json = model_dump(json) if isinstance(json, BaseModel) else json
13417
13639
 
13418
13640
  return await self._github.arequest(
@@ -13660,13 +13882,15 @@ class ReposClient:
13660
13882
 
13661
13883
  url = f"/repos/{owner}/{repo}/releases/{release_id}"
13662
13884
 
13663
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13664
-
13665
- if not kwargs:
13666
- kwargs = UNSET
13885
+ headers = {
13886
+ "Content-Type": "application/json",
13887
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13888
+ **(headers or {}),
13889
+ }
13667
13890
 
13668
13891
  json = kwargs if data is UNSET else data
13669
- json = type_validate_python(ReposOwnerRepoReleasesReleaseIdPatchBody, json)
13892
+ if self._github.config.rest_api_validate_body:
13893
+ json = type_validate_python(ReposOwnerRepoReleasesReleaseIdPatchBody, json)
13670
13894
  json = model_dump(json) if isinstance(json, BaseModel) else json
13671
13895
 
13672
13896
  return self._github.request(
@@ -13730,13 +13954,15 @@ class ReposClient:
13730
13954
 
13731
13955
  url = f"/repos/{owner}/{repo}/releases/{release_id}"
13732
13956
 
13733
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13734
-
13735
- if not kwargs:
13736
- kwargs = UNSET
13957
+ headers = {
13958
+ "Content-Type": "application/json",
13959
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13960
+ **(headers or {}),
13961
+ }
13737
13962
 
13738
13963
  json = kwargs if data is UNSET else data
13739
- json = type_validate_python(ReposOwnerRepoReleasesReleaseIdPatchBody, json)
13964
+ if self._github.config.rest_api_validate_body:
13965
+ json = type_validate_python(ReposOwnerRepoReleasesReleaseIdPatchBody, json)
13740
13966
  json = model_dump(json) if isinstance(json, BaseModel) else json
13741
13967
 
13742
13968
  return await self._github.arequest(
@@ -13826,12 +14052,9 @@ class ReposClient:
13826
14052
  *,
13827
14053
  headers: Optional[Dict[str, str]] = None,
13828
14054
  data: FileTypes,
13829
- **kwargs,
13830
14055
  ) -> Response[ReleaseAsset]:
13831
14056
  """See also: https://docs.github.com/rest/releases/assets#upload-a-release-asset"""
13832
14057
 
13833
- from githubkit.typing import FileTypes
13834
-
13835
14058
  from ..models import ReleaseAsset
13836
14059
 
13837
14060
  url = f"/repos/{owner}/{repo}/releases/{release_id}/assets"
@@ -13841,14 +14064,13 @@ class ReposClient:
13841
14064
  "label": label,
13842
14065
  }
13843
14066
 
13844
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13845
-
13846
- if not kwargs:
13847
- kwargs = UNSET
14067
+ headers = {
14068
+ "Content-Type": "application/octet-stream",
14069
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
14070
+ **(headers or {}),
14071
+ }
13848
14072
 
13849
- content = kwargs if data is UNSET else data
13850
- content = type_validate_python(FileTypes, content)
13851
- content = model_dump(content) if isinstance(content, BaseModel) else content
14073
+ content = data
13852
14074
 
13853
14075
  return self._github.request(
13854
14076
  "POST",
@@ -13870,12 +14092,9 @@ class ReposClient:
13870
14092
  *,
13871
14093
  headers: Optional[Dict[str, str]] = None,
13872
14094
  data: FileTypes,
13873
- **kwargs,
13874
14095
  ) -> Response[ReleaseAsset]:
13875
14096
  """See also: https://docs.github.com/rest/releases/assets#upload-a-release-asset"""
13876
14097
 
13877
- from githubkit.typing import FileTypes
13878
-
13879
14098
  from ..models import ReleaseAsset
13880
14099
 
13881
14100
  url = f"/repos/{owner}/{repo}/releases/{release_id}/assets"
@@ -13885,14 +14104,13 @@ class ReposClient:
13885
14104
  "label": label,
13886
14105
  }
13887
14106
 
13888
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13889
-
13890
- if not kwargs:
13891
- kwargs = UNSET
14107
+ headers = {
14108
+ "Content-Type": "application/octet-stream",
14109
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
14110
+ **(headers or {}),
14111
+ }
13892
14112
 
13893
- content = kwargs if data is UNSET else data
13894
- content = type_validate_python(FileTypes, content)
13895
- content = model_dump(content) if isinstance(content, BaseModel) else content
14113
+ content = data
13896
14114
 
13897
14115
  return await self._github.arequest(
13898
14116
  "POST",
@@ -14097,6 +14315,7 @@ class ReposClient:
14097
14315
  per_page: Missing[int] = UNSET,
14098
14316
  page: Missing[int] = UNSET,
14099
14317
  includes_parents: Missing[bool] = UNSET,
14318
+ targets: Missing[str] = UNSET,
14100
14319
  *,
14101
14320
  headers: Optional[Dict[str, str]] = None,
14102
14321
  ) -> Response[List[RepositoryRuleset]]:
@@ -14112,6 +14331,7 @@ class ReposClient:
14112
14331
  "per_page": per_page,
14113
14332
  "page": page,
14114
14333
  "includes_parents": includes_parents,
14334
+ "targets": targets,
14115
14335
  }
14116
14336
 
14117
14337
  headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
@@ -14135,6 +14355,7 @@ class ReposClient:
14135
14355
  per_page: Missing[int] = UNSET,
14136
14356
  page: Missing[int] = UNSET,
14137
14357
  includes_parents: Missing[bool] = UNSET,
14358
+ targets: Missing[str] = UNSET,
14138
14359
  *,
14139
14360
  headers: Optional[Dict[str, str]] = None,
14140
14361
  ) -> Response[List[RepositoryRuleset]]:
@@ -14150,6 +14371,7 @@ class ReposClient:
14150
14371
  "per_page": per_page,
14151
14372
  "page": page,
14152
14373
  "includes_parents": includes_parents,
14374
+ "targets": targets,
14153
14375
  }
14154
14376
 
14155
14377
  headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
@@ -14237,13 +14459,15 @@ class ReposClient:
14237
14459
 
14238
14460
  url = f"/repos/{owner}/{repo}/rulesets"
14239
14461
 
14240
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
14241
-
14242
- if not kwargs:
14243
- kwargs = UNSET
14462
+ headers = {
14463
+ "Content-Type": "application/json",
14464
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
14465
+ **(headers or {}),
14466
+ }
14244
14467
 
14245
14468
  json = kwargs if data is UNSET else data
14246
- json = type_validate_python(ReposOwnerRepoRulesetsPostBody, json)
14469
+ if self._github.config.rest_api_validate_body:
14470
+ json = type_validate_python(ReposOwnerRepoRulesetsPostBody, json)
14247
14471
  json = model_dump(json) if isinstance(json, BaseModel) else json
14248
14472
 
14249
14473
  return self._github.request(
@@ -14329,13 +14553,15 @@ class ReposClient:
14329
14553
 
14330
14554
  url = f"/repos/{owner}/{repo}/rulesets"
14331
14555
 
14332
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
14333
-
14334
- if not kwargs:
14335
- kwargs = UNSET
14556
+ headers = {
14557
+ "Content-Type": "application/json",
14558
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
14559
+ **(headers or {}),
14560
+ }
14336
14561
 
14337
14562
  json = kwargs if data is UNSET else data
14338
- json = type_validate_python(ReposOwnerRepoRulesetsPostBody, json)
14563
+ if self._github.config.rest_api_validate_body:
14564
+ json = type_validate_python(ReposOwnerRepoRulesetsPostBody, json)
14339
14565
  json = model_dump(json) if isinstance(json, BaseModel) else json
14340
14566
 
14341
14567
  return await self._github.arequest(
@@ -14632,13 +14858,15 @@ class ReposClient:
14632
14858
 
14633
14859
  url = f"/repos/{owner}/{repo}/rulesets/{ruleset_id}"
14634
14860
 
14635
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
14636
-
14637
- if not kwargs:
14638
- kwargs = UNSET
14861
+ headers = {
14862
+ "Content-Type": "application/json",
14863
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
14864
+ **(headers or {}),
14865
+ }
14639
14866
 
14640
14867
  json = kwargs if data is UNSET else data
14641
- json = type_validate_python(ReposOwnerRepoRulesetsRulesetIdPutBody, json)
14868
+ if self._github.config.rest_api_validate_body:
14869
+ json = type_validate_python(ReposOwnerRepoRulesetsRulesetIdPutBody, json)
14642
14870
  json = model_dump(json) if isinstance(json, BaseModel) else json
14643
14871
 
14644
14872
  return self._github.request(
@@ -14727,13 +14955,15 @@ class ReposClient:
14727
14955
 
14728
14956
  url = f"/repos/{owner}/{repo}/rulesets/{ruleset_id}"
14729
14957
 
14730
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
14731
-
14732
- if not kwargs:
14733
- kwargs = UNSET
14958
+ headers = {
14959
+ "Content-Type": "application/json",
14960
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
14961
+ **(headers or {}),
14962
+ }
14734
14963
 
14735
14964
  json = kwargs if data is UNSET else data
14736
- json = type_validate_python(ReposOwnerRepoRulesetsRulesetIdPutBody, json)
14965
+ if self._github.config.rest_api_validate_body:
14966
+ json = type_validate_python(ReposOwnerRepoRulesetsRulesetIdPutBody, json)
14737
14967
  json = model_dump(json) if isinstance(json, BaseModel) else json
14738
14968
 
14739
14969
  return await self._github.arequest(
@@ -15078,13 +15308,15 @@ class ReposClient:
15078
15308
 
15079
15309
  url = f"/repos/{owner}/{repo}/statuses/{sha}"
15080
15310
 
15081
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
15082
-
15083
- if not kwargs:
15084
- kwargs = UNSET
15311
+ headers = {
15312
+ "Content-Type": "application/json",
15313
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
15314
+ **(headers or {}),
15315
+ }
15085
15316
 
15086
15317
  json = kwargs if data is UNSET else data
15087
- json = type_validate_python(ReposOwnerRepoStatusesShaPostBody, json)
15318
+ if self._github.config.rest_api_validate_body:
15319
+ json = type_validate_python(ReposOwnerRepoStatusesShaPostBody, json)
15088
15320
  json = model_dump(json) if isinstance(json, BaseModel) else json
15089
15321
 
15090
15322
  return self._github.request(
@@ -15137,13 +15369,15 @@ class ReposClient:
15137
15369
 
15138
15370
  url = f"/repos/{owner}/{repo}/statuses/{sha}"
15139
15371
 
15140
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
15141
-
15142
- if not kwargs:
15143
- kwargs = UNSET
15372
+ headers = {
15373
+ "Content-Type": "application/json",
15374
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
15375
+ **(headers or {}),
15376
+ }
15144
15377
 
15145
15378
  json = kwargs if data is UNSET else data
15146
- json = type_validate_python(ReposOwnerRepoStatusesShaPostBody, json)
15379
+ if self._github.config.rest_api_validate_body:
15380
+ json = type_validate_python(ReposOwnerRepoStatusesShaPostBody, json)
15147
15381
  json = model_dump(json) if isinstance(json, BaseModel) else json
15148
15382
 
15149
15383
  return await self._github.arequest(
@@ -15314,13 +15548,15 @@ class ReposClient:
15314
15548
 
15315
15549
  url = f"/repos/{owner}/{repo}/tags/protection"
15316
15550
 
15317
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
15318
-
15319
- if not kwargs:
15320
- kwargs = UNSET
15551
+ headers = {
15552
+ "Content-Type": "application/json",
15553
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
15554
+ **(headers or {}),
15555
+ }
15321
15556
 
15322
15557
  json = kwargs if data is UNSET else data
15323
- json = type_validate_python(ReposOwnerRepoTagsProtectionPostBody, json)
15558
+ if self._github.config.rest_api_validate_body:
15559
+ json = type_validate_python(ReposOwnerRepoTagsProtectionPostBody, json)
15324
15560
  json = model_dump(json) if isinstance(json, BaseModel) else json
15325
15561
 
15326
15562
  return self._github.request(
@@ -15375,13 +15611,15 @@ class ReposClient:
15375
15611
 
15376
15612
  url = f"/repos/{owner}/{repo}/tags/protection"
15377
15613
 
15378
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
15379
-
15380
- if not kwargs:
15381
- kwargs = UNSET
15614
+ headers = {
15615
+ "Content-Type": "application/json",
15616
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
15617
+ **(headers or {}),
15618
+ }
15382
15619
 
15383
15620
  json = kwargs if data is UNSET else data
15384
- json = type_validate_python(ReposOwnerRepoTagsProtectionPostBody, json)
15621
+ if self._github.config.rest_api_validate_body:
15622
+ json = type_validate_python(ReposOwnerRepoTagsProtectionPostBody, json)
15385
15623
  json = model_dump(json) if isinstance(json, BaseModel) else json
15386
15624
 
15387
15625
  return await self._github.arequest(
@@ -15665,13 +15903,15 @@ class ReposClient:
15665
15903
 
15666
15904
  url = f"/repos/{owner}/{repo}/topics"
15667
15905
 
15668
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
15669
-
15670
- if not kwargs:
15671
- kwargs = UNSET
15906
+ headers = {
15907
+ "Content-Type": "application/json",
15908
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
15909
+ **(headers or {}),
15910
+ }
15672
15911
 
15673
15912
  json = kwargs if data is UNSET else data
15674
- json = type_validate_python(ReposOwnerRepoTopicsPutBody, json)
15913
+ if self._github.config.rest_api_validate_body:
15914
+ json = type_validate_python(ReposOwnerRepoTopicsPutBody, json)
15675
15915
  json = model_dump(json) if isinstance(json, BaseModel) else json
15676
15916
 
15677
15917
  return self._github.request(
@@ -15727,13 +15967,15 @@ class ReposClient:
15727
15967
 
15728
15968
  url = f"/repos/{owner}/{repo}/topics"
15729
15969
 
15730
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
15731
-
15732
- if not kwargs:
15733
- kwargs = UNSET
15970
+ headers = {
15971
+ "Content-Type": "application/json",
15972
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
15973
+ **(headers or {}),
15974
+ }
15734
15975
 
15735
15976
  json = kwargs if data is UNSET else data
15736
- json = type_validate_python(ReposOwnerRepoTopicsPutBody, json)
15977
+ if self._github.config.rest_api_validate_body:
15978
+ json = type_validate_python(ReposOwnerRepoTopicsPutBody, json)
15737
15979
  json = model_dump(json) if isinstance(json, BaseModel) else json
15738
15980
 
15739
15981
  return await self._github.arequest(
@@ -16018,13 +16260,15 @@ class ReposClient:
16018
16260
 
16019
16261
  url = f"/repos/{owner}/{repo}/transfer"
16020
16262
 
16021
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
16022
-
16023
- if not kwargs:
16024
- kwargs = UNSET
16263
+ headers = {
16264
+ "Content-Type": "application/json",
16265
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
16266
+ **(headers or {}),
16267
+ }
16025
16268
 
16026
16269
  json = kwargs if data is UNSET else data
16027
- json = type_validate_python(ReposOwnerRepoTransferPostBody, json)
16270
+ if self._github.config.rest_api_validate_body:
16271
+ json = type_validate_python(ReposOwnerRepoTransferPostBody, json)
16028
16272
  json = model_dump(json) if isinstance(json, BaseModel) else json
16029
16273
 
16030
16274
  return self._github.request(
@@ -16073,13 +16317,15 @@ class ReposClient:
16073
16317
 
16074
16318
  url = f"/repos/{owner}/{repo}/transfer"
16075
16319
 
16076
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
16077
-
16078
- if not kwargs:
16079
- kwargs = UNSET
16320
+ headers = {
16321
+ "Content-Type": "application/json",
16322
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
16323
+ **(headers or {}),
16324
+ }
16080
16325
 
16081
16326
  json = kwargs if data is UNSET else data
16082
- json = type_validate_python(ReposOwnerRepoTransferPostBody, json)
16327
+ if self._github.config.rest_api_validate_body:
16328
+ json = type_validate_python(ReposOwnerRepoTransferPostBody, json)
16083
16329
  json = model_dump(json) if isinstance(json, BaseModel) else json
16084
16330
 
16085
16331
  return await self._github.arequest(
@@ -16289,15 +16535,17 @@ class ReposClient:
16289
16535
 
16290
16536
  url = f"/repos/{template_owner}/{template_repo}/generate"
16291
16537
 
16292
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
16293
-
16294
- if not kwargs:
16295
- kwargs = UNSET
16538
+ headers = {
16539
+ "Content-Type": "application/json",
16540
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
16541
+ **(headers or {}),
16542
+ }
16296
16543
 
16297
16544
  json = kwargs if data is UNSET else data
16298
- json = type_validate_python(
16299
- ReposTemplateOwnerTemplateRepoGeneratePostBody, json
16300
- )
16545
+ if self._github.config.rest_api_validate_body:
16546
+ json = type_validate_python(
16547
+ ReposTemplateOwnerTemplateRepoGeneratePostBody, json
16548
+ )
16301
16549
  json = model_dump(json) if isinstance(json, BaseModel) else json
16302
16550
 
16303
16551
  return self._github.request(
@@ -16351,15 +16599,17 @@ class ReposClient:
16351
16599
 
16352
16600
  url = f"/repos/{template_owner}/{template_repo}/generate"
16353
16601
 
16354
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
16355
-
16356
- if not kwargs:
16357
- kwargs = UNSET
16602
+ headers = {
16603
+ "Content-Type": "application/json",
16604
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
16605
+ **(headers or {}),
16606
+ }
16358
16607
 
16359
16608
  json = kwargs if data is UNSET else data
16360
- json = type_validate_python(
16361
- ReposTemplateOwnerTemplateRepoGeneratePostBody, json
16362
- )
16609
+ if self._github.config.rest_api_validate_body:
16610
+ json = type_validate_python(
16611
+ ReposTemplateOwnerTemplateRepoGeneratePostBody, json
16612
+ )
16363
16613
  json = model_dump(json) if isinstance(json, BaseModel) else json
16364
16614
 
16365
16615
  return await self._github.arequest(
@@ -16588,13 +16838,15 @@ class ReposClient:
16588
16838
 
16589
16839
  url = "/user/repos"
16590
16840
 
16591
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
16592
-
16593
- if not kwargs:
16594
- kwargs = UNSET
16841
+ headers = {
16842
+ "Content-Type": "application/json",
16843
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
16844
+ **(headers or {}),
16845
+ }
16595
16846
 
16596
16847
  json = kwargs if data is UNSET else data
16597
- json = type_validate_python(UserReposPostBody, json)
16848
+ if self._github.config.rest_api_validate_body:
16849
+ json = type_validate_python(UserReposPostBody, json)
16598
16850
  json = model_dump(json) if isinstance(json, BaseModel) else json
16599
16851
 
16600
16852
  return self._github.request(
@@ -16670,13 +16922,15 @@ class ReposClient:
16670
16922
 
16671
16923
  url = "/user/repos"
16672
16924
 
16673
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
16674
-
16675
- if not kwargs:
16676
- kwargs = UNSET
16925
+ headers = {
16926
+ "Content-Type": "application/json",
16927
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
16928
+ **(headers or {}),
16929
+ }
16677
16930
 
16678
16931
  json = kwargs if data is UNSET else data
16679
- json = type_validate_python(UserReposPostBody, json)
16932
+ if self._github.config.rest_api_validate_body:
16933
+ json = type_validate_python(UserReposPostBody, json)
16680
16934
  json = model_dump(json) if isinstance(json, BaseModel) else json
16681
16935
 
16682
16936
  return await self._github.arequest(