octocrate 2.1.0

A comprehensive GitHub REST API library based on Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
use octocrate_core::*;
#[allow(unused_imports)]
use octocrate_types::*;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
#[allow(unused_imports)]
use typed_builder::TypedBuilder;

pub mod get_authenticated {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Integration;
}

pub mod create_from_manifest {
  #[allow(unused_imports)]
  use super::*;

  #[allow(clippy::large_enum_variant)]
  #[derive(Debug, Clone, Serialize, Deserialize)]
  #[serde(untagged)]
  pub enum Response {
    /// GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.
    Integration(Integration),
    ResponseItem2(ResponseItem2),
  }

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct ResponseItem2 {
    pub client_id: String,
    pub client_secret: String,
    pub pem: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub webhook_secret: Option<String>,
  }
}

pub mod get_webhook_config_for_app {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = WebhookConfig;
}

pub mod update_webhook_config_for_app {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = WebhookConfig;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Request {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub content_type: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub insecure_ssl: Option<StringOrNumber>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub secret: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub url: Option<String>,
  }
}

pub mod list_webhook_deliveries {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<HookDeliveryItem>;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub per_page: Option<i64>,
    /// Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub cursor: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub redelivery: Option<bool>,
  }
}

pub mod get_webhook_delivery {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = HookDelivery;
}

pub mod list_installation_requests_for_authenticated_app {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<IntegrationInstallationRequest>;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub per_page: Option<i64>,
    /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub page: Option<i64>,
  }
}

pub mod list_installations {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<Installation>;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub per_page: Option<i64>,
    /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub page: Option<i64>,
    /// Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub since: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub outdated: Option<String>,
  }
}

pub mod get_installation {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Installation;
}

pub mod create_installation_access_token {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = InstallationToken;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Request {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub permissions: Option<AppPermissions>,
    /// List of repository names that the token should have access to
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub repositories: Option<Vec<String>>,
    /// List of repository IDs that the token should have access to
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub repository_ids: Option<Vec<i64>>,
  }
}

pub mod delete_authorization {
  #[allow(unused_imports)]
  use super::*;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Request {
    /// The OAuth access token used to authenticate to the GitHub API.
    pub access_token: String,
  }
}

pub mod check_token {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Authorization;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Request {
    /// The access_token of the OAuth or GitHub application.
    pub access_token: String,
  }
}

pub mod reset_token {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Authorization;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Request {
    /// The access_token of the OAuth or GitHub application.
    pub access_token: String,
  }
}

pub mod delete_token {
  #[allow(unused_imports)]
  use super::*;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Request {
    /// The OAuth access token used to authenticate to the GitHub API.
    pub access_token: String,
  }
}

pub mod scope_token {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Authorization;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Request {
    /// The access token used to authenticate to the GitHub API.
    pub access_token: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub permissions: Option<AppPermissions>,
    /// The list of repository names to scope the user access token to. `repositories` may not be specified if `repository_ids` is specified.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub repositories: Option<Vec<String>>,
    /// The list of repository IDs to scope the user access token to. `repository_ids` may not be specified if `repositories` is specified.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub repository_ids: Option<Vec<i64>>,
    /// The name of the user or organization to scope the user access token to. **Required** unless `target_id` is specified.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub target: Option<String>,
    /// The ID of the user or organization to scope the user access token to. **Required** unless `target` is specified.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub target_id: Option<i64>,
  }
}

pub mod get_by_slug {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Integration;
}

pub mod list_repos_accessible_to_installation {
  #[allow(unused_imports)]
  use super::*;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub per_page: Option<i64>,
    /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub page: Option<i64>,
  }

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Response {
    pub repositories: Vec<Repository>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub repository_selection: Option<String>,
    pub total_count: i64,
  }
}

pub mod get_subscription_plan_for_account {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = MarketplacePurchase;
}

pub mod list_plans {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<MarketplaceListingPlan>;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub per_page: Option<i64>,
    /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub page: Option<i64>,
  }
}

pub mod list_accounts_for_plan {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<MarketplacePurchase>;

  #[allow(clippy::large_enum_variant)]
  #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Copy)]
  pub enum QueryDirection {
    #[serde(rename = "asc")]
    Asc,
    #[serde(rename = "desc")]
    Desc,
  }

  impl std::fmt::Display for QueryDirection {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
      match self {
        QueryDirection::Asc => write!(f, "asc"),
        QueryDirection::Desc => write!(f, "desc"),
      }
    }
  }

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The property to sort the results by.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub sort: Option<parameters::Sort>,
    /// To return the oldest accounts first, set to `asc`. Ignored without the `sort` parameter.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub direction: Option<QueryDirection>,
    /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub per_page: Option<i64>,
    /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub page: Option<i64>,
  }
}

pub mod get_subscription_plan_for_account_stubbed {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = MarketplacePurchase;
}

pub mod list_plans_stubbed {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<MarketplaceListingPlan>;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub per_page: Option<i64>,
    /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub page: Option<i64>,
  }
}

pub mod list_accounts_for_plan_stubbed {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<MarketplacePurchase>;

  #[allow(clippy::large_enum_variant)]
  #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Copy)]
  pub enum QueryDirection {
    #[serde(rename = "asc")]
    Asc,
    #[serde(rename = "desc")]
    Desc,
  }

  impl std::fmt::Display for QueryDirection {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
      match self {
        QueryDirection::Asc => write!(f, "asc"),
        QueryDirection::Desc => write!(f, "desc"),
      }
    }
  }

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The property to sort the results by.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub sort: Option<parameters::Sort>,
    /// To return the oldest accounts first, set to `asc`. Ignored without the `sort` parameter.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub direction: Option<QueryDirection>,
    /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub per_page: Option<i64>,
    /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub page: Option<i64>,
  }
}

pub mod get_org_installation {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Installation;
}

pub mod get_repo_installation {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Installation;
}

pub mod list_installations_for_authenticated_user {
  #[allow(unused_imports)]
  use super::*;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub per_page: Option<i64>,
    /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub page: Option<i64>,
  }

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Response {
    pub installations: Vec<Installation>,
    pub total_count: i64,
  }
}

pub mod list_installation_repos_for_authenticated_user {
  #[allow(unused_imports)]
  use super::*;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub per_page: Option<i64>,
    /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub page: Option<i64>,
  }

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Response {
    pub repositories: Vec<Repository>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub repository_selection: Option<String>,
    pub total_count: i64,
  }
}

pub mod list_subscriptions_for_authenticated_user {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<UserMarketplacePurchase>;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub per_page: Option<i64>,
    /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub page: Option<i64>,
  }
}

pub mod list_subscriptions_for_authenticated_user_stubbed {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<UserMarketplacePurchase>;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub per_page: Option<i64>,
    /// The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub page: Option<i64>,
  }
}

pub mod get_user_installation {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Installation;
}

/// Information for integrations and installations.
pub struct GitHubAppsAPI {
  config: SharedAPIConfig,
}

impl GitHubAppsAPI {
  pub fn new(config: &SharedAPIConfig) -> Self {
    Self {
      config: config.clone(),
    }
  }

  /// **Get the authenticated app**
  ///
  /// Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app)" endpoint.
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#get-the-authenticated-app](https://docs.github.com/rest/apps/apps#get-the-authenticated-app)
  pub fn get_authenticated(&self) -> Request<(), (), get_authenticated::Response> {
    let url = format!("/app");

    Request::<(), (), get_authenticated::Response>::builder(&self.config)
      .get(url)
      .build()
  }

  /// **Create a GitHub App from a manifest**
  ///
  /// Use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest](https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest)
  pub fn create_from_manifest(
    &self,
    code: impl Into<String>,
  ) -> Request<(), (), create_from_manifest::Response> {
    let code = code.into();
    let url = format!("/app-manifests/{code}/conversions");

    Request::<(), (), create_from_manifest::Response>::builder(&self.config)
      .post(url)
      .build()
  }

  /// **Get a webhook configuration for an app**
  ///
  /// Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app](https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app)
  pub fn get_webhook_config_for_app(
    &self,
  ) -> Request<(), (), get_webhook_config_for_app::Response> {
    let url = format!("/app/hook/config");

    Request::<(), (), get_webhook_config_for_app::Response>::builder(&self.config)
      .get(url)
      .build()
  }

  /// **Update a webhook configuration for an app**
  ///
  /// Updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app](https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app)
  pub fn update_webhook_config_for_app(
    &self,
  ) -> Request<update_webhook_config_for_app::Request, (), update_webhook_config_for_app::Response>
  {
    let url = format!("/app/hook/config");

    Request::<update_webhook_config_for_app::Request, (), update_webhook_config_for_app::Response>::builder(&self.config)
      .patch(url)
      .build()
  }

  /// **List deliveries for an app webhook**
  ///
  /// Returns a list of webhook deliveries for the webhook configured for a GitHub App.
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook](https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook)
  pub fn list_webhook_deliveries(
    &self,
  ) -> Request<(), list_webhook_deliveries::Query, list_webhook_deliveries::Response> {
    let url = format!("/app/hook/deliveries");

    Request::<(), list_webhook_deliveries::Query, list_webhook_deliveries::Response>::builder(
      &self.config,
    )
    .get(url)
    .build()
  }

  /// **Get a delivery for an app webhook**
  ///
  /// Returns a delivery for the webhook configured for a GitHub App.
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook](https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook)
  pub fn get_webhook_delivery(
    &self,
    delivery_id: impl Into<i64>,
  ) -> Request<(), (), get_webhook_delivery::Response> {
    let delivery_id = delivery_id.into();
    let url = format!("/app/hook/deliveries/{delivery_id}");

    Request::<(), (), get_webhook_delivery::Response>::builder(&self.config)
      .get(url)
      .build()
  }

  /// **Redeliver a delivery for an app webhook**
  ///
  /// Redeliver a delivery for the webhook configured for a GitHub App.
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook](https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook)
  pub fn redeliver_webhook_delivery(
    &self,
    delivery_id: impl Into<i64>,
  ) -> NoContentRequest<(), ()> {
    let delivery_id = delivery_id.into();
    let url = format!("/app/hook/deliveries/{delivery_id}/attempts");

    NoContentRequest::<(), ()>::builder(&self.config)
      .post(url)
      .build()
  }

  /// **List installation requests for the authenticated app**
  ///
  /// Lists all the pending installation requests for the authenticated GitHub App.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app](https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app)
  pub fn list_installation_requests_for_authenticated_app(
    &self,
  ) -> Request<
    (),
    list_installation_requests_for_authenticated_app::Query,
    list_installation_requests_for_authenticated_app::Response,
  > {
    let url = format!("/app/installation-requests");

    Request::<
      (),
      list_installation_requests_for_authenticated_app::Query,
      list_installation_requests_for_authenticated_app::Response,
    >::builder(&self.config)
    .get(url)
    .build()
  }

  /// **List installations for the authenticated app**
  ///
  /// The permissions the installation has are included under the `permissions` key.
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app](https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app)
  pub fn list_installations(
    &self,
  ) -> Request<(), list_installations::Query, list_installations::Response> {
    let url = format!("/app/installations");

    Request::<(), list_installations::Query, list_installations::Response>::builder(&self.config)
      .get(url)
      .build()
  }

  /// **Get an installation for the authenticated app**
  ///
  /// Enables an authenticated GitHub App to find an installation's information using the installation id.
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app](https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app)
  pub fn get_installation(
    &self,
    installation_id: impl Into<i64>,
  ) -> Request<(), (), get_installation::Response> {
    let installation_id = installation_id.into();
    let url = format!("/app/installations/{installation_id}");

    Request::<(), (), get_installation::Response>::builder(&self.config)
      .get(url)
      .build()
  }

  /// **Delete an installation for the authenticated app**
  ///
  /// Uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)" endpoint.
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app](https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app)
  pub fn delete_installation(&self, installation_id: impl Into<i64>) -> NoContentRequest<(), ()> {
    let installation_id = installation_id.into();
    let url = format!("/app/installations/{installation_id}");

    NoContentRequest::<(), ()>::builder(&self.config)
      .delete(url)
      .build()
  }

  /// **Create an installation access token for an app**
  ///
  /// Creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access.
  ///
  /// Optionally, you can use the `repositories` or `repository_ids` body parameters to specify individual repositories that the installation access token can access. If you don't use `repositories` or `repository_ids` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.
  ///
  /// Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.
  ///
  /// When using the repository or permission parameters to reduce the access of the token, the complexity of the token is increased due to both the number of permissions in the request and the number of repositories the token will have access to. If the complexity is too large, the token will fail to be issued. If this occurs, the error message will indicate the maximum number of repositories that should be requested. For the average application requesting 8 permissions, this limit is around 5000 repositories. With fewer permissions requested, more repositories are supported.
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app](https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app)
  pub fn create_installation_access_token(
    &self,
    installation_id: impl Into<i64>,
  ) -> Request<
    create_installation_access_token::Request,
    (),
    create_installation_access_token::Response,
  > {
    let installation_id = installation_id.into();
    let url = format!("/app/installations/{installation_id}/access_tokens");

    Request::<
      create_installation_access_token::Request,
      (),
      create_installation_access_token::Response,
    >::builder(&self.config)
    .post(url)
    .build()
  }

  /// **Suspend an app installation**
  ///
  /// Suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub API or webhook events is blocked for that account.
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#suspend-an-app-installation](https://docs.github.com/rest/apps/apps#suspend-an-app-installation)
  pub fn suspend_installation(&self, installation_id: impl Into<i64>) -> NoContentRequest<(), ()> {
    let installation_id = installation_id.into();
    let url = format!("/app/installations/{installation_id}/suspended");

    NoContentRequest::<(), ()>::builder(&self.config)
      .put(url)
      .build()
  }

  /// **Unsuspend an app installation**
  ///
  /// Removes a GitHub App installation suspension.
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation](https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation)
  pub fn unsuspend_installation(
    &self,
    installation_id: impl Into<i64>,
  ) -> NoContentRequest<(), ()> {
    let installation_id = installation_id.into();
    let url = format!("/app/installations/{installation_id}/suspended");

    NoContentRequest::<(), ()>::builder(&self.config)
      .delete(url)
      .build()
  }

  /// **Delete an app authorization**
  ///
  /// OAuth and GitHub application owners can revoke a grant for their application and a specific user. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the OAuth application's `client_id` and `client_secret` as the username and password. You must also provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted.
  /// Deleting an application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized).
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization](https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization)
  pub fn delete_authorization(
    &self,
    client_id: impl Into<String>,
  ) -> NoContentRequest<delete_authorization::Request, ()> {
    let client_id = client_id.into();
    let url = format!("/applications/{client_id}/grant");

    NoContentRequest::<delete_authorization::Request, ()>::builder(&self.config)
      .delete(url)
      .build()
  }

  /// **Check a token**
  ///
  /// OAuth applications and GitHub applications with OAuth authorizations can use this API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) to use this endpoint, where the username is the application `client_id` and the password is its `client_secret`. Invalid tokens will return `404 NOT FOUND`.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/oauth-applications#check-a-token](https://docs.github.com/rest/apps/oauth-applications#check-a-token)
  pub fn check_token(
    &self,
    client_id: impl Into<String>,
  ) -> Request<check_token::Request, (), check_token::Response> {
    let client_id = client_id.into();
    let url = format!("/applications/{client_id}/token");

    Request::<check_token::Request, (), check_token::Response>::builder(&self.config)
      .post(url)
      .build()
  }

  /// **Reset a token**
  ///
  /// OAuth applications and GitHub applications with OAuth authorizations can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the application's `client_id` and `client_secret` as the username and password. Invalid tokens will return `404 NOT FOUND`.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/oauth-applications#reset-a-token](https://docs.github.com/rest/apps/oauth-applications#reset-a-token)
  pub fn reset_token(
    &self,
    client_id: impl Into<String>,
  ) -> Request<reset_token::Request, (), reset_token::Response> {
    let client_id = client_id.into();
    let url = format!("/applications/{client_id}/token");

    Request::<reset_token::Request, (), reset_token::Response>::builder(&self.config)
      .patch(url)
      .build()
  }

  /// **Delete an app token**
  ///
  /// OAuth  or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization. You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) when accessing this endpoint, using the application's `client_id` and `client_secret` as the username and password.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token](https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token)
  pub fn delete_token(
    &self,
    client_id: impl Into<String>,
  ) -> NoContentRequest<delete_token::Request, ()> {
    let client_id = client_id.into();
    let url = format!("/applications/{client_id}/token");

    NoContentRequest::<delete_token::Request, ()>::builder(&self.config)
      .delete(url)
      .build()
  }

  /// **Create a scoped access token**
  ///
  /// Use a non-scoped user access token to create a repository-scoped and/or permission-scoped user access token. You can specify
  /// which repositories the token can access and which permissions are granted to the
  /// token.
  ///
  /// Invalid tokens will return `404 NOT FOUND`.
  ///
  /// You must use [Basic Authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication)
  /// when accessing this endpoint, using the `client_id` and `client_secret` of the GitHub App
  /// as the username and password.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#create-a-scoped-access-token](https://docs.github.com/rest/apps/apps#create-a-scoped-access-token)
  pub fn scope_token(
    &self,
    client_id: impl Into<String>,
  ) -> Request<scope_token::Request, (), scope_token::Response> {
    let client_id = client_id.into();
    let url = format!("/applications/{client_id}/token/scoped");

    Request::<scope_token::Request, (), scope_token::Response>::builder(&self.config)
      .post(url)
      .build()
  }

  /// **Get an app**
  ///
  /// **Note**: The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`).
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#get-an-app](https://docs.github.com/rest/apps/apps#get-an-app)
  pub fn get_by_slug(&self, app_slug: impl Into<String>) -> Request<(), (), get_by_slug::Response> {
    let app_slug = app_slug.into();
    let url = format!("/apps/{app_slug}");

    Request::<(), (), get_by_slug::Response>::builder(&self.config)
      .get(url)
      .build()
  }

  /// **List repositories accessible to the app installation**
  ///
  /// List repositories that an app installation can access.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation](https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation)
  pub fn list_repos_accessible_to_installation(
    &self,
  ) -> Request<
    (),
    list_repos_accessible_to_installation::Query,
    list_repos_accessible_to_installation::Response,
  > {
    let url = format!("/installation/repositories");

    Request::<
      (),
      list_repos_accessible_to_installation::Query,
      list_repos_accessible_to_installation::Response,
    >::builder(&self.config)
    .get(url)
    .build()
  }

  /// **Revoke an installation access token**
  ///
  /// Revokes the installation token you're using to authenticate as an installation and access this endpoint.
  ///
  /// Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app)" endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token](https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token)
  pub fn revoke_installation_access_token(&self) -> NoContentRequest<(), ()> {
    let url = format!("/installation/token");

    NoContentRequest::<(), ()>::builder(&self.config)
      .delete(url)
      .build()
  }

  /// **Get a subscription plan for an account**
  ///
  /// Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.
  ///
  /// GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account](https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account)
  pub fn get_subscription_plan_for_account(
    &self,
    account_id: impl Into<i64>,
  ) -> Request<(), (), get_subscription_plan_for_account::Response> {
    let account_id = account_id.into();
    let url = format!("/marketplace_listing/accounts/{account_id}");

    Request::<(), (), get_subscription_plan_for_account::Response>::builder(&self.config)
      .get(url)
      .build()
  }

  /// **List plans**
  ///
  /// Lists all plans that are part of your GitHub Marketplace listing.
  ///
  /// GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/marketplace#list-plans](https://docs.github.com/rest/apps/marketplace#list-plans)
  pub fn list_plans(&self) -> Request<(), list_plans::Query, list_plans::Response> {
    let url = format!("/marketplace_listing/plans");

    Request::<(), list_plans::Query, list_plans::Response>::builder(&self.config)
      .get(url)
      .build()
  }

  /// **List accounts for a plan**
  ///
  /// Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.
  ///
  /// GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan](https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan)
  pub fn list_accounts_for_plan(
    &self,
    plan_id: impl Into<i64>,
  ) -> Request<(), list_accounts_for_plan::Query, list_accounts_for_plan::Response> {
    let plan_id = plan_id.into();
    let url = format!("/marketplace_listing/plans/{plan_id}/accounts");

    Request::<(), list_accounts_for_plan::Query, list_accounts_for_plan::Response>::builder(
      &self.config,
    )
    .get(url)
    .build()
  }

  /// **Get a subscription plan for an account (stubbed)**
  ///
  /// Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.
  ///
  /// GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed](https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed)
  pub fn get_subscription_plan_for_account_stubbed(
    &self,
    account_id: impl Into<i64>,
  ) -> Request<(), (), get_subscription_plan_for_account_stubbed::Response> {
    let account_id = account_id.into();
    let url = format!("/marketplace_listing/stubbed/accounts/{account_id}");

    Request::<(), (), get_subscription_plan_for_account_stubbed::Response>::builder(&self.config)
      .get(url)
      .build()
  }

  /// **List plans (stubbed)**
  ///
  /// Lists all plans that are part of your GitHub Marketplace listing.
  ///
  /// GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/marketplace#list-plans-stubbed](https://docs.github.com/rest/apps/marketplace#list-plans-stubbed)
  pub fn list_plans_stubbed(
    &self,
  ) -> Request<(), list_plans_stubbed::Query, list_plans_stubbed::Response> {
    let url = format!("/marketplace_listing/stubbed/plans");

    Request::<(), list_plans_stubbed::Query, list_plans_stubbed::Response>::builder(&self.config)
      .get(url)
      .build()
  }

  /// **List accounts for a plan (stubbed)**
  ///
  /// Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.
  ///
  /// GitHub Apps must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. OAuth apps must use [basic authentication](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) with their client ID and client secret to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed](https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed)
  pub fn list_accounts_for_plan_stubbed(
    &self,
    plan_id: impl Into<i64>,
  ) -> Request<(), list_accounts_for_plan_stubbed::Query, list_accounts_for_plan_stubbed::Response>
  {
    let plan_id = plan_id.into();
    let url = format!("/marketplace_listing/stubbed/plans/{plan_id}/accounts");

    Request::<(), list_accounts_for_plan_stubbed::Query, list_accounts_for_plan_stubbed::Response>::builder(&self.config)
      .get(url)
      .build()
  }

  /// **Get an organization installation for the authenticated app**
  ///
  /// Enables an authenticated GitHub App to find the organization's installation information.
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app](https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app)
  pub fn get_org_installation(
    &self,
    org: impl Into<String>,
  ) -> Request<(), (), get_org_installation::Response> {
    let org = org.into();
    let url = format!("/orgs/{org}/installation");

    Request::<(), (), get_org_installation::Response>::builder(&self.config)
      .get(url)
      .build()
  }

  /// **Get a repository installation for the authenticated app**
  ///
  /// Enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to.
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app](https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app)
  pub fn get_repo_installation(
    &self,
    owner: impl Into<String>,
    repo: impl Into<String>,
  ) -> Request<(), (), get_repo_installation::Response> {
    let owner = owner.into();
    let repo = repo.into();
    let url = format!("/repos/{owner}/{repo}/installation");

    Request::<(), (), get_repo_installation::Response>::builder(&self.config)
      .get(url)
      .build()
  }

  /// **List app installations accessible to the user access token**
  ///
  /// Lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.
  ///
  /// The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.
  ///
  /// You can find the permissions for the installation under the `permissions` key.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token](https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token)
  pub fn list_installations_for_authenticated_user(
    &self,
  ) -> Request<
    (),
    list_installations_for_authenticated_user::Query,
    list_installations_for_authenticated_user::Response,
  > {
    let url = format!("/user/installations");

    Request::<
      (),
      list_installations_for_authenticated_user::Query,
      list_installations_for_authenticated_user::Response,
    >::builder(&self.config)
    .get(url)
    .build()
  }

  /// **List repositories accessible to the user access token**
  ///
  /// List repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation.
  ///
  /// The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.
  ///
  /// The access the user has to each repository is included in the hash under the `permissions` key.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token](https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token)
  pub fn list_installation_repos_for_authenticated_user(
    &self,
    installation_id: impl Into<i64>,
  ) -> Request<
    (),
    list_installation_repos_for_authenticated_user::Query,
    list_installation_repos_for_authenticated_user::Response,
  > {
    let installation_id = installation_id.into();
    let url = format!("/user/installations/{installation_id}/repositories");

    Request::<
      (),
      list_installation_repos_for_authenticated_user::Query,
      list_installation_repos_for_authenticated_user::Response,
    >::builder(&self.config)
    .get(url)
    .build()
  }

  /// **Add a repository to an app installation**
  ///
  /// Add a single repository to an installation. The authenticated user must have admin access to the repository.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation](https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation)
  pub fn add_repo_to_installation_for_authenticated_user(
    &self,
    installation_id: impl Into<i64>,
    repository_id: impl Into<i64>,
  ) -> NoContentRequest<(), ()> {
    let installation_id = installation_id.into();
    let repository_id = repository_id.into();
    let url = format!("/user/installations/{installation_id}/repositories/{repository_id}");

    NoContentRequest::<(), ()>::builder(&self.config)
      .put(url)
      .build()
  }

  /// **Remove a repository from an app installation**
  ///
  /// Remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation](https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation)
  pub fn remove_repo_from_installation_for_authenticated_user(
    &self,
    installation_id: impl Into<i64>,
    repository_id: impl Into<i64>,
  ) -> NoContentRequest<(), ()> {
    let installation_id = installation_id.into();
    let repository_id = repository_id.into();
    let url = format!("/user/installations/{installation_id}/repositories/{repository_id}");

    NoContentRequest::<(), ()>::builder(&self.config)
      .delete(url)
      .build()
  }

  /// **List subscriptions for the authenticated user**
  ///
  /// Lists the active subscriptions for the authenticated user.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user](https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user)
  pub fn list_subscriptions_for_authenticated_user(
    &self,
  ) -> Request<
    (),
    list_subscriptions_for_authenticated_user::Query,
    list_subscriptions_for_authenticated_user::Response,
  > {
    let url = format!("/user/marketplace_purchases");

    Request::<
      (),
      list_subscriptions_for_authenticated_user::Query,
      list_subscriptions_for_authenticated_user::Response,
    >::builder(&self.config)
    .get(url)
    .build()
  }

  /// **List subscriptions for the authenticated user (stubbed)**
  ///
  /// Lists the active subscriptions for the authenticated user.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed](https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed)
  pub fn list_subscriptions_for_authenticated_user_stubbed(
    &self,
  ) -> Request<
    (),
    list_subscriptions_for_authenticated_user_stubbed::Query,
    list_subscriptions_for_authenticated_user_stubbed::Response,
  > {
    let url = format!("/user/marketplace_purchases/stubbed");

    Request::<
      (),
      list_subscriptions_for_authenticated_user_stubbed::Query,
      list_subscriptions_for_authenticated_user_stubbed::Response,
    >::builder(&self.config)
    .get(url)
    .build()
  }

  /// **Get a user installation for the authenticated app**
  ///
  /// Enables an authenticated GitHub App to find the user’s installation information.
  ///
  /// You must use a [JWT](https://docs.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app](https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app)
  pub fn get_user_installation(
    &self,
    username: impl Into<String>,
  ) -> Request<(), (), get_user_installation::Response> {
    let username = username.into();
    let url = format!("/users/{username}/installation");

    Request::<(), (), get_user_installation::Response>::builder(&self.config)
      .get(url)
      .build()
  }
}