-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathApiUrls.cs
More file actions
4161 lines (3758 loc) · 181 KB
/
ApiUrls.cs
File metadata and controls
4161 lines (3758 loc) · 181 KB
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
using System;
using System.Diagnostics.CodeAnalysis;
namespace Octokit
{
/// <summary>
/// Class for retrieving GitHub API URLs
/// </summary>
public static partial class ApiUrls
{
static readonly Uri _currentUserRepositoriesUrl = new Uri("user/repos", UriKind.Relative);
static readonly Uri _currentUserOrganizationsUrl = new Uri("user/orgs", UriKind.Relative);
static readonly Uri _currentUserSshKeys = new Uri("user/keys", UriKind.Relative);
static readonly Uri _currentUserGpgKeys = new Uri("user/gpg_keys", UriKind.Relative);
static readonly Uri _currentUserStars = new Uri("user/starred", UriKind.Relative);
static readonly Uri _currentUserWatched = new Uri("user/subscriptions", UriKind.Relative);
static readonly Uri _currentUserEmailsEndpoint = new Uri("user/emails", UriKind.Relative);
static readonly Uri _currentUserNotificationsEndpoint = new Uri("notifications", UriKind.Relative);
static readonly Uri _currentUserAllIssues = new Uri("issues", UriKind.Relative);
static readonly Uri _currentUserOwnedAndMemberIssues = new Uri("user/issues", UriKind.Relative);
/// <summary>
/// Returns the <see cref="Uri"/> that returns all public repositories in
/// response to a GET request.
/// </summary>
public static Uri AllPublicRepositories()
{
return "repositories".FormatUri();
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all public repositories in
/// response to a GET request.
/// </summary>
/// <param name="since">The integer Id of the last Repository that you’ve seen.</param>
public static Uri AllPublicRepositories(long since)
{
return "repositories?since={0}".FormatUri(since);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the repositories for the currently logged in user in
/// response to a GET request. A POST to this URL creates a new repository.
/// </summary>
/// <returns></returns>
public static Uri Repositories()
{
return _currentUserRepositoriesUrl;
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the repositories for the specified login.
/// </summary>
/// <param name="login">The login for the user</param>
/// <returns></returns>
public static Uri Repositories(string login)
{
return "users/{0}/repos".FormatUri(login);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the repositories for the specified organization in
/// response to a GET request. A POST to this URL creates a new repository for the organization.
/// </summary>
/// <param name="organization">The name of the organization</param>
/// <returns></returns>
public static Uri OrganizationRepositories(string organization)
{
return "orgs/{0}/repos".FormatUri(organization);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the organizations for the currently logged in user.
/// </summary>
/// <returns></returns>
public static Uri UserOrganizations()
{
return "user/orgs".FormatUri();
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the organizations for the specified login.
/// </summary>
/// <param name="login">The login for the user</param>
/// <returns></returns>
public static Uri UserOrganizations(string login)
{
return "users/{0}/orgs".FormatUri(login);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the organizations.
/// </summary>
/// <returns></returns>
public static Uri AllOrganizations()
{
return "organizations".FormatUri();
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the organizations.
/// </summary>
/// /// <param name="since">The integer Id of the last Organization that you’ve seen.</param>
/// <returns></returns>
public static Uri AllOrganizations(long since)
{
return "organizations?since={0}".FormatUri(since);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the organization for the specified organization name
/// </summary>
/// <param name="organizationName">The name of the organization</param>
/// <returns>The <see cref="Uri"/> that returns the organization for the specified organization name</returns>
public static Uri Organization(string organizationName)
{
return "orgs/{0}".FormatUri(organizationName);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the SSH keys for the currently logged in user.
/// </summary>
/// <returns></returns>
public static Uri SshKeys()
{
return _currentUserSshKeys;
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the SSH keys for the specified user.
/// </summary>
/// <param name="login">The login for the user</param>
/// <returns></returns>
public static Uri SshKeys(string login)
{
return "users/{0}/keys".FormatUri(login);
}
/// <summary>
/// Returns the <see cref="Uri"/> to retrieve keys for the current user.
/// </summary>
public static Uri Keys()
{
return "user/keys".FormatUri();
}
/// <summary>
/// Returns the <see cref="Uri"/> to retrieve keys for a given user.
/// </summary>
/// <param name="userName">The user to search on</param>
public static Uri Keys(string userName)
{
return "users/{0}/keys".FormatUri(userName);
}
/// <summary>
/// Returns the <see cref="Uri"/> to retrieve a given key.
/// </summary>
/// <param name="id">The Key Id to retrieve</param>
public static Uri Keys(int id)
{
return "user/keys/{0}".FormatUri(id);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the email addresses for the currently logged in user.
/// </summary>
/// <returns></returns>
public static Uri Emails()
{
return _currentUserEmailsEndpoint;
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the releases for the specified repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public static Uri Releases(string owner, string name)
{
return "repos/{0}/{1}/releases".FormatUri(owner, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns a single release for the specified repository
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="id">The id of the release</param>
/// <returns></returns>
public static Uri Releases(string owner, string name, int id)
{
return "repos/{0}/{1}/releases/{2}".FormatUri(owner, name, id);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns a single release for the specified repository
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="tag">The tag of the release</param>
/// <returns></returns>
public static Uri Releases(string owner, string name, string tag)
{
return "repos/{0}/{1}/releases/tags/{2}".FormatUri(owner, name, tag);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the latest release for the specified repository
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public static Uri LatestRelease(string owner, string name)
{
return "repos/{0}/{1}/releases/latest".FormatUri(owner, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all the assets for the specified release for the specified repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="id">The id of the release</param>
/// <returns></returns>
public static Uri ReleaseAssets(string owner, string name, int id)
{
return "repos/{0}/{1}/releases/{2}/assets".FormatUri(owner, name, id);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the assets specified by the asset id.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="id">The id of the release asset</param>
/// <returns></returns>
public static Uri Asset(string owner, string name, int id)
{
return "repos/{0}/{1}/releases/assets/{2}".FormatUri(owner, name, id);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the notifications for the currently logged in user.
/// </summary>
/// <returns></returns>
public static Uri Notifications()
{
return _currentUserNotificationsEndpoint;
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the notifications for the currently logged in user
/// specific to the repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public static Uri Notifications(string owner, string name)
{
return "repos/{0}/{1}/notifications".FormatUri(owner, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the specified notification.
/// </summary>
/// <param name="id">The Id of the notification.</param>
/// <returns></returns>
public static Uri Notification(int id)
{
return "notifications/threads/{0}".FormatUri(id);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the specified notification's subscription status.
/// </summary>
/// <param name="id">The Id of the notification.</param>
public static Uri NotificationSubscription(int id)
{
return "notifications/threads/{0}/subscription".FormatUri(id);
}
/// <summary>
/// Returns the <see cref="Uri"/> for creating a new installation token.
/// </summary>
/// <param name="installationId">The Id of the GitHub App installation.</param>
public static Uri AccessTokens(long installationId)
{
return "app/installations/{0}/access_tokens".FormatUri(installationId);
}
/// <summary>
/// Returns the <see cref="Uri"/> that creates a github app.
/// </summary>
public static Uri App()
{
return "app".FormatUri();
}
/// <summary>
/// Returns the <see cref="Uri"/> that creates a github app.
/// </summary>
public static Uri App(string slug)
{
return "apps/{0}".FormatUri(slug);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all the installations of the authenticated application.
/// </summary>
public static Uri Installations()
{
return "app/installations".FormatUri();
}
/// <summary>
/// Returns the <see cref="Uri"/> that lists repositories accessible to the user for an installation..
/// </summary>
/// <param name="installationId">The id of the installation</param>
public static Uri UserInstallationRepositories(long installationId)
{
return "user/installations/{0}/repositories".FormatUri(installationId);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the repository's installation information.
/// </summary>
/// <returns></returns>
public static Uri RepoInstallation(string owner, string repo)
{
return "repos/{0}/{1}/installation".FormatUri(owner, repo);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the repository's installation information.
/// </summary>
/// <returns></returns>
public static Uri RepoInstallation(long repositoryId)
{
return "repositories/{0}/installation".FormatUri(repositoryId);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the organization's installation information.
/// </summary>
public static Uri OrganizationInstallation(string organization)
{
return "orgs/{0}/installation".FormatUri(organization); ;
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the user's installation information.
/// </summary>
public static Uri UserInstallation(string username)
{
return "users/{0}/installation".FormatUri(username);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns a single installation of the authenticated application.
/// </summary>
public static Uri Installation(long installationId)
{
return "app/installations/{0}".FormatUri(installationId);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all the installations in repositories the user has explicit permission to access
/// </summary>
public static Uri UserInstallations()
{
return "user/installations".FormatUri();
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all the repositories
/// </summary>
/// <returns></returns>
public static Uri InstallationRepositories()
{
return "installation/repositories".FormatUri();
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the issues across all the authenticated user’s visible
/// repositories including owned repositories, member repositories, and organization repositories:
/// </summary>
public static Uri Issues()
{
return _currentUserAllIssues;
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the issues across owned and member repositories for the
/// authenticated user:
/// </summary>
public static Uri IssuesForOwnedAndMember()
{
return _currentUserOwnedAndMemberIssues;
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the issues for the currently logged in user
/// specific to the repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public static Uri Issues(string owner, string name)
{
return "repos/{0}/{1}/issues".FormatUri(owner, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the issues for the specified organization for the
/// currently logged in user.
/// </summary>
/// <param name="organization">The name of the organization</param>
/// <returns></returns>
public static Uri Issues(string organization)
{
return "orgs/{0}/issues".FormatUri(organization);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the specified issue.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
/// <returns></returns>
public static Uri Issue(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}".FormatUri(owner, name, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the specified issue to be locked/unlocked.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
/// <returns></returns>
public static Uri IssueLock(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}/lock".FormatUri(owner, name, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the reaction of a specified issue.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
/// <returns></returns>
public static Uri IssueReactions(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}/reactions".FormatUri(owner, name, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the reaction of a specified issue.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="number">The issue number</param>
/// <returns></returns>
public static Uri IssueReactions(long repositoryId, int number)
{
return "repositories/{0}/issues/{1}/reactions".FormatUri(repositoryId, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the timeline of a specified issue.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="repo">The name of the repository</param>
/// <param name="number">The issue number</param>
/// <returns></returns>
public static Uri IssueTimeline(string owner, string repo, int number)
{
return "repos/{0}/{1}/issues/{2}/timeline".FormatUri(owner, repo, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the timeline of a specified issue.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="number">The issue number</param>
/// <returns></returns>
public static Uri IssueTimeline(long repositoryId, int number)
{
return "repositories/{0}/issues/{1}/timeline".FormatUri(repositoryId, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the comments for all issues in a specific repo.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public static Uri IssueComments(string owner, string name)
{
return "repos/{0}/{1}/issues/comments".FormatUri(owner, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the comments of a specified issue.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
/// <returns></returns>
public static Uri IssueComments(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}/comments".FormatUri(owner, name, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the specified comment.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="id">The comment id</param>
/// <returns></returns>
public static Uri IssueComment(string owner, string name, int id)
{
return "repos/{0}/{1}/issues/comments/{2}".FormatUri(owner, name, id);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the reaction of a specified issue comment.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment number</param>
/// <returns></returns>
public static Uri IssueCommentReactions(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/comments/{2}/reactions".FormatUri(owner, name, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the reaction of a specified issue comment.
/// </summary>
/// <param name="repositoryId">The owner of the repository</param>
/// <param name="number">The comment number</param>
/// <returns></returns>
public static Uri IssueCommentReactions(long repositoryId, int number)
{
return "repositories/{0}/issues/comments/{1}/reactions".FormatUri(repositoryId, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the specified comment.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment number</param>
/// <returns></returns>
public static Uri CommitComment(string owner, string name, int number)
{
return "repos/{0}/{1}/comments/{2}".FormatUri(owner, name, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the comments of a specified commit.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="sha">The sha of the commit</param>
/// <returns></returns>
public static Uri CommitComments(string owner, string name, string sha)
{
return "repos/{0}/{1}/commits/{2}/comments".FormatUri(owner, name, sha);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the comments of a specified commit.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public static Uri CommitComments(string owner, string name)
{
return "repos/{0}/{1}/comments".FormatUri(owner, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the reaction of a specified commit comment.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment number</param>
/// <returns></returns>
public static Uri CommitCommentReactions(string owner, string name, int number)
{
return "repos/{0}/{1}/comments/{2}/reactions".FormatUri(owner, name, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the reaction of a specified commit comment.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="number">The comment number</param>
/// <returns></returns>
public static Uri CommitCommentReactions(long repositoryId, int number)
{
return "repositories/{0}/comments/{1}/reactions".FormatUri(repositoryId, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the assignees to which issues may be assigned.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public static Uri Assignees(string owner, string name)
{
return "repos/{0}/{1}/assignees".FormatUri(owner, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns a 204 if the login belongs to an assignee of the repository.
/// Otherwise returns a 404.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="login">The login for the user</param>
/// <returns></returns>
public static Uri CheckAssignee(string owner, string name, string login)
{
return "repos/{0}/{1}/assignees/{2}".FormatUri(owner, name, login);
}
/// <summary>
/// Returns the <see cref="Uri"/> to add and remove assignees for an issue.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
/// <returns></returns>
public static Uri IssueAssignees(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}/assignees".FormatUri(owner, name, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the members of the organization
/// </summary>
/// <param name="org">The organization</param>
/// <returns></returns>
public static Uri Members(string org)
{
return "orgs/{0}/members".FormatUri(org);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the members of the organization
/// </summary>
/// <param name="org">The organization</param>
/// <param name="filter">The member filter, <see cref="OrganizationMembersFilter"/></param>
/// <returns>The correct uri</returns>
public static Uri Members(string org, OrganizationMembersFilter filter)
{
return "orgs/{0}/members?filter={1}".FormatUri(org, filter.ToParameter());
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the members of the organization
/// </summary>
/// <param name="org">The organization</param>
/// <param name="role">The role filter, <see cref="OrganizationMembersRole"/></param>
/// <returns>The correct uri</returns>
public static Uri Members(string org, OrganizationMembersRole role)
{
return "orgs/{0}/members?role={1}".FormatUri(org, role.ToParameter());
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the members of the organization
/// </summary>
/// <param name="org">The organization</param>
/// <param name="filter">The member filter, <see cref="OrganizationMembersFilter"/></param>
/// <param name="role">The role filter, <see cref="OrganizationMembersRole"/></param>
/// <returns>The correct uri</returns>
public static Uri Members(string org, OrganizationMembersFilter filter, OrganizationMembersRole role)
{
return "orgs/{0}/members?filter={1}&role={2}".FormatUri(org, filter.ToParameter(), role.ToParameter());
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the public members of the organization
/// </summary>
/// <param name="org">Organization</param>
/// <returns></returns>
public static Uri PublicMembers(string org)
{
return "orgs/{0}/public_members".FormatUri(org);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns a 204 if requester is an organization member and
/// the user is, publicly or privately a member of the organization.
/// Returns a 404 if the requester is an organization member and the user is not a member or
/// the requester is not an organization member and is inquiring about themselves.
/// Returns a 302 if the requester is not an organization member.
/// </summary>
/// <param name="org">The organization being inquired about</param>
/// <param name="name">The user being inquired about</param>
/// <returns></returns>
public static Uri CheckMember(string org, string name)
{
return "orgs/{0}/members/{1}".FormatUri(org, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns member of organization
/// </summary>
/// <param name="org">The organization being inquired about</param>
/// <param name="user">The user being inquired about</param>
/// <returns>The <see cref="Uri"/> that returns member of organization</returns>
public static Uri OrganizationMember(string org, string user)
{
return "orgs/{0}/members/{1}".FormatUri(org, user);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns a 204 if the user is a public member of the
/// organization.
/// Otherwise returns a 404.
/// </summary>
/// <param name="org">The organization being inquired about</param>
/// <param name="name">The user being inquired about</param>
/// <returns></returns>
public static Uri CheckMemberPublic(string org, string name)
{
return "orgs/{0}/public_members/{1}".FormatUri(org, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns a 204 if the user is publicizing, or concealing
/// their membership in an organization.
/// </summary>
/// <param name="org">The organization to publicize, or conceal their membership of</param>
/// <param name="name">The user publicizing, or concealing their membership of the organization</param>
/// <returns></returns>
public static Uri OrganizationMembership(string org, string name)
{
return "orgs/{0}/public_members/{1}".FormatUri(org, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the organization memberships
/// </summary>
/// <param name="org">The name of the organization</param>
/// <param name="name">The name of the user</param>
/// <returns></returns>
public static Uri OrganizationMemberships(string org, string name)
{
return "orgs/{0}/memberships/{1}".FormatUri(org, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the organizations pending invitations
/// </summary>
/// <param name="org">The name of the organization</param>
/// <returns></returns>
public static Uri OrganizationPendingInvititations(string org)
{
return "orgs/{0}/invitations".FormatUri(org);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the outside collaborators of the organization
/// </summary>
/// <param name="org">The organization</param>
/// <returns></returns>
public static Uri OutsideCollaborators(string org)
{
return "orgs/{0}/outside_collaborators".FormatUri(org);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the outside collaborators of the organization
/// </summary>
/// <param name="org">The organization</param>
/// <param name="filter">The collaborator filter, <see cref="OrganizationMembersFilter"/></param>
/// <returns>The correct uri</returns>
public static Uri OutsideCollaborators(string org, OrganizationMembersFilter filter)
{
return "orgs/{0}/outside_collaborators?filter={1}".FormatUri(org, filter.ToParameter());
}
public static Uri OutsideCollaborator(string org, string user)
{
return "orgs/{0}/outside_collaborators/{1}".FormatUri(org, user);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the issue/pull request event and issue info for the specified repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public static Uri Events(string owner, string name)
{
return "repos/{0}/{1}/events".FormatUri(owner, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the issue/pull request event info for the specified issue.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
/// <returns></returns>
public static Uri IssuesEvents(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}/events".FormatUri(owner, name, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the issue/pull request event and issue info for the specified repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public static Uri IssuesEvents(string owner, string name)
{
return "repos/{0}/{1}/issues/events".FormatUri(owner, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the issue/pull request event and issue info for the specified event.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="id">The event id</param>
/// <returns></returns>
public static Uri IssuesEvent(string owner, string name, long id)
{
return "repos/{0}/{1}/issues/events/{2}".FormatUri(owner, name, id);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the specified milestone.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The milestone number</param>
/// <returns></returns>
public static Uri Milestone(string owner, string name, int number)
{
return "repos/{0}/{1}/milestones/{2}".FormatUri(owner, name, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the milestones for the specified repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public static Uri Milestones(string owner, string name)
{
return "repos/{0}/{1}/milestones".FormatUri(owner, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the specified label.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="labelName">The name of label</param>
/// <returns></returns>
public static Uri Label(string owner, string name, string labelName)
{
return "repos/{0}/{1}/labels/{2}".FormatUri(owner, name, labelName);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the labels for the specified repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public static Uri Labels(string owner, string name)
{
return "repos/{0}/{1}/labels".FormatUri(owner, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns the named label for the specified issue.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
/// <param name="labelName">The name of the label</param>
/// <returns></returns>
public static Uri IssueLabel(string owner, string name, int number, string labelName)
{
return "repos/{0}/{1}/issues/{2}/labels/{3}".FormatUri(owner, name, number, labelName);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the labels for the specified issue.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
/// <returns></returns>
public static Uri IssueLabels(string owner, string name, int number)
{
return "repos/{0}/{1}/issues/{2}/labels".FormatUri(owner, name, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> that returns all of the labels for all issues in the specified milestone.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The milestone number</param>
/// <returns></returns>
public static Uri MilestoneLabels(string owner, string name, int number)
{
return "repos/{0}/{1}/milestones/{2}/labels".FormatUri(owner, name, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> to use when creating a commit status for the specified reference.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns></returns>
public static Uri CreateCommitStatus(string owner, string name, string reference)
{
return "repos/{0}/{1}/statuses/{2}".FormatUri(owner, name, reference);
}
/// <summary>
/// Returns the <see cref="Uri"/> that lists the repository hooks for the specified reference.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public static Uri RepositoryHooks(string owner, string name)
{
return "repos/{0}/{1}/hooks".FormatUri(owner, name);
}
/// <summary>
/// Returns the <see cref="Uri"/> that gets the repository hook for the specified reference.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="hookId">The identifier of the repository hook</param>
/// <returns></returns>
public static Uri RepositoryHookById(string owner, string name, int hookId)
{
return "repos/{0}/{1}/hooks/{2}".FormatUri(owner, name, hookId);
}
/// <summary>
/// Returns the <see cref="Uri"/> that can tests a specified repository hook
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="hookId">The identifier of the repository hook</param>
/// <returns></returns>
public static Uri RepositoryHookTest(string owner, string name, int hookId)
{
return "repos/{0}/{1}/hooks/{2}/tests".FormatUri(owner, name, hookId);
}
/// <summary>
/// Returns the <see cref="Uri"/> that can ping a specified repository hook
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="hookId">The identifier of the repository hook</param>
/// <returns></returns>
public static Uri RepositoryHookPing(string owner, string name, int hookId)
{
return "repos/{0}/{1}/hooks/{2}/pings".FormatUri(owner, name, hookId);
}
/// <summary>
/// Returns the <see cref="Uri"/> that lists the commit statuses for the specified reference.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns></returns>
public static Uri CommitStatuses(string owner, string name, string reference)
{
return "repos/{0}/{1}/commits/{2}/statuses".FormatUri(owner, name, reference);
}
/// <summary>