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

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

Potentially problematic release.


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

Files changed (78) hide show
  1. githubkit/config.py +3 -0
  2. githubkit/core.py +5 -0
  3. githubkit/github.py +3 -0
  4. githubkit/versions/ghec_v2022_11_28/models/group_0051.py +5 -1
  5. githubkit/versions/ghec_v2022_11_28/models/group_0088.py +0 -1
  6. githubkit/versions/ghec_v2022_11_28/models/group_0098.py +4 -0
  7. githubkit/versions/ghec_v2022_11_28/models/group_1010.py +3 -1
  8. githubkit/versions/ghec_v2022_11_28/rest/actions.py +652 -472
  9. githubkit/versions/ghec_v2022_11_28/rest/activity.py +60 -44
  10. githubkit/versions/ghec_v2022_11_28/rest/apps.py +102 -74
  11. githubkit/versions/ghec_v2022_11_28/rest/billing.py +40 -32
  12. githubkit/versions/ghec_v2022_11_28/rest/checks.py +83 -66
  13. githubkit/versions/ghec_v2022_11_28/rest/code_scanning.py +74 -58
  14. githubkit/versions/ghec_v2022_11_28/rest/code_security.py +86 -66
  15. githubkit/versions/ghec_v2022_11_28/rest/codespaces.py +218 -154
  16. githubkit/versions/ghec_v2022_11_28/rest/copilot.py +72 -40
  17. githubkit/versions/ghec_v2022_11_28/rest/dependabot.py +68 -52
  18. githubkit/versions/ghec_v2022_11_28/rest/dependency_graph.py +14 -10
  19. githubkit/versions/ghec_v2022_11_28/rest/enterprise_admin.py +278 -208
  20. githubkit/versions/ghec_v2022_11_28/rest/gists.py +56 -40
  21. githubkit/versions/ghec_v2022_11_28/rest/git.py +84 -60
  22. githubkit/versions/ghec_v2022_11_28/rest/interactions.py +42 -30
  23. githubkit/versions/ghec_v2022_11_28/rest/issues.py +250 -198
  24. githubkit/versions/ghec_v2022_11_28/rest/markdown.py +34 -26
  25. githubkit/versions/ghec_v2022_11_28/rest/migrations.py +92 -60
  26. githubkit/versions/ghec_v2022_11_28/rest/oidc.py +14 -10
  27. githubkit/versions/ghec_v2022_11_28/rest/orgs.py +362 -246
  28. githubkit/versions/ghec_v2022_11_28/rest/projects.py +170 -126
  29. githubkit/versions/ghec_v2022_11_28/rest/pulls.py +234 -170
  30. githubkit/versions/ghec_v2022_11_28/rest/reactions.py +166 -130
  31. githubkit/versions/ghec_v2022_11_28/rest/repos.py +1035 -800
  32. githubkit/versions/ghec_v2022_11_28/rest/scim.py +50 -34
  33. githubkit/versions/ghec_v2022_11_28/rest/secret_scanning.py +36 -28
  34. githubkit/versions/ghec_v2022_11_28/rest/security_advisories.py +42 -30
  35. githubkit/versions/ghec_v2022_11_28/rest/teams.py +324 -238
  36. githubkit/versions/ghec_v2022_11_28/rest/users.py +154 -118
  37. githubkit/versions/ghec_v2022_11_28/types/group_0051.py +2 -1
  38. githubkit/versions/ghec_v2022_11_28/types/group_0088.py +0 -1
  39. githubkit/versions/ghec_v2022_11_28/types/group_0098.py +1 -0
  40. githubkit/versions/ghec_v2022_11_28/types/group_1010.py +3 -1
  41. githubkit/versions/v2022_11_28/models/group_0030.py +5 -1
  42. githubkit/versions/v2022_11_28/models/group_0060.py +0 -1
  43. githubkit/versions/v2022_11_28/models/group_0082.py +4 -0
  44. githubkit/versions/v2022_11_28/models/group_0936.py +3 -1
  45. githubkit/versions/v2022_11_28/rest/actions.py +534 -386
  46. githubkit/versions/v2022_11_28/rest/activity.py +60 -44
  47. githubkit/versions/v2022_11_28/rest/apps.py +102 -74
  48. githubkit/versions/v2022_11_28/rest/checks.py +83 -66
  49. githubkit/versions/v2022_11_28/rest/code_scanning.py +74 -58
  50. githubkit/versions/v2022_11_28/rest/code_security.py +86 -66
  51. githubkit/versions/v2022_11_28/rest/codespaces.py +218 -154
  52. githubkit/versions/v2022_11_28/rest/copilot.py +72 -40
  53. githubkit/versions/v2022_11_28/rest/dependabot.py +68 -52
  54. githubkit/versions/v2022_11_28/rest/dependency_graph.py +14 -10
  55. githubkit/versions/v2022_11_28/rest/gists.py +56 -40
  56. githubkit/versions/v2022_11_28/rest/git.py +84 -60
  57. githubkit/versions/v2022_11_28/rest/interactions.py +42 -30
  58. githubkit/versions/v2022_11_28/rest/issues.py +250 -198
  59. githubkit/versions/v2022_11_28/rest/markdown.py +34 -26
  60. githubkit/versions/v2022_11_28/rest/migrations.py +92 -60
  61. githubkit/versions/v2022_11_28/rest/oidc.py +14 -10
  62. githubkit/versions/v2022_11_28/rest/orgs.py +240 -168
  63. githubkit/versions/v2022_11_28/rest/projects.py +170 -126
  64. githubkit/versions/v2022_11_28/rest/pulls.py +234 -170
  65. githubkit/versions/v2022_11_28/rest/reactions.py +166 -130
  66. githubkit/versions/v2022_11_28/rest/repos.py +1035 -800
  67. githubkit/versions/v2022_11_28/rest/secret_scanning.py +36 -28
  68. githubkit/versions/v2022_11_28/rest/security_advisories.py +42 -30
  69. githubkit/versions/v2022_11_28/rest/teams.py +274 -204
  70. githubkit/versions/v2022_11_28/rest/users.py +154 -118
  71. githubkit/versions/v2022_11_28/types/group_0030.py +2 -1
  72. githubkit/versions/v2022_11_28/types/group_0060.py +0 -1
  73. githubkit/versions/v2022_11_28/types/group_0082.py +1 -0
  74. githubkit/versions/v2022_11_28/types/group_0936.py +3 -1
  75. {githubkit-0.11.12.dist-info → githubkit-0.11.14.dist-info}/METADATA +3 -2
  76. {githubkit-0.11.12.dist-info → githubkit-0.11.14.dist-info}/RECORD +78 -78
  77. {githubkit-0.11.12.dist-info → githubkit-0.11.14.dist-info}/WHEEL +1 -1
  78. {githubkit-0.11.12.dist-info → githubkit-0.11.14.dist-info}/LICENSE +0 -0
@@ -10,10 +10,9 @@ See https://github.com/github/rest-api-description for more information.
10
10
  from __future__ import annotations
11
11
 
12
12
  from weakref import ref
13
- from typing_extensions import Annotated
14
13
  from typing import TYPE_CHECKING, Dict, Literal, Optional, overload
15
14
 
16
- from pydantic import Field, BaseModel
15
+ from pydantic import BaseModel
17
16
 
18
17
  from githubkit.typing import Missing, UnsetType
19
18
  from githubkit.utils import UNSET, exclude_unset
@@ -401,13 +400,15 @@ class ReposClient:
401
400
 
402
401
  url = f"/orgs/{org}/repos"
403
402
 
404
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
405
-
406
- if not kwargs:
407
- kwargs = UNSET
403
+ headers = {
404
+ "Content-Type": "application/json",
405
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
406
+ **(headers or {}),
407
+ }
408
408
 
409
409
  json = kwargs if data is UNSET else data
410
- json = type_validate_python(OrgsOrgReposPostBody, json)
410
+ if self._github.config.rest_api_validate_body:
411
+ json = type_validate_python(OrgsOrgReposPostBody, json)
411
412
  json = model_dump(json) if isinstance(json, BaseModel) else json
412
413
 
413
414
  return self._github.request(
@@ -490,13 +491,15 @@ class ReposClient:
490
491
 
491
492
  url = f"/orgs/{org}/repos"
492
493
 
493
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
494
-
495
- if not kwargs:
496
- kwargs = UNSET
494
+ headers = {
495
+ "Content-Type": "application/json",
496
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
497
+ **(headers or {}),
498
+ }
497
499
 
498
500
  json = kwargs if data is UNSET else data
499
- json = type_validate_python(OrgsOrgReposPostBody, json)
501
+ if self._github.config.rest_api_validate_body:
502
+ json = type_validate_python(OrgsOrgReposPostBody, json)
500
503
  json = model_dump(json) if isinstance(json, BaseModel) else json
501
504
 
502
505
  return await self._github.arequest(
@@ -516,6 +519,7 @@ class ReposClient:
516
519
  org: str,
517
520
  per_page: Missing[int] = UNSET,
518
521
  page: Missing[int] = UNSET,
522
+ targets: Missing[str] = UNSET,
519
523
  *,
520
524
  headers: Optional[Dict[str, str]] = None,
521
525
  ) -> Response[List[RepositoryRuleset]]:
@@ -530,6 +534,7 @@ class ReposClient:
530
534
  params = {
531
535
  "per_page": per_page,
532
536
  "page": page,
537
+ "targets": targets,
533
538
  }
534
539
 
535
540
  headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
@@ -551,6 +556,7 @@ class ReposClient:
551
556
  org: str,
552
557
  per_page: Missing[int] = UNSET,
553
558
  page: Missing[int] = UNSET,
559
+ targets: Missing[str] = UNSET,
554
560
  *,
555
561
  headers: Optional[Dict[str, str]] = None,
556
562
  ) -> Response[List[RepositoryRuleset]]:
@@ -565,6 +571,7 @@ class ReposClient:
565
571
  params = {
566
572
  "per_page": per_page,
567
573
  "page": page,
574
+ "targets": targets,
568
575
  }
569
576
 
570
577
  headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
@@ -651,13 +658,15 @@ class ReposClient:
651
658
 
652
659
  url = f"/orgs/{org}/rulesets"
653
660
 
654
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
655
-
656
- if not kwargs:
657
- kwargs = UNSET
661
+ headers = {
662
+ "Content-Type": "application/json",
663
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
664
+ **(headers or {}),
665
+ }
658
666
 
659
667
  json = kwargs if data is UNSET else data
660
- json = type_validate_python(OrgsOrgRulesetsPostBody, json)
668
+ if self._github.config.rest_api_validate_body:
669
+ json = type_validate_python(OrgsOrgRulesetsPostBody, json)
661
670
  json = model_dump(json) if isinstance(json, BaseModel) else json
662
671
 
663
672
  return self._github.request(
@@ -742,13 +751,15 @@ class ReposClient:
742
751
 
743
752
  url = f"/orgs/{org}/rulesets"
744
753
 
745
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
746
-
747
- if not kwargs:
748
- kwargs = UNSET
754
+ headers = {
755
+ "Content-Type": "application/json",
756
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
757
+ **(headers or {}),
758
+ }
749
759
 
750
760
  json = kwargs if data is UNSET else data
751
- json = type_validate_python(OrgsOrgRulesetsPostBody, json)
761
+ if self._github.config.rest_api_validate_body:
762
+ json = type_validate_python(OrgsOrgRulesetsPostBody, json)
752
763
  json = model_dump(json) if isinstance(json, BaseModel) else json
753
764
 
754
765
  return await self._github.arequest(
@@ -1034,13 +1045,15 @@ class ReposClient:
1034
1045
 
1035
1046
  url = f"/orgs/{org}/rulesets/{ruleset_id}"
1036
1047
 
1037
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1038
-
1039
- if not kwargs:
1040
- kwargs = UNSET
1048
+ headers = {
1049
+ "Content-Type": "application/json",
1050
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1051
+ **(headers or {}),
1052
+ }
1041
1053
 
1042
1054
  json = kwargs if data is UNSET else data
1043
- json = type_validate_python(OrgsOrgRulesetsRulesetIdPutBody, json)
1055
+ if self._github.config.rest_api_validate_body:
1056
+ json = type_validate_python(OrgsOrgRulesetsRulesetIdPutBody, json)
1044
1057
  json = model_dump(json) if isinstance(json, BaseModel) else json
1045
1058
 
1046
1059
  return self._github.request(
@@ -1132,13 +1145,15 @@ class ReposClient:
1132
1145
 
1133
1146
  url = f"/orgs/{org}/rulesets/{ruleset_id}"
1134
1147
 
1135
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1136
-
1137
- if not kwargs:
1138
- kwargs = UNSET
1148
+ headers = {
1149
+ "Content-Type": "application/json",
1150
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1151
+ **(headers or {}),
1152
+ }
1139
1153
 
1140
1154
  json = kwargs if data is UNSET else data
1141
- json = type_validate_python(OrgsOrgRulesetsRulesetIdPutBody, json)
1155
+ if self._github.config.rest_api_validate_body:
1156
+ json = type_validate_python(OrgsOrgRulesetsRulesetIdPutBody, json)
1142
1157
  json = model_dump(json) if isinstance(json, BaseModel) else json
1143
1158
 
1144
1159
  return await self._github.arequest(
@@ -1376,13 +1391,15 @@ class ReposClient:
1376
1391
 
1377
1392
  url = f"/repos/{owner}/{repo}"
1378
1393
 
1379
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1380
-
1381
- if not kwargs:
1382
- kwargs = UNSET
1394
+ headers = {
1395
+ "Content-Type": "application/json",
1396
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1397
+ **(headers or {}),
1398
+ }
1383
1399
 
1384
1400
  json = kwargs if data is UNSET else data
1385
- json = type_validate_python(ReposOwnerRepoPatchBody, json)
1401
+ if self._github.config.rest_api_validate_body:
1402
+ json = type_validate_python(ReposOwnerRepoPatchBody, json)
1386
1403
  json = model_dump(json) if isinstance(json, BaseModel) else json
1387
1404
 
1388
1405
  return self._github.request(
@@ -1469,13 +1486,15 @@ class ReposClient:
1469
1486
 
1470
1487
  url = f"/repos/{owner}/{repo}"
1471
1488
 
1472
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1473
-
1474
- if not kwargs:
1475
- kwargs = UNSET
1489
+ headers = {
1490
+ "Content-Type": "application/json",
1491
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1492
+ **(headers or {}),
1493
+ }
1476
1494
 
1477
1495
  json = kwargs if data is UNSET else data
1478
- json = type_validate_python(ReposOwnerRepoPatchBody, json)
1496
+ if self._github.config.rest_api_validate_body:
1497
+ json = type_validate_python(ReposOwnerRepoPatchBody, json)
1479
1498
  json = model_dump(json) if isinstance(json, BaseModel) else json
1480
1499
 
1481
1500
  return await self._github.arequest(
@@ -1648,13 +1667,15 @@ class ReposClient:
1648
1667
 
1649
1668
  url = f"/repos/{owner}/{repo}/attestations"
1650
1669
 
1651
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1652
-
1653
- if not kwargs:
1654
- kwargs = UNSET
1670
+ headers = {
1671
+ "Content-Type": "application/json",
1672
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1673
+ **(headers or {}),
1674
+ }
1655
1675
 
1656
1676
  json = kwargs if data is UNSET else data
1657
- json = type_validate_python(ReposOwnerRepoAttestationsPostBody, json)
1677
+ if self._github.config.rest_api_validate_body:
1678
+ json = type_validate_python(ReposOwnerRepoAttestationsPostBody, json)
1658
1679
  json = model_dump(json) if isinstance(json, BaseModel) else json
1659
1680
 
1660
1681
  return self._github.request(
@@ -1710,13 +1731,15 @@ class ReposClient:
1710
1731
 
1711
1732
  url = f"/repos/{owner}/{repo}/attestations"
1712
1733
 
1713
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1714
-
1715
- if not kwargs:
1716
- kwargs = UNSET
1734
+ headers = {
1735
+ "Content-Type": "application/json",
1736
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1737
+ **(headers or {}),
1738
+ }
1717
1739
 
1718
1740
  json = kwargs if data is UNSET else data
1719
- json = type_validate_python(ReposOwnerRepoAttestationsPostBody, json)
1741
+ if self._github.config.rest_api_validate_body:
1742
+ json = type_validate_python(ReposOwnerRepoAttestationsPostBody, json)
1720
1743
  json = model_dump(json) if isinstance(json, BaseModel) else json
1721
1744
 
1722
1745
  return await self._github.arequest(
@@ -1883,13 +1906,15 @@ class ReposClient:
1883
1906
 
1884
1907
  url = f"/repos/{owner}/{repo}/autolinks"
1885
1908
 
1886
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1887
-
1888
- if not kwargs:
1889
- kwargs = UNSET
1909
+ headers = {
1910
+ "Content-Type": "application/json",
1911
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1912
+ **(headers or {}),
1913
+ }
1890
1914
 
1891
1915
  json = kwargs if data is UNSET else data
1892
- json = type_validate_python(ReposOwnerRepoAutolinksPostBody, json)
1916
+ if self._github.config.rest_api_validate_body:
1917
+ json = type_validate_python(ReposOwnerRepoAutolinksPostBody, json)
1893
1918
  json = model_dump(json) if isinstance(json, BaseModel) else json
1894
1919
 
1895
1920
  return self._github.request(
@@ -1941,13 +1966,15 @@ class ReposClient:
1941
1966
 
1942
1967
  url = f"/repos/{owner}/{repo}/autolinks"
1943
1968
 
1944
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1945
-
1946
- if not kwargs:
1947
- kwargs = UNSET
1969
+ headers = {
1970
+ "Content-Type": "application/json",
1971
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1972
+ **(headers or {}),
1973
+ }
1948
1974
 
1949
1975
  json = kwargs if data is UNSET else data
1950
- json = type_validate_python(ReposOwnerRepoAutolinksPostBody, json)
1976
+ if self._github.config.rest_api_validate_body:
1977
+ json = type_validate_python(ReposOwnerRepoAutolinksPostBody, json)
1951
1978
  json = model_dump(json) if isinstance(json, BaseModel) else json
1952
1979
 
1953
1980
  return await self._github.arequest(
@@ -2425,13 +2452,17 @@ class ReposClient:
2425
2452
 
2426
2453
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection"
2427
2454
 
2428
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
2429
-
2430
- if not kwargs:
2431
- kwargs = UNSET
2455
+ headers = {
2456
+ "Content-Type": "application/json",
2457
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
2458
+ **(headers or {}),
2459
+ }
2432
2460
 
2433
2461
  json = kwargs if data is UNSET else data
2434
- json = type_validate_python(ReposOwnerRepoBranchesBranchProtectionPutBody, json)
2462
+ if self._github.config.rest_api_validate_body:
2463
+ json = type_validate_python(
2464
+ ReposOwnerRepoBranchesBranchProtectionPutBody, json
2465
+ )
2435
2466
  json = model_dump(json) if isinstance(json, BaseModel) else json
2436
2467
 
2437
2468
  return self._github.request(
@@ -2509,13 +2540,17 @@ class ReposClient:
2509
2540
 
2510
2541
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection"
2511
2542
 
2512
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
2513
-
2514
- if not kwargs:
2515
- kwargs = UNSET
2543
+ headers = {
2544
+ "Content-Type": "application/json",
2545
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
2546
+ **(headers or {}),
2547
+ }
2516
2548
 
2517
2549
  json = kwargs if data is UNSET else data
2518
- json = type_validate_python(ReposOwnerRepoBranchesBranchProtectionPutBody, json)
2550
+ if self._github.config.rest_api_validate_body:
2551
+ json = type_validate_python(
2552
+ ReposOwnerRepoBranchesBranchProtectionPutBody, json
2553
+ )
2519
2554
  json = model_dump(json) if isinstance(json, BaseModel) else json
2520
2555
 
2521
2556
  return await self._github.arequest(
@@ -2875,16 +2910,18 @@ class ReposClient:
2875
2910
 
2876
2911
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
2877
2912
 
2878
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
2879
-
2880
- if not kwargs:
2881
- kwargs = UNSET
2913
+ headers = {
2914
+ "Content-Type": "application/json",
2915
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
2916
+ **(headers or {}),
2917
+ }
2882
2918
 
2883
2919
  json = kwargs if data is UNSET else data
2884
- json = type_validate_python(
2885
- ReposOwnerRepoBranchesBranchProtectionRequiredPullRequestReviewsPatchBody,
2886
- json,
2887
- )
2920
+ if self._github.config.rest_api_validate_body:
2921
+ json = type_validate_python(
2922
+ ReposOwnerRepoBranchesBranchProtectionRequiredPullRequestReviewsPatchBody,
2923
+ json,
2924
+ )
2888
2925
  json = model_dump(json) if isinstance(json, BaseModel) else json
2889
2926
 
2890
2927
  return self._github.request(
@@ -2954,16 +2991,18 @@ class ReposClient:
2954
2991
 
2955
2992
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
2956
2993
 
2957
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
2958
-
2959
- if not kwargs:
2960
- kwargs = UNSET
2994
+ headers = {
2995
+ "Content-Type": "application/json",
2996
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
2997
+ **(headers or {}),
2998
+ }
2961
2999
 
2962
3000
  json = kwargs if data is UNSET else data
2963
- json = type_validate_python(
2964
- ReposOwnerRepoBranchesBranchProtectionRequiredPullRequestReviewsPatchBody,
2965
- json,
2966
- )
3001
+ if self._github.config.rest_api_validate_body:
3002
+ json = type_validate_python(
3003
+ ReposOwnerRepoBranchesBranchProtectionRequiredPullRequestReviewsPatchBody,
3004
+ json,
3005
+ )
2967
3006
  json = model_dump(json) if isinstance(json, BaseModel) else json
2968
3007
 
2969
3008
  return await self._github.arequest(
@@ -3287,15 +3326,18 @@ class ReposClient:
3287
3326
  f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
3288
3327
  )
3289
3328
 
3290
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3291
-
3292
- if not kwargs:
3293
- kwargs = UNSET
3329
+ headers = {
3330
+ "Content-Type": "application/json",
3331
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3332
+ **(headers or {}),
3333
+ }
3294
3334
 
3295
3335
  json = kwargs if data is UNSET else data
3296
- json = type_validate_python(
3297
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksPatchBody, json
3298
- )
3336
+ if self._github.config.rest_api_validate_body:
3337
+ json = type_validate_python(
3338
+ ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksPatchBody,
3339
+ json,
3340
+ )
3299
3341
  json = model_dump(json) if isinstance(json, BaseModel) else json
3300
3342
 
3301
3343
  return self._github.request(
@@ -3366,15 +3408,18 @@ class ReposClient:
3366
3408
  f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"
3367
3409
  )
3368
3410
 
3369
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3370
-
3371
- if not kwargs:
3372
- kwargs = UNSET
3411
+ headers = {
3412
+ "Content-Type": "application/json",
3413
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3414
+ **(headers or {}),
3415
+ }
3373
3416
 
3374
3417
  json = kwargs if data is UNSET else data
3375
- json = type_validate_python(
3376
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksPatchBody, json
3377
- )
3418
+ if self._github.config.rest_api_validate_body:
3419
+ json = type_validate_python(
3420
+ ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksPatchBody,
3421
+ json,
3422
+ )
3378
3423
  json = model_dump(json) if isinstance(json, BaseModel) else json
3379
3424
 
3380
3425
  return await self._github.arequest(
@@ -3500,19 +3545,21 @@ class ReposClient:
3500
3545
 
3501
3546
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
3502
3547
 
3503
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3504
-
3505
- if not kwargs:
3506
- kwargs = UNSET
3548
+ headers = {
3549
+ "Content-Type": "application/json",
3550
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3551
+ **(headers or {}),
3552
+ }
3507
3553
 
3508
3554
  json = kwargs if data is UNSET else data
3509
- json = type_validate_python(
3510
- Union[
3511
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsPutBodyOneof0,
3512
- List[str],
3513
- ],
3514
- json,
3515
- )
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
+ )
3516
3563
  json = model_dump(json) if isinstance(json, BaseModel) else json
3517
3564
 
3518
3565
  return self._github.request(
@@ -3582,19 +3629,21 @@ class ReposClient:
3582
3629
 
3583
3630
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
3584
3631
 
3585
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3586
-
3587
- if not kwargs:
3588
- kwargs = UNSET
3632
+ headers = {
3633
+ "Content-Type": "application/json",
3634
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3635
+ **(headers or {}),
3636
+ }
3589
3637
 
3590
3638
  json = kwargs if data is UNSET else data
3591
- json = type_validate_python(
3592
- Union[
3593
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsPutBodyOneof0,
3594
- List[str],
3595
- ],
3596
- json,
3597
- )
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
+ )
3598
3647
  json = model_dump(json) if isinstance(json, BaseModel) else json
3599
3648
 
3600
3649
  return await self._github.arequest(
@@ -3664,19 +3713,21 @@ class ReposClient:
3664
3713
 
3665
3714
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
3666
3715
 
3667
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3668
-
3669
- if not kwargs:
3670
- kwargs = UNSET
3716
+ headers = {
3717
+ "Content-Type": "application/json",
3718
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3719
+ **(headers or {}),
3720
+ }
3671
3721
 
3672
3722
  json = kwargs if data is UNSET else data
3673
- json = type_validate_python(
3674
- Union[
3675
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsPostBodyOneof0,
3676
- List[str],
3677
- ],
3678
- json,
3679
- )
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
+ )
3680
3731
  json = model_dump(json) if isinstance(json, BaseModel) else json
3681
3732
 
3682
3733
  return self._github.request(
@@ -3747,19 +3798,21 @@ class ReposClient:
3747
3798
 
3748
3799
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
3749
3800
 
3750
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3751
-
3752
- if not kwargs:
3753
- kwargs = UNSET
3801
+ headers = {
3802
+ "Content-Type": "application/json",
3803
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3804
+ **(headers or {}),
3805
+ }
3754
3806
 
3755
3807
  json = kwargs if data is UNSET else data
3756
- json = type_validate_python(
3757
- Union[
3758
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsPostBodyOneof0,
3759
- List[str],
3760
- ],
3761
- json,
3762
- )
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
+ )
3763
3816
  json = model_dump(json) if isinstance(json, BaseModel) else json
3764
3817
 
3765
3818
  return await self._github.arequest(
@@ -3830,19 +3883,21 @@ class ReposClient:
3830
3883
 
3831
3884
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
3832
3885
 
3833
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3834
-
3835
- if not kwargs:
3836
- kwargs = UNSET
3886
+ headers = {
3887
+ "Content-Type": "application/json",
3888
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3889
+ **(headers or {}),
3890
+ }
3837
3891
 
3838
3892
  json = kwargs if data is UNSET else data
3839
- json = type_validate_python(
3840
- Union[
3841
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsDeleteBodyOneof0,
3842
- List[str],
3843
- ],
3844
- json,
3845
- )
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
+ )
3846
3901
  json = model_dump(json) if isinstance(json, BaseModel) else json
3847
3902
 
3848
3903
  return self._github.request(
@@ -3912,19 +3967,21 @@ class ReposClient:
3912
3967
 
3913
3968
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"
3914
3969
 
3915
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
3916
-
3917
- if not kwargs:
3918
- kwargs = UNSET
3970
+ headers = {
3971
+ "Content-Type": "application/json",
3972
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
3973
+ **(headers or {}),
3974
+ }
3919
3975
 
3920
3976
  json = kwargs if data is UNSET else data
3921
- json = type_validate_python(
3922
- Union[
3923
- ReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksContextsDeleteBodyOneof0,
3924
- List[str],
3925
- ],
3926
- json,
3927
- )
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
+ )
3928
3985
  json = model_dump(json) if isinstance(json, BaseModel) else json
3929
3986
 
3930
3987
  return await self._github.arequest(
@@ -4134,15 +4191,17 @@ class ReposClient:
4134
4191
 
4135
4192
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
4136
4193
 
4137
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4138
-
4139
- if not kwargs:
4140
- kwargs = UNSET
4194
+ headers = {
4195
+ "Content-Type": "application/json",
4196
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4197
+ **(headers or {}),
4198
+ }
4141
4199
 
4142
4200
  json = kwargs if data is UNSET else data
4143
- json = type_validate_python(
4144
- ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPutBody, json
4145
- )
4201
+ if self._github.config.rest_api_validate_body:
4202
+ json = type_validate_python(
4203
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPutBody, json
4204
+ )
4146
4205
  json = model_dump(json) if isinstance(json, BaseModel) else json
4147
4206
 
4148
4207
  return self._github.request(
@@ -4203,15 +4262,17 @@ class ReposClient:
4203
4262
 
4204
4263
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
4205
4264
 
4206
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4207
-
4208
- if not kwargs:
4209
- kwargs = UNSET
4265
+ headers = {
4266
+ "Content-Type": "application/json",
4267
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4268
+ **(headers or {}),
4269
+ }
4210
4270
 
4211
4271
  json = kwargs if data is UNSET else data
4212
- json = type_validate_python(
4213
- ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPutBody, json
4214
- )
4272
+ if self._github.config.rest_api_validate_body:
4273
+ json = type_validate_python(
4274
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPutBody, json
4275
+ )
4215
4276
  json = model_dump(json) if isinstance(json, BaseModel) else json
4216
4277
 
4217
4278
  return await self._github.arequest(
@@ -4272,15 +4333,17 @@ class ReposClient:
4272
4333
 
4273
4334
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
4274
4335
 
4275
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4276
-
4277
- if not kwargs:
4278
- kwargs = UNSET
4336
+ headers = {
4337
+ "Content-Type": "application/json",
4338
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4339
+ **(headers or {}),
4340
+ }
4279
4341
 
4280
4342
  json = kwargs if data is UNSET else data
4281
- json = type_validate_python(
4282
- ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPostBody, json
4283
- )
4343
+ if self._github.config.rest_api_validate_body:
4344
+ json = type_validate_python(
4345
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPostBody, json
4346
+ )
4284
4347
  json = model_dump(json) if isinstance(json, BaseModel) else json
4285
4348
 
4286
4349
  return self._github.request(
@@ -4341,15 +4404,17 @@ class ReposClient:
4341
4404
 
4342
4405
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
4343
4406
 
4344
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4345
-
4346
- if not kwargs:
4347
- kwargs = UNSET
4407
+ headers = {
4408
+ "Content-Type": "application/json",
4409
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4410
+ **(headers or {}),
4411
+ }
4348
4412
 
4349
4413
  json = kwargs if data is UNSET else data
4350
- json = type_validate_python(
4351
- ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPostBody, json
4352
- )
4414
+ if self._github.config.rest_api_validate_body:
4415
+ json = type_validate_python(
4416
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsPostBody, json
4417
+ )
4353
4418
  json = model_dump(json) if isinstance(json, BaseModel) else json
4354
4419
 
4355
4420
  return await self._github.arequest(
@@ -4410,15 +4475,17 @@ class ReposClient:
4410
4475
 
4411
4476
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
4412
4477
 
4413
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4414
-
4415
- if not kwargs:
4416
- kwargs = UNSET
4478
+ headers = {
4479
+ "Content-Type": "application/json",
4480
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4481
+ **(headers or {}),
4482
+ }
4417
4483
 
4418
4484
  json = kwargs if data is UNSET else data
4419
- json = type_validate_python(
4420
- ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsDeleteBody, json
4421
- )
4485
+ if self._github.config.rest_api_validate_body:
4486
+ json = type_validate_python(
4487
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsDeleteBody, json
4488
+ )
4422
4489
  json = model_dump(json) if isinstance(json, BaseModel) else json
4423
4490
 
4424
4491
  return self._github.request(
@@ -4479,15 +4546,17 @@ class ReposClient:
4479
4546
 
4480
4547
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"
4481
4548
 
4482
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4483
-
4484
- if not kwargs:
4485
- kwargs = UNSET
4549
+ headers = {
4550
+ "Content-Type": "application/json",
4551
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4552
+ **(headers or {}),
4553
+ }
4486
4554
 
4487
4555
  json = kwargs if data is UNSET else data
4488
- json = type_validate_python(
4489
- ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsDeleteBody, json
4490
- )
4556
+ if self._github.config.rest_api_validate_body:
4557
+ json = type_validate_python(
4558
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsAppsDeleteBody, json
4559
+ )
4491
4560
  json = model_dump(json) if isinstance(json, BaseModel) else json
4492
4561
 
4493
4562
  return await self._github.arequest(
@@ -4612,19 +4681,21 @@ class ReposClient:
4612
4681
 
4613
4682
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
4614
4683
 
4615
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4616
-
4617
- if not kwargs:
4618
- kwargs = UNSET
4684
+ headers = {
4685
+ "Content-Type": "application/json",
4686
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4687
+ **(headers or {}),
4688
+ }
4619
4689
 
4620
4690
  json = kwargs if data is UNSET else data
4621
- json = type_validate_python(
4622
- Union[
4623
- ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsPutBodyOneof0,
4624
- List[str],
4625
- ],
4626
- json,
4627
- )
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
+ )
4628
4699
  json = model_dump(json) if isinstance(json, BaseModel) else json
4629
4700
 
4630
4701
  return self._github.request(
@@ -4693,19 +4764,21 @@ class ReposClient:
4693
4764
 
4694
4765
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
4695
4766
 
4696
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4697
-
4698
- if not kwargs:
4699
- kwargs = UNSET
4767
+ headers = {
4768
+ "Content-Type": "application/json",
4769
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4770
+ **(headers or {}),
4771
+ }
4700
4772
 
4701
4773
  json = kwargs if data is UNSET else data
4702
- json = type_validate_python(
4703
- Union[
4704
- ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsPutBodyOneof0,
4705
- List[str],
4706
- ],
4707
- json,
4708
- )
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
+ )
4709
4782
  json = model_dump(json) if isinstance(json, BaseModel) else json
4710
4783
 
4711
4784
  return await self._github.arequest(
@@ -4774,19 +4847,21 @@ class ReposClient:
4774
4847
 
4775
4848
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
4776
4849
 
4777
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4778
-
4779
- if not kwargs:
4780
- kwargs = UNSET
4850
+ headers = {
4851
+ "Content-Type": "application/json",
4852
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4853
+ **(headers or {}),
4854
+ }
4781
4855
 
4782
4856
  json = kwargs if data is UNSET else data
4783
- json = type_validate_python(
4784
- Union[
4785
- ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsPostBodyOneof0,
4786
- List[str],
4787
- ],
4788
- json,
4789
- )
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
+ )
4790
4865
  json = model_dump(json) if isinstance(json, BaseModel) else json
4791
4866
 
4792
4867
  return self._github.request(
@@ -4855,19 +4930,21 @@ class ReposClient:
4855
4930
 
4856
4931
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
4857
4932
 
4858
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4859
-
4860
- if not kwargs:
4861
- kwargs = UNSET
4933
+ headers = {
4934
+ "Content-Type": "application/json",
4935
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
4936
+ **(headers or {}),
4937
+ }
4862
4938
 
4863
4939
  json = kwargs if data is UNSET else data
4864
- json = type_validate_python(
4865
- Union[
4866
- ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsPostBodyOneof0,
4867
- List[str],
4868
- ],
4869
- json,
4870
- )
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
+ )
4871
4948
  json = model_dump(json) if isinstance(json, BaseModel) else json
4872
4949
 
4873
4950
  return await self._github.arequest(
@@ -4936,19 +5013,21 @@ class ReposClient:
4936
5013
 
4937
5014
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
4938
5015
 
4939
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
4940
-
4941
- if not kwargs:
4942
- kwargs = UNSET
5016
+ headers = {
5017
+ "Content-Type": "application/json",
5018
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5019
+ **(headers or {}),
5020
+ }
4943
5021
 
4944
5022
  json = kwargs if data is UNSET else data
4945
- json = type_validate_python(
4946
- Union[
4947
- ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsDeleteBodyOneof0,
4948
- List[str],
4949
- ],
4950
- json,
4951
- )
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
+ )
4952
5031
  json = model_dump(json) if isinstance(json, BaseModel) else json
4953
5032
 
4954
5033
  return self._github.request(
@@ -5017,19 +5096,21 @@ class ReposClient:
5017
5096
 
5018
5097
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"
5019
5098
 
5020
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5021
-
5022
- if not kwargs:
5023
- kwargs = UNSET
5099
+ headers = {
5100
+ "Content-Type": "application/json",
5101
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5102
+ **(headers or {}),
5103
+ }
5024
5104
 
5025
5105
  json = kwargs if data is UNSET else data
5026
- json = type_validate_python(
5027
- Union[
5028
- ReposOwnerRepoBranchesBranchProtectionRestrictionsTeamsDeleteBodyOneof0,
5029
- List[str],
5030
- ],
5031
- json,
5032
- )
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
+ )
5033
5114
  json = model_dump(json) if isinstance(json, BaseModel) else json
5034
5115
 
5035
5116
  return await self._github.arequest(
@@ -5146,15 +5227,17 @@ class ReposClient:
5146
5227
 
5147
5228
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
5148
5229
 
5149
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5150
-
5151
- if not kwargs:
5152
- kwargs = UNSET
5230
+ headers = {
5231
+ "Content-Type": "application/json",
5232
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5233
+ **(headers or {}),
5234
+ }
5153
5235
 
5154
5236
  json = kwargs if data is UNSET else data
5155
- json = type_validate_python(
5156
- ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPutBody, json
5157
- )
5237
+ if self._github.config.rest_api_validate_body:
5238
+ json = type_validate_python(
5239
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPutBody, json
5240
+ )
5158
5241
  json = model_dump(json) if isinstance(json, BaseModel) else json
5159
5242
 
5160
5243
  return self._github.request(
@@ -5215,15 +5298,17 @@ class ReposClient:
5215
5298
 
5216
5299
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
5217
5300
 
5218
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5219
-
5220
- if not kwargs:
5221
- kwargs = UNSET
5301
+ headers = {
5302
+ "Content-Type": "application/json",
5303
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5304
+ **(headers or {}),
5305
+ }
5222
5306
 
5223
5307
  json = kwargs if data is UNSET else data
5224
- json = type_validate_python(
5225
- ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPutBody, json
5226
- )
5308
+ if self._github.config.rest_api_validate_body:
5309
+ json = type_validate_python(
5310
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPutBody, json
5311
+ )
5227
5312
  json = model_dump(json) if isinstance(json, BaseModel) else json
5228
5313
 
5229
5314
  return await self._github.arequest(
@@ -5284,15 +5369,17 @@ class ReposClient:
5284
5369
 
5285
5370
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
5286
5371
 
5287
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5288
-
5289
- if not kwargs:
5290
- kwargs = UNSET
5372
+ headers = {
5373
+ "Content-Type": "application/json",
5374
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5375
+ **(headers or {}),
5376
+ }
5291
5377
 
5292
5378
  json = kwargs if data is UNSET else data
5293
- json = type_validate_python(
5294
- ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPostBody, json
5295
- )
5379
+ if self._github.config.rest_api_validate_body:
5380
+ json = type_validate_python(
5381
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPostBody, json
5382
+ )
5296
5383
  json = model_dump(json) if isinstance(json, BaseModel) else json
5297
5384
 
5298
5385
  return self._github.request(
@@ -5353,15 +5440,17 @@ class ReposClient:
5353
5440
 
5354
5441
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
5355
5442
 
5356
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5357
-
5358
- if not kwargs:
5359
- kwargs = UNSET
5443
+ headers = {
5444
+ "Content-Type": "application/json",
5445
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5446
+ **(headers or {}),
5447
+ }
5360
5448
 
5361
5449
  json = kwargs if data is UNSET else data
5362
- json = type_validate_python(
5363
- ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPostBody, json
5364
- )
5450
+ if self._github.config.rest_api_validate_body:
5451
+ json = type_validate_python(
5452
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersPostBody, json
5453
+ )
5365
5454
  json = model_dump(json) if isinstance(json, BaseModel) else json
5366
5455
 
5367
5456
  return await self._github.arequest(
@@ -5422,15 +5511,17 @@ class ReposClient:
5422
5511
 
5423
5512
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
5424
5513
 
5425
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5426
-
5427
- if not kwargs:
5428
- kwargs = UNSET
5514
+ headers = {
5515
+ "Content-Type": "application/json",
5516
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5517
+ **(headers or {}),
5518
+ }
5429
5519
 
5430
5520
  json = kwargs if data is UNSET else data
5431
- json = type_validate_python(
5432
- ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersDeleteBody, json
5433
- )
5521
+ if self._github.config.rest_api_validate_body:
5522
+ json = type_validate_python(
5523
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersDeleteBody, json
5524
+ )
5434
5525
  json = model_dump(json) if isinstance(json, BaseModel) else json
5435
5526
 
5436
5527
  return self._github.request(
@@ -5491,15 +5582,17 @@ class ReposClient:
5491
5582
 
5492
5583
  url = f"/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"
5493
5584
 
5494
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5495
-
5496
- if not kwargs:
5497
- kwargs = UNSET
5585
+ headers = {
5586
+ "Content-Type": "application/json",
5587
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5588
+ **(headers or {}),
5589
+ }
5498
5590
 
5499
5591
  json = kwargs if data is UNSET else data
5500
- json = type_validate_python(
5501
- ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersDeleteBody, json
5502
- )
5592
+ if self._github.config.rest_api_validate_body:
5593
+ json = type_validate_python(
5594
+ ReposOwnerRepoBranchesBranchProtectionRestrictionsUsersDeleteBody, json
5595
+ )
5503
5596
  json = model_dump(json) if isinstance(json, BaseModel) else json
5504
5597
 
5505
5598
  return await self._github.arequest(
@@ -5557,13 +5650,17 @@ class ReposClient:
5557
5650
 
5558
5651
  url = f"/repos/{owner}/{repo}/branches/{branch}/rename"
5559
5652
 
5560
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5561
-
5562
- if not kwargs:
5563
- kwargs = UNSET
5653
+ headers = {
5654
+ "Content-Type": "application/json",
5655
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5656
+ **(headers or {}),
5657
+ }
5564
5658
 
5565
5659
  json = kwargs if data is UNSET else data
5566
- json = type_validate_python(ReposOwnerRepoBranchesBranchRenamePostBody, json)
5660
+ if self._github.config.rest_api_validate_body:
5661
+ json = type_validate_python(
5662
+ ReposOwnerRepoBranchesBranchRenamePostBody, json
5663
+ )
5567
5664
  json = model_dump(json) if isinstance(json, BaseModel) else json
5568
5665
 
5569
5666
  return self._github.request(
@@ -5623,13 +5720,17 @@ class ReposClient:
5623
5720
 
5624
5721
  url = f"/repos/{owner}/{repo}/branches/{branch}/rename"
5625
5722
 
5626
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5627
-
5628
- if not kwargs:
5629
- kwargs = UNSET
5723
+ headers = {
5724
+ "Content-Type": "application/json",
5725
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5726
+ **(headers or {}),
5727
+ }
5630
5728
 
5631
5729
  json = kwargs if data is UNSET else data
5632
- json = type_validate_python(ReposOwnerRepoBranchesBranchRenamePostBody, json)
5730
+ if self._github.config.rest_api_validate_body:
5731
+ json = type_validate_python(
5732
+ ReposOwnerRepoBranchesBranchRenamePostBody, json
5733
+ )
5633
5734
  json = model_dump(json) if isinstance(json, BaseModel) else json
5634
5735
 
5635
5736
  return await self._github.arequest(
@@ -5871,13 +5972,17 @@ class ReposClient:
5871
5972
 
5872
5973
  url = f"/repos/{owner}/{repo}/collaborators/{username}"
5873
5974
 
5874
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5875
-
5876
- if not kwargs:
5877
- kwargs = UNSET
5975
+ headers = {
5976
+ "Content-Type": "application/json",
5977
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
5978
+ **(headers or {}),
5979
+ }
5878
5980
 
5879
5981
  json = kwargs if data is UNSET else data
5880
- json = type_validate_python(ReposOwnerRepoCollaboratorsUsernamePutBody, json)
5982
+ if self._github.config.rest_api_validate_body:
5983
+ json = type_validate_python(
5984
+ ReposOwnerRepoCollaboratorsUsernamePutBody, json
5985
+ )
5881
5986
  json = model_dump(json) if isinstance(json, BaseModel) else json
5882
5987
 
5883
5988
  return self._github.request(
@@ -5936,13 +6041,17 @@ class ReposClient:
5936
6041
 
5937
6042
  url = f"/repos/{owner}/{repo}/collaborators/{username}"
5938
6043
 
5939
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
5940
-
5941
- if not kwargs:
5942
- kwargs = UNSET
6044
+ headers = {
6045
+ "Content-Type": "application/json",
6046
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
6047
+ **(headers or {}),
6048
+ }
5943
6049
 
5944
6050
  json = kwargs if data is UNSET else data
5945
- json = type_validate_python(ReposOwnerRepoCollaboratorsUsernamePutBody, json)
6051
+ if self._github.config.rest_api_validate_body:
6052
+ json = type_validate_python(
6053
+ ReposOwnerRepoCollaboratorsUsernamePutBody, json
6054
+ )
5946
6055
  json = model_dump(json) if isinstance(json, BaseModel) else json
5947
6056
 
5948
6057
  return await self._github.arequest(
@@ -6270,13 +6379,15 @@ class ReposClient:
6270
6379
 
6271
6380
  url = f"/repos/{owner}/{repo}/comments/{comment_id}"
6272
6381
 
6273
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
6274
-
6275
- if not kwargs:
6276
- kwargs = UNSET
6382
+ headers = {
6383
+ "Content-Type": "application/json",
6384
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
6385
+ **(headers or {}),
6386
+ }
6277
6387
 
6278
6388
  json = kwargs if data is UNSET else data
6279
- json = type_validate_python(ReposOwnerRepoCommentsCommentIdPatchBody, json)
6389
+ if self._github.config.rest_api_validate_body:
6390
+ json = type_validate_python(ReposOwnerRepoCommentsCommentIdPatchBody, json)
6280
6391
  json = model_dump(json) if isinstance(json, BaseModel) else json
6281
6392
 
6282
6393
  return self._github.request(
@@ -6333,13 +6444,15 @@ class ReposClient:
6333
6444
 
6334
6445
  url = f"/repos/{owner}/{repo}/comments/{comment_id}"
6335
6446
 
6336
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
6337
-
6338
- if not kwargs:
6339
- kwargs = UNSET
6447
+ headers = {
6448
+ "Content-Type": "application/json",
6449
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
6450
+ **(headers or {}),
6451
+ }
6340
6452
 
6341
6453
  json = kwargs if data is UNSET else data
6342
- json = type_validate_python(ReposOwnerRepoCommentsCommentIdPatchBody, json)
6454
+ if self._github.config.rest_api_validate_body:
6455
+ json = type_validate_python(ReposOwnerRepoCommentsCommentIdPatchBody, json)
6343
6456
  json = model_dump(json) if isinstance(json, BaseModel) else json
6344
6457
 
6345
6458
  return await self._github.arequest(
@@ -6624,15 +6737,17 @@ class ReposClient:
6624
6737
 
6625
6738
  url = f"/repos/{owner}/{repo}/commits/{commit_sha}/comments"
6626
6739
 
6627
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
6628
-
6629
- if not kwargs:
6630
- kwargs = UNSET
6740
+ headers = {
6741
+ "Content-Type": "application/json",
6742
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
6743
+ **(headers or {}),
6744
+ }
6631
6745
 
6632
6746
  json = kwargs if data is UNSET else data
6633
- json = type_validate_python(
6634
- ReposOwnerRepoCommitsCommitShaCommentsPostBody, json
6635
- )
6747
+ if self._github.config.rest_api_validate_body:
6748
+ json = type_validate_python(
6749
+ ReposOwnerRepoCommitsCommitShaCommentsPostBody, json
6750
+ )
6636
6751
  json = model_dump(json) if isinstance(json, BaseModel) else json
6637
6752
 
6638
6753
  return self._github.request(
@@ -6694,15 +6809,17 @@ class ReposClient:
6694
6809
 
6695
6810
  url = f"/repos/{owner}/{repo}/commits/{commit_sha}/comments"
6696
6811
 
6697
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
6698
-
6699
- if not kwargs:
6700
- kwargs = UNSET
6812
+ headers = {
6813
+ "Content-Type": "application/json",
6814
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
6815
+ **(headers or {}),
6816
+ }
6701
6817
 
6702
6818
  json = kwargs if data is UNSET else data
6703
- json = type_validate_python(
6704
- ReposOwnerRepoCommitsCommitShaCommentsPostBody, json
6705
- )
6819
+ if self._github.config.rest_api_validate_body:
6820
+ json = type_validate_python(
6821
+ ReposOwnerRepoCommitsCommitShaCommentsPostBody, json
6822
+ )
6706
6823
  json = model_dump(json) if isinstance(json, BaseModel) else json
6707
6824
 
6708
6825
  return await self._github.arequest(
@@ -7142,14 +7259,8 @@ class ReposClient:
7142
7259
  *,
7143
7260
  headers: Optional[Dict[str, str]] = None,
7144
7261
  ) -> Response[
7145
- Annotated[
7146
- Union[
7147
- List[ContentDirectoryItems],
7148
- ContentFile,
7149
- ContentSymlink,
7150
- ContentSubmodule,
7151
- ],
7152
- Field(discriminator="type"),
7262
+ Union[
7263
+ List[ContentDirectoryItems], ContentFile, ContentSymlink, ContentSubmodule
7153
7264
  ]
7154
7265
  ]:
7155
7266
  """See also: https://docs.github.com/rest/repos/contents#get-repository-content"""
@@ -7177,14 +7288,11 @@ class ReposClient:
7177
7288
  url,
7178
7289
  params=exclude_unset(params),
7179
7290
  headers=exclude_unset(headers),
7180
- response_model=Annotated[
7181
- Union[
7182
- List[ContentDirectoryItems],
7183
- ContentFile,
7184
- ContentSymlink,
7185
- ContentSubmodule,
7186
- ],
7187
- Field(discriminator="type"),
7291
+ response_model=Union[
7292
+ List[ContentDirectoryItems],
7293
+ ContentFile,
7294
+ ContentSymlink,
7295
+ ContentSubmodule,
7188
7296
  ],
7189
7297
  error_models={
7190
7298
  "404": BasicError,
@@ -7201,14 +7309,8 @@ class ReposClient:
7201
7309
  *,
7202
7310
  headers: Optional[Dict[str, str]] = None,
7203
7311
  ) -> Response[
7204
- Annotated[
7205
- Union[
7206
- List[ContentDirectoryItems],
7207
- ContentFile,
7208
- ContentSymlink,
7209
- ContentSubmodule,
7210
- ],
7211
- Field(discriminator="type"),
7312
+ Union[
7313
+ List[ContentDirectoryItems], ContentFile, ContentSymlink, ContentSubmodule
7212
7314
  ]
7213
7315
  ]:
7214
7316
  """See also: https://docs.github.com/rest/repos/contents#get-repository-content"""
@@ -7236,14 +7338,11 @@ class ReposClient:
7236
7338
  url,
7237
7339
  params=exclude_unset(params),
7238
7340
  headers=exclude_unset(headers),
7239
- response_model=Annotated[
7240
- Union[
7241
- List[ContentDirectoryItems],
7242
- ContentFile,
7243
- ContentSymlink,
7244
- ContentSubmodule,
7245
- ],
7246
- Field(discriminator="type"),
7341
+ response_model=Union[
7342
+ List[ContentDirectoryItems],
7343
+ ContentFile,
7344
+ ContentSymlink,
7345
+ ContentSubmodule,
7247
7346
  ],
7248
7347
  error_models={
7249
7348
  "404": BasicError,
@@ -7303,13 +7402,15 @@ class ReposClient:
7303
7402
 
7304
7403
  url = f"/repos/{owner}/{repo}/contents/{path}"
7305
7404
 
7306
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
7307
-
7308
- if not kwargs:
7309
- kwargs = UNSET
7405
+ headers = {
7406
+ "Content-Type": "application/json",
7407
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
7408
+ **(headers or {}),
7409
+ }
7310
7410
 
7311
7411
  json = kwargs if data is UNSET else data
7312
- json = type_validate_python(ReposOwnerRepoContentsPathPutBody, json)
7412
+ if self._github.config.rest_api_validate_body:
7413
+ json = type_validate_python(ReposOwnerRepoContentsPathPutBody, json)
7313
7414
  json = model_dump(json) if isinstance(json, BaseModel) else json
7314
7415
 
7315
7416
  return self._github.request(
@@ -7377,13 +7478,15 @@ class ReposClient:
7377
7478
 
7378
7479
  url = f"/repos/{owner}/{repo}/contents/{path}"
7379
7480
 
7380
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
7381
-
7382
- if not kwargs:
7383
- kwargs = UNSET
7481
+ headers = {
7482
+ "Content-Type": "application/json",
7483
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
7484
+ **(headers or {}),
7485
+ }
7384
7486
 
7385
7487
  json = kwargs if data is UNSET else data
7386
- json = type_validate_python(ReposOwnerRepoContentsPathPutBody, json)
7488
+ if self._github.config.rest_api_validate_body:
7489
+ json = type_validate_python(ReposOwnerRepoContentsPathPutBody, json)
7387
7490
  json = model_dump(json) if isinstance(json, BaseModel) else json
7388
7491
 
7389
7492
  return await self._github.arequest(
@@ -7450,13 +7553,15 @@ class ReposClient:
7450
7553
 
7451
7554
  url = f"/repos/{owner}/{repo}/contents/{path}"
7452
7555
 
7453
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
7454
-
7455
- if not kwargs:
7456
- kwargs = UNSET
7556
+ headers = {
7557
+ "Content-Type": "application/json",
7558
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
7559
+ **(headers or {}),
7560
+ }
7457
7561
 
7458
7562
  json = kwargs if data is UNSET else data
7459
- json = type_validate_python(ReposOwnerRepoContentsPathDeleteBody, json)
7563
+ if self._github.config.rest_api_validate_body:
7564
+ json = type_validate_python(ReposOwnerRepoContentsPathDeleteBody, json)
7460
7565
  json = model_dump(json) if isinstance(json, BaseModel) else json
7461
7566
 
7462
7567
  return self._github.request(
@@ -7524,13 +7629,15 @@ class ReposClient:
7524
7629
 
7525
7630
  url = f"/repos/{owner}/{repo}/contents/{path}"
7526
7631
 
7527
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
7528
-
7529
- if not kwargs:
7530
- kwargs = UNSET
7632
+ headers = {
7633
+ "Content-Type": "application/json",
7634
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
7635
+ **(headers or {}),
7636
+ }
7531
7637
 
7532
7638
  json = kwargs if data is UNSET else data
7533
- json = type_validate_python(ReposOwnerRepoContentsPathDeleteBody, json)
7639
+ if self._github.config.rest_api_validate_body:
7640
+ json = type_validate_python(ReposOwnerRepoContentsPathDeleteBody, json)
7534
7641
  json = model_dump(json) if isinstance(json, BaseModel) else json
7535
7642
 
7536
7643
  return await self._github.arequest(
@@ -7753,13 +7860,15 @@ class ReposClient:
7753
7860
 
7754
7861
  url = f"/repos/{owner}/{repo}/deployments"
7755
7862
 
7756
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
7757
-
7758
- if not kwargs:
7759
- kwargs = UNSET
7863
+ headers = {
7864
+ "Content-Type": "application/json",
7865
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
7866
+ **(headers or {}),
7867
+ }
7760
7868
 
7761
7869
  json = kwargs if data is UNSET else data
7762
- json = type_validate_python(ReposOwnerRepoDeploymentsPostBody, json)
7870
+ if self._github.config.rest_api_validate_body:
7871
+ json = type_validate_python(ReposOwnerRepoDeploymentsPostBody, json)
7763
7872
  json = model_dump(json) if isinstance(json, BaseModel) else json
7764
7873
 
7765
7874
  return self._github.request(
@@ -7823,13 +7932,15 @@ class ReposClient:
7823
7932
 
7824
7933
  url = f"/repos/{owner}/{repo}/deployments"
7825
7934
 
7826
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
7827
-
7828
- if not kwargs:
7829
- kwargs = UNSET
7935
+ headers = {
7936
+ "Content-Type": "application/json",
7937
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
7938
+ **(headers or {}),
7939
+ }
7830
7940
 
7831
7941
  json = kwargs if data is UNSET else data
7832
- json = type_validate_python(ReposOwnerRepoDeploymentsPostBody, json)
7942
+ if self._github.config.rest_api_validate_body:
7943
+ json = type_validate_python(ReposOwnerRepoDeploymentsPostBody, json)
7833
7944
  json = model_dump(json) if isinstance(json, BaseModel) else json
7834
7945
 
7835
7946
  return await self._github.arequest(
@@ -8078,15 +8189,17 @@ class ReposClient:
8078
8189
 
8079
8190
  url = f"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
8080
8191
 
8081
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8082
-
8083
- if not kwargs:
8084
- kwargs = UNSET
8192
+ headers = {
8193
+ "Content-Type": "application/json",
8194
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8195
+ **(headers or {}),
8196
+ }
8085
8197
 
8086
8198
  json = kwargs if data is UNSET else data
8087
- json = type_validate_python(
8088
- ReposOwnerRepoDeploymentsDeploymentIdStatusesPostBody, json
8089
- )
8199
+ if self._github.config.rest_api_validate_body:
8200
+ json = type_validate_python(
8201
+ ReposOwnerRepoDeploymentsDeploymentIdStatusesPostBody, json
8202
+ )
8090
8203
  json = model_dump(json) if isinstance(json, BaseModel) else json
8091
8204
 
8092
8205
  return self._github.request(
@@ -8159,15 +8272,17 @@ class ReposClient:
8159
8272
 
8160
8273
  url = f"/repos/{owner}/{repo}/deployments/{deployment_id}/statuses"
8161
8274
 
8162
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8163
-
8164
- if not kwargs:
8165
- kwargs = UNSET
8275
+ headers = {
8276
+ "Content-Type": "application/json",
8277
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8278
+ **(headers or {}),
8279
+ }
8166
8280
 
8167
8281
  json = kwargs if data is UNSET else data
8168
- json = type_validate_python(
8169
- ReposOwnerRepoDeploymentsDeploymentIdStatusesPostBody, json
8170
- )
8282
+ if self._github.config.rest_api_validate_body:
8283
+ json = type_validate_python(
8284
+ ReposOwnerRepoDeploymentsDeploymentIdStatusesPostBody, json
8285
+ )
8171
8286
  json = model_dump(json) if isinstance(json, BaseModel) else json
8172
8287
 
8173
8288
  return await self._github.arequest(
@@ -8278,13 +8393,15 @@ class ReposClient:
8278
8393
 
8279
8394
  url = f"/repos/{owner}/{repo}/dispatches"
8280
8395
 
8281
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8282
-
8283
- if not kwargs:
8284
- kwargs = UNSET
8396
+ headers = {
8397
+ "Content-Type": "application/json",
8398
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8399
+ **(headers or {}),
8400
+ }
8285
8401
 
8286
8402
  json = kwargs if data is UNSET else data
8287
- json = type_validate_python(ReposOwnerRepoDispatchesPostBody, json)
8403
+ if self._github.config.rest_api_validate_body:
8404
+ json = type_validate_python(ReposOwnerRepoDispatchesPostBody, json)
8288
8405
  json = model_dump(json) if isinstance(json, BaseModel) else json
8289
8406
 
8290
8407
  return self._github.request(
@@ -8341,13 +8458,15 @@ class ReposClient:
8341
8458
 
8342
8459
  url = f"/repos/{owner}/{repo}/dispatches"
8343
8460
 
8344
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8345
-
8346
- if not kwargs:
8347
- kwargs = UNSET
8461
+ headers = {
8462
+ "Content-Type": "application/json",
8463
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8464
+ **(headers or {}),
8465
+ }
8348
8466
 
8349
8467
  json = kwargs if data is UNSET else data
8350
- json = type_validate_python(ReposOwnerRepoDispatchesPostBody, json)
8468
+ if self._github.config.rest_api_validate_body:
8469
+ json = type_validate_python(ReposOwnerRepoDispatchesPostBody, json)
8351
8470
  json = model_dump(json) if isinstance(json, BaseModel) else json
8352
8471
 
8353
8472
  return await self._github.arequest(
@@ -8528,15 +8647,17 @@ class ReposClient:
8528
8647
 
8529
8648
  url = f"/repos/{owner}/{repo}/environments/{environment_name}"
8530
8649
 
8531
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8532
-
8533
- if not kwargs:
8534
- kwargs = UNSET
8650
+ headers = {
8651
+ "Content-Type": "application/json",
8652
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8653
+ **(headers or {}),
8654
+ }
8535
8655
 
8536
8656
  json = kwargs if data is UNSET else data
8537
- json = type_validate_python(
8538
- Union[ReposOwnerRepoEnvironmentsEnvironmentNamePutBody, None], json
8539
- )
8657
+ if self._github.config.rest_api_validate_body:
8658
+ json = type_validate_python(
8659
+ Union[ReposOwnerRepoEnvironmentsEnvironmentNamePutBody, None], json
8660
+ )
8540
8661
  json = model_dump(json) if isinstance(json, BaseModel) else json
8541
8662
 
8542
8663
  return self._github.request(
@@ -8611,15 +8732,17 @@ class ReposClient:
8611
8732
 
8612
8733
  url = f"/repos/{owner}/{repo}/environments/{environment_name}"
8613
8734
 
8614
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8615
-
8616
- if not kwargs:
8617
- kwargs = UNSET
8735
+ headers = {
8736
+ "Content-Type": "application/json",
8737
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8738
+ **(headers or {}),
8739
+ }
8618
8740
 
8619
8741
  json = kwargs if data is UNSET else data
8620
- json = type_validate_python(
8621
- Union[ReposOwnerRepoEnvironmentsEnvironmentNamePutBody, None], json
8622
- )
8742
+ if self._github.config.rest_api_validate_body:
8743
+ json = type_validate_python(
8744
+ Union[ReposOwnerRepoEnvironmentsEnvironmentNamePutBody, None], json
8745
+ )
8623
8746
  json = model_dump(json) if isinstance(json, BaseModel) else json
8624
8747
 
8625
8748
  return await self._github.arequest(
@@ -8786,13 +8909,15 @@ class ReposClient:
8786
8909
 
8787
8910
  url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
8788
8911
 
8789
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8790
-
8791
- if not kwargs:
8792
- kwargs = UNSET
8912
+ headers = {
8913
+ "Content-Type": "application/json",
8914
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8915
+ **(headers or {}),
8916
+ }
8793
8917
 
8794
8918
  json = kwargs if data is UNSET else data
8795
- json = type_validate_python(DeploymentBranchPolicyNamePatternWithType, json)
8919
+ if self._github.config.rest_api_validate_body:
8920
+ json = type_validate_python(DeploymentBranchPolicyNamePatternWithType, json)
8796
8921
  json = model_dump(json) if isinstance(json, BaseModel) else json
8797
8922
 
8798
8923
  return self._github.request(
@@ -8847,13 +8972,15 @@ class ReposClient:
8847
8972
 
8848
8973
  url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"
8849
8974
 
8850
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8851
-
8852
- if not kwargs:
8853
- kwargs = UNSET
8975
+ headers = {
8976
+ "Content-Type": "application/json",
8977
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
8978
+ **(headers or {}),
8979
+ }
8854
8980
 
8855
8981
  json = kwargs if data is UNSET else data
8856
- json = type_validate_python(DeploymentBranchPolicyNamePatternWithType, json)
8982
+ if self._github.config.rest_api_validate_body:
8983
+ json = type_validate_python(DeploymentBranchPolicyNamePatternWithType, json)
8857
8984
  json = model_dump(json) if isinstance(json, BaseModel) else json
8858
8985
 
8859
8986
  return await self._github.arequest(
@@ -8955,13 +9082,15 @@ class ReposClient:
8955
9082
 
8956
9083
  url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
8957
9084
 
8958
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
8959
-
8960
- if not kwargs:
8961
- kwargs = UNSET
9085
+ headers = {
9086
+ "Content-Type": "application/json",
9087
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9088
+ **(headers or {}),
9089
+ }
8962
9090
 
8963
9091
  json = kwargs if data is UNSET else data
8964
- json = type_validate_python(DeploymentBranchPolicyNamePattern, json)
9092
+ if self._github.config.rest_api_validate_body:
9093
+ json = type_validate_python(DeploymentBranchPolicyNamePattern, json)
8965
9094
  json = model_dump(json) if isinstance(json, BaseModel) else json
8966
9095
 
8967
9096
  return self._github.request(
@@ -9014,13 +9143,15 @@ class ReposClient:
9014
9143
 
9015
9144
  url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"
9016
9145
 
9017
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9018
-
9019
- if not kwargs:
9020
- kwargs = UNSET
9146
+ headers = {
9147
+ "Content-Type": "application/json",
9148
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9149
+ **(headers or {}),
9150
+ }
9021
9151
 
9022
9152
  json = kwargs if data is UNSET else data
9023
- json = type_validate_python(DeploymentBranchPolicyNamePattern, json)
9153
+ if self._github.config.rest_api_validate_body:
9154
+ json = type_validate_python(DeploymentBranchPolicyNamePattern, json)
9024
9155
  json = model_dump(json) if isinstance(json, BaseModel) else json
9025
9156
 
9026
9157
  return await self._github.arequest(
@@ -9171,16 +9302,18 @@ class ReposClient:
9171
9302
 
9172
9303
  url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
9173
9304
 
9174
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9175
-
9176
- if not kwargs:
9177
- kwargs = UNSET
9305
+ headers = {
9306
+ "Content-Type": "application/json",
9307
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9308
+ **(headers or {}),
9309
+ }
9178
9310
 
9179
9311
  json = kwargs if data is UNSET else data
9180
- json = type_validate_python(
9181
- ReposOwnerRepoEnvironmentsEnvironmentNameDeploymentProtectionRulesPostBody,
9182
- json,
9183
- )
9312
+ if self._github.config.rest_api_validate_body:
9313
+ json = type_validate_python(
9314
+ ReposOwnerRepoEnvironmentsEnvironmentNameDeploymentProtectionRulesPostBody,
9315
+ json,
9316
+ )
9184
9317
  json = model_dump(json) if isinstance(json, BaseModel) else json
9185
9318
 
9186
9319
  return self._github.request(
@@ -9235,16 +9368,18 @@ class ReposClient:
9235
9368
 
9236
9369
  url = f"/repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"
9237
9370
 
9238
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9239
-
9240
- if not kwargs:
9241
- kwargs = UNSET
9371
+ headers = {
9372
+ "Content-Type": "application/json",
9373
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9374
+ **(headers or {}),
9375
+ }
9242
9376
 
9243
9377
  json = kwargs if data is UNSET else data
9244
- json = type_validate_python(
9245
- ReposOwnerRepoEnvironmentsEnvironmentNameDeploymentProtectionRulesPostBody,
9246
- json,
9247
- )
9378
+ if self._github.config.rest_api_validate_body:
9379
+ json = type_validate_python(
9380
+ ReposOwnerRepoEnvironmentsEnvironmentNameDeploymentProtectionRulesPostBody,
9381
+ json,
9382
+ )
9248
9383
  json = model_dump(json) if isinstance(json, BaseModel) else json
9249
9384
 
9250
9385
  return await self._github.arequest(
@@ -9534,13 +9669,15 @@ class ReposClient:
9534
9669
 
9535
9670
  url = f"/repos/{owner}/{repo}/forks"
9536
9671
 
9537
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9538
-
9539
- if not kwargs:
9540
- kwargs = UNSET
9672
+ headers = {
9673
+ "Content-Type": "application/json",
9674
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9675
+ **(headers or {}),
9676
+ }
9541
9677
 
9542
9678
  json = kwargs if data is UNSET else data
9543
- 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)
9544
9681
  json = model_dump(json) if isinstance(json, BaseModel) else json
9545
9682
 
9546
9683
  return self._github.request(
@@ -9602,13 +9739,15 @@ class ReposClient:
9602
9739
 
9603
9740
  url = f"/repos/{owner}/{repo}/forks"
9604
9741
 
9605
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9606
-
9607
- if not kwargs:
9608
- kwargs = UNSET
9742
+ headers = {
9743
+ "Content-Type": "application/json",
9744
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9745
+ **(headers or {}),
9746
+ }
9609
9747
 
9610
9748
  json = kwargs if data is UNSET else data
9611
- 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)
9612
9751
  json = model_dump(json) if isinstance(json, BaseModel) else json
9613
9752
 
9614
9753
  return await self._github.arequest(
@@ -9741,13 +9880,15 @@ class ReposClient:
9741
9880
 
9742
9881
  url = f"/repos/{owner}/{repo}/hooks"
9743
9882
 
9744
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9745
-
9746
- if not kwargs:
9747
- kwargs = UNSET
9883
+ headers = {
9884
+ "Content-Type": "application/json",
9885
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9886
+ **(headers or {}),
9887
+ }
9748
9888
 
9749
9889
  json = kwargs if data is UNSET else data
9750
- 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)
9751
9892
  json = model_dump(json) if isinstance(json, BaseModel) else json
9752
9893
 
9753
9894
  return self._github.request(
@@ -9809,13 +9950,15 @@ class ReposClient:
9809
9950
 
9810
9951
  url = f"/repos/{owner}/{repo}/hooks"
9811
9952
 
9812
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9813
-
9814
- if not kwargs:
9815
- kwargs = UNSET
9953
+ headers = {
9954
+ "Content-Type": "application/json",
9955
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
9956
+ **(headers or {}),
9957
+ }
9816
9958
 
9817
9959
  json = kwargs if data is UNSET else data
9818
- 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)
9819
9962
  json = model_dump(json) if isinstance(json, BaseModel) else json
9820
9963
 
9821
9964
  return await self._github.arequest(
@@ -9981,13 +10124,15 @@ class ReposClient:
9981
10124
 
9982
10125
  url = f"/repos/{owner}/{repo}/hooks/{hook_id}"
9983
10126
 
9984
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
9985
-
9986
- if not kwargs:
9987
- kwargs = UNSET
10127
+ headers = {
10128
+ "Content-Type": "application/json",
10129
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
10130
+ **(headers or {}),
10131
+ }
9988
10132
 
9989
10133
  json = kwargs if data is UNSET else data
9990
- json = type_validate_python(ReposOwnerRepoHooksHookIdPatchBody, json)
10134
+ if self._github.config.rest_api_validate_body:
10135
+ json = type_validate_python(ReposOwnerRepoHooksHookIdPatchBody, json)
9991
10136
  json = model_dump(json) if isinstance(json, BaseModel) else json
9992
10137
 
9993
10138
  return self._github.request(
@@ -10050,13 +10195,15 @@ class ReposClient:
10050
10195
 
10051
10196
  url = f"/repos/{owner}/{repo}/hooks/{hook_id}"
10052
10197
 
10053
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10054
-
10055
- if not kwargs:
10056
- kwargs = UNSET
10198
+ headers = {
10199
+ "Content-Type": "application/json",
10200
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
10201
+ **(headers or {}),
10202
+ }
10057
10203
 
10058
10204
  json = kwargs if data is UNSET else data
10059
- json = type_validate_python(ReposOwnerRepoHooksHookIdPatchBody, json)
10205
+ if self._github.config.rest_api_validate_body:
10206
+ json = type_validate_python(ReposOwnerRepoHooksHookIdPatchBody, json)
10060
10207
  json = model_dump(json) if isinstance(json, BaseModel) else json
10061
10208
 
10062
10209
  return await self._github.arequest(
@@ -10159,13 +10306,15 @@ class ReposClient:
10159
10306
 
10160
10307
  url = f"/repos/{owner}/{repo}/hooks/{hook_id}/config"
10161
10308
 
10162
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10163
-
10164
- if not kwargs:
10165
- kwargs = UNSET
10309
+ headers = {
10310
+ "Content-Type": "application/json",
10311
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
10312
+ **(headers or {}),
10313
+ }
10166
10314
 
10167
10315
  json = kwargs if data is UNSET else data
10168
- json = type_validate_python(ReposOwnerRepoHooksHookIdConfigPatchBody, json)
10316
+ if self._github.config.rest_api_validate_body:
10317
+ json = type_validate_python(ReposOwnerRepoHooksHookIdConfigPatchBody, json)
10169
10318
  json = model_dump(json) if isinstance(json, BaseModel) else json
10170
10319
 
10171
10320
  return self._github.request(
@@ -10218,13 +10367,15 @@ class ReposClient:
10218
10367
 
10219
10368
  url = f"/repos/{owner}/{repo}/hooks/{hook_id}/config"
10220
10369
 
10221
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10222
-
10223
- if not kwargs:
10224
- kwargs = UNSET
10370
+ headers = {
10371
+ "Content-Type": "application/json",
10372
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
10373
+ **(headers or {}),
10374
+ }
10225
10375
 
10226
10376
  json = kwargs if data is UNSET else data
10227
- json = type_validate_python(ReposOwnerRepoHooksHookIdConfigPatchBody, json)
10377
+ if self._github.config.rest_api_validate_body:
10378
+ json = type_validate_python(ReposOwnerRepoHooksHookIdConfigPatchBody, json)
10228
10379
  json = model_dump(json) if isinstance(json, BaseModel) else json
10229
10380
 
10230
10381
  return await self._github.arequest(
@@ -10681,15 +10832,17 @@ class ReposClient:
10681
10832
 
10682
10833
  url = f"/repos/{owner}/{repo}/invitations/{invitation_id}"
10683
10834
 
10684
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10685
-
10686
- if not kwargs:
10687
- kwargs = UNSET
10835
+ headers = {
10836
+ "Content-Type": "application/json",
10837
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
10838
+ **(headers or {}),
10839
+ }
10688
10840
 
10689
10841
  json = kwargs if data is UNSET else data
10690
- json = type_validate_python(
10691
- ReposOwnerRepoInvitationsInvitationIdPatchBody, json
10692
- )
10842
+ if self._github.config.rest_api_validate_body:
10843
+ json = type_validate_python(
10844
+ ReposOwnerRepoInvitationsInvitationIdPatchBody, json
10845
+ )
10693
10846
  json = model_dump(json) if isinstance(json, BaseModel) else json
10694
10847
 
10695
10848
  return self._github.request(
@@ -10744,15 +10897,17 @@ class ReposClient:
10744
10897
 
10745
10898
  url = f"/repos/{owner}/{repo}/invitations/{invitation_id}"
10746
10899
 
10747
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10748
-
10749
- if not kwargs:
10750
- kwargs = UNSET
10900
+ headers = {
10901
+ "Content-Type": "application/json",
10902
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
10903
+ **(headers or {}),
10904
+ }
10751
10905
 
10752
10906
  json = kwargs if data is UNSET else data
10753
- json = type_validate_python(
10754
- ReposOwnerRepoInvitationsInvitationIdPatchBody, json
10755
- )
10907
+ if self._github.config.rest_api_validate_body:
10908
+ json = type_validate_python(
10909
+ ReposOwnerRepoInvitationsInvitationIdPatchBody, json
10910
+ )
10756
10911
  json = model_dump(json) if isinstance(json, BaseModel) else json
10757
10912
 
10758
10913
  return await self._github.arequest(
@@ -10865,13 +11020,15 @@ class ReposClient:
10865
11020
 
10866
11021
  url = f"/repos/{owner}/{repo}/keys"
10867
11022
 
10868
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10869
-
10870
- if not kwargs:
10871
- kwargs = UNSET
11023
+ headers = {
11024
+ "Content-Type": "application/json",
11025
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11026
+ **(headers or {}),
11027
+ }
10872
11028
 
10873
11029
  json = kwargs if data is UNSET else data
10874
- json = type_validate_python(ReposOwnerRepoKeysPostBody, json)
11030
+ if self._github.config.rest_api_validate_body:
11031
+ json = type_validate_python(ReposOwnerRepoKeysPostBody, json)
10875
11032
  json = model_dump(json) if isinstance(json, BaseModel) else json
10876
11033
 
10877
11034
  return self._github.request(
@@ -10923,13 +11080,15 @@ class ReposClient:
10923
11080
 
10924
11081
  url = f"/repos/{owner}/{repo}/keys"
10925
11082
 
10926
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
10927
-
10928
- if not kwargs:
10929
- kwargs = UNSET
11083
+ headers = {
11084
+ "Content-Type": "application/json",
11085
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11086
+ **(headers or {}),
11087
+ }
10930
11088
 
10931
11089
  json = kwargs if data is UNSET else data
10932
- json = type_validate_python(ReposOwnerRepoKeysPostBody, json)
11090
+ if self._github.config.rest_api_validate_body:
11091
+ json = type_validate_python(ReposOwnerRepoKeysPostBody, json)
10933
11092
  json = model_dump(json) if isinstance(json, BaseModel) else json
10934
11093
 
10935
11094
  return await self._github.arequest(
@@ -11115,13 +11274,15 @@ class ReposClient:
11115
11274
 
11116
11275
  url = f"/repos/{owner}/{repo}/merge-upstream"
11117
11276
 
11118
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11119
-
11120
- if not kwargs:
11121
- kwargs = UNSET
11277
+ headers = {
11278
+ "Content-Type": "application/json",
11279
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11280
+ **(headers or {}),
11281
+ }
11122
11282
 
11123
11283
  json = kwargs if data is UNSET else data
11124
- json = type_validate_python(ReposOwnerRepoMergeUpstreamPostBody, json)
11284
+ if self._github.config.rest_api_validate_body:
11285
+ json = type_validate_python(ReposOwnerRepoMergeUpstreamPostBody, json)
11125
11286
  json = model_dump(json) if isinstance(json, BaseModel) else json
11126
11287
 
11127
11288
  return self._github.request(
@@ -11169,13 +11330,15 @@ class ReposClient:
11169
11330
 
11170
11331
  url = f"/repos/{owner}/{repo}/merge-upstream"
11171
11332
 
11172
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11173
-
11174
- if not kwargs:
11175
- kwargs = UNSET
11333
+ headers = {
11334
+ "Content-Type": "application/json",
11335
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11336
+ **(headers or {}),
11337
+ }
11176
11338
 
11177
11339
  json = kwargs if data is UNSET else data
11178
- json = type_validate_python(ReposOwnerRepoMergeUpstreamPostBody, json)
11340
+ if self._github.config.rest_api_validate_body:
11341
+ json = type_validate_python(ReposOwnerRepoMergeUpstreamPostBody, json)
11179
11342
  json = model_dump(json) if isinstance(json, BaseModel) else json
11180
11343
 
11181
11344
  return await self._github.arequest(
@@ -11230,13 +11393,15 @@ class ReposClient:
11230
11393
 
11231
11394
  url = f"/repos/{owner}/{repo}/merges"
11232
11395
 
11233
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11234
-
11235
- if not kwargs:
11236
- kwargs = UNSET
11396
+ headers = {
11397
+ "Content-Type": "application/json",
11398
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11399
+ **(headers or {}),
11400
+ }
11237
11401
 
11238
11402
  json = kwargs if data is UNSET else data
11239
- json = type_validate_python(ReposOwnerRepoMergesPostBody, json)
11403
+ if self._github.config.rest_api_validate_body:
11404
+ json = type_validate_python(ReposOwnerRepoMergesPostBody, json)
11240
11405
  json = model_dump(json) if isinstance(json, BaseModel) else json
11241
11406
 
11242
11407
  return self._github.request(
@@ -11294,13 +11459,15 @@ class ReposClient:
11294
11459
 
11295
11460
  url = f"/repos/{owner}/{repo}/merges"
11296
11461
 
11297
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11298
-
11299
- if not kwargs:
11300
- kwargs = UNSET
11462
+ headers = {
11463
+ "Content-Type": "application/json",
11464
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11465
+ **(headers or {}),
11466
+ }
11301
11467
 
11302
11468
  json = kwargs if data is UNSET else data
11303
- json = type_validate_python(ReposOwnerRepoMergesPostBody, json)
11469
+ if self._github.config.rest_api_validate_body:
11470
+ json = type_validate_python(ReposOwnerRepoMergesPostBody, json)
11304
11471
  json = model_dump(json) if isinstance(json, BaseModel) else json
11305
11472
 
11306
11473
  return await self._github.arequest(
@@ -11507,22 +11674,24 @@ class ReposClient:
11507
11674
 
11508
11675
  url = f"/repos/{owner}/{repo}/pages"
11509
11676
 
11510
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11511
-
11512
- if not kwargs:
11513
- kwargs = UNSET
11677
+ headers = {
11678
+ "Content-Type": "application/json",
11679
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11680
+ **(headers or {}),
11681
+ }
11514
11682
 
11515
11683
  json = kwargs if data is UNSET else data
11516
- json = type_validate_python(
11517
- Union[
11518
- ReposOwnerRepoPagesPutBodyAnyof0,
11519
- ReposOwnerRepoPagesPutBodyAnyof1,
11520
- ReposOwnerRepoPagesPutBodyAnyof2,
11521
- ReposOwnerRepoPagesPutBodyAnyof3,
11522
- ReposOwnerRepoPagesPutBodyAnyof4,
11523
- ],
11524
- json,
11525
- )
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
+ )
11526
11695
  json = model_dump(json) if isinstance(json, BaseModel) else json
11527
11696
 
11528
11697
  return self._github.request(
@@ -11679,22 +11848,24 @@ class ReposClient:
11679
11848
 
11680
11849
  url = f"/repos/{owner}/{repo}/pages"
11681
11850
 
11682
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11683
-
11684
- if not kwargs:
11685
- kwargs = UNSET
11851
+ headers = {
11852
+ "Content-Type": "application/json",
11853
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11854
+ **(headers or {}),
11855
+ }
11686
11856
 
11687
11857
  json = kwargs if data is UNSET else data
11688
- json = type_validate_python(
11689
- Union[
11690
- ReposOwnerRepoPagesPutBodyAnyof0,
11691
- ReposOwnerRepoPagesPutBodyAnyof1,
11692
- ReposOwnerRepoPagesPutBodyAnyof2,
11693
- ReposOwnerRepoPagesPutBodyAnyof3,
11694
- ReposOwnerRepoPagesPutBodyAnyof4,
11695
- ],
11696
- json,
11697
- )
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
+ )
11698
11869
  json = model_dump(json) if isinstance(json, BaseModel) else json
11699
11870
 
11700
11871
  return await self._github.arequest(
@@ -11778,21 +11949,23 @@ class ReposClient:
11778
11949
 
11779
11950
  url = f"/repos/{owner}/{repo}/pages"
11780
11951
 
11781
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11782
-
11783
- if not kwargs:
11784
- kwargs = UNSET
11952
+ headers = {
11953
+ "Content-Type": "application/json",
11954
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
11955
+ **(headers or {}),
11956
+ }
11785
11957
 
11786
11958
  json = kwargs if data is UNSET else data
11787
- json = type_validate_python(
11788
- Union[
11789
- ReposOwnerRepoPagesPostBodyAnyof0,
11790
- None,
11791
- ReposOwnerRepoPagesPostBodyAnyof1,
11792
- None,
11793
- ],
11794
- json,
11795
- )
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
+ )
11796
11969
  json = model_dump(json) if isinstance(json, BaseModel) else json
11797
11970
 
11798
11971
  return self._github.request(
@@ -11876,21 +12049,23 @@ class ReposClient:
11876
12049
 
11877
12050
  url = f"/repos/{owner}/{repo}/pages"
11878
12051
 
11879
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
11880
-
11881
- if not kwargs:
11882
- kwargs = UNSET
12052
+ headers = {
12053
+ "Content-Type": "application/json",
12054
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
12055
+ **(headers or {}),
12056
+ }
11883
12057
 
11884
12058
  json = kwargs if data is UNSET else data
11885
- json = type_validate_python(
11886
- Union[
11887
- ReposOwnerRepoPagesPostBodyAnyof0,
11888
- None,
11889
- ReposOwnerRepoPagesPostBodyAnyof1,
11890
- None,
11891
- ],
11892
- json,
11893
- )
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
+ )
11894
12069
  json = model_dump(json) if isinstance(json, BaseModel) else json
11895
12070
 
11896
12071
  return await self._github.arequest(
@@ -12200,13 +12375,15 @@ class ReposClient:
12200
12375
 
12201
12376
  url = f"/repos/{owner}/{repo}/pages/deployments"
12202
12377
 
12203
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
12204
-
12205
- if not kwargs:
12206
- kwargs = UNSET
12378
+ headers = {
12379
+ "Content-Type": "application/json",
12380
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
12381
+ **(headers or {}),
12382
+ }
12207
12383
 
12208
12384
  json = kwargs if data is UNSET else data
12209
- json = type_validate_python(ReposOwnerRepoPagesDeploymentsPostBody, json)
12385
+ if self._github.config.rest_api_validate_body:
12386
+ json = type_validate_python(ReposOwnerRepoPagesDeploymentsPostBody, json)
12210
12387
  json = model_dump(json) if isinstance(json, BaseModel) else json
12211
12388
 
12212
12389
  return self._github.request(
@@ -12267,13 +12444,15 @@ class ReposClient:
12267
12444
 
12268
12445
  url = f"/repos/{owner}/{repo}/pages/deployments"
12269
12446
 
12270
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
12271
-
12272
- if not kwargs:
12273
- kwargs = UNSET
12447
+ headers = {
12448
+ "Content-Type": "application/json",
12449
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
12450
+ **(headers or {}),
12451
+ }
12274
12452
 
12275
12453
  json = kwargs if data is UNSET else data
12276
- json = type_validate_python(ReposOwnerRepoPagesDeploymentsPostBody, json)
12454
+ if self._github.config.rest_api_validate_body:
12455
+ json = type_validate_python(ReposOwnerRepoPagesDeploymentsPostBody, json)
12277
12456
  json = model_dump(json) if isinstance(json, BaseModel) else json
12278
12457
 
12279
12458
  return await self._github.arequest(
@@ -12689,13 +12868,15 @@ class ReposClient:
12689
12868
 
12690
12869
  url = f"/repos/{owner}/{repo}/properties/values"
12691
12870
 
12692
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
12693
-
12694
- if not kwargs:
12695
- kwargs = UNSET
12871
+ headers = {
12872
+ "Content-Type": "application/json",
12873
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
12874
+ **(headers or {}),
12875
+ }
12696
12876
 
12697
12877
  json = kwargs if data is UNSET else data
12698
- json = type_validate_python(ReposOwnerRepoPropertiesValuesPatchBody, json)
12878
+ if self._github.config.rest_api_validate_body:
12879
+ json = type_validate_python(ReposOwnerRepoPropertiesValuesPatchBody, json)
12699
12880
  json = model_dump(json) if isinstance(json, BaseModel) else json
12700
12881
 
12701
12882
  return self._github.request(
@@ -12750,13 +12931,15 @@ class ReposClient:
12750
12931
 
12751
12932
  url = f"/repos/{owner}/{repo}/properties/values"
12752
12933
 
12753
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
12754
-
12755
- if not kwargs:
12756
- kwargs = UNSET
12934
+ headers = {
12935
+ "Content-Type": "application/json",
12936
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
12937
+ **(headers or {}),
12938
+ }
12757
12939
 
12758
12940
  json = kwargs if data is UNSET else data
12759
- json = type_validate_python(ReposOwnerRepoPropertiesValuesPatchBody, json)
12941
+ if self._github.config.rest_api_validate_body:
12942
+ json = type_validate_python(ReposOwnerRepoPropertiesValuesPatchBody, json)
12760
12943
  json = model_dump(json) if isinstance(json, BaseModel) else json
12761
12944
 
12762
12945
  return await self._github.arequest(
@@ -13020,13 +13203,15 @@ class ReposClient:
13020
13203
 
13021
13204
  url = f"/repos/{owner}/{repo}/releases"
13022
13205
 
13023
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13024
-
13025
- if not kwargs:
13026
- kwargs = UNSET
13206
+ headers = {
13207
+ "Content-Type": "application/json",
13208
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13209
+ **(headers or {}),
13210
+ }
13027
13211
 
13028
13212
  json = kwargs if data is UNSET else data
13029
- json = type_validate_python(ReposOwnerRepoReleasesPostBody, json)
13213
+ if self._github.config.rest_api_validate_body:
13214
+ json = type_validate_python(ReposOwnerRepoReleasesPostBody, json)
13030
13215
  json = model_dump(json) if isinstance(json, BaseModel) else json
13031
13216
 
13032
13217
  return self._github.request(
@@ -13090,13 +13275,15 @@ class ReposClient:
13090
13275
 
13091
13276
  url = f"/repos/{owner}/{repo}/releases"
13092
13277
 
13093
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13094
-
13095
- if not kwargs:
13096
- kwargs = UNSET
13278
+ headers = {
13279
+ "Content-Type": "application/json",
13280
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13281
+ **(headers or {}),
13282
+ }
13097
13283
 
13098
13284
  json = kwargs if data is UNSET else data
13099
- json = type_validate_python(ReposOwnerRepoReleasesPostBody, json)
13285
+ if self._github.config.rest_api_validate_body:
13286
+ json = type_validate_python(ReposOwnerRepoReleasesPostBody, json)
13100
13287
  json = model_dump(json) if isinstance(json, BaseModel) else json
13101
13288
 
13102
13289
  return await self._github.arequest(
@@ -13244,13 +13431,17 @@ class ReposClient:
13244
13431
 
13245
13432
  url = f"/repos/{owner}/{repo}/releases/assets/{asset_id}"
13246
13433
 
13247
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13248
-
13249
- if not kwargs:
13250
- kwargs = UNSET
13434
+ headers = {
13435
+ "Content-Type": "application/json",
13436
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13437
+ **(headers or {}),
13438
+ }
13251
13439
 
13252
13440
  json = kwargs if data is UNSET else data
13253
- json = type_validate_python(ReposOwnerRepoReleasesAssetsAssetIdPatchBody, json)
13441
+ if self._github.config.rest_api_validate_body:
13442
+ json = type_validate_python(
13443
+ ReposOwnerRepoReleasesAssetsAssetIdPatchBody, json
13444
+ )
13254
13445
  json = model_dump(json) if isinstance(json, BaseModel) else json
13255
13446
 
13256
13447
  return self._github.request(
@@ -13302,13 +13493,17 @@ class ReposClient:
13302
13493
 
13303
13494
  url = f"/repos/{owner}/{repo}/releases/assets/{asset_id}"
13304
13495
 
13305
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13306
-
13307
- if not kwargs:
13308
- kwargs = UNSET
13496
+ headers = {
13497
+ "Content-Type": "application/json",
13498
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13499
+ **(headers or {}),
13500
+ }
13309
13501
 
13310
13502
  json = kwargs if data is UNSET else data
13311
- json = type_validate_python(ReposOwnerRepoReleasesAssetsAssetIdPatchBody, json)
13503
+ if self._github.config.rest_api_validate_body:
13504
+ json = type_validate_python(
13505
+ ReposOwnerRepoReleasesAssetsAssetIdPatchBody, json
13506
+ )
13312
13507
  json = model_dump(json) if isinstance(json, BaseModel) else json
13313
13508
 
13314
13509
  return await self._github.arequest(
@@ -13362,13 +13557,17 @@ class ReposClient:
13362
13557
 
13363
13558
  url = f"/repos/{owner}/{repo}/releases/generate-notes"
13364
13559
 
13365
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13366
-
13367
- if not kwargs:
13368
- kwargs = UNSET
13560
+ headers = {
13561
+ "Content-Type": "application/json",
13562
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13563
+ **(headers or {}),
13564
+ }
13369
13565
 
13370
13566
  json = kwargs if data is UNSET else data
13371
- json = type_validate_python(ReposOwnerRepoReleasesGenerateNotesPostBody, json)
13567
+ if self._github.config.rest_api_validate_body:
13568
+ json = type_validate_python(
13569
+ ReposOwnerRepoReleasesGenerateNotesPostBody, json
13570
+ )
13372
13571
  json = model_dump(json) if isinstance(json, BaseModel) else json
13373
13572
 
13374
13573
  return self._github.request(
@@ -13425,13 +13624,17 @@ class ReposClient:
13425
13624
 
13426
13625
  url = f"/repos/{owner}/{repo}/releases/generate-notes"
13427
13626
 
13428
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13429
-
13430
- if not kwargs:
13431
- kwargs = UNSET
13627
+ headers = {
13628
+ "Content-Type": "application/json",
13629
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13630
+ **(headers or {}),
13631
+ }
13432
13632
 
13433
13633
  json = kwargs if data is UNSET else data
13434
- json = type_validate_python(ReposOwnerRepoReleasesGenerateNotesPostBody, json)
13634
+ if self._github.config.rest_api_validate_body:
13635
+ json = type_validate_python(
13636
+ ReposOwnerRepoReleasesGenerateNotesPostBody, json
13637
+ )
13435
13638
  json = model_dump(json) if isinstance(json, BaseModel) else json
13436
13639
 
13437
13640
  return await self._github.arequest(
@@ -13679,13 +13882,15 @@ class ReposClient:
13679
13882
 
13680
13883
  url = f"/repos/{owner}/{repo}/releases/{release_id}"
13681
13884
 
13682
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13683
-
13684
- if not kwargs:
13685
- kwargs = UNSET
13885
+ headers = {
13886
+ "Content-Type": "application/json",
13887
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13888
+ **(headers or {}),
13889
+ }
13686
13890
 
13687
13891
  json = kwargs if data is UNSET else data
13688
- json = type_validate_python(ReposOwnerRepoReleasesReleaseIdPatchBody, json)
13892
+ if self._github.config.rest_api_validate_body:
13893
+ json = type_validate_python(ReposOwnerRepoReleasesReleaseIdPatchBody, json)
13689
13894
  json = model_dump(json) if isinstance(json, BaseModel) else json
13690
13895
 
13691
13896
  return self._github.request(
@@ -13749,13 +13954,15 @@ class ReposClient:
13749
13954
 
13750
13955
  url = f"/repos/{owner}/{repo}/releases/{release_id}"
13751
13956
 
13752
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13753
-
13754
- if not kwargs:
13755
- kwargs = UNSET
13957
+ headers = {
13958
+ "Content-Type": "application/json",
13959
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
13960
+ **(headers or {}),
13961
+ }
13756
13962
 
13757
13963
  json = kwargs if data is UNSET else data
13758
- json = type_validate_python(ReposOwnerRepoReleasesReleaseIdPatchBody, json)
13964
+ if self._github.config.rest_api_validate_body:
13965
+ json = type_validate_python(ReposOwnerRepoReleasesReleaseIdPatchBody, json)
13759
13966
  json = model_dump(json) if isinstance(json, BaseModel) else json
13760
13967
 
13761
13968
  return await self._github.arequest(
@@ -13845,12 +14052,9 @@ class ReposClient:
13845
14052
  *,
13846
14053
  headers: Optional[Dict[str, str]] = None,
13847
14054
  data: FileTypes,
13848
- **kwargs,
13849
14055
  ) -> Response[ReleaseAsset]:
13850
14056
  """See also: https://docs.github.com/rest/releases/assets#upload-a-release-asset"""
13851
14057
 
13852
- from githubkit.typing import FileTypes
13853
-
13854
14058
  from ..models import ReleaseAsset
13855
14059
 
13856
14060
  url = f"/repos/{owner}/{repo}/releases/{release_id}/assets"
@@ -13860,14 +14064,13 @@ class ReposClient:
13860
14064
  "label": label,
13861
14065
  }
13862
14066
 
13863
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13864
-
13865
- if not kwargs:
13866
- kwargs = UNSET
14067
+ headers = {
14068
+ "Content-Type": "application/octet-stream",
14069
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
14070
+ **(headers or {}),
14071
+ }
13867
14072
 
13868
- content = kwargs if data is UNSET else data
13869
- content = type_validate_python(FileTypes, content)
13870
- content = model_dump(content) if isinstance(content, BaseModel) else content
14073
+ content = data
13871
14074
 
13872
14075
  return self._github.request(
13873
14076
  "POST",
@@ -13889,12 +14092,9 @@ class ReposClient:
13889
14092
  *,
13890
14093
  headers: Optional[Dict[str, str]] = None,
13891
14094
  data: FileTypes,
13892
- **kwargs,
13893
14095
  ) -> Response[ReleaseAsset]:
13894
14096
  """See also: https://docs.github.com/rest/releases/assets#upload-a-release-asset"""
13895
14097
 
13896
- from githubkit.typing import FileTypes
13897
-
13898
14098
  from ..models import ReleaseAsset
13899
14099
 
13900
14100
  url = f"/repos/{owner}/{repo}/releases/{release_id}/assets"
@@ -13904,14 +14104,13 @@ class ReposClient:
13904
14104
  "label": label,
13905
14105
  }
13906
14106
 
13907
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
13908
-
13909
- if not kwargs:
13910
- kwargs = UNSET
14107
+ headers = {
14108
+ "Content-Type": "application/octet-stream",
14109
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
14110
+ **(headers or {}),
14111
+ }
13911
14112
 
13912
- content = kwargs if data is UNSET else data
13913
- content = type_validate_python(FileTypes, content)
13914
- content = model_dump(content) if isinstance(content, BaseModel) else content
14113
+ content = data
13915
14114
 
13916
14115
  return await self._github.arequest(
13917
14116
  "POST",
@@ -14116,6 +14315,7 @@ class ReposClient:
14116
14315
  per_page: Missing[int] = UNSET,
14117
14316
  page: Missing[int] = UNSET,
14118
14317
  includes_parents: Missing[bool] = UNSET,
14318
+ targets: Missing[str] = UNSET,
14119
14319
  *,
14120
14320
  headers: Optional[Dict[str, str]] = None,
14121
14321
  ) -> Response[List[RepositoryRuleset]]:
@@ -14131,6 +14331,7 @@ class ReposClient:
14131
14331
  "per_page": per_page,
14132
14332
  "page": page,
14133
14333
  "includes_parents": includes_parents,
14334
+ "targets": targets,
14134
14335
  }
14135
14336
 
14136
14337
  headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
@@ -14154,6 +14355,7 @@ class ReposClient:
14154
14355
  per_page: Missing[int] = UNSET,
14155
14356
  page: Missing[int] = UNSET,
14156
14357
  includes_parents: Missing[bool] = UNSET,
14358
+ targets: Missing[str] = UNSET,
14157
14359
  *,
14158
14360
  headers: Optional[Dict[str, str]] = None,
14159
14361
  ) -> Response[List[RepositoryRuleset]]:
@@ -14169,6 +14371,7 @@ class ReposClient:
14169
14371
  "per_page": per_page,
14170
14372
  "page": page,
14171
14373
  "includes_parents": includes_parents,
14374
+ "targets": targets,
14172
14375
  }
14173
14376
 
14174
14377
  headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
@@ -14256,13 +14459,15 @@ class ReposClient:
14256
14459
 
14257
14460
  url = f"/repos/{owner}/{repo}/rulesets"
14258
14461
 
14259
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
14260
-
14261
- if not kwargs:
14262
- kwargs = UNSET
14462
+ headers = {
14463
+ "Content-Type": "application/json",
14464
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
14465
+ **(headers or {}),
14466
+ }
14263
14467
 
14264
14468
  json = kwargs if data is UNSET else data
14265
- json = type_validate_python(ReposOwnerRepoRulesetsPostBody, json)
14469
+ if self._github.config.rest_api_validate_body:
14470
+ json = type_validate_python(ReposOwnerRepoRulesetsPostBody, json)
14266
14471
  json = model_dump(json) if isinstance(json, BaseModel) else json
14267
14472
 
14268
14473
  return self._github.request(
@@ -14348,13 +14553,15 @@ class ReposClient:
14348
14553
 
14349
14554
  url = f"/repos/{owner}/{repo}/rulesets"
14350
14555
 
14351
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
14352
-
14353
- if not kwargs:
14354
- kwargs = UNSET
14556
+ headers = {
14557
+ "Content-Type": "application/json",
14558
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
14559
+ **(headers or {}),
14560
+ }
14355
14561
 
14356
14562
  json = kwargs if data is UNSET else data
14357
- json = type_validate_python(ReposOwnerRepoRulesetsPostBody, json)
14563
+ if self._github.config.rest_api_validate_body:
14564
+ json = type_validate_python(ReposOwnerRepoRulesetsPostBody, json)
14358
14565
  json = model_dump(json) if isinstance(json, BaseModel) else json
14359
14566
 
14360
14567
  return await self._github.arequest(
@@ -14651,13 +14858,15 @@ class ReposClient:
14651
14858
 
14652
14859
  url = f"/repos/{owner}/{repo}/rulesets/{ruleset_id}"
14653
14860
 
14654
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
14655
-
14656
- if not kwargs:
14657
- kwargs = UNSET
14861
+ headers = {
14862
+ "Content-Type": "application/json",
14863
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
14864
+ **(headers or {}),
14865
+ }
14658
14866
 
14659
14867
  json = kwargs if data is UNSET else data
14660
- json = type_validate_python(ReposOwnerRepoRulesetsRulesetIdPutBody, json)
14868
+ if self._github.config.rest_api_validate_body:
14869
+ json = type_validate_python(ReposOwnerRepoRulesetsRulesetIdPutBody, json)
14661
14870
  json = model_dump(json) if isinstance(json, BaseModel) else json
14662
14871
 
14663
14872
  return self._github.request(
@@ -14746,13 +14955,15 @@ class ReposClient:
14746
14955
 
14747
14956
  url = f"/repos/{owner}/{repo}/rulesets/{ruleset_id}"
14748
14957
 
14749
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
14750
-
14751
- if not kwargs:
14752
- kwargs = UNSET
14958
+ headers = {
14959
+ "Content-Type": "application/json",
14960
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
14961
+ **(headers or {}),
14962
+ }
14753
14963
 
14754
14964
  json = kwargs if data is UNSET else data
14755
- json = type_validate_python(ReposOwnerRepoRulesetsRulesetIdPutBody, json)
14965
+ if self._github.config.rest_api_validate_body:
14966
+ json = type_validate_python(ReposOwnerRepoRulesetsRulesetIdPutBody, json)
14756
14967
  json = model_dump(json) if isinstance(json, BaseModel) else json
14757
14968
 
14758
14969
  return await self._github.arequest(
@@ -15097,13 +15308,15 @@ class ReposClient:
15097
15308
 
15098
15309
  url = f"/repos/{owner}/{repo}/statuses/{sha}"
15099
15310
 
15100
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
15101
-
15102
- if not kwargs:
15103
- kwargs = UNSET
15311
+ headers = {
15312
+ "Content-Type": "application/json",
15313
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
15314
+ **(headers or {}),
15315
+ }
15104
15316
 
15105
15317
  json = kwargs if data is UNSET else data
15106
- json = type_validate_python(ReposOwnerRepoStatusesShaPostBody, json)
15318
+ if self._github.config.rest_api_validate_body:
15319
+ json = type_validate_python(ReposOwnerRepoStatusesShaPostBody, json)
15107
15320
  json = model_dump(json) if isinstance(json, BaseModel) else json
15108
15321
 
15109
15322
  return self._github.request(
@@ -15156,13 +15369,15 @@ class ReposClient:
15156
15369
 
15157
15370
  url = f"/repos/{owner}/{repo}/statuses/{sha}"
15158
15371
 
15159
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
15160
-
15161
- if not kwargs:
15162
- kwargs = UNSET
15372
+ headers = {
15373
+ "Content-Type": "application/json",
15374
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
15375
+ **(headers or {}),
15376
+ }
15163
15377
 
15164
15378
  json = kwargs if data is UNSET else data
15165
- json = type_validate_python(ReposOwnerRepoStatusesShaPostBody, json)
15379
+ if self._github.config.rest_api_validate_body:
15380
+ json = type_validate_python(ReposOwnerRepoStatusesShaPostBody, json)
15166
15381
  json = model_dump(json) if isinstance(json, BaseModel) else json
15167
15382
 
15168
15383
  return await self._github.arequest(
@@ -15333,13 +15548,15 @@ class ReposClient:
15333
15548
 
15334
15549
  url = f"/repos/{owner}/{repo}/tags/protection"
15335
15550
 
15336
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
15337
-
15338
- if not kwargs:
15339
- kwargs = UNSET
15551
+ headers = {
15552
+ "Content-Type": "application/json",
15553
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
15554
+ **(headers or {}),
15555
+ }
15340
15556
 
15341
15557
  json = kwargs if data is UNSET else data
15342
- json = type_validate_python(ReposOwnerRepoTagsProtectionPostBody, json)
15558
+ if self._github.config.rest_api_validate_body:
15559
+ json = type_validate_python(ReposOwnerRepoTagsProtectionPostBody, json)
15343
15560
  json = model_dump(json) if isinstance(json, BaseModel) else json
15344
15561
 
15345
15562
  return self._github.request(
@@ -15394,13 +15611,15 @@ class ReposClient:
15394
15611
 
15395
15612
  url = f"/repos/{owner}/{repo}/tags/protection"
15396
15613
 
15397
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
15398
-
15399
- if not kwargs:
15400
- kwargs = UNSET
15614
+ headers = {
15615
+ "Content-Type": "application/json",
15616
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
15617
+ **(headers or {}),
15618
+ }
15401
15619
 
15402
15620
  json = kwargs if data is UNSET else data
15403
- json = type_validate_python(ReposOwnerRepoTagsProtectionPostBody, json)
15621
+ if self._github.config.rest_api_validate_body:
15622
+ json = type_validate_python(ReposOwnerRepoTagsProtectionPostBody, json)
15404
15623
  json = model_dump(json) if isinstance(json, BaseModel) else json
15405
15624
 
15406
15625
  return await self._github.arequest(
@@ -15684,13 +15903,15 @@ class ReposClient:
15684
15903
 
15685
15904
  url = f"/repos/{owner}/{repo}/topics"
15686
15905
 
15687
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
15688
-
15689
- if not kwargs:
15690
- kwargs = UNSET
15906
+ headers = {
15907
+ "Content-Type": "application/json",
15908
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
15909
+ **(headers or {}),
15910
+ }
15691
15911
 
15692
15912
  json = kwargs if data is UNSET else data
15693
- json = type_validate_python(ReposOwnerRepoTopicsPutBody, json)
15913
+ if self._github.config.rest_api_validate_body:
15914
+ json = type_validate_python(ReposOwnerRepoTopicsPutBody, json)
15694
15915
  json = model_dump(json) if isinstance(json, BaseModel) else json
15695
15916
 
15696
15917
  return self._github.request(
@@ -15746,13 +15967,15 @@ class ReposClient:
15746
15967
 
15747
15968
  url = f"/repos/{owner}/{repo}/topics"
15748
15969
 
15749
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
15750
-
15751
- if not kwargs:
15752
- kwargs = UNSET
15970
+ headers = {
15971
+ "Content-Type": "application/json",
15972
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
15973
+ **(headers or {}),
15974
+ }
15753
15975
 
15754
15976
  json = kwargs if data is UNSET else data
15755
- json = type_validate_python(ReposOwnerRepoTopicsPutBody, json)
15977
+ if self._github.config.rest_api_validate_body:
15978
+ json = type_validate_python(ReposOwnerRepoTopicsPutBody, json)
15756
15979
  json = model_dump(json) if isinstance(json, BaseModel) else json
15757
15980
 
15758
15981
  return await self._github.arequest(
@@ -16037,13 +16260,15 @@ class ReposClient:
16037
16260
 
16038
16261
  url = f"/repos/{owner}/{repo}/transfer"
16039
16262
 
16040
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
16041
-
16042
- if not kwargs:
16043
- kwargs = UNSET
16263
+ headers = {
16264
+ "Content-Type": "application/json",
16265
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
16266
+ **(headers or {}),
16267
+ }
16044
16268
 
16045
16269
  json = kwargs if data is UNSET else data
16046
- json = type_validate_python(ReposOwnerRepoTransferPostBody, json)
16270
+ if self._github.config.rest_api_validate_body:
16271
+ json = type_validate_python(ReposOwnerRepoTransferPostBody, json)
16047
16272
  json = model_dump(json) if isinstance(json, BaseModel) else json
16048
16273
 
16049
16274
  return self._github.request(
@@ -16092,13 +16317,15 @@ class ReposClient:
16092
16317
 
16093
16318
  url = f"/repos/{owner}/{repo}/transfer"
16094
16319
 
16095
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
16096
-
16097
- if not kwargs:
16098
- kwargs = UNSET
16320
+ headers = {
16321
+ "Content-Type": "application/json",
16322
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
16323
+ **(headers or {}),
16324
+ }
16099
16325
 
16100
16326
  json = kwargs if data is UNSET else data
16101
- json = type_validate_python(ReposOwnerRepoTransferPostBody, json)
16327
+ if self._github.config.rest_api_validate_body:
16328
+ json = type_validate_python(ReposOwnerRepoTransferPostBody, json)
16102
16329
  json = model_dump(json) if isinstance(json, BaseModel) else json
16103
16330
 
16104
16331
  return await self._github.arequest(
@@ -16308,15 +16535,17 @@ class ReposClient:
16308
16535
 
16309
16536
  url = f"/repos/{template_owner}/{template_repo}/generate"
16310
16537
 
16311
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
16312
-
16313
- if not kwargs:
16314
- kwargs = UNSET
16538
+ headers = {
16539
+ "Content-Type": "application/json",
16540
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
16541
+ **(headers or {}),
16542
+ }
16315
16543
 
16316
16544
  json = kwargs if data is UNSET else data
16317
- json = type_validate_python(
16318
- ReposTemplateOwnerTemplateRepoGeneratePostBody, json
16319
- )
16545
+ if self._github.config.rest_api_validate_body:
16546
+ json = type_validate_python(
16547
+ ReposTemplateOwnerTemplateRepoGeneratePostBody, json
16548
+ )
16320
16549
  json = model_dump(json) if isinstance(json, BaseModel) else json
16321
16550
 
16322
16551
  return self._github.request(
@@ -16370,15 +16599,17 @@ class ReposClient:
16370
16599
 
16371
16600
  url = f"/repos/{template_owner}/{template_repo}/generate"
16372
16601
 
16373
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
16374
-
16375
- if not kwargs:
16376
- kwargs = UNSET
16602
+ headers = {
16603
+ "Content-Type": "application/json",
16604
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
16605
+ **(headers or {}),
16606
+ }
16377
16607
 
16378
16608
  json = kwargs if data is UNSET else data
16379
- json = type_validate_python(
16380
- ReposTemplateOwnerTemplateRepoGeneratePostBody, json
16381
- )
16609
+ if self._github.config.rest_api_validate_body:
16610
+ json = type_validate_python(
16611
+ ReposTemplateOwnerTemplateRepoGeneratePostBody, json
16612
+ )
16382
16613
  json = model_dump(json) if isinstance(json, BaseModel) else json
16383
16614
 
16384
16615
  return await self._github.arequest(
@@ -16607,13 +16838,15 @@ class ReposClient:
16607
16838
 
16608
16839
  url = "/user/repos"
16609
16840
 
16610
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
16611
-
16612
- if not kwargs:
16613
- kwargs = UNSET
16841
+ headers = {
16842
+ "Content-Type": "application/json",
16843
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
16844
+ **(headers or {}),
16845
+ }
16614
16846
 
16615
16847
  json = kwargs if data is UNSET else data
16616
- json = type_validate_python(UserReposPostBody, json)
16848
+ if self._github.config.rest_api_validate_body:
16849
+ json = type_validate_python(UserReposPostBody, json)
16617
16850
  json = model_dump(json) if isinstance(json, BaseModel) else json
16618
16851
 
16619
16852
  return self._github.request(
@@ -16689,13 +16922,15 @@ class ReposClient:
16689
16922
 
16690
16923
  url = "/user/repos"
16691
16924
 
16692
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
16693
-
16694
- if not kwargs:
16695
- kwargs = UNSET
16925
+ headers = {
16926
+ "Content-Type": "application/json",
16927
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
16928
+ **(headers or {}),
16929
+ }
16696
16930
 
16697
16931
  json = kwargs if data is UNSET else data
16698
- json = type_validate_python(UserReposPostBody, json)
16932
+ if self._github.config.rest_api_validate_body:
16933
+ json = type_validate_python(UserReposPostBody, json)
16699
16934
  json = model_dump(json) if isinstance(json, BaseModel) else json
16700
16935
 
16701
16936
  return await self._github.arequest(