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

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

Potentially problematic release.


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

Files changed (66) hide show
  1. githubkit/config.py +3 -0
  2. githubkit/core.py +5 -0
  3. githubkit/github.py +3 -0
  4. githubkit/versions/ghec_v2022_11_28/models/group_0088.py +0 -1
  5. githubkit/versions/ghec_v2022_11_28/rest/actions.py +652 -472
  6. githubkit/versions/ghec_v2022_11_28/rest/activity.py +60 -44
  7. githubkit/versions/ghec_v2022_11_28/rest/apps.py +102 -74
  8. githubkit/versions/ghec_v2022_11_28/rest/billing.py +40 -32
  9. githubkit/versions/ghec_v2022_11_28/rest/checks.py +84 -64
  10. githubkit/versions/ghec_v2022_11_28/rest/code_scanning.py +74 -58
  11. githubkit/versions/ghec_v2022_11_28/rest/code_security.py +86 -66
  12. githubkit/versions/ghec_v2022_11_28/rest/codespaces.py +218 -154
  13. githubkit/versions/ghec_v2022_11_28/rest/copilot.py +72 -40
  14. githubkit/versions/ghec_v2022_11_28/rest/dependabot.py +68 -52
  15. githubkit/versions/ghec_v2022_11_28/rest/dependency_graph.py +14 -10
  16. githubkit/versions/ghec_v2022_11_28/rest/enterprise_admin.py +278 -208
  17. githubkit/versions/ghec_v2022_11_28/rest/gists.py +56 -40
  18. githubkit/versions/ghec_v2022_11_28/rest/git.py +84 -60
  19. githubkit/versions/ghec_v2022_11_28/rest/interactions.py +42 -30
  20. githubkit/versions/ghec_v2022_11_28/rest/issues.py +250 -198
  21. githubkit/versions/ghec_v2022_11_28/rest/markdown.py +34 -26
  22. githubkit/versions/ghec_v2022_11_28/rest/migrations.py +92 -60
  23. githubkit/versions/ghec_v2022_11_28/rest/oidc.py +14 -10
  24. githubkit/versions/ghec_v2022_11_28/rest/orgs.py +362 -246
  25. githubkit/versions/ghec_v2022_11_28/rest/projects.py +170 -126
  26. githubkit/versions/ghec_v2022_11_28/rest/pulls.py +234 -170
  27. githubkit/versions/ghec_v2022_11_28/rest/reactions.py +166 -130
  28. githubkit/versions/ghec_v2022_11_28/rest/repos.py +1020 -766
  29. githubkit/versions/ghec_v2022_11_28/rest/scim.py +50 -34
  30. githubkit/versions/ghec_v2022_11_28/rest/secret_scanning.py +36 -28
  31. githubkit/versions/ghec_v2022_11_28/rest/security_advisories.py +42 -30
  32. githubkit/versions/ghec_v2022_11_28/rest/teams.py +324 -238
  33. githubkit/versions/ghec_v2022_11_28/rest/users.py +154 -118
  34. githubkit/versions/ghec_v2022_11_28/types/group_0088.py +0 -1
  35. githubkit/versions/v2022_11_28/models/group_0060.py +0 -1
  36. githubkit/versions/v2022_11_28/rest/actions.py +534 -386
  37. githubkit/versions/v2022_11_28/rest/activity.py +60 -44
  38. githubkit/versions/v2022_11_28/rest/apps.py +102 -74
  39. githubkit/versions/v2022_11_28/rest/checks.py +84 -64
  40. githubkit/versions/v2022_11_28/rest/code_scanning.py +74 -58
  41. githubkit/versions/v2022_11_28/rest/code_security.py +86 -66
  42. githubkit/versions/v2022_11_28/rest/codespaces.py +218 -154
  43. githubkit/versions/v2022_11_28/rest/copilot.py +72 -40
  44. githubkit/versions/v2022_11_28/rest/dependabot.py +68 -52
  45. githubkit/versions/v2022_11_28/rest/dependency_graph.py +14 -10
  46. githubkit/versions/v2022_11_28/rest/gists.py +56 -40
  47. githubkit/versions/v2022_11_28/rest/git.py +84 -60
  48. githubkit/versions/v2022_11_28/rest/interactions.py +42 -30
  49. githubkit/versions/v2022_11_28/rest/issues.py +250 -198
  50. githubkit/versions/v2022_11_28/rest/markdown.py +34 -26
  51. githubkit/versions/v2022_11_28/rest/migrations.py +92 -60
  52. githubkit/versions/v2022_11_28/rest/oidc.py +14 -10
  53. githubkit/versions/v2022_11_28/rest/orgs.py +240 -168
  54. githubkit/versions/v2022_11_28/rest/projects.py +170 -126
  55. githubkit/versions/v2022_11_28/rest/pulls.py +234 -170
  56. githubkit/versions/v2022_11_28/rest/reactions.py +166 -130
  57. githubkit/versions/v2022_11_28/rest/repos.py +1020 -766
  58. githubkit/versions/v2022_11_28/rest/secret_scanning.py +36 -28
  59. githubkit/versions/v2022_11_28/rest/security_advisories.py +42 -30
  60. githubkit/versions/v2022_11_28/rest/teams.py +274 -204
  61. githubkit/versions/v2022_11_28/rest/users.py +154 -118
  62. githubkit/versions/v2022_11_28/types/group_0060.py +0 -1
  63. {githubkit-0.11.13.dist-info → githubkit-0.11.14.dist-info}/METADATA +2 -1
  64. {githubkit-0.11.13.dist-info → githubkit-0.11.14.dist-info}/RECORD +66 -66
  65. {githubkit-0.11.13.dist-info → githubkit-0.11.14.dist-info}/WHEEL +1 -1
  66. {githubkit-0.11.13.dist-info → githubkit-0.11.14.dist-info}/LICENSE +0 -0
@@ -463,13 +463,17 @@ class CopilotClient:
463
463
 
464
464
  url = f"/orgs/{org}/copilot/billing/selected_teams"
465
465
 
466
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
467
-
468
- if not kwargs:
469
- kwargs = UNSET
466
+ headers = {
467
+ "Content-Type": "application/json",
468
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
469
+ **(headers or {}),
470
+ }
470
471
 
471
472
  json = kwargs if data is UNSET else data
472
- json = type_validate_python(OrgsOrgCopilotBillingSelectedTeamsPostBody, json)
473
+ if self._github.config.rest_api_validate_body:
474
+ json = type_validate_python(
475
+ OrgsOrgCopilotBillingSelectedTeamsPostBody, json
476
+ )
473
477
  json = model_dump(json) if isinstance(json, BaseModel) else json
474
478
 
475
479
  return self._github.request(
@@ -523,13 +527,17 @@ class CopilotClient:
523
527
 
524
528
  url = f"/orgs/{org}/copilot/billing/selected_teams"
525
529
 
526
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
527
-
528
- if not kwargs:
529
- kwargs = UNSET
530
+ headers = {
531
+ "Content-Type": "application/json",
532
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
533
+ **(headers or {}),
534
+ }
530
535
 
531
536
  json = kwargs if data is UNSET else data
532
- json = type_validate_python(OrgsOrgCopilotBillingSelectedTeamsPostBody, json)
537
+ if self._github.config.rest_api_validate_body:
538
+ json = type_validate_python(
539
+ OrgsOrgCopilotBillingSelectedTeamsPostBody, json
540
+ )
533
541
  json = model_dump(json) if isinstance(json, BaseModel) else json
534
542
 
535
543
  return await self._github.arequest(
@@ -583,13 +591,17 @@ class CopilotClient:
583
591
 
584
592
  url = f"/orgs/{org}/copilot/billing/selected_teams"
585
593
 
586
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
587
-
588
- if not kwargs:
589
- kwargs = UNSET
594
+ headers = {
595
+ "Content-Type": "application/json",
596
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
597
+ **(headers or {}),
598
+ }
590
599
 
591
600
  json = kwargs if data is UNSET else data
592
- json = type_validate_python(OrgsOrgCopilotBillingSelectedTeamsDeleteBody, json)
601
+ if self._github.config.rest_api_validate_body:
602
+ json = type_validate_python(
603
+ OrgsOrgCopilotBillingSelectedTeamsDeleteBody, json
604
+ )
593
605
  json = model_dump(json) if isinstance(json, BaseModel) else json
594
606
 
595
607
  return self._github.request(
@@ -643,13 +655,17 @@ class CopilotClient:
643
655
 
644
656
  url = f"/orgs/{org}/copilot/billing/selected_teams"
645
657
 
646
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
647
-
648
- if not kwargs:
649
- kwargs = UNSET
658
+ headers = {
659
+ "Content-Type": "application/json",
660
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
661
+ **(headers or {}),
662
+ }
650
663
 
651
664
  json = kwargs if data is UNSET else data
652
- json = type_validate_python(OrgsOrgCopilotBillingSelectedTeamsDeleteBody, json)
665
+ if self._github.config.rest_api_validate_body:
666
+ json = type_validate_python(
667
+ OrgsOrgCopilotBillingSelectedTeamsDeleteBody, json
668
+ )
653
669
  json = model_dump(json) if isinstance(json, BaseModel) else json
654
670
 
655
671
  return await self._github.arequest(
@@ -703,13 +719,17 @@ class CopilotClient:
703
719
 
704
720
  url = f"/orgs/{org}/copilot/billing/selected_users"
705
721
 
706
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
707
-
708
- if not kwargs:
709
- kwargs = UNSET
722
+ headers = {
723
+ "Content-Type": "application/json",
724
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
725
+ **(headers or {}),
726
+ }
710
727
 
711
728
  json = kwargs if data is UNSET else data
712
- json = type_validate_python(OrgsOrgCopilotBillingSelectedUsersPostBody, json)
729
+ if self._github.config.rest_api_validate_body:
730
+ json = type_validate_python(
731
+ OrgsOrgCopilotBillingSelectedUsersPostBody, json
732
+ )
713
733
  json = model_dump(json) if isinstance(json, BaseModel) else json
714
734
 
715
735
  return self._github.request(
@@ -763,13 +783,17 @@ class CopilotClient:
763
783
 
764
784
  url = f"/orgs/{org}/copilot/billing/selected_users"
765
785
 
766
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
767
-
768
- if not kwargs:
769
- kwargs = UNSET
786
+ headers = {
787
+ "Content-Type": "application/json",
788
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
789
+ **(headers or {}),
790
+ }
770
791
 
771
792
  json = kwargs if data is UNSET else data
772
- json = type_validate_python(OrgsOrgCopilotBillingSelectedUsersPostBody, json)
793
+ if self._github.config.rest_api_validate_body:
794
+ json = type_validate_python(
795
+ OrgsOrgCopilotBillingSelectedUsersPostBody, json
796
+ )
773
797
  json = model_dump(json) if isinstance(json, BaseModel) else json
774
798
 
775
799
  return await self._github.arequest(
@@ -823,13 +847,17 @@ class CopilotClient:
823
847
 
824
848
  url = f"/orgs/{org}/copilot/billing/selected_users"
825
849
 
826
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
827
-
828
- if not kwargs:
829
- kwargs = UNSET
850
+ headers = {
851
+ "Content-Type": "application/json",
852
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
853
+ **(headers or {}),
854
+ }
830
855
 
831
856
  json = kwargs if data is UNSET else data
832
- json = type_validate_python(OrgsOrgCopilotBillingSelectedUsersDeleteBody, json)
857
+ if self._github.config.rest_api_validate_body:
858
+ json = type_validate_python(
859
+ OrgsOrgCopilotBillingSelectedUsersDeleteBody, json
860
+ )
833
861
  json = model_dump(json) if isinstance(json, BaseModel) else json
834
862
 
835
863
  return self._github.request(
@@ -883,13 +911,17 @@ class CopilotClient:
883
911
 
884
912
  url = f"/orgs/{org}/copilot/billing/selected_users"
885
913
 
886
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
887
-
888
- if not kwargs:
889
- kwargs = UNSET
914
+ headers = {
915
+ "Content-Type": "application/json",
916
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
917
+ **(headers or {}),
918
+ }
890
919
 
891
920
  json = kwargs if data is UNSET else data
892
- json = type_validate_python(OrgsOrgCopilotBillingSelectedUsersDeleteBody, json)
921
+ if self._github.config.rest_api_validate_body:
922
+ json = type_validate_python(
923
+ OrgsOrgCopilotBillingSelectedUsersDeleteBody, json
924
+ )
893
925
  json = model_dump(json) if isinstance(json, BaseModel) else json
894
926
 
895
927
  return await self._github.arequest(
@@ -485,13 +485,15 @@ class DependabotClient:
485
485
 
486
486
  url = f"/orgs/{org}/dependabot/secrets/{secret_name}"
487
487
 
488
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
489
-
490
- if not kwargs:
491
- kwargs = UNSET
488
+ headers = {
489
+ "Content-Type": "application/json",
490
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
491
+ **(headers or {}),
492
+ }
492
493
 
493
494
  json = kwargs if data is UNSET else data
494
- json = type_validate_python(OrgsOrgDependabotSecretsSecretNamePutBody, json)
495
+ if self._github.config.rest_api_validate_body:
496
+ json = type_validate_python(OrgsOrgDependabotSecretsSecretNamePutBody, json)
495
497
  json = model_dump(json) if isinstance(json, BaseModel) else json
496
498
 
497
499
  return self._github.request(
@@ -541,13 +543,15 @@ class DependabotClient:
541
543
 
542
544
  url = f"/orgs/{org}/dependabot/secrets/{secret_name}"
543
545
 
544
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
545
-
546
- if not kwargs:
547
- kwargs = UNSET
546
+ headers = {
547
+ "Content-Type": "application/json",
548
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
549
+ **(headers or {}),
550
+ }
548
551
 
549
552
  json = kwargs if data is UNSET else data
550
- json = type_validate_python(OrgsOrgDependabotSecretsSecretNamePutBody, json)
553
+ if self._github.config.rest_api_validate_body:
554
+ json = type_validate_python(OrgsOrgDependabotSecretsSecretNamePutBody, json)
551
555
  json = model_dump(json) if isinstance(json, BaseModel) else json
552
556
 
553
557
  return await self._github.arequest(
@@ -698,15 +702,17 @@ class DependabotClient:
698
702
 
699
703
  url = f"/orgs/{org}/dependabot/secrets/{secret_name}/repositories"
700
704
 
701
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
702
-
703
- if not kwargs:
704
- kwargs = UNSET
705
+ headers = {
706
+ "Content-Type": "application/json",
707
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
708
+ **(headers or {}),
709
+ }
705
710
 
706
711
  json = kwargs if data is UNSET else data
707
- json = type_validate_python(
708
- OrgsOrgDependabotSecretsSecretNameRepositoriesPutBody, json
709
- )
712
+ if self._github.config.rest_api_validate_body:
713
+ json = type_validate_python(
714
+ OrgsOrgDependabotSecretsSecretNameRepositoriesPutBody, json
715
+ )
710
716
  json = model_dump(json) if isinstance(json, BaseModel) else json
711
717
 
712
718
  return self._github.request(
@@ -754,15 +760,17 @@ class DependabotClient:
754
760
 
755
761
  url = f"/orgs/{org}/dependabot/secrets/{secret_name}/repositories"
756
762
 
757
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
758
-
759
- if not kwargs:
760
- kwargs = UNSET
763
+ headers = {
764
+ "Content-Type": "application/json",
765
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
766
+ **(headers or {}),
767
+ }
761
768
 
762
769
  json = kwargs if data is UNSET else data
763
- json = type_validate_python(
764
- OrgsOrgDependabotSecretsSecretNameRepositoriesPutBody, json
765
- )
770
+ if self._github.config.rest_api_validate_body:
771
+ json = type_validate_python(
772
+ OrgsOrgDependabotSecretsSecretNameRepositoriesPutBody, json
773
+ )
766
774
  json = model_dump(json) if isinstance(json, BaseModel) else json
767
775
 
768
776
  return await self._github.arequest(
@@ -1096,15 +1104,17 @@ class DependabotClient:
1096
1104
 
1097
1105
  url = f"/repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
1098
1106
 
1099
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1100
-
1101
- if not kwargs:
1102
- kwargs = UNSET
1107
+ headers = {
1108
+ "Content-Type": "application/json",
1109
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1110
+ **(headers or {}),
1111
+ }
1103
1112
 
1104
1113
  json = kwargs if data is UNSET else data
1105
- json = type_validate_python(
1106
- ReposOwnerRepoDependabotAlertsAlertNumberPatchBody, json
1107
- )
1114
+ if self._github.config.rest_api_validate_body:
1115
+ json = type_validate_python(
1116
+ ReposOwnerRepoDependabotAlertsAlertNumberPatchBody, json
1117
+ )
1108
1118
  json = model_dump(json) if isinstance(json, BaseModel) else json
1109
1119
 
1110
1120
  return self._github.request(
@@ -1176,15 +1186,17 @@ class DependabotClient:
1176
1186
 
1177
1187
  url = f"/repos/{owner}/{repo}/dependabot/alerts/{alert_number}"
1178
1188
 
1179
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1180
-
1181
- if not kwargs:
1182
- kwargs = UNSET
1189
+ headers = {
1190
+ "Content-Type": "application/json",
1191
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1192
+ **(headers or {}),
1193
+ }
1183
1194
 
1184
1195
  json = kwargs if data is UNSET else data
1185
- json = type_validate_python(
1186
- ReposOwnerRepoDependabotAlertsAlertNumberPatchBody, json
1187
- )
1196
+ if self._github.config.rest_api_validate_body:
1197
+ json = type_validate_python(
1198
+ ReposOwnerRepoDependabotAlertsAlertNumberPatchBody, json
1199
+ )
1188
1200
  json = model_dump(json) if isinstance(json, BaseModel) else json
1189
1201
 
1190
1202
  return await self._github.arequest(
@@ -1395,15 +1407,17 @@ class DependabotClient:
1395
1407
 
1396
1408
  url = f"/repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
1397
1409
 
1398
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1399
-
1400
- if not kwargs:
1401
- kwargs = UNSET
1410
+ headers = {
1411
+ "Content-Type": "application/json",
1412
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1413
+ **(headers or {}),
1414
+ }
1402
1415
 
1403
1416
  json = kwargs if data is UNSET else data
1404
- json = type_validate_python(
1405
- ReposOwnerRepoDependabotSecretsSecretNamePutBody, json
1406
- )
1417
+ if self._github.config.rest_api_validate_body:
1418
+ json = type_validate_python(
1419
+ ReposOwnerRepoDependabotSecretsSecretNamePutBody, json
1420
+ )
1407
1421
  json = model_dump(json) if isinstance(json, BaseModel) else json
1408
1422
 
1409
1423
  return self._github.request(
@@ -1457,15 +1471,17 @@ class DependabotClient:
1457
1471
 
1458
1472
  url = f"/repos/{owner}/{repo}/dependabot/secrets/{secret_name}"
1459
1473
 
1460
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
1461
-
1462
- if not kwargs:
1463
- kwargs = UNSET
1474
+ headers = {
1475
+ "Content-Type": "application/json",
1476
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
1477
+ **(headers or {}),
1478
+ }
1464
1479
 
1465
1480
  json = kwargs if data is UNSET else data
1466
- json = type_validate_python(
1467
- ReposOwnerRepoDependabotSecretsSecretNamePutBody, json
1468
- )
1481
+ if self._github.config.rest_api_validate_body:
1482
+ json = type_validate_python(
1483
+ ReposOwnerRepoDependabotSecretsSecretNamePutBody, json
1484
+ )
1469
1485
  json = model_dump(json) if isinstance(json, BaseModel) else json
1470
1486
 
1471
1487
  return await self._github.arequest(
@@ -224,13 +224,15 @@ class DependencyGraphClient:
224
224
 
225
225
  url = f"/repos/{owner}/{repo}/dependency-graph/snapshots"
226
226
 
227
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
228
-
229
- if not kwargs:
230
- kwargs = UNSET
227
+ headers = {
228
+ "Content-Type": "application/json",
229
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
230
+ **(headers or {}),
231
+ }
231
232
 
232
233
  json = kwargs if data is UNSET else data
233
- json = type_validate_python(Snapshot, json)
234
+ if self._github.config.rest_api_validate_body:
235
+ json = type_validate_python(Snapshot, json)
234
236
  json = model_dump(json) if isinstance(json, BaseModel) else json
235
237
 
236
238
  return self._github.request(
@@ -287,13 +289,15 @@ class DependencyGraphClient:
287
289
 
288
290
  url = f"/repos/{owner}/{repo}/dependency-graph/snapshots"
289
291
 
290
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
291
-
292
- if not kwargs:
293
- kwargs = UNSET
292
+ headers = {
293
+ "Content-Type": "application/json",
294
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
295
+ **(headers or {}),
296
+ }
294
297
 
295
298
  json = kwargs if data is UNSET else data
296
- json = type_validate_python(Snapshot, json)
299
+ if self._github.config.rest_api_validate_body:
300
+ json = type_validate_python(Snapshot, json)
297
301
  json = model_dump(json) if isinstance(json, BaseModel) else json
298
302
 
299
303
  return await self._github.arequest(
@@ -152,13 +152,15 @@ class GistsClient:
152
152
 
153
153
  url = "/gists"
154
154
 
155
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
156
-
157
- if not kwargs:
158
- kwargs = UNSET
155
+ headers = {
156
+ "Content-Type": "application/json",
157
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
158
+ **(headers or {}),
159
+ }
159
160
 
160
161
  json = kwargs if data is UNSET else data
161
- json = type_validate_python(GistsPostBody, json)
162
+ if self._github.config.rest_api_validate_body:
163
+ json = type_validate_python(GistsPostBody, json)
162
164
  json = model_dump(json) if isinstance(json, BaseModel) else json
163
165
 
164
166
  return self._github.request(
@@ -203,13 +205,15 @@ class GistsClient:
203
205
 
204
206
  url = "/gists"
205
207
 
206
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
207
-
208
- if not kwargs:
209
- kwargs = UNSET
208
+ headers = {
209
+ "Content-Type": "application/json",
210
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
211
+ **(headers or {}),
212
+ }
210
213
 
211
214
  json = kwargs if data is UNSET else data
212
- json = type_validate_python(GistsPostBody, json)
215
+ if self._github.config.rest_api_validate_body:
216
+ json = type_validate_python(GistsPostBody, json)
213
217
  json = model_dump(json) if isinstance(json, BaseModel) else json
214
218
 
215
219
  return await self._github.arequest(
@@ -508,13 +512,15 @@ class GistsClient:
508
512
 
509
513
  url = f"/gists/{gist_id}"
510
514
 
511
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
512
-
513
- if not kwargs:
514
- kwargs = UNSET
515
+ headers = {
516
+ "Content-Type": "application/json",
517
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
518
+ **(headers or {}),
519
+ }
515
520
 
516
521
  json = kwargs if data is UNSET else data
517
- json = type_validate_python(Union[GistsGistIdPatchBody, None], json)
522
+ if self._github.config.rest_api_validate_body:
523
+ json = type_validate_python(Union[GistsGistIdPatchBody, None], json)
518
524
  json = model_dump(json) if isinstance(json, BaseModel) else json
519
525
 
520
526
  return self._github.request(
@@ -570,13 +576,15 @@ class GistsClient:
570
576
 
571
577
  url = f"/gists/{gist_id}"
572
578
 
573
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
574
-
575
- if not kwargs:
576
- kwargs = UNSET
579
+ headers = {
580
+ "Content-Type": "application/json",
581
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
582
+ **(headers or {}),
583
+ }
577
584
 
578
585
  json = kwargs if data is UNSET else data
579
- json = type_validate_python(Union[GistsGistIdPatchBody, None], json)
586
+ if self._github.config.rest_api_validate_body:
587
+ json = type_validate_python(Union[GistsGistIdPatchBody, None], json)
580
588
  json = model_dump(json) if isinstance(json, BaseModel) else json
581
589
 
582
590
  return await self._github.arequest(
@@ -694,13 +702,15 @@ class GistsClient:
694
702
 
695
703
  url = f"/gists/{gist_id}/comments"
696
704
 
697
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
698
-
699
- if not kwargs:
700
- kwargs = UNSET
705
+ headers = {
706
+ "Content-Type": "application/json",
707
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
708
+ **(headers or {}),
709
+ }
701
710
 
702
711
  json = kwargs if data is UNSET else data
703
- json = type_validate_python(GistsGistIdCommentsPostBody, json)
712
+ if self._github.config.rest_api_validate_body:
713
+ json = type_validate_python(GistsGistIdCommentsPostBody, json)
704
714
  json = model_dump(json) if isinstance(json, BaseModel) else json
705
715
 
706
716
  return self._github.request(
@@ -748,13 +758,15 @@ class GistsClient:
748
758
 
749
759
  url = f"/gists/{gist_id}/comments"
750
760
 
751
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
752
-
753
- if not kwargs:
754
- kwargs = UNSET
761
+ headers = {
762
+ "Content-Type": "application/json",
763
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
764
+ **(headers or {}),
765
+ }
755
766
 
756
767
  json = kwargs if data is UNSET else data
757
- json = type_validate_python(GistsGistIdCommentsPostBody, json)
768
+ if self._github.config.rest_api_validate_body:
769
+ json = type_validate_python(GistsGistIdCommentsPostBody, json)
758
770
  json = model_dump(json) if isinstance(json, BaseModel) else json
759
771
 
760
772
  return await self._github.arequest(
@@ -911,13 +923,15 @@ class GistsClient:
911
923
 
912
924
  url = f"/gists/{gist_id}/comments/{comment_id}"
913
925
 
914
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
915
-
916
- if not kwargs:
917
- kwargs = UNSET
926
+ headers = {
927
+ "Content-Type": "application/json",
928
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
929
+ **(headers or {}),
930
+ }
918
931
 
919
932
  json = kwargs if data is UNSET else data
920
- json = type_validate_python(GistsGistIdCommentsCommentIdPatchBody, json)
933
+ if self._github.config.rest_api_validate_body:
934
+ json = type_validate_python(GistsGistIdCommentsCommentIdPatchBody, json)
921
935
  json = model_dump(json) if isinstance(json, BaseModel) else json
922
936
 
923
937
  return self._github.request(
@@ -971,13 +985,15 @@ class GistsClient:
971
985
 
972
986
  url = f"/gists/{gist_id}/comments/{comment_id}"
973
987
 
974
- headers = {"X-GitHub-Api-Version": self._REST_API_VERSION, **(headers or {})}
975
-
976
- if not kwargs:
977
- kwargs = UNSET
988
+ headers = {
989
+ "Content-Type": "application/json",
990
+ "X-GitHub-Api-Version": self._REST_API_VERSION,
991
+ **(headers or {}),
992
+ }
978
993
 
979
994
  json = kwargs if data is UNSET else data
980
- json = type_validate_python(GistsGistIdCommentsCommentIdPatchBody, json)
995
+ if self._github.config.rest_api_validate_body:
996
+ json = type_validate_python(GistsGistIdCommentsCommentIdPatchBody, json)
981
997
  json = model_dump(json) if isinstance(json, BaseModel) else json
982
998
 
983
999
  return await self._github.arequest(