-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.gen.go
5949 lines (4976 loc) · 281 KB
/
client.gen.go
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
// Code generated by github.com/connormckelvey/go-github-mockable/cmd/generate. DO NOT EDIT.
package gogithubmockable
import (
"context"
github "github.com/google/go-github/v48/github"
"io"
"net/http"
"net/url"
"os"
"time"
)
/*
A Client manages communication with the GitHub API.
*/
type Client struct {
client *github.Client
}
func NewClient(client *github.Client) *Client {
c := new(Client)
c.client = client
return c
}
/*
GetBaseURL returns the Base URL for API requests. Defaults to the public GitHub API, but can be
set to a domain endpoint to use with GitHub Enterprise. BaseURL should
always be specified with a trailing slash.
*/
func (c *Client) GetBaseURL() *url.URL {
return c.client.BaseURL
}
/*
SetBaseURL sets the Base URL for API requests. Defaults to the public GitHub API, but can be
set to a domain endpoint to use with GitHub Enterprise. BaseURL should
always be specified with a trailing slash.
*/
func (c *Client) SetBaseURL(baseurl *url.URL) {
c.client.BaseURL = baseurl
}
/*
GetUploadURL returns the Base URL for uploading files.
*/
func (c *Client) GetUploadURL() *url.URL {
return c.client.UploadURL
}
/*
SetUploadURL sets the Base URL for uploading files.
*/
func (c *Client) SetUploadURL(uploadurl *url.URL) {
c.client.UploadURL = uploadurl
}
/*
GetUserAgent returns the User agent used when communicating with the GitHub API.
*/
func (c *Client) GetUserAgent() string {
return c.client.UserAgent
}
/*
SetUserAgent sets the User agent used when communicating with the GitHub API.
*/
func (c *Client) SetUserAgent(useragent string) {
c.client.UserAgent = useragent
}
/*
ActionsService handles communication with the actions related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/actions/
*/
func (c *Client) Actions() ActionsService {
return c.client.Actions
}
/*
ActivityService handles communication with the activity related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/activity/
*/
func (c *Client) Activity() ActivityService {
return c.client.Activity
}
/*
AdminService handles communication with the admin related methods of the
GitHub API. These API routes are normally only accessible for GitHub
Enterprise installations.
GitHub API docs: https://docs.github.com/en/rest/enterprise-admin
*/
func (c *Client) Admin() AdminService {
return c.client.Admin
}
/*
AppsService provides access to the installation related functions
in the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/apps/
*/
func (c *Client) Apps() AppsService {
return c.client.Apps
}
/*
AuthorizationsService handles communication with the authorization related
methods of the GitHub API.
This service requires HTTP Basic Authentication; it cannot be accessed using
an OAuth token.
GitHub API docs: https://docs.github.com/en/rest/oauth-authorizations
*/
func (c *Client) Authorizations() AuthorizationsService {
return c.client.Authorizations
}
/*
BillingService provides access to the billing related functions
in the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/billing
*/
func (c *Client) Billing() BillingService {
return c.client.Billing
}
/*
ChecksService provides access to the Checks API in the
GitHub API.
GitHub API docs: https://docs.github.com/en/rest/checks/
*/
func (c *Client) Checks() ChecksService {
return c.client.Checks
}
/*
CodeScanningService handles communication with the code scanning related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/code-scanning
*/
func (c *Client) CodeScanning() CodeScanningService {
return c.client.CodeScanning
}
/*
DependabotService handles communication with the Dependabot related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/dependabot/
*/
func (c *Client) Dependabot() DependabotService {
return c.client.Dependabot
}
/*
EnterpriseService provides access to the enterprise related functions
in the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/
*/
func (c *Client) Enterprise() EnterpriseService {
return c.client.Enterprise
}
/*
GistsService handles communication with the Gist related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/gists
*/
func (c *Client) Gists() GistsService {
return c.client.Gists
}
/*
GitService handles communication with the git data related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/git/
*/
func (c *Client) Git() GitService {
return c.client.Git
}
/*
GitignoresService provides access to the gitignore related functions in the
GitHub API.
GitHub API docs: https://docs.github.com/en/rest/gitignore/
*/
func (c *Client) Gitignores() GitignoresService {
return c.client.Gitignores
}
/*
InteractionsService handles communication with the repository and organization related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/interactions/
*/
func (c *Client) Interactions() InteractionsService {
return c.client.Interactions
}
/*
IssueImportService handles communication with the issue import related
methods of the Issue Import GitHub API.
*/
func (c *Client) IssueImport() IssueImportService {
return c.client.IssueImport
}
/*
IssuesService handles communication with the issue related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/issues/
*/
func (c *Client) Issues() IssuesService {
return c.client.Issues
}
/*
LicensesService handles communication with the license related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/licenses/
*/
func (c *Client) Licenses() LicensesService {
return c.client.Licenses
}
/*
MarketplaceService handles communication with the marketplace related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/apps#marketplace
*/
func (c *Client) Marketplace() MarketplaceService {
return c.client.Marketplace
}
func (c *Client) Migrations() MigrationsService {
return c.client.Migrations
}
/*
OrganizationsService provides access to the organization related functions
in the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/orgs/
*/
func (c *Client) Organizations() OrganizationsService {
return c.client.Organizations
}
/*
ProjectsService provides access to the projects functions in the
GitHub API.
GitHub API docs: https://docs.github.com/en/rest/projects
*/
func (c *Client) Projects() ProjectsService {
return c.client.Projects
}
/*
PullRequestsService handles communication with the pull request related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/pulls/
*/
func (c *Client) PullRequests() PullRequestsService {
return c.client.PullRequests
}
/*
ReactionsService provides access to the reactions-related functions in the
GitHub API.
GitHub API docs: https://docs.github.com/en/rest/reactions
*/
func (c *Client) Reactions() ReactionsService {
return c.client.Reactions
}
/*
RepositoriesService handles communication with the repository related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/repos/
*/
func (c *Client) Repositories() RepositoriesService {
return c.client.Repositories
}
/*
SCIMService provides access to SCIM related functions in the
GitHub API.
GitHub API docs: https://docs.github.com/en/rest/scim
*/
func (c *Client) SCIM() SCIMService {
return c.client.SCIM
}
/*
SearchService provides access to the search related functions
in the GitHub API.
Each method takes a query string defining the search keywords and any search qualifiers.
For example, when searching issues, the query "gopher is:issue language:go" will search
for issues containing the word "gopher" in Go repositories. The method call
opts := &github.SearchOptions{Sort: "created", Order: "asc"}
cl.Search.Issues(ctx, "gopher is:issue language:go", opts)
will search for such issues, sorting by creation date in ascending order
(i.e., oldest first).
If query includes multiple conditions, it MUST NOT include "+" as the condition separator.
You have to use " " as the separator instead.
For example, querying with "language:c++" and "leveldb", then query should be
"language:c++ leveldb" but not "language:c+++leveldb".
GitHub API docs: https://docs.github.com/en/rest/search/
*/
func (c *Client) Search() SearchService {
return c.client.Search
}
/*
SecretScanningService handles communication with the secret scanning related
methods of the GitHub API.
*/
func (c *Client) SecretScanning() SecretScanningService {
return c.client.SecretScanning
}
/*
TeamsService provides access to the team-related functions
in the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/teams/
*/
func (c *Client) Teams() TeamsService {
return c.client.Teams
}
/*
UsersService handles communication with the user related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/users/
*/
func (c *Client) Users() UsersService {
return c.client.Users
}
/*
APIMeta returns information about GitHub.com, the service. Or, if you access
this endpoint on your organization’s GitHub Enterprise installation, this
endpoint provides information about that installation.
GitHub API docs: https://docs.github.com/en/rest/meta#get-github-meta-information
*/
func (c *Client) APIMeta(ctx context.Context) (*github.APIMeta, *github.Response, error) {
return c.client.APIMeta(ctx)
}
/*
BareDo sends an API request and lets you handle the api response. If an error
or API Error occurs, the error will contain more information. Otherwise you
are supposed to read and close the response's Body. If rate limit is exceeded
and reset time is in the future, BareDo returns *RateLimitError immediately
without making a network API call.
The provided ctx must be non-nil, if it is nil an error is returned. If it is
canceled or times out, ctx.Err() will be returned.
*/
func (c *Client) BareDo(ctx context.Context, req *http.Request) (*github.Response, error) {
return c.client.BareDo(ctx, req)
}
/*
Client returns the http.Client used by this GitHub client.
*/
func (c *Client) Client() *http.Client {
return c.client.Client()
}
/*
Do sends an API request and returns the API response. The API response is
JSON decoded and stored in the value pointed to by v, or returned as an
error if an API error has occurred. If v implements the io.Writer interface,
the raw response body will be written to v, without attempting to first
decode it. If v is nil, and no error hapens, the response is returned as is.
If rate limit is exceeded and reset time is in the future, Do returns
*RateLimitError immediately without making a network API call.
The provided ctx must be non-nil, if it is nil an error is returned. If it
is canceled or times out, ctx.Err() will be returned.
*/
func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*github.Response, error) {
return c.client.Do(ctx, req, v)
}
/*
GetCodeOfConduct returns an individual code of conduct.
https://docs.github.com/en/rest/codes_of_conduct/#get-an-individual-code-of-conduct
*/
func (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*github.CodeOfConduct, *github.Response, error) {
return c.client.GetCodeOfConduct(ctx, key)
}
/*
ListCodesOfConduct returns all codes of conduct.
GitHub API docs: https://docs.github.com/en/rest/codes_of_conduct/#list-all-codes-of-conduct
*/
func (c *Client) ListCodesOfConduct(ctx context.Context) ([]*github.CodeOfConduct, *github.Response, error) {
return c.client.ListCodesOfConduct(ctx)
}
/*
ListEmojis returns the emojis available to use on GitHub.
GitHub API docs: https://docs.github.com/en/rest/emojis/
*/
func (c *Client) ListEmojis(ctx context.Context) (map[string]string, *github.Response, error) {
return c.client.ListEmojis(ctx)
}
/*
ListServiceHooks lists all of the available service hooks.
GitHub API docs: https://developer.github.com/webhooks/#services
*/
func (c *Client) ListServiceHooks(ctx context.Context) ([]*github.ServiceHook, *github.Response, error) {
return c.client.ListServiceHooks(ctx)
}
/*
Markdown renders an arbitrary Markdown document.
GitHub API docs: https://docs.github.com/en/rest/markdown/
*/
func (c *Client) Markdown(ctx context.Context, text string, opts *github.MarkdownOptions) (string, *github.Response, error) {
return c.client.Markdown(ctx, text, opts)
}
/*
NewFormRequest creates an API request. A relative URL can be provided in urlStr,
in which case it is resolved relative to the BaseURL of the Client.
Relative URLs should always be specified without a preceding slash.
Body is sent with Content-Type: application/x-www-form-urlencoded.
*/
func (c *Client) NewFormRequest(urlStr string, body io.Reader) (*http.Request, error) {
return c.client.NewFormRequest(urlStr, body)
}
/*
NewRequest creates an API request. A relative URL can be provided in urlStr,
in which case it is resolved relative to the BaseURL of the Client.
Relative URLs should always be specified without a preceding slash. If
specified, the value pointed to by body is JSON encoded and included as the
request body.
*/
func (c *Client) NewRequest(method string, urlStr string, body interface{}) (*http.Request, error) {
return c.client.NewRequest(method, urlStr, body)
}
/*
NewUploadRequest creates an upload request. A relative URL can be provided in
urlStr, in which case it is resolved relative to the UploadURL of the Client.
Relative URLs should always be specified without a preceding slash.
*/
func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string) (*http.Request, error) {
return c.client.NewUploadRequest(urlStr, reader, size, mediaType)
}
/*
Octocat returns an ASCII art octocat with the specified message in a speech
bubble. If message is empty, a random zen phrase is used.
*/
func (c *Client) Octocat(ctx context.Context, message string) (string, *github.Response, error) {
return c.client.Octocat(ctx, message)
}
/*
RateLimits returns the rate limits for the current client.
*/
func (c *Client) RateLimits(ctx context.Context) (*github.RateLimits, *github.Response, error) {
return c.client.RateLimits(ctx)
}
/*
Zen returns a random line from The Zen of GitHub.
see also: http://warpspire.com/posts/taste/
*/
func (c *Client) Zen(ctx context.Context) (string, *github.Response, error) {
return c.client.Zen(ctx)
}
type ClientAPI interface {
/*
GetBaseURL returns the Base URL for API requests. Defaults to the public GitHub API, but can be
set to a domain endpoint to use with GitHub Enterprise. BaseURL should
always be specified with a trailing slash.
*/
GetBaseURL() *url.URL
/*
SetBaseURL sets the Base URL for API requests. Defaults to the public GitHub API, but can be
set to a domain endpoint to use with GitHub Enterprise. BaseURL should
always be specified with a trailing slash.
*/
SetBaseURL(*url.URL)
/*
GetUploadURL returns the Base URL for uploading files.
*/
GetUploadURL() *url.URL
/*
SetUploadURL sets the Base URL for uploading files.
*/
SetUploadURL(*url.URL)
/*
GetUserAgent returns the User agent used when communicating with the GitHub API.
*/
GetUserAgent() string
/*
SetUserAgent sets the User agent used when communicating with the GitHub API.
*/
SetUserAgent(string)
/*
ActionsService handles communication with the actions related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/actions/
*/
Actions() ActionsService
/*
ActivityService handles communication with the activity related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/activity/
*/
Activity() ActivityService
/*
AdminService handles communication with the admin related methods of the
GitHub API. These API routes are normally only accessible for GitHub
Enterprise installations.
GitHub API docs: https://docs.github.com/en/rest/enterprise-admin
*/
Admin() AdminService
/*
AppsService provides access to the installation related functions
in the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/apps/
*/
Apps() AppsService
/*
AuthorizationsService handles communication with the authorization related
methods of the GitHub API.
This service requires HTTP Basic Authentication; it cannot be accessed using
an OAuth token.
GitHub API docs: https://docs.github.com/en/rest/oauth-authorizations
*/
Authorizations() AuthorizationsService
/*
BillingService provides access to the billing related functions
in the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/billing
*/
Billing() BillingService
/*
ChecksService provides access to the Checks API in the
GitHub API.
GitHub API docs: https://docs.github.com/en/rest/checks/
*/
Checks() ChecksService
/*
CodeScanningService handles communication with the code scanning related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/code-scanning
*/
CodeScanning() CodeScanningService
/*
DependabotService handles communication with the Dependabot related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/dependabot/
*/
Dependabot() DependabotService
/*
EnterpriseService provides access to the enterprise related functions
in the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/enterprise-admin/
*/
Enterprise() EnterpriseService
/*
GistsService handles communication with the Gist related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/gists
*/
Gists() GistsService
/*
GitService handles communication with the git data related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/git/
*/
Git() GitService
/*
GitignoresService provides access to the gitignore related functions in the
GitHub API.
GitHub API docs: https://docs.github.com/en/rest/gitignore/
*/
Gitignores() GitignoresService
/*
InteractionsService handles communication with the repository and organization related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/interactions/
*/
Interactions() InteractionsService
/*
IssueImportService handles communication with the issue import related
methods of the Issue Import GitHub API.
*/
IssueImport() IssueImportService
/*
IssuesService handles communication with the issue related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/issues/
*/
Issues() IssuesService
/*
LicensesService handles communication with the license related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/licenses/
*/
Licenses() LicensesService
/*
MarketplaceService handles communication with the marketplace related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/apps#marketplace
*/
Marketplace() MarketplaceService
Migrations() MigrationsService
/*
OrganizationsService provides access to the organization related functions
in the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/orgs/
*/
Organizations() OrganizationsService
/*
ProjectsService provides access to the projects functions in the
GitHub API.
GitHub API docs: https://docs.github.com/en/rest/projects
*/
Projects() ProjectsService
/*
PullRequestsService handles communication with the pull request related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/pulls/
*/
PullRequests() PullRequestsService
/*
ReactionsService provides access to the reactions-related functions in the
GitHub API.
GitHub API docs: https://docs.github.com/en/rest/reactions
*/
Reactions() ReactionsService
/*
RepositoriesService handles communication with the repository related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/repos/
*/
Repositories() RepositoriesService
/*
SCIMService provides access to SCIM related functions in the
GitHub API.
GitHub API docs: https://docs.github.com/en/rest/scim
*/
SCIM() SCIMService
/*
SearchService provides access to the search related functions
in the GitHub API.
Each method takes a query string defining the search keywords and any search qualifiers.
For example, when searching issues, the query "gopher is:issue language:go" will search
for issues containing the word "gopher" in Go repositories. The method call
opts := &github.SearchOptions{Sort: "created", Order: "asc"}
cl.Search.Issues(ctx, "gopher is:issue language:go", opts)
will search for such issues, sorting by creation date in ascending order
(i.e., oldest first).
If query includes multiple conditions, it MUST NOT include "+" as the condition separator.
You have to use " " as the separator instead.
For example, querying with "language:c++" and "leveldb", then query should be
"language:c++ leveldb" but not "language:c+++leveldb".
GitHub API docs: https://docs.github.com/en/rest/search/
*/
Search() SearchService
/*
SecretScanningService handles communication with the secret scanning related
methods of the GitHub API.
*/
SecretScanning() SecretScanningService
/*
TeamsService provides access to the team-related functions
in the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/teams/
*/
Teams() TeamsService
/*
UsersService handles communication with the user related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/users/
*/
Users() UsersService
/*
APIMeta returns information about GitHub.com, the service. Or, if you access
this endpoint on your organization’s GitHub Enterprise installation, this
endpoint provides information about that installation.
GitHub API docs: https://docs.github.com/en/rest/meta#get-github-meta-information
*/
APIMeta(ctx context.Context) (*github.APIMeta, *github.Response, error)
/*
BareDo sends an API request and lets you handle the api response. If an error
or API Error occurs, the error will contain more information. Otherwise you
are supposed to read and close the response's Body. If rate limit is exceeded
and reset time is in the future, BareDo returns *RateLimitError immediately
without making a network API call.
The provided ctx must be non-nil, if it is nil an error is returned. If it is
canceled or times out, ctx.Err() will be returned.
*/
BareDo(ctx context.Context, req *http.Request) (*github.Response, error)
/*
Client returns the http.Client used by this GitHub client.
*/
Client() *http.Client
/*
Do sends an API request and returns the API response. The API response is
JSON decoded and stored in the value pointed to by v, or returned as an
error if an API error has occurred. If v implements the io.Writer interface,
the raw response body will be written to v, without attempting to first
decode it. If v is nil, and no error hapens, the response is returned as is.
If rate limit is exceeded and reset time is in the future, Do returns
*RateLimitError immediately without making a network API call.
The provided ctx must be non-nil, if it is nil an error is returned. If it
is canceled or times out, ctx.Err() will be returned.
*/
Do(ctx context.Context, req *http.Request, v interface{}) (*github.Response, error)
/*
GetCodeOfConduct returns an individual code of conduct.
https://docs.github.com/en/rest/codes_of_conduct/#get-an-individual-code-of-conduct
*/
GetCodeOfConduct(ctx context.Context, key string) (*github.CodeOfConduct, *github.Response, error)
/*
ListCodesOfConduct returns all codes of conduct.
GitHub API docs: https://docs.github.com/en/rest/codes_of_conduct/#list-all-codes-of-conduct
*/
ListCodesOfConduct(ctx context.Context) ([]*github.CodeOfConduct, *github.Response, error)
/*
ListEmojis returns the emojis available to use on GitHub.
GitHub API docs: https://docs.github.com/en/rest/emojis/
*/
ListEmojis(ctx context.Context) (map[string]string, *github.Response, error)
/*
ListServiceHooks lists all of the available service hooks.
GitHub API docs: https://developer.github.com/webhooks/#services
*/
ListServiceHooks(ctx context.Context) ([]*github.ServiceHook, *github.Response, error)
/*
Markdown renders an arbitrary Markdown document.
GitHub API docs: https://docs.github.com/en/rest/markdown/
*/
Markdown(ctx context.Context, text string, opts *github.MarkdownOptions) (string, *github.Response, error)
/*
NewFormRequest creates an API request. A relative URL can be provided in urlStr,
in which case it is resolved relative to the BaseURL of the Client.
Relative URLs should always be specified without a preceding slash.
Body is sent with Content-Type: application/x-www-form-urlencoded.
*/
NewFormRequest(urlStr string, body io.Reader) (*http.Request, error)
/*
NewRequest creates an API request. A relative URL can be provided in urlStr,
in which case it is resolved relative to the BaseURL of the Client.
Relative URLs should always be specified without a preceding slash. If
specified, the value pointed to by body is JSON encoded and included as the
request body.
*/
NewRequest(method string, urlStr string, body interface{}) (*http.Request, error)
/*
NewUploadRequest creates an upload request. A relative URL can be provided in
urlStr, in which case it is resolved relative to the UploadURL of the Client.
Relative URLs should always be specified without a preceding slash.
*/
NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string) (*http.Request, error)
/*
Octocat returns an ASCII art octocat with the specified message in a speech
bubble. If message is empty, a random zen phrase is used.
*/
Octocat(ctx context.Context, message string) (string, *github.Response, error)
/*
RateLimits returns the rate limits for the current client.
*/
RateLimits(ctx context.Context) (*github.RateLimits, *github.Response, error)
/*
Zen returns a random line from The Zen of GitHub.
see also: http://warpspire.com/posts/taste/
*/
Zen(ctx context.Context) (string, *github.Response, error)
}
/*
ActionsService handles communication with the actions related
methods of the GitHub API.
GitHub API docs: https://docs.github.com/en/rest/actions/
*/
type ActionsService interface {
/*
AddEnabledReposInOrg adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization.
GitHub API docs: https://docs.github.com/en/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization
*/
AddEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*github.Response, error)
/*
AddRepositoryAccessRunnerGroup adds a repository to the list of selected repositories that can access a self-hosted runner group.
The runner group must have visibility set to 'selected'.
GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization
*/
AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, repoID int64) (*github.Response, error)
/*
AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization.
GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization
*/
AddRunnerGroupRunners(ctx context.Context, org string, groupID int64, runnerID int64) (*github.Response, error)
/*
AddSelectedRepoToOrgSecret adds a repository to an organization secret.
GitHub API docs: https://docs.github.com/en/rest/actions/secrets#add-selected-repository-to-an-organization-secret
*/
AddSelectedRepoToOrgSecret(ctx context.Context, org string, name string, repo *github.Repository) (*github.Response, error)
/*
CancelWorkflowRunByID cancels a workflow run by ID.
GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#cancel-a-workflow-run
*/
CancelWorkflowRunByID(ctx context.Context, owner string, repo string, runID int64) (*github.Response, error)
/*
CreateOrUpdateEnvSecret creates or updates a single environment secret with an encrypted value.
GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-an-environment-secret
*/
CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *github.EncryptedSecret) (*github.Response, error)
/*
CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value.
GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-an-organization-secret
*/
CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *github.EncryptedSecret) (*github.Response, error)
/*
CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value.
GitHub API docs: https://docs.github.com/en/rest/actions/secrets#create-or-update-a-repository-secret
*/
CreateOrUpdateRepoSecret(ctx context.Context, owner string, repo string, eSecret *github.EncryptedSecret) (*github.Response, error)
/*
CreateOrganizationRegistrationToken creates a token that can be used to add a self-hosted runner to an organization.
GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization
*/
CreateOrganizationRegistrationToken(ctx context.Context, owner string) (*github.RegistrationToken, *github.Response, error)
/*
CreateOrganizationRemoveToken creates a token that can be used to remove a self-hosted runner from an organization.
GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization
*/
CreateOrganizationRemoveToken(ctx context.Context, owner string) (*github.RemoveToken, *github.Response, error)
/*
CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization.
GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization
*/
CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq github.CreateRunnerGroupRequest) (*github.RunnerGroup, *github.Response, error)
/*
CreateRegistrationToken creates a token that can be used to add a self-hosted runner.
GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository
*/
CreateRegistrationToken(ctx context.Context, owner string, repo string) (*github.RegistrationToken, *github.Response, error)
/*
CreateRemoveToken creates a token that can be used to remove a self-hosted runner from a repository.
GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository
*/
CreateRemoveToken(ctx context.Context, owner string, repo string) (*github.RemoveToken, *github.Response, error)
/*
CreateWorkflowDispatchEventByFileName manually triggers a GitHub Actions workflow run.
GitHub API docs: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event
*/
CreateWorkflowDispatchEventByFileName(ctx context.Context, owner string, repo string, workflowFileName string, event github.CreateWorkflowDispatchEventRequest) (*github.Response, error)
/*
CreateWorkflowDispatchEventByID manually triggers a GitHub Actions workflow run.
GitHub API docs: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event
*/
CreateWorkflowDispatchEventByID(ctx context.Context, owner string, repo string, workflowID int64, event github.CreateWorkflowDispatchEventRequest) (*github.Response, error)
/*
DeleteArtifact deletes a workflow run artifact.
GitHub API docs: https://docs.github.com/en/rest/actions/artifacts#delete-an-artifact
*/
DeleteArtifact(ctx context.Context, owner string, repo string, artifactID int64) (*github.Response, error)
/*
DeleteEnvSecret deletes a secret in an environment using the secret name.
GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-an-environment-secret
*/
DeleteEnvSecret(ctx context.Context, repoID int, env string, secretName string) (*github.Response, error)
/*
DeleteOrgSecret deletes a secret in an organization using the secret name.
GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-an-organization-secret
*/
DeleteOrgSecret(ctx context.Context, org string, name string) (*github.Response, error)
/*
DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization.
GitHub API docs: https://docs.github.com/en/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization
*/
DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*github.Response, error)
/*
DeleteRepoSecret deletes a secret in a repository using the secret name.
GitHub API docs: https://docs.github.com/en/rest/actions/secrets#delete-a-repository-secret
*/
DeleteRepoSecret(ctx context.Context, owner string, repo string, name string) (*github.Response, error)
/*
DeleteWorkflowRun deletes a workflow run by ID.
GitHub API docs: https://docs.github.com/en/rest/actions/workflow-runs#delete-a-workflow-run
*/
DeleteWorkflowRun(ctx context.Context, owner string, repo string, runID int64) (*github.Response, error)
/*
DeleteWorkflowRunLogs deletes all logs for a workflow run.