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 package versionhistory
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "net/http"
61 "net/url"
62 "strconv"
63 "strings"
64
65 googleapi "google.golang.org/api/googleapi"
66 internal "google.golang.org/api/internal"
67 gensupport "google.golang.org/api/internal/gensupport"
68 option "google.golang.org/api/option"
69 internaloption "google.golang.org/api/option/internaloption"
70 htransport "google.golang.org/api/transport/http"
71 )
72
73
74
75 var _ = bytes.NewBuffer
76 var _ = strconv.Itoa
77 var _ = fmt.Sprintf
78 var _ = json.NewDecoder
79 var _ = io.Copy
80 var _ = url.Parse
81 var _ = gensupport.MarshalJSON
82 var _ = googleapi.Version
83 var _ = errors.New
84 var _ = strings.Replace
85 var _ = context.Canceled
86 var _ = internaloption.WithDefaultEndpoint
87 var _ = internal.Version
88
89 const apiId = "versionhistory:v1"
90 const apiName = "versionhistory"
91 const apiVersion = "v1"
92 const basePath = "https://versionhistory.googleapis.com/"
93 const basePathTemplate = "https://versionhistory.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://versionhistory.mtls.googleapis.com/"
95
96
97 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
98 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
99 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
100 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
101 opts = append(opts, internaloption.EnableNewAuthLibrary())
102 client, endpoint, err := htransport.NewClient(ctx, opts...)
103 if err != nil {
104 return nil, err
105 }
106 s, err := New(client)
107 if err != nil {
108 return nil, err
109 }
110 if endpoint != "" {
111 s.BasePath = endpoint
112 }
113 return s, nil
114 }
115
116
117
118
119
120
121 func New(client *http.Client) (*Service, error) {
122 if client == nil {
123 return nil, errors.New("client is nil")
124 }
125 s := &Service{client: client, BasePath: basePath}
126 s.Platforms = NewPlatformsService(s)
127 return s, nil
128 }
129
130 type Service struct {
131 client *http.Client
132 BasePath string
133 UserAgent string
134
135 Platforms *PlatformsService
136 }
137
138 func (s *Service) userAgent() string {
139 if s.UserAgent == "" {
140 return googleapi.UserAgent
141 }
142 return googleapi.UserAgent + " " + s.UserAgent
143 }
144
145 func NewPlatformsService(s *Service) *PlatformsService {
146 rs := &PlatformsService{s: s}
147 rs.Channels = NewPlatformsChannelsService(s)
148 return rs
149 }
150
151 type PlatformsService struct {
152 s *Service
153
154 Channels *PlatformsChannelsService
155 }
156
157 func NewPlatformsChannelsService(s *Service) *PlatformsChannelsService {
158 rs := &PlatformsChannelsService{s: s}
159 rs.Versions = NewPlatformsChannelsVersionsService(s)
160 return rs
161 }
162
163 type PlatformsChannelsService struct {
164 s *Service
165
166 Versions *PlatformsChannelsVersionsService
167 }
168
169 func NewPlatformsChannelsVersionsService(s *Service) *PlatformsChannelsVersionsService {
170 rs := &PlatformsChannelsVersionsService{s: s}
171 rs.Releases = NewPlatformsChannelsVersionsReleasesService(s)
172 return rs
173 }
174
175 type PlatformsChannelsVersionsService struct {
176 s *Service
177
178 Releases *PlatformsChannelsVersionsReleasesService
179 }
180
181 func NewPlatformsChannelsVersionsReleasesService(s *Service) *PlatformsChannelsVersionsReleasesService {
182 rs := &PlatformsChannelsVersionsReleasesService{s: s}
183 return rs
184 }
185
186 type PlatformsChannelsVersionsReleasesService struct {
187 s *Service
188 }
189
190
191
192
193
194 type Channel struct {
195
196
197
198
199
200
201
202
203
204
205
206
207
208 ChannelType string `json:"channelType,omitempty"`
209
210
211 Name string `json:"name,omitempty"`
212
213
214
215
216
217 ForceSendFields []string `json:"-"`
218
219
220
221
222 NullFields []string `json:"-"`
223 }
224
225 func (s *Channel) MarshalJSON() ([]byte, error) {
226 type NoMethod Channel
227 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
228 }
229
230
231
232
233
234
235 type Interval struct {
236
237
238 EndTime string `json:"endTime,omitempty"`
239
240
241
242 StartTime string `json:"startTime,omitempty"`
243
244
245
246
247
248 ForceSendFields []string `json:"-"`
249
250
251
252
253 NullFields []string `json:"-"`
254 }
255
256 func (s *Interval) MarshalJSON() ([]byte, error) {
257 type NoMethod Interval
258 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
259 }
260
261
262 type ListChannelsResponse struct {
263
264 Channels []*Channel `json:"channels,omitempty"`
265
266
267 NextPageToken string `json:"nextPageToken,omitempty"`
268
269
270 googleapi.ServerResponse `json:"-"`
271
272
273
274
275
276 ForceSendFields []string `json:"-"`
277
278
279
280
281 NullFields []string `json:"-"`
282 }
283
284 func (s *ListChannelsResponse) MarshalJSON() ([]byte, error) {
285 type NoMethod ListChannelsResponse
286 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
287 }
288
289
290 type ListPlatformsResponse struct {
291
292
293 NextPageToken string `json:"nextPageToken,omitempty"`
294
295 Platforms []*Platform `json:"platforms,omitempty"`
296
297
298 googleapi.ServerResponse `json:"-"`
299
300
301
302
303
304 ForceSendFields []string `json:"-"`
305
306
307
308
309 NullFields []string `json:"-"`
310 }
311
312 func (s *ListPlatformsResponse) MarshalJSON() ([]byte, error) {
313 type NoMethod ListPlatformsResponse
314 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
315 }
316
317
318 type ListReleasesResponse struct {
319
320
321 NextPageToken string `json:"nextPageToken,omitempty"`
322
323 Releases []*Release `json:"releases,omitempty"`
324
325
326 googleapi.ServerResponse `json:"-"`
327
328
329
330
331
332 ForceSendFields []string `json:"-"`
333
334
335
336
337 NullFields []string `json:"-"`
338 }
339
340 func (s *ListReleasesResponse) MarshalJSON() ([]byte, error) {
341 type NoMethod ListReleasesResponse
342 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
343 }
344
345
346 type ListVersionsResponse struct {
347
348
349 NextPageToken string `json:"nextPageToken,omitempty"`
350
351 Versions []*Version `json:"versions,omitempty"`
352
353
354 googleapi.ServerResponse `json:"-"`
355
356
357
358
359
360 ForceSendFields []string `json:"-"`
361
362
363
364
365 NullFields []string `json:"-"`
366 }
367
368 func (s *ListVersionsResponse) MarshalJSON() ([]byte, error) {
369 type NoMethod ListVersionsResponse
370 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
371 }
372
373
374
375
376
377 type Platform struct {
378
379 Name string `json:"name,omitempty"`
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399 PlatformType string `json:"platformType,omitempty"`
400
401
402
403
404
405 ForceSendFields []string `json:"-"`
406
407
408
409
410 NullFields []string `json:"-"`
411 }
412
413 func (s *Platform) MarshalJSON() ([]byte, error) {
414 type NoMethod Platform
415 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
416 }
417
418
419
420
421
422
423 type Release struct {
424
425
426
427 Fraction float64 `json:"fraction,omitempty"`
428
429
430
431 FractionGroup int64 `json:"fractionGroup,omitempty,string"`
432
433
434
435 Name string `json:"name,omitempty"`
436
437
438 Serving *Interval `json:"serving,omitempty"`
439
440 Version string `json:"version,omitempty"`
441
442
443
444
445
446 ForceSendFields []string `json:"-"`
447
448
449
450
451 NullFields []string `json:"-"`
452 }
453
454 func (s *Release) MarshalJSON() ([]byte, error) {
455 type NoMethod Release
456 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
457 }
458
459 func (s *Release) UnmarshalJSON(data []byte) error {
460 type NoMethod Release
461 var s1 struct {
462 Fraction gensupport.JSONFloat64 `json:"fraction"`
463 *NoMethod
464 }
465 s1.NoMethod = (*NoMethod)(s)
466 if err := json.Unmarshal(data, &s1); err != nil {
467 return err
468 }
469 s.Fraction = float64(s1.Fraction)
470 return nil
471 }
472
473
474
475 type Version struct {
476
477
478
479 Name string `json:"name,omitempty"`
480
481 Version string `json:"version,omitempty"`
482
483
484
485
486
487 ForceSendFields []string `json:"-"`
488
489
490
491
492 NullFields []string `json:"-"`
493 }
494
495 func (s *Version) MarshalJSON() ([]byte, error) {
496 type NoMethod Version
497 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
498 }
499
500 type PlatformsListCall struct {
501 s *Service
502 parent string
503 urlParams_ gensupport.URLParams
504 ifNoneMatch_ string
505 ctx_ context.Context
506 header_ http.Header
507 }
508
509
510
511
512
513
514 func (r *PlatformsService) List(parent string) *PlatformsListCall {
515 c := &PlatformsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
516 c.parent = parent
517 return c
518 }
519
520
521
522
523 func (c *PlatformsListCall) PageSize(pageSize int64) *PlatformsListCall {
524 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
525 return c
526 }
527
528
529
530
531 func (c *PlatformsListCall) PageToken(pageToken string) *PlatformsListCall {
532 c.urlParams_.Set("pageToken", pageToken)
533 return c
534 }
535
536
537
538
539 func (c *PlatformsListCall) Fields(s ...googleapi.Field) *PlatformsListCall {
540 c.urlParams_.Set("fields", googleapi.CombineFields(s))
541 return c
542 }
543
544
545
546
547 func (c *PlatformsListCall) IfNoneMatch(entityTag string) *PlatformsListCall {
548 c.ifNoneMatch_ = entityTag
549 return c
550 }
551
552
553 func (c *PlatformsListCall) Context(ctx context.Context) *PlatformsListCall {
554 c.ctx_ = ctx
555 return c
556 }
557
558
559
560 func (c *PlatformsListCall) Header() http.Header {
561 if c.header_ == nil {
562 c.header_ = make(http.Header)
563 }
564 return c.header_
565 }
566
567 func (c *PlatformsListCall) doRequest(alt string) (*http.Response, error) {
568 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
569 if c.ifNoneMatch_ != "" {
570 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
571 }
572 var body io.Reader = nil
573 c.urlParams_.Set("alt", alt)
574 c.urlParams_.Set("prettyPrint", "false")
575 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/platforms")
576 urls += "?" + c.urlParams_.Encode()
577 req, err := http.NewRequest("GET", urls, body)
578 if err != nil {
579 return nil, err
580 }
581 req.Header = reqHeaders
582 googleapi.Expand(req.URL, map[string]string{
583 "parent": c.parent,
584 })
585 return gensupport.SendRequest(c.ctx_, c.s.client, req)
586 }
587
588
589
590
591
592
593
594 func (c *PlatformsListCall) Do(opts ...googleapi.CallOption) (*ListPlatformsResponse, error) {
595 gensupport.SetOptions(c.urlParams_, opts...)
596 res, err := c.doRequest("json")
597 if res != nil && res.StatusCode == http.StatusNotModified {
598 if res.Body != nil {
599 res.Body.Close()
600 }
601 return nil, gensupport.WrapError(&googleapi.Error{
602 Code: res.StatusCode,
603 Header: res.Header,
604 })
605 }
606 if err != nil {
607 return nil, err
608 }
609 defer googleapi.CloseBody(res)
610 if err := googleapi.CheckResponse(res); err != nil {
611 return nil, gensupport.WrapError(err)
612 }
613 ret := &ListPlatformsResponse{
614 ServerResponse: googleapi.ServerResponse{
615 Header: res.Header,
616 HTTPStatusCode: res.StatusCode,
617 },
618 }
619 target := &ret
620 if err := gensupport.DecodeResponse(target, res); err != nil {
621 return nil, err
622 }
623 return ret, nil
624 }
625
626
627
628
629 func (c *PlatformsListCall) Pages(ctx context.Context, f func(*ListPlatformsResponse) error) error {
630 c.ctx_ = ctx
631 defer c.PageToken(c.urlParams_.Get("pageToken"))
632 for {
633 x, err := c.Do()
634 if err != nil {
635 return err
636 }
637 if err := f(x); err != nil {
638 return err
639 }
640 if x.NextPageToken == "" {
641 return nil
642 }
643 c.PageToken(x.NextPageToken)
644 }
645 }
646
647 type PlatformsChannelsListCall struct {
648 s *Service
649 parent string
650 urlParams_ gensupport.URLParams
651 ifNoneMatch_ string
652 ctx_ context.Context
653 header_ http.Header
654 }
655
656
657
658
659
660 func (r *PlatformsChannelsService) List(parent string) *PlatformsChannelsListCall {
661 c := &PlatformsChannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
662 c.parent = parent
663 return c
664 }
665
666
667
668
669 func (c *PlatformsChannelsListCall) PageSize(pageSize int64) *PlatformsChannelsListCall {
670 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
671 return c
672 }
673
674
675
676
677 func (c *PlatformsChannelsListCall) PageToken(pageToken string) *PlatformsChannelsListCall {
678 c.urlParams_.Set("pageToken", pageToken)
679 return c
680 }
681
682
683
684
685 func (c *PlatformsChannelsListCall) Fields(s ...googleapi.Field) *PlatformsChannelsListCall {
686 c.urlParams_.Set("fields", googleapi.CombineFields(s))
687 return c
688 }
689
690
691
692
693 func (c *PlatformsChannelsListCall) IfNoneMatch(entityTag string) *PlatformsChannelsListCall {
694 c.ifNoneMatch_ = entityTag
695 return c
696 }
697
698
699 func (c *PlatformsChannelsListCall) Context(ctx context.Context) *PlatformsChannelsListCall {
700 c.ctx_ = ctx
701 return c
702 }
703
704
705
706 func (c *PlatformsChannelsListCall) Header() http.Header {
707 if c.header_ == nil {
708 c.header_ = make(http.Header)
709 }
710 return c.header_
711 }
712
713 func (c *PlatformsChannelsListCall) doRequest(alt string) (*http.Response, error) {
714 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
715 if c.ifNoneMatch_ != "" {
716 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
717 }
718 var body io.Reader = nil
719 c.urlParams_.Set("alt", alt)
720 c.urlParams_.Set("prettyPrint", "false")
721 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/channels")
722 urls += "?" + c.urlParams_.Encode()
723 req, err := http.NewRequest("GET", urls, body)
724 if err != nil {
725 return nil, err
726 }
727 req.Header = reqHeaders
728 googleapi.Expand(req.URL, map[string]string{
729 "parent": c.parent,
730 })
731 return gensupport.SendRequest(c.ctx_, c.s.client, req)
732 }
733
734
735
736
737
738
739
740 func (c *PlatformsChannelsListCall) Do(opts ...googleapi.CallOption) (*ListChannelsResponse, error) {
741 gensupport.SetOptions(c.urlParams_, opts...)
742 res, err := c.doRequest("json")
743 if res != nil && res.StatusCode == http.StatusNotModified {
744 if res.Body != nil {
745 res.Body.Close()
746 }
747 return nil, gensupport.WrapError(&googleapi.Error{
748 Code: res.StatusCode,
749 Header: res.Header,
750 })
751 }
752 if err != nil {
753 return nil, err
754 }
755 defer googleapi.CloseBody(res)
756 if err := googleapi.CheckResponse(res); err != nil {
757 return nil, gensupport.WrapError(err)
758 }
759 ret := &ListChannelsResponse{
760 ServerResponse: googleapi.ServerResponse{
761 Header: res.Header,
762 HTTPStatusCode: res.StatusCode,
763 },
764 }
765 target := &ret
766 if err := gensupport.DecodeResponse(target, res); err != nil {
767 return nil, err
768 }
769 return ret, nil
770 }
771
772
773
774
775 func (c *PlatformsChannelsListCall) Pages(ctx context.Context, f func(*ListChannelsResponse) error) error {
776 c.ctx_ = ctx
777 defer c.PageToken(c.urlParams_.Get("pageToken"))
778 for {
779 x, err := c.Do()
780 if err != nil {
781 return err
782 }
783 if err := f(x); err != nil {
784 return err
785 }
786 if x.NextPageToken == "" {
787 return nil
788 }
789 c.PageToken(x.NextPageToken)
790 }
791 }
792
793 type PlatformsChannelsVersionsListCall struct {
794 s *Service
795 parent string
796 urlParams_ gensupport.URLParams
797 ifNoneMatch_ string
798 ctx_ context.Context
799 header_ http.Header
800 }
801
802
803
804
805
806 func (r *PlatformsChannelsVersionsService) List(parent string) *PlatformsChannelsVersionsListCall {
807 c := &PlatformsChannelsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
808 c.parent = parent
809 return c
810 }
811
812
813
814
815
816
817
818
819
820
821
822 func (c *PlatformsChannelsVersionsListCall) Filter(filter string) *PlatformsChannelsVersionsListCall {
823 c.urlParams_.Set("filter", filter)
824 return c
825 }
826
827
828
829
830
831
832
833
834
835
836
837
838 func (c *PlatformsChannelsVersionsListCall) OrderBy(orderBy string) *PlatformsChannelsVersionsListCall {
839 c.urlParams_.Set("orderBy", orderBy)
840 return c
841 }
842
843
844
845
846 func (c *PlatformsChannelsVersionsListCall) PageSize(pageSize int64) *PlatformsChannelsVersionsListCall {
847 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
848 return c
849 }
850
851
852
853
854 func (c *PlatformsChannelsVersionsListCall) PageToken(pageToken string) *PlatformsChannelsVersionsListCall {
855 c.urlParams_.Set("pageToken", pageToken)
856 return c
857 }
858
859
860
861
862 func (c *PlatformsChannelsVersionsListCall) Fields(s ...googleapi.Field) *PlatformsChannelsVersionsListCall {
863 c.urlParams_.Set("fields", googleapi.CombineFields(s))
864 return c
865 }
866
867
868
869
870 func (c *PlatformsChannelsVersionsListCall) IfNoneMatch(entityTag string) *PlatformsChannelsVersionsListCall {
871 c.ifNoneMatch_ = entityTag
872 return c
873 }
874
875
876 func (c *PlatformsChannelsVersionsListCall) Context(ctx context.Context) *PlatformsChannelsVersionsListCall {
877 c.ctx_ = ctx
878 return c
879 }
880
881
882
883 func (c *PlatformsChannelsVersionsListCall) Header() http.Header {
884 if c.header_ == nil {
885 c.header_ = make(http.Header)
886 }
887 return c.header_
888 }
889
890 func (c *PlatformsChannelsVersionsListCall) doRequest(alt string) (*http.Response, error) {
891 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
892 if c.ifNoneMatch_ != "" {
893 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
894 }
895 var body io.Reader = nil
896 c.urlParams_.Set("alt", alt)
897 c.urlParams_.Set("prettyPrint", "false")
898 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions")
899 urls += "?" + c.urlParams_.Encode()
900 req, err := http.NewRequest("GET", urls, body)
901 if err != nil {
902 return nil, err
903 }
904 req.Header = reqHeaders
905 googleapi.Expand(req.URL, map[string]string{
906 "parent": c.parent,
907 })
908 return gensupport.SendRequest(c.ctx_, c.s.client, req)
909 }
910
911
912
913
914
915
916
917 func (c *PlatformsChannelsVersionsListCall) Do(opts ...googleapi.CallOption) (*ListVersionsResponse, error) {
918 gensupport.SetOptions(c.urlParams_, opts...)
919 res, err := c.doRequest("json")
920 if res != nil && res.StatusCode == http.StatusNotModified {
921 if res.Body != nil {
922 res.Body.Close()
923 }
924 return nil, gensupport.WrapError(&googleapi.Error{
925 Code: res.StatusCode,
926 Header: res.Header,
927 })
928 }
929 if err != nil {
930 return nil, err
931 }
932 defer googleapi.CloseBody(res)
933 if err := googleapi.CheckResponse(res); err != nil {
934 return nil, gensupport.WrapError(err)
935 }
936 ret := &ListVersionsResponse{
937 ServerResponse: googleapi.ServerResponse{
938 Header: res.Header,
939 HTTPStatusCode: res.StatusCode,
940 },
941 }
942 target := &ret
943 if err := gensupport.DecodeResponse(target, res); err != nil {
944 return nil, err
945 }
946 return ret, nil
947 }
948
949
950
951
952 func (c *PlatformsChannelsVersionsListCall) Pages(ctx context.Context, f func(*ListVersionsResponse) error) error {
953 c.ctx_ = ctx
954 defer c.PageToken(c.urlParams_.Get("pageToken"))
955 for {
956 x, err := c.Do()
957 if err != nil {
958 return err
959 }
960 if err := f(x); err != nil {
961 return err
962 }
963 if x.NextPageToken == "" {
964 return nil
965 }
966 c.PageToken(x.NextPageToken)
967 }
968 }
969
970 type PlatformsChannelsVersionsReleasesListCall struct {
971 s *Service
972 parent string
973 urlParams_ gensupport.URLParams
974 ifNoneMatch_ string
975 ctx_ context.Context
976 header_ http.Header
977 }
978
979
980
981
982
983 func (r *PlatformsChannelsVersionsReleasesService) List(parent string) *PlatformsChannelsVersionsReleasesListCall {
984 c := &PlatformsChannelsVersionsReleasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
985 c.parent = parent
986 return c
987 }
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003 func (c *PlatformsChannelsVersionsReleasesListCall) Filter(filter string) *PlatformsChannelsVersionsReleasesListCall {
1004 c.urlParams_.Set("filter", filter)
1005 return c
1006 }
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020 func (c *PlatformsChannelsVersionsReleasesListCall) OrderBy(orderBy string) *PlatformsChannelsVersionsReleasesListCall {
1021 c.urlParams_.Set("orderBy", orderBy)
1022 return c
1023 }
1024
1025
1026
1027
1028 func (c *PlatformsChannelsVersionsReleasesListCall) PageSize(pageSize int64) *PlatformsChannelsVersionsReleasesListCall {
1029 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1030 return c
1031 }
1032
1033
1034
1035
1036 func (c *PlatformsChannelsVersionsReleasesListCall) PageToken(pageToken string) *PlatformsChannelsVersionsReleasesListCall {
1037 c.urlParams_.Set("pageToken", pageToken)
1038 return c
1039 }
1040
1041
1042
1043
1044 func (c *PlatformsChannelsVersionsReleasesListCall) Fields(s ...googleapi.Field) *PlatformsChannelsVersionsReleasesListCall {
1045 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1046 return c
1047 }
1048
1049
1050
1051
1052 func (c *PlatformsChannelsVersionsReleasesListCall) IfNoneMatch(entityTag string) *PlatformsChannelsVersionsReleasesListCall {
1053 c.ifNoneMatch_ = entityTag
1054 return c
1055 }
1056
1057
1058 func (c *PlatformsChannelsVersionsReleasesListCall) Context(ctx context.Context) *PlatformsChannelsVersionsReleasesListCall {
1059 c.ctx_ = ctx
1060 return c
1061 }
1062
1063
1064
1065 func (c *PlatformsChannelsVersionsReleasesListCall) Header() http.Header {
1066 if c.header_ == nil {
1067 c.header_ = make(http.Header)
1068 }
1069 return c.header_
1070 }
1071
1072 func (c *PlatformsChannelsVersionsReleasesListCall) doRequest(alt string) (*http.Response, error) {
1073 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1074 if c.ifNoneMatch_ != "" {
1075 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1076 }
1077 var body io.Reader = nil
1078 c.urlParams_.Set("alt", alt)
1079 c.urlParams_.Set("prettyPrint", "false")
1080 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/releases")
1081 urls += "?" + c.urlParams_.Encode()
1082 req, err := http.NewRequest("GET", urls, body)
1083 if err != nil {
1084 return nil, err
1085 }
1086 req.Header = reqHeaders
1087 googleapi.Expand(req.URL, map[string]string{
1088 "parent": c.parent,
1089 })
1090 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1091 }
1092
1093
1094
1095
1096
1097
1098
1099 func (c *PlatformsChannelsVersionsReleasesListCall) Do(opts ...googleapi.CallOption) (*ListReleasesResponse, error) {
1100 gensupport.SetOptions(c.urlParams_, opts...)
1101 res, err := c.doRequest("json")
1102 if res != nil && res.StatusCode == http.StatusNotModified {
1103 if res.Body != nil {
1104 res.Body.Close()
1105 }
1106 return nil, gensupport.WrapError(&googleapi.Error{
1107 Code: res.StatusCode,
1108 Header: res.Header,
1109 })
1110 }
1111 if err != nil {
1112 return nil, err
1113 }
1114 defer googleapi.CloseBody(res)
1115 if err := googleapi.CheckResponse(res); err != nil {
1116 return nil, gensupport.WrapError(err)
1117 }
1118 ret := &ListReleasesResponse{
1119 ServerResponse: googleapi.ServerResponse{
1120 Header: res.Header,
1121 HTTPStatusCode: res.StatusCode,
1122 },
1123 }
1124 target := &ret
1125 if err := gensupport.DecodeResponse(target, res); err != nil {
1126 return nil, err
1127 }
1128 return ret, nil
1129 }
1130
1131
1132
1133
1134 func (c *PlatformsChannelsVersionsReleasesListCall) Pages(ctx context.Context, f func(*ListReleasesResponse) error) error {
1135 c.ctx_ = ctx
1136 defer c.PageToken(c.urlParams_.Get("pageToken"))
1137 for {
1138 x, err := c.Do()
1139 if err != nil {
1140 return err
1141 }
1142 if err := f(x); err != nil {
1143 return err
1144 }
1145 if x.NextPageToken == "" {
1146 return nil
1147 }
1148 c.PageToken(x.NextPageToken)
1149 }
1150 }
1151
View as plain text