octocrate 2.0.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
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 list_public_events {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<Event>;

  #[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_feeds {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Feed;
}

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

  pub type Response = Vec<Event>;

  #[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_notifications_for_authenticated_user {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<Thread>;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// If `true`, show notifications marked as read.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub all: Option<bool>,
    /// If `true`, only shows notifications in which the user is directly participating or mentioned.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub participating: Option<bool>,
    /// 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>,
    /// Only show notifications updated before 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 before: Option<String>,
    /// 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>,
    /// The number of results per page (max 50). 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>,
  }
}

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

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Request {
    /// Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub last_read_at: Option<String>,
    /// Whether the notification has been read.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub read: Option<bool>,
  }

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

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

  pub type Response = Thread;
}

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

  pub type Response = ThreadSubscription;
}

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

  pub type Response = ThreadSubscription;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Request {
    /// Whether to block all notifications from a thread.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub ignored: Option<bool>,
  }
}

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

  pub type Response = Vec<Event>;

  #[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_repo_events {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<Event>;

  #[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_repo_notifications_for_authenticated_user {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<Thread>;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// If `true`, show notifications marked as read.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub all: Option<bool>,
    /// If `true`, only shows notifications in which the user is directly participating or mentioned.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub participating: Option<bool>,
    /// 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>,
    /// Only show notifications updated before 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 before: Option<String>,
    /// 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 mark_repo_notifications_as_read {
  #[allow(unused_imports)]
  use super::*;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Request {
    /// Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub last_read_at: Option<String>,
  }

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

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

  #[derive(Debug, Clone, Serialize, Deserialize)]
  #[serde(untagged)]
  pub enum Response {
    SimpleUserArray(Vec<SimpleUser>),
    StargazerArray(Vec<Stargazer>),
  }

  #[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_watchers_for_repo {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<SimpleUser>;

  #[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_repo_subscription {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = RepositorySubscription;
}

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

  pub type Response = RepositorySubscription;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Request {
    /// Determines if all notifications should be blocked from this repository.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub ignored: Option<bool>,
    /// Determines if notifications should be received from this repository.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub subscribed: Option<bool>,
  }
}

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

  pub type Response = Vec<Repository>;

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The property to sort the results by. `created` means when the repository was starred. `updated` means when the repository was last pushed to.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub sort: Option<parameters::SortStarred>,
    /// The direction to sort the results by.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub direction: Option<parameters::Direction>,
    /// 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_watched_repos_for_authenticated_user {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<MinimalRepository>;

  #[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_events_for_authenticated_user {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<Event>;

  #[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_org_events_for_authenticated_user {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<Event>;

  #[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_public_events_for_user {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<Event>;

  #[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_received_events_for_user {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<Event>;

  #[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_received_public_events_for_user {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<Event>;

  #[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_repos_starred_by_user {
  #[allow(unused_imports)]
  use super::*;

  #[derive(Debug, Clone, Serialize, Deserialize)]
  #[serde(untagged)]
  pub enum Response {
    StarredRepositoryArray(Vec<StarredRepository>),
    RepositoryArray(Vec<Repository>),
  }

  #[derive(Debug, Clone, Serialize, Deserialize, TypedBuilder)]
  #[builder(field_defaults(setter(into)))]
  pub struct Query {
    /// The property to sort the results by. `created` means when the repository was starred. `updated` means when the repository was last pushed to.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub sort: Option<parameters::SortStarred>,
    /// The direction to sort the results by.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub direction: Option<parameters::Direction>,
    /// 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_repos_watched_by_user {
  #[allow(unused_imports)]
  use super::*;

  pub type Response = Vec<MinimalRepository>;

  #[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>,
  }
}

/// Activity APIs provide access to notifications, subscriptions, and timelines.
pub struct GitHubActivityAPI {
  config: SharedAPIConfig,
}

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

  /// **List public events**
  ///
  /// We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/events#list-public-events](https://docs.github.com/rest/activity/events#list-public-events)
  pub fn list_public_events(
    &self,
  ) -> Request<(), list_public_events::Query, list_public_events::Response> {
    let url = format!("/events");

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

  /// **Get feeds**
  ///
  /// Lists the feeds available to the authenticated user. The response provides a URL for each feed. You can then get a specific feed by sending a request to one of the feed URLs.
  ///
  /// *   **Timeline**: The GitHub global public timeline
  /// *   **User**: The public timeline for any user, using `uri_template`. For more information, see "[Hypermedia](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia)."
  /// *   **Current user public**: The public timeline for the authenticated user
  /// *   **Current user**: The private timeline for the authenticated user
  /// *   **Current user actor**: The private timeline for activity created by the authenticated user
  /// *   **Current user organizations**: The private timeline for the organizations the authenticated user is a member of.
  /// *   **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.
  ///
  /// By default, timeline resources are returned in JSON. You can specify the `application/atom+xml` type in the `Accept` header to return timeline resources in Atom format. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."
  ///
  /// **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/feeds#get-feeds](https://docs.github.com/rest/activity/feeds#get-feeds)
  pub fn get_feeds(&self) -> Request<(), (), get_feeds::Response> {
    let url = format!("/feeds");

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

  /// **List public events for a network of repositories**
  ///
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories](https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories)
  pub fn list_public_events_for_repo_network(
    &self,
    owner: impl Into<String>,
    repo: impl Into<String>,
  ) -> Request<
    (),
    list_public_events_for_repo_network::Query,
    list_public_events_for_repo_network::Response,
  > {
    let owner = owner.into();
    let repo = repo.into();
    let url = format!("/networks/{owner}/{repo}/events");

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

  /// **List notifications for the authenticated user**
  ///
  /// List all notifications for the current user, sorted by most recently updated.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user](https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user)
  pub fn list_notifications_for_authenticated_user(
    &self,
  ) -> Request<
    (),
    list_notifications_for_authenticated_user::Query,
    list_notifications_for_authenticated_user::Response,
  > {
    let url = format!("/notifications");

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

  /// **Mark notifications as read**
  ///
  /// Marks all notifications as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/notifications#mark-notifications-as-read](https://docs.github.com/rest/activity/notifications#mark-notifications-as-read)
  pub fn mark_notifications_as_read(
    &self,
  ) -> Request<mark_notifications_as_read::Request, (), mark_notifications_as_read::Response> {
    let url = format!("/notifications");

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

  /// **Get a thread**
  ///
  /// Gets information about a notification thread.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/notifications#get-a-thread](https://docs.github.com/rest/activity/notifications#get-a-thread)
  pub fn get_thread(&self, thread_id: impl Into<i64>) -> Request<(), (), get_thread::Response> {
    let thread_id = thread_id.into();
    let url = format!("/notifications/threads/{thread_id}");

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

  /// **Mark a thread as read**
  ///
  /// Marks a thread as "read." Marking a thread as "read" is equivalent to clicking a notification in your notification inbox on GitHub: https://github.com/notifications.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read](https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read)
  pub fn mark_thread_as_read(&self, thread_id: impl Into<i64>) -> NoContentRequest<(), ()> {
    let thread_id = thread_id.into();
    let url = format!("/notifications/threads/{thread_id}");

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

  /// **Mark a thread as done**
  ///
  /// Marks a thread as "done." Marking a thread as "done" is equivalent to marking a notification in your notification inbox on GitHub as done: https://github.com/notifications.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done](https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done)
  pub fn mark_thread_as_done(&self, thread_id: impl Into<i64>) -> NoContentRequest<(), ()> {
    let thread_id = thread_id.into();
    let url = format!("/notifications/threads/{thread_id}");

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

  /// **Get a thread subscription for the authenticated user**
  ///
  /// This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/activity/watching#get-a-repository-subscription).
  ///
  /// Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user](https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user)
  pub fn get_thread_subscription_for_authenticated_user(
    &self,
    thread_id: impl Into<i64>,
  ) -> Request<(), (), get_thread_subscription_for_authenticated_user::Response> {
    let thread_id = thread_id.into();
    let url = format!("/notifications/threads/{thread_id}/subscription");

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

  /// **Set a thread subscription**
  ///
  /// If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.
  ///
  /// You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.
  ///
  /// Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription) endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/notifications#set-a-thread-subscription](https://docs.github.com/rest/activity/notifications#set-a-thread-subscription)
  pub fn set_thread_subscription(
    &self,
    thread_id: impl Into<i64>,
  ) -> Request<set_thread_subscription::Request, (), set_thread_subscription::Response> {
    let thread_id = thread_id.into();
    let url = format!("/notifications/threads/{thread_id}/subscription");

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

  /// **Delete a thread subscription**
  ///
  /// Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/activity/notifications#set-a-thread-subscription) endpoint and set `ignore` to `true`.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription](https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription)
  pub fn delete_thread_subscription(&self, thread_id: impl Into<i64>) -> NoContentRequest<(), ()> {
    let thread_id = thread_id.into();
    let url = format!("/notifications/threads/{thread_id}/subscription");

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

  /// **List public organization events**
  ///
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/events#list-public-organization-events](https://docs.github.com/rest/activity/events#list-public-organization-events)
  pub fn list_public_org_events(
    &self,
    org: impl Into<String>,
  ) -> Request<(), list_public_org_events::Query, list_public_org_events::Response> {
    let org = org.into();
    let url = format!("/orgs/{org}/events");

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

  /// **List repository events**
  ///
  /// **Note**: This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h.
  ///
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/events#list-repository-events](https://docs.github.com/rest/activity/events#list-repository-events)
  pub fn list_repo_events(
    &self,
    owner: impl Into<String>,
    repo: impl Into<String>,
  ) -> Request<(), list_repo_events::Query, list_repo_events::Response> {
    let owner = owner.into();
    let repo = repo.into();
    let url = format!("/repos/{owner}/{repo}/events");

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

  /// **List repository notifications for the authenticated user**
  ///
  /// Lists all notifications for the current user in the specified repository.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user](https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user)
  pub fn list_repo_notifications_for_authenticated_user(
    &self,
    owner: impl Into<String>,
    repo: impl Into<String>,
  ) -> Request<
    (),
    list_repo_notifications_for_authenticated_user::Query,
    list_repo_notifications_for_authenticated_user::Response,
  > {
    let owner = owner.into();
    let repo = repo.into();
    let url = format!("/repos/{owner}/{repo}/notifications");

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

  /// **Mark repository notifications as read**
  ///
  /// Marks all notifications in a repository as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read](https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read)
  pub fn mark_repo_notifications_as_read(
    &self,
    owner: impl Into<String>,
    repo: impl Into<String>,
  ) -> Request<
    mark_repo_notifications_as_read::Request,
    (),
    mark_repo_notifications_as_read::Response,
  > {
    let owner = owner.into();
    let repo = repo.into();
    let url = format!("/repos/{owner}/{repo}/notifications");

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

  /// **List stargazers**
  ///
  /// Lists the people that have starred the repository.
  ///
  /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."
  ///
  /// - **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/starring#list-stargazers](https://docs.github.com/rest/activity/starring#list-stargazers)
  pub fn list_stargazers_for_repo(
    &self,
    owner: impl Into<String>,
    repo: impl Into<String>,
  ) -> Request<(), list_stargazers_for_repo::Query, list_stargazers_for_repo::Response> {
    let owner = owner.into();
    let repo = repo.into();
    let url = format!("/repos/{owner}/{repo}/stargazers");

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

  /// **List watchers**
  ///
  /// Lists the people watching the specified repository.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/watching#list-watchers](https://docs.github.com/rest/activity/watching#list-watchers)
  pub fn list_watchers_for_repo(
    &self,
    owner: impl Into<String>,
    repo: impl Into<String>,
  ) -> Request<(), list_watchers_for_repo::Query, list_watchers_for_repo::Response> {
    let owner = owner.into();
    let repo = repo.into();
    let url = format!("/repos/{owner}/{repo}/subscribers");

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

  /// **Get a repository subscription**
  ///
  /// Gets information about whether the authenticated user is subscribed to the repository.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/watching#get-a-repository-subscription](https://docs.github.com/rest/activity/watching#get-a-repository-subscription)
  pub fn get_repo_subscription(
    &self,
    owner: impl Into<String>,
    repo: impl Into<String>,
  ) -> Request<(), (), get_repo_subscription::Response> {
    let owner = owner.into();
    let repo = repo.into();
    let url = format!("/repos/{owner}/{repo}/subscription");

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

  /// **Set a repository subscription**
  ///
  /// If you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/activity/watching#delete-a-repository-subscription) completely.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/watching#set-a-repository-subscription](https://docs.github.com/rest/activity/watching#set-a-repository-subscription)
  pub fn set_repo_subscription(
    &self,
    owner: impl Into<String>,
    repo: impl Into<String>,
  ) -> Request<set_repo_subscription::Request, (), set_repo_subscription::Response> {
    let owner = owner.into();
    let repo = repo.into();
    let url = format!("/repos/{owner}/{repo}/subscription");

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

  /// **Delete a repository subscription**
  ///
  /// This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/activity/watching#set-a-repository-subscription).
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/watching#delete-a-repository-subscription](https://docs.github.com/rest/activity/watching#delete-a-repository-subscription)
  pub fn delete_repo_subscription(
    &self,
    owner: impl Into<String>,
    repo: impl Into<String>,
  ) -> NoContentRequest<(), ()> {
    let owner = owner.into();
    let repo = repo.into();
    let url = format!("/repos/{owner}/{repo}/subscription");

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

  /// **List repositories starred by the authenticated user**
  ///
  /// Lists repositories the authenticated user has starred.
  ///
  /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."
  ///
  /// - **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user](https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user)
  pub fn list_repos_starred_by_authenticated_user(
    &self,
  ) -> Request<
    (),
    list_repos_starred_by_authenticated_user::Query,
    list_repos_starred_by_authenticated_user::Response,
  > {
    let url = format!("/user/starred");

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

  /// **Check if a repository is starred by the authenticated user**
  ///
  /// Whether the authenticated user has starred the repository.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user](https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user)
  pub fn check_repo_is_starred_by_authenticated_user(
    &self,
    owner: impl Into<String>,
    repo: impl Into<String>,
  ) -> NoContentRequest<(), ()> {
    let owner = owner.into();
    let repo = repo.into();
    let url = format!("/user/starred/{owner}/{repo}");

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

  /// **Star a repository for the authenticated user**
  ///
  /// Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user](https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user)
  pub fn star_repo_for_authenticated_user(
    &self,
    owner: impl Into<String>,
    repo: impl Into<String>,
  ) -> NoContentRequest<(), ()> {
    let owner = owner.into();
    let repo = repo.into();
    let url = format!("/user/starred/{owner}/{repo}");

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

  /// **Unstar a repository for the authenticated user**
  ///
  /// Unstar a repository that the authenticated user has previously starred.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user](https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user)
  pub fn unstar_repo_for_authenticated_user(
    &self,
    owner: impl Into<String>,
    repo: impl Into<String>,
  ) -> NoContentRequest<(), ()> {
    let owner = owner.into();
    let repo = repo.into();
    let url = format!("/user/starred/{owner}/{repo}");

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

  /// **List repositories watched by the authenticated user**
  ///
  /// Lists repositories the authenticated user is watching.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user](https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user)
  pub fn list_watched_repos_for_authenticated_user(
    &self,
  ) -> Request<
    (),
    list_watched_repos_for_authenticated_user::Query,
    list_watched_repos_for_authenticated_user::Response,
  > {
    let url = format!("/user/subscriptions");

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

  /// **List events for the authenticated user**
  ///
  /// If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user](https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user)
  pub fn list_events_for_authenticated_user(
    &self,
    username: impl Into<String>,
  ) -> Request<
    (),
    list_events_for_authenticated_user::Query,
    list_events_for_authenticated_user::Response,
  > {
    let username = username.into();
    let url = format!("/users/{username}/events");

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

  /// **List organization events for the authenticated user**
  ///
  /// This is the user's organization dashboard. You must be authenticated as the user to view this.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user](https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user)
  pub fn list_org_events_for_authenticated_user(
    &self,
    username: impl Into<String>,
    org: impl Into<String>,
  ) -> Request<
    (),
    list_org_events_for_authenticated_user::Query,
    list_org_events_for_authenticated_user::Response,
  > {
    let username = username.into();
    let org = org.into();
    let url = format!("/users/{username}/events/orgs/{org}");

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

  /// **List public events for a user**
  ///
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/events#list-public-events-for-a-user](https://docs.github.com/rest/activity/events#list-public-events-for-a-user)
  pub fn list_public_events_for_user(
    &self,
    username: impl Into<String>,
  ) -> Request<(), list_public_events_for_user::Query, list_public_events_for_user::Response> {
    let username = username.into();
    let url = format!("/users/{username}/events/public");

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

  /// **List events received by the authenticated user**
  ///
  /// These are events that you've received by watching repositories and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user](https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user)
  pub fn list_received_events_for_user(
    &self,
    username: impl Into<String>,
  ) -> Request<(), list_received_events_for_user::Query, list_received_events_for_user::Response>
  {
    let username = username.into();
    let url = format!("/users/{username}/received_events");

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

  /// **List public events received by a user**
  ///
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user](https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user)
  pub fn list_received_public_events_for_user(
    &self,
    username: impl Into<String>,
  ) -> Request<
    (),
    list_received_public_events_for_user::Query,
    list_received_public_events_for_user::Response,
  > {
    let username = username.into();
    let url = format!("/users/{username}/received_events/public");

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

  /// **List repositories starred by a user**
  ///
  /// Lists repositories a user has starred.
  ///
  /// This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."
  ///
  /// - **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user](https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user)
  pub fn list_repos_starred_by_user(
    &self,
    username: impl Into<String>,
  ) -> Request<(), list_repos_starred_by_user::Query, list_repos_starred_by_user::Response> {
    let username = username.into();
    let url = format!("/users/{username}/starred");

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

  /// **List repositories watched by a user**
  ///
  /// Lists repositories a user is watching.
  ///
  /// *Documentation*: [https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user](https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user)
  pub fn list_repos_watched_by_user(
    &self,
    username: impl Into<String>,
  ) -> Request<(), list_repos_watched_by_user::Query, list_repos_watched_by_user::Response> {
    let username = username.into();
    let url = format!("/users/{username}/subscriptions");

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