octocrate 0.3.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
use octocrate_core::*;
#[allow(unused_imports)]
use crate::types::*;

/// Interact with and view information about users and also current user.
pub struct GitHubUsersAPI {
  config: SharedAPIConfig,
}

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

  /// *** List SSH signing keys for the authenticated user ***
  ///
  /// Lists the SSH signing keys for the authenticated user's GitHub account.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user](https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user)
  pub fn list_ssh_signing_keys_for_authenticated_user(
    &self,
  ) -> Request<(), UsersListSshSigningKeysForAuthenticatedUserQuery, SSHSigningKeyArray> {
    let url = format!("/user/ssh_signing_keys");

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

  /// *** Create a SSH signing key for the authenticated user ***
  ///
  /// Creates an SSH signing key for the authenticated user's GitHub account.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `write:ssh_signing_key` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user](https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user)
  pub fn create_ssh_signing_key_for_authenticated_user(
    &self,
  ) -> Request<UsersCreateSshSigningKeyForAuthenticatedUserRequest, (), SSHSigningKey> {
    let url = format!("/user/ssh_signing_keys");

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

  /// *** List email addresses for the authenticated user ***
  ///
  /// Lists all of your email addresses, and specifies which one is visible
  /// to the public.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user](https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user)
  pub fn list_emails_for_authenticated_user(
    &self,
  ) -> Request<(), UsersListEmailsForAuthenticatedUserQuery, EmailArray> {
    let url = format!("/user/emails");

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

  /// *** Add an email address for the authenticated user ***
  ///
  /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user](https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user)
  pub fn add_email_for_authenticated_user(
    &self,
  ) -> Request<UsersAddEmailForAuthenticatedUserRequest, (), EmailArray> {
    let url = format!("/user/emails");

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

  /// *** Delete an email address for the authenticated user ***
  ///
  /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user](https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user)
  pub fn delete_email_for_authenticated_user(
    &self,
  ) -> NoContentRequest<UsersDeleteEmailForAuthenticatedUserRequest, ()> {
    let url = format!("/user/emails");

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

  /// *** List public email addresses for the authenticated user ***
  ///
  /// Lists your publicly visible email address, which you can set with the
  /// [Set primary email visibility for the authenticated user](https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user)
  /// endpoint.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user](https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user)
  pub fn list_public_emails_for_authenticated_user(
    &self,
  ) -> Request<(), UsersListPublicEmailsForAuthenticatedUserQuery, EmailArray> {
    let url = format!("/user/public_emails");

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

  /// *** Check if a user is blocked by the authenticated user ***
  ///
  /// Returns a 204 if the given user is blocked by the authenticated user. Returns a 404 if the given user is not blocked by the authenticated user, or if the given user account has been identified as spam by GitHub.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user](https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user)
  pub fn check_blocked(
    &self,
    username: impl Into<String>,
  ) -> NoContentRequest<(), ()> {
    let username = username.into();
    let url = format!("/user/blocks/{username}");

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

  /// *** Block a user ***
  ///
  /// Blocks the given user and returns a 204. If the authenticated user cannot block the given user a 422 is returned.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/blocking#block-a-user](https://docs.github.com/rest/users/blocking#block-a-user)
  pub fn block(
    &self,
    username: impl Into<String>,
  ) -> NoContentRequest<(), ()> {
    let username = username.into();
    let url = format!("/user/blocks/{username}");

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

  /// *** Unblock a user ***
  ///
  /// Unblocks the given user and returns a 204.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/blocking#unblock-a-user](https://docs.github.com/rest/users/blocking#unblock-a-user)
  pub fn unblock(
    &self,
    username: impl Into<String>,
  ) -> NoContentRequest<(), ()> {
    let username = username.into();
    let url = format!("/user/blocks/{username}");

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

  /// *** List followers of a user ***
  ///
  /// Lists the people following the specified user.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/followers#list-followers-of-a-user](https://docs.github.com/rest/users/followers#list-followers-of-a-user)
  pub fn list_followers_for_user(
    &self,
    username: impl Into<String>,
  ) -> Request<(), UsersListFollowersForUserQuery, SimpleUserArray> {
    let username = username.into();
    let url = format!("/users/{username}/followers");

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

  /// *** List GPG keys for the authenticated user ***
  ///
  /// Lists the current user's GPG keys.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user](https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user)
  pub fn list_gpg_keys_for_authenticated_user(
    &self,
  ) -> Request<(), UsersListGpgKeysForAuthenticatedUserQuery, GPGKeyArray> {
    let url = format!("/user/gpg_keys");

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

  /// *** Create a GPG key for the authenticated user ***
  ///
  /// Adds a GPG key to the authenticated user's GitHub account.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user](https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user)
  pub fn create_gpg_key_for_authenticated_user(
    &self,
  ) -> Request<UsersCreateGpgKeyForAuthenticatedUserRequest, (), GPGKey> {
    let url = format!("/user/gpg_keys");

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

  /// *** List GPG keys for a user ***
  ///
  /// Lists the GPG keys for a user. This information is accessible by anyone.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user](https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user)
  pub fn list_gpg_keys_for_user(
    &self,
    username: impl Into<String>,
  ) -> Request<(), UsersListGpgKeysForUserQuery, GPGKeyArray> {
    let username = username.into();
    let url = format!("/users/{username}/gpg_keys");

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

  /// *** List the people the authenticated user follows ***
  ///
  /// Lists the people who the authenticated user follows.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows](https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows)
  pub fn list_followed_by_authenticated_user(
    &self,
  ) -> Request<(), UsersListFollowedByAuthenticatedUserQuery, SimpleUserArray> {
    let url = format!("/user/following");

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

  /// *** List public keys for a user ***
  ///
  /// Lists the _verified_ public SSH keys for a user. This is accessible by anyone.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/keys#list-public-keys-for-a-user](https://docs.github.com/rest/users/keys#list-public-keys-for-a-user)
  pub fn list_public_keys_for_user(
    &self,
    username: impl Into<String>,
  ) -> Request<(), UsersListPublicKeysForUserQuery, KeySimpleArray> {
    let username = username.into();
    let url = format!("/users/{username}/keys");

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

  /// *** Get a public SSH key for the authenticated user ***
  ///
  /// View extended details for a single public SSH key.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user](https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user)
  pub fn get_public_ssh_key_for_authenticated_user(
    &self,
    key_id: impl Into<i64>,
  ) -> Request<(), (), Key> {
    let key_id = key_id.into();
    let url = format!("/user/keys/{key_id}");

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

  /// *** Delete a public SSH key for the authenticated user ***
  ///
  /// Removes a public SSH key from the authenticated user's GitHub account.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `admin:public_key` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user](https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user)
  pub fn delete_public_ssh_key_for_authenticated_user(
    &self,
    key_id: impl Into<i64>,
  ) -> NoContentRequest<(), ()> {
    let key_id = key_id.into();
    let url = format!("/user/keys/{key_id}");

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

  /// *** Check if a user follows another user ***
  ///
  /// 
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user](https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user)
  pub fn check_following_for_user(
    &self,
    username: impl Into<String>,
    target_user: impl Into<String>,
  ) -> NoContentRequest<(), ()> {
    let username = username.into();
    let target_user = target_user.into();
    let url = format!("/users/{username}/following/{target_user}");

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

  /// *** List followers of the authenticated user ***
  ///
  /// Lists the people following the authenticated user.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user](https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user)
  pub fn list_followers_for_authenticated_user(
    &self,
  ) -> Request<(), UsersListFollowersForAuthenticatedUserQuery, SimpleUserArray> {
    let url = format!("/user/followers");

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

  /// *** Get a user ***
  ///
  /// Provides publicly available information about someone with a GitHub account.
  /// 
  /// The `email` key in the following response is the publicly visible email address from your GitHub [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub. For more information, see [Authentication](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#authentication).
  /// 
  /// The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/rest/users/emails)".
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/users#get-a-user](https://docs.github.com/rest/users/users#get-a-user)
  pub fn get_by_username(
    &self,
    username: impl Into<String>,
  ) -> Request<(), (), UsersGetByUsernameResponse> {
    let username = username.into();
    let url = format!("/users/{username}");

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

  /// *** Get contextual information for a user ***
  ///
  /// Provides hovercard information. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations.
  /// 
  ///   The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository, you would use a `subject_type` value of `repository` and a `subject_id` value of `1300192` (the ID of the `Spoon-Knife` repository).
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/users#get-contextual-information-for-a-user](https://docs.github.com/rest/users/users#get-contextual-information-for-a-user)
  pub fn get_context_for_user(
    &self,
    username: impl Into<String>,
  ) -> Request<(), UsersGetContextForUserQuery, Hovercard> {
    let username = username.into();
    let url = format!("/users/{username}/hovercard");

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

  /// *** List the people a user follows ***
  ///
  /// Lists the people who the specified user follows.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/followers#list-the-people-a-user-follows](https://docs.github.com/rest/users/followers#list-the-people-a-user-follows)
  pub fn list_following_for_user(
    &self,
    username: impl Into<String>,
  ) -> Request<(), UsersListFollowingForUserQuery, SimpleUserArray> {
    let username = username.into();
    let url = format!("/users/{username}/following");

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

  /// *** List SSH signing keys for a user ***
  ///
  /// Lists the SSH signing keys for a user. This operation is accessible by anyone.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user](https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user)
  pub fn list_ssh_signing_keys_for_user(
    &self,
    username: impl Into<String>,
  ) -> Request<(), UsersListSshSigningKeysForUserQuery, SSHSigningKeyArray> {
    let username = username.into();
    let url = format!("/users/{username}/ssh_signing_keys");

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

  /// *** Get an SSH signing key for the authenticated user ***
  ///
  /// Gets extended details for an SSH signing key.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user](https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user)
  pub fn get_ssh_signing_key_for_authenticated_user(
    &self,
    ssh_signing_key_id: impl Into<i64>,
  ) -> Request<(), (), SSHSigningKey> {
    let ssh_signing_key_id = ssh_signing_key_id.into();
    let url = format!("/user/ssh_signing_keys/{ssh_signing_key_id}");

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

  /// *** Delete an SSH signing key for the authenticated user ***
  ///
  /// Deletes an SSH signing key from the authenticated user's GitHub account.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `admin:ssh_signing_key` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user](https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user)
  pub fn delete_ssh_signing_key_for_authenticated_user(
    &self,
    ssh_signing_key_id: impl Into<i64>,
  ) -> NoContentRequest<(), ()> {
    let ssh_signing_key_id = ssh_signing_key_id.into();
    let url = format!("/user/ssh_signing_keys/{ssh_signing_key_id}");

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

  /// *** List users ***
  ///
  /// Lists all users, in the order that they signed up on GitHub. This list includes personal user accounts and organization accounts.
  /// 
  /// Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of users.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/users#list-users](https://docs.github.com/rest/users/users#list-users)
  pub fn list(
    &self,
  ) -> Request<(), UsersListQuery, SimpleUserArray> {
    let url = format!("/users");

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

  /// *** List social accounts for a user ***
  ///
  /// Lists social media accounts for a user. This endpoint is accessible by anyone.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user](https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user)
  pub fn list_social_accounts_for_user(
    &self,
    username: impl Into<String>,
  ) -> Request<(), UsersListSocialAccountsForUserQuery, SocialAccountArray> {
    let username = username.into();
    let url = format!("/users/{username}/social_accounts");

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

  /// *** List public SSH keys for the authenticated user ***
  ///
  /// Lists the public SSH keys for the authenticated user's GitHub account.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user](https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user)
  pub fn list_public_ssh_keys_for_authenticated_user(
    &self,
  ) -> Request<(), UsersListPublicSshKeysForAuthenticatedUserQuery, KeyArray> {
    let url = format!("/user/keys");

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

  /// *** Create a public SSH key for the authenticated user ***
  ///
  /// Adds a public SSH key to the authenticated user's GitHub account.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user](https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user)
  pub fn create_public_ssh_key_for_authenticated_user(
    &self,
  ) -> Request<UsersCreatePublicSshKeyForAuthenticatedUserRequest, (), Key> {
    let url = format!("/user/keys");

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

  /// *** List users blocked by the authenticated user ***
  ///
  /// List the users you've blocked on your personal account.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user](https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user)
  pub fn list_blocked_by_authenticated_user(
    &self,
  ) -> Request<(), UsersListBlockedByAuthenticatedUserQuery, SimpleUserArray> {
    let url = format!("/user/blocks");

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

  /// *** Set primary email visibility for the authenticated user ***
  ///
  /// Sets the visibility for your primary email addresses.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user](https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user)
  pub fn set_primary_email_visibility_for_authenticated_user(
    &self,
  ) -> Request<UsersSetPrimaryEmailVisibilityForAuthenticatedUserRequest, (), EmailArray> {
    let url = format!("/user/email/visibility");

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

  /// *** Get a GPG key for the authenticated user ***
  ///
  /// View extended details for a single GPG key.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user](https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user)
  pub fn get_gpg_key_for_authenticated_user(
    &self,
    gpg_key_id: impl Into<i64>,
  ) -> Request<(), (), GPGKey> {
    let gpg_key_id = gpg_key_id.into();
    let url = format!("/user/gpg_keys/{gpg_key_id}");

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

  /// *** Delete a GPG key for the authenticated user ***
  ///
  /// Removes a GPG key from the authenticated user's GitHub account.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `admin:gpg_key` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user](https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user)
  pub fn delete_gpg_key_for_authenticated_user(
    &self,
    gpg_key_id: impl Into<i64>,
  ) -> NoContentRequest<(), ()> {
    let gpg_key_id = gpg_key_id.into();
    let url = format!("/user/gpg_keys/{gpg_key_id}");

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

  /// *** Check if a person is followed by the authenticated user ***
  ///
  /// 
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user](https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user)
  pub fn check_person_is_followed_by_authenticated(
    &self,
    username: impl Into<String>,
  ) -> NoContentRequest<(), ()> {
    let username = username.into();
    let url = format!("/user/following/{username}");

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

  /// *** Follow a user ***
  ///
  /// Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method)."
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `user:follow` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/followers#follow-a-user](https://docs.github.com/rest/users/followers#follow-a-user)
  pub fn follow(
    &self,
    username: impl Into<String>,
  ) -> NoContentRequest<(), ()> {
    let username = username.into();
    let url = format!("/user/following/{username}");

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

  /// *** Unfollow a user ***
  ///
  /// OAuth app tokens and personal access tokens (classic) need the `user:follow` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/followers#unfollow-a-user](https://docs.github.com/rest/users/followers#unfollow-a-user)
  pub fn unfollow(
    &self,
    username: impl Into<String>,
  ) -> NoContentRequest<(), ()> {
    let username = username.into();
    let url = format!("/user/following/{username}");

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

  /// *** List social accounts for the authenticated user ***
  ///
  /// Lists all of your social accounts.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user](https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user)
  pub fn list_social_accounts_for_authenticated_user(
    &self,
  ) -> Request<(), UsersListSocialAccountsForAuthenticatedUserQuery, SocialAccountArray> {
    let url = format!("/user/social_accounts");

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

  /// *** Add social accounts for the authenticated user ***
  ///
  /// Add one or more social accounts to the authenticated user's profile.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user](https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user)
  pub fn add_social_account_for_authenticated_user(
    &self,
  ) -> Request<UsersAddSocialAccountForAuthenticatedUserRequest, (), SocialAccountArray> {
    let url = format!("/user/social_accounts");

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

  /// *** Delete social accounts for the authenticated user ***
  ///
  /// Deletes one or more social accounts from the authenticated user's profile.
  /// 
  /// OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user](https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user)
  pub fn delete_social_account_for_authenticated_user(
    &self,
  ) -> NoContentRequest<UsersDeleteSocialAccountForAuthenticatedUserRequest, ()> {
    let url = format!("/user/social_accounts");

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

  /// *** Get the authenticated user ***
  ///
  /// OAuth app tokens and personal access tokens (classic) need the `user` scope in order for the response to include private profile information.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/users#get-the-authenticated-user](https://docs.github.com/rest/users/users#get-the-authenticated-user)
  pub fn get_authenticated(
    &self,
  ) -> Request<(), (), UsersGetAuthenticatedResponse> {
    let url = format!("/user");

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

  /// *** Update the authenticated user ***
  ///
  /// **Note:** If your email is set to private and you send an `email` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API.
  ///
  /// *Documentation*: [https://docs.github.com/rest/users/users#update-the-authenticated-user](https://docs.github.com/rest/users/users#update-the-authenticated-user)
  pub fn update_authenticated(
    &self,
  ) -> Request<UsersUpdateAuthenticatedRequest, (), PrivateUser> {
    let url = format!("/user");

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


}