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 rapidmigrationassessment
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 = "rapidmigrationassessment:v1"
90 const apiName = "rapidmigrationassessment"
91 const apiVersion = "v1"
92 const basePath = "https://rapidmigrationassessment.googleapis.com/"
93 const basePathTemplate = "https://rapidmigrationassessment.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://rapidmigrationassessment.mtls.googleapis.com/"
95
96
97 const (
98
99
100 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
101 )
102
103
104 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
105 scopesOption := internaloption.WithDefaultScopes(
106 "https://www.googleapis.com/auth/cloud-platform",
107 )
108
109 opts = append([]option.ClientOption{scopesOption}, opts...)
110 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
111 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
113 opts = append(opts, internaloption.EnableNewAuthLibrary())
114 client, endpoint, err := htransport.NewClient(ctx, opts...)
115 if err != nil {
116 return nil, err
117 }
118 s, err := New(client)
119 if err != nil {
120 return nil, err
121 }
122 if endpoint != "" {
123 s.BasePath = endpoint
124 }
125 return s, nil
126 }
127
128
129
130
131
132
133 func New(client *http.Client) (*Service, error) {
134 if client == nil {
135 return nil, errors.New("client is nil")
136 }
137 s := &Service{client: client, BasePath: basePath}
138 s.Projects = NewProjectsService(s)
139 return s, nil
140 }
141
142 type Service struct {
143 client *http.Client
144 BasePath string
145 UserAgent string
146
147 Projects *ProjectsService
148 }
149
150 func (s *Service) userAgent() string {
151 if s.UserAgent == "" {
152 return googleapi.UserAgent
153 }
154 return googleapi.UserAgent + " " + s.UserAgent
155 }
156
157 func NewProjectsService(s *Service) *ProjectsService {
158 rs := &ProjectsService{s: s}
159 rs.Locations = NewProjectsLocationsService(s)
160 return rs
161 }
162
163 type ProjectsService struct {
164 s *Service
165
166 Locations *ProjectsLocationsService
167 }
168
169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
170 rs := &ProjectsLocationsService{s: s}
171 rs.Annotations = NewProjectsLocationsAnnotationsService(s)
172 rs.Collectors = NewProjectsLocationsCollectorsService(s)
173 rs.Operations = NewProjectsLocationsOperationsService(s)
174 return rs
175 }
176
177 type ProjectsLocationsService struct {
178 s *Service
179
180 Annotations *ProjectsLocationsAnnotationsService
181
182 Collectors *ProjectsLocationsCollectorsService
183
184 Operations *ProjectsLocationsOperationsService
185 }
186
187 func NewProjectsLocationsAnnotationsService(s *Service) *ProjectsLocationsAnnotationsService {
188 rs := &ProjectsLocationsAnnotationsService{s: s}
189 return rs
190 }
191
192 type ProjectsLocationsAnnotationsService struct {
193 s *Service
194 }
195
196 func NewProjectsLocationsCollectorsService(s *Service) *ProjectsLocationsCollectorsService {
197 rs := &ProjectsLocationsCollectorsService{s: s}
198 return rs
199 }
200
201 type ProjectsLocationsCollectorsService struct {
202 s *Service
203 }
204
205 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
206 rs := &ProjectsLocationsOperationsService{s: s}
207 return rs
208 }
209
210 type ProjectsLocationsOperationsService struct {
211 s *Service
212 }
213
214
215 type Annotation struct {
216
217 CreateTime string `json:"createTime,omitempty"`
218
219 Labels map[string]string `json:"labels,omitempty"`
220
221 Name string `json:"name,omitempty"`
222
223
224
225
226
227
228
229 Type string `json:"type,omitempty"`
230
231 UpdateTime string `json:"updateTime,omitempty"`
232
233
234 googleapi.ServerResponse `json:"-"`
235
236
237
238
239
240 ForceSendFields []string `json:"-"`
241
242
243
244
245 NullFields []string `json:"-"`
246 }
247
248 func (s *Annotation) MarshalJSON() ([]byte, error) {
249 type NoMethod Annotation
250 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
251 }
252
253
254 type CancelOperationRequest struct {
255 }
256
257
258 type Collector struct {
259
260
261 Bucket string `json:"bucket,omitempty"`
262
263 ClientVersion string `json:"clientVersion,omitempty"`
264
265 CollectionDays int64 `json:"collectionDays,omitempty"`
266
267 CreateTime string `json:"createTime,omitempty"`
268
269 Description string `json:"description,omitempty"`
270
271 DisplayName string `json:"displayName,omitempty"`
272
273 EulaUri string `json:"eulaUri,omitempty"`
274
275 ExpectedAssetCount int64 `json:"expectedAssetCount,omitempty,string"`
276
277 GuestOsScan *GuestOsScan `json:"guestOsScan,omitempty"`
278
279 Labels map[string]string `json:"labels,omitempty"`
280
281 Name string `json:"name,omitempty"`
282
283 ServiceAccount string `json:"serviceAccount,omitempty"`
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298 State string `json:"state,omitempty"`
299
300 UpdateTime string `json:"updateTime,omitempty"`
301
302 VsphereScan *VSphereScan `json:"vsphereScan,omitempty"`
303
304
305 googleapi.ServerResponse `json:"-"`
306
307
308
309
310
311 ForceSendFields []string `json:"-"`
312
313
314
315
316 NullFields []string `json:"-"`
317 }
318
319 func (s *Collector) MarshalJSON() ([]byte, error) {
320 type NoMethod Collector
321 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
322 }
323
324
325
326
327
328 type Empty struct {
329
330 googleapi.ServerResponse `json:"-"`
331 }
332
333
334 type GuestOsScan struct {
335
336 CoreSource string `json:"coreSource,omitempty"`
337
338
339
340
341
342 ForceSendFields []string `json:"-"`
343
344
345
346
347 NullFields []string `json:"-"`
348 }
349
350 func (s *GuestOsScan) MarshalJSON() ([]byte, error) {
351 type NoMethod GuestOsScan
352 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
353 }
354
355
356 type ListCollectorsResponse struct {
357
358 Collectors []*Collector `json:"collectors,omitempty"`
359
360
361 NextPageToken string `json:"nextPageToken,omitempty"`
362
363 Unreachable []string `json:"unreachable,omitempty"`
364
365
366 googleapi.ServerResponse `json:"-"`
367
368
369
370
371
372 ForceSendFields []string `json:"-"`
373
374
375
376
377 NullFields []string `json:"-"`
378 }
379
380 func (s *ListCollectorsResponse) MarshalJSON() ([]byte, error) {
381 type NoMethod ListCollectorsResponse
382 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
383 }
384
385
386 type ListLocationsResponse struct {
387
388
389 Locations []*Location `json:"locations,omitempty"`
390
391 NextPageToken string `json:"nextPageToken,omitempty"`
392
393
394 googleapi.ServerResponse `json:"-"`
395
396
397
398
399
400 ForceSendFields []string `json:"-"`
401
402
403
404
405 NullFields []string `json:"-"`
406 }
407
408 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
409 type NoMethod ListLocationsResponse
410 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
411 }
412
413
414 type ListOperationsResponse struct {
415
416 NextPageToken string `json:"nextPageToken,omitempty"`
417
418
419 Operations []*Operation `json:"operations,omitempty"`
420
421
422 googleapi.ServerResponse `json:"-"`
423
424
425
426
427
428 ForceSendFields []string `json:"-"`
429
430
431
432
433 NullFields []string `json:"-"`
434 }
435
436 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
437 type NoMethod ListOperationsResponse
438 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
439 }
440
441
442 type Location struct {
443
444
445 DisplayName string `json:"displayName,omitempty"`
446
447
448 Labels map[string]string `json:"labels,omitempty"`
449
450 LocationId string `json:"locationId,omitempty"`
451
452
453 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
454
455
456
457 Name string `json:"name,omitempty"`
458
459
460 googleapi.ServerResponse `json:"-"`
461
462
463
464
465
466 ForceSendFields []string `json:"-"`
467
468
469
470
471 NullFields []string `json:"-"`
472 }
473
474 func (s *Location) MarshalJSON() ([]byte, error) {
475 type NoMethod Location
476 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
477 }
478
479
480
481 type Operation struct {
482
483
484
485 Done bool `json:"done,omitempty"`
486
487 Error *Status `json:"error,omitempty"`
488
489
490
491
492 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
493
494
495
496 Name string `json:"name,omitempty"`
497
498
499
500
501
502
503
504 Response googleapi.RawMessage `json:"response,omitempty"`
505
506
507 googleapi.ServerResponse `json:"-"`
508
509
510
511
512
513 ForceSendFields []string `json:"-"`
514
515
516
517
518 NullFields []string `json:"-"`
519 }
520
521 func (s *Operation) MarshalJSON() ([]byte, error) {
522 type NoMethod Operation
523 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
524 }
525
526
527 type OperationMetadata struct {
528
529 ApiVersion string `json:"apiVersion,omitempty"`
530
531 CreateTime string `json:"createTime,omitempty"`
532
533 EndTime string `json:"endTime,omitempty"`
534
535
536
537
538 RequestedCancellation bool `json:"requestedCancellation,omitempty"`
539
540 StatusMessage string `json:"statusMessage,omitempty"`
541
542
543 Target string `json:"target,omitempty"`
544
545 Verb string `json:"verb,omitempty"`
546
547
548
549
550
551 ForceSendFields []string `json:"-"`
552
553
554
555
556 NullFields []string `json:"-"`
557 }
558
559 func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
560 type NoMethod OperationMetadata
561 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
562 }
563
564
565 type PauseCollectorRequest struct {
566
567
568
569
570
571
572
573
574
575
576
577 RequestId string `json:"requestId,omitempty"`
578
579
580
581
582
583 ForceSendFields []string `json:"-"`
584
585
586
587
588 NullFields []string `json:"-"`
589 }
590
591 func (s *PauseCollectorRequest) MarshalJSON() ([]byte, error) {
592 type NoMethod PauseCollectorRequest
593 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
594 }
595
596
597 type RegisterCollectorRequest struct {
598
599
600
601
602
603
604
605
606
607
608
609 RequestId string `json:"requestId,omitempty"`
610
611
612
613
614
615 ForceSendFields []string `json:"-"`
616
617
618
619
620 NullFields []string `json:"-"`
621 }
622
623 func (s *RegisterCollectorRequest) MarshalJSON() ([]byte, error) {
624 type NoMethod RegisterCollectorRequest
625 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
626 }
627
628
629 type ResumeCollectorRequest struct {
630
631
632
633
634
635
636
637
638
639
640
641 RequestId string `json:"requestId,omitempty"`
642
643
644
645
646
647 ForceSendFields []string `json:"-"`
648
649
650
651
652 NullFields []string `json:"-"`
653 }
654
655 func (s *ResumeCollectorRequest) MarshalJSON() ([]byte, error) {
656 type NoMethod ResumeCollectorRequest
657 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
658 }
659
660
661
662
663
664
665
666 type Status struct {
667
668 Code int64 `json:"code,omitempty"`
669
670
671 Details []googleapi.RawMessage `json:"details,omitempty"`
672
673
674
675 Message string `json:"message,omitempty"`
676
677
678
679
680
681 ForceSendFields []string `json:"-"`
682
683
684
685
686 NullFields []string `json:"-"`
687 }
688
689 func (s *Status) MarshalJSON() ([]byte, error) {
690 type NoMethod Status
691 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
692 }
693
694
695 type VSphereScan struct {
696
697 CoreSource string `json:"coreSource,omitempty"`
698
699
700
701
702
703 ForceSendFields []string `json:"-"`
704
705
706
707
708 NullFields []string `json:"-"`
709 }
710
711 func (s *VSphereScan) MarshalJSON() ([]byte, error) {
712 type NoMethod VSphereScan
713 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
714 }
715
716 type ProjectsLocationsGetCall struct {
717 s *Service
718 name string
719 urlParams_ gensupport.URLParams
720 ifNoneMatch_ string
721 ctx_ context.Context
722 header_ http.Header
723 }
724
725
726
727
728 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
729 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
730 c.name = name
731 return c
732 }
733
734
735
736
737 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
738 c.urlParams_.Set("fields", googleapi.CombineFields(s))
739 return c
740 }
741
742
743
744
745 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
746 c.ifNoneMatch_ = entityTag
747 return c
748 }
749
750
751 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
752 c.ctx_ = ctx
753 return c
754 }
755
756
757
758 func (c *ProjectsLocationsGetCall) Header() http.Header {
759 if c.header_ == nil {
760 c.header_ = make(http.Header)
761 }
762 return c.header_
763 }
764
765 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
766 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
767 if c.ifNoneMatch_ != "" {
768 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
769 }
770 var body io.Reader = nil
771 c.urlParams_.Set("alt", alt)
772 c.urlParams_.Set("prettyPrint", "false")
773 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
774 urls += "?" + c.urlParams_.Encode()
775 req, err := http.NewRequest("GET", urls, body)
776 if err != nil {
777 return nil, err
778 }
779 req.Header = reqHeaders
780 googleapi.Expand(req.URL, map[string]string{
781 "name": c.name,
782 })
783 return gensupport.SendRequest(c.ctx_, c.s.client, req)
784 }
785
786
787
788
789
790
791 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
792 gensupport.SetOptions(c.urlParams_, opts...)
793 res, err := c.doRequest("json")
794 if res != nil && res.StatusCode == http.StatusNotModified {
795 if res.Body != nil {
796 res.Body.Close()
797 }
798 return nil, gensupport.WrapError(&googleapi.Error{
799 Code: res.StatusCode,
800 Header: res.Header,
801 })
802 }
803 if err != nil {
804 return nil, err
805 }
806 defer googleapi.CloseBody(res)
807 if err := googleapi.CheckResponse(res); err != nil {
808 return nil, gensupport.WrapError(err)
809 }
810 ret := &Location{
811 ServerResponse: googleapi.ServerResponse{
812 Header: res.Header,
813 HTTPStatusCode: res.StatusCode,
814 },
815 }
816 target := &ret
817 if err := gensupport.DecodeResponse(target, res); err != nil {
818 return nil, err
819 }
820 return ret, nil
821 }
822
823 type ProjectsLocationsListCall struct {
824 s *Service
825 name string
826 urlParams_ gensupport.URLParams
827 ifNoneMatch_ string
828 ctx_ context.Context
829 header_ http.Header
830 }
831
832
833
834
835 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
836 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
837 c.name = name
838 return c
839 }
840
841
842
843
844
845 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
846 c.urlParams_.Set("filter", filter)
847 return c
848 }
849
850
851
852 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
853 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
854 return c
855 }
856
857
858
859
860 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
861 c.urlParams_.Set("pageToken", pageToken)
862 return c
863 }
864
865
866
867
868 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
869 c.urlParams_.Set("fields", googleapi.CombineFields(s))
870 return c
871 }
872
873
874
875
876 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
877 c.ifNoneMatch_ = entityTag
878 return c
879 }
880
881
882 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
883 c.ctx_ = ctx
884 return c
885 }
886
887
888
889 func (c *ProjectsLocationsListCall) Header() http.Header {
890 if c.header_ == nil {
891 c.header_ = make(http.Header)
892 }
893 return c.header_
894 }
895
896 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
897 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
898 if c.ifNoneMatch_ != "" {
899 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
900 }
901 var body io.Reader = nil
902 c.urlParams_.Set("alt", alt)
903 c.urlParams_.Set("prettyPrint", "false")
904 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
905 urls += "?" + c.urlParams_.Encode()
906 req, err := http.NewRequest("GET", urls, body)
907 if err != nil {
908 return nil, err
909 }
910 req.Header = reqHeaders
911 googleapi.Expand(req.URL, map[string]string{
912 "name": c.name,
913 })
914 return gensupport.SendRequest(c.ctx_, c.s.client, req)
915 }
916
917
918
919
920
921
922
923 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
924 gensupport.SetOptions(c.urlParams_, opts...)
925 res, err := c.doRequest("json")
926 if res != nil && res.StatusCode == http.StatusNotModified {
927 if res.Body != nil {
928 res.Body.Close()
929 }
930 return nil, gensupport.WrapError(&googleapi.Error{
931 Code: res.StatusCode,
932 Header: res.Header,
933 })
934 }
935 if err != nil {
936 return nil, err
937 }
938 defer googleapi.CloseBody(res)
939 if err := googleapi.CheckResponse(res); err != nil {
940 return nil, gensupport.WrapError(err)
941 }
942 ret := &ListLocationsResponse{
943 ServerResponse: googleapi.ServerResponse{
944 Header: res.Header,
945 HTTPStatusCode: res.StatusCode,
946 },
947 }
948 target := &ret
949 if err := gensupport.DecodeResponse(target, res); err != nil {
950 return nil, err
951 }
952 return ret, nil
953 }
954
955
956
957
958 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
959 c.ctx_ = ctx
960 defer c.PageToken(c.urlParams_.Get("pageToken"))
961 for {
962 x, err := c.Do()
963 if err != nil {
964 return err
965 }
966 if err := f(x); err != nil {
967 return err
968 }
969 if x.NextPageToken == "" {
970 return nil
971 }
972 c.PageToken(x.NextPageToken)
973 }
974 }
975
976 type ProjectsLocationsAnnotationsCreateCall struct {
977 s *Service
978 parent string
979 annotation *Annotation
980 urlParams_ gensupport.URLParams
981 ctx_ context.Context
982 header_ http.Header
983 }
984
985
986
987
988 func (r *ProjectsLocationsAnnotationsService) Create(parent string, annotation *Annotation) *ProjectsLocationsAnnotationsCreateCall {
989 c := &ProjectsLocationsAnnotationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
990 c.parent = parent
991 c.annotation = annotation
992 return c
993 }
994
995
996
997 func (c *ProjectsLocationsAnnotationsCreateCall) RequestId(requestId string) *ProjectsLocationsAnnotationsCreateCall {
998 c.urlParams_.Set("requestId", requestId)
999 return c
1000 }
1001
1002
1003
1004
1005 func (c *ProjectsLocationsAnnotationsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAnnotationsCreateCall {
1006 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1007 return c
1008 }
1009
1010
1011 func (c *ProjectsLocationsAnnotationsCreateCall) Context(ctx context.Context) *ProjectsLocationsAnnotationsCreateCall {
1012 c.ctx_ = ctx
1013 return c
1014 }
1015
1016
1017
1018 func (c *ProjectsLocationsAnnotationsCreateCall) Header() http.Header {
1019 if c.header_ == nil {
1020 c.header_ = make(http.Header)
1021 }
1022 return c.header_
1023 }
1024
1025 func (c *ProjectsLocationsAnnotationsCreateCall) doRequest(alt string) (*http.Response, error) {
1026 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1027 var body io.Reader = nil
1028 body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotation)
1029 if err != nil {
1030 return nil, err
1031 }
1032 c.urlParams_.Set("alt", alt)
1033 c.urlParams_.Set("prettyPrint", "false")
1034 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/annotations")
1035 urls += "?" + c.urlParams_.Encode()
1036 req, err := http.NewRequest("POST", urls, body)
1037 if err != nil {
1038 return nil, err
1039 }
1040 req.Header = reqHeaders
1041 googleapi.Expand(req.URL, map[string]string{
1042 "parent": c.parent,
1043 })
1044 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1045 }
1046
1047
1048
1049
1050
1051
1052 func (c *ProjectsLocationsAnnotationsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1053 gensupport.SetOptions(c.urlParams_, opts...)
1054 res, err := c.doRequest("json")
1055 if res != nil && res.StatusCode == http.StatusNotModified {
1056 if res.Body != nil {
1057 res.Body.Close()
1058 }
1059 return nil, gensupport.WrapError(&googleapi.Error{
1060 Code: res.StatusCode,
1061 Header: res.Header,
1062 })
1063 }
1064 if err != nil {
1065 return nil, err
1066 }
1067 defer googleapi.CloseBody(res)
1068 if err := googleapi.CheckResponse(res); err != nil {
1069 return nil, gensupport.WrapError(err)
1070 }
1071 ret := &Operation{
1072 ServerResponse: googleapi.ServerResponse{
1073 Header: res.Header,
1074 HTTPStatusCode: res.StatusCode,
1075 },
1076 }
1077 target := &ret
1078 if err := gensupport.DecodeResponse(target, res); err != nil {
1079 return nil, err
1080 }
1081 return ret, nil
1082 }
1083
1084 type ProjectsLocationsAnnotationsGetCall struct {
1085 s *Service
1086 name string
1087 urlParams_ gensupport.URLParams
1088 ifNoneMatch_ string
1089 ctx_ context.Context
1090 header_ http.Header
1091 }
1092
1093
1094
1095
1096 func (r *ProjectsLocationsAnnotationsService) Get(name string) *ProjectsLocationsAnnotationsGetCall {
1097 c := &ProjectsLocationsAnnotationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1098 c.name = name
1099 return c
1100 }
1101
1102
1103
1104
1105 func (c *ProjectsLocationsAnnotationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAnnotationsGetCall {
1106 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1107 return c
1108 }
1109
1110
1111
1112
1113 func (c *ProjectsLocationsAnnotationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAnnotationsGetCall {
1114 c.ifNoneMatch_ = entityTag
1115 return c
1116 }
1117
1118
1119 func (c *ProjectsLocationsAnnotationsGetCall) Context(ctx context.Context) *ProjectsLocationsAnnotationsGetCall {
1120 c.ctx_ = ctx
1121 return c
1122 }
1123
1124
1125
1126 func (c *ProjectsLocationsAnnotationsGetCall) Header() http.Header {
1127 if c.header_ == nil {
1128 c.header_ = make(http.Header)
1129 }
1130 return c.header_
1131 }
1132
1133 func (c *ProjectsLocationsAnnotationsGetCall) doRequest(alt string) (*http.Response, error) {
1134 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1135 if c.ifNoneMatch_ != "" {
1136 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1137 }
1138 var body io.Reader = nil
1139 c.urlParams_.Set("alt", alt)
1140 c.urlParams_.Set("prettyPrint", "false")
1141 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1142 urls += "?" + c.urlParams_.Encode()
1143 req, err := http.NewRequest("GET", urls, body)
1144 if err != nil {
1145 return nil, err
1146 }
1147 req.Header = reqHeaders
1148 googleapi.Expand(req.URL, map[string]string{
1149 "name": c.name,
1150 })
1151 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1152 }
1153
1154
1155
1156
1157
1158
1159 func (c *ProjectsLocationsAnnotationsGetCall) Do(opts ...googleapi.CallOption) (*Annotation, error) {
1160 gensupport.SetOptions(c.urlParams_, opts...)
1161 res, err := c.doRequest("json")
1162 if res != nil && res.StatusCode == http.StatusNotModified {
1163 if res.Body != nil {
1164 res.Body.Close()
1165 }
1166 return nil, gensupport.WrapError(&googleapi.Error{
1167 Code: res.StatusCode,
1168 Header: res.Header,
1169 })
1170 }
1171 if err != nil {
1172 return nil, err
1173 }
1174 defer googleapi.CloseBody(res)
1175 if err := googleapi.CheckResponse(res); err != nil {
1176 return nil, gensupport.WrapError(err)
1177 }
1178 ret := &Annotation{
1179 ServerResponse: googleapi.ServerResponse{
1180 Header: res.Header,
1181 HTTPStatusCode: res.StatusCode,
1182 },
1183 }
1184 target := &ret
1185 if err := gensupport.DecodeResponse(target, res); err != nil {
1186 return nil, err
1187 }
1188 return ret, nil
1189 }
1190
1191 type ProjectsLocationsCollectorsCreateCall struct {
1192 s *Service
1193 parent string
1194 collector *Collector
1195 urlParams_ gensupport.URLParams
1196 ctx_ context.Context
1197 header_ http.Header
1198 }
1199
1200
1201
1202
1203
1204 func (r *ProjectsLocationsCollectorsService) Create(parent string, collector *Collector) *ProjectsLocationsCollectorsCreateCall {
1205 c := &ProjectsLocationsCollectorsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1206 c.parent = parent
1207 c.collector = collector
1208 return c
1209 }
1210
1211
1212
1213 func (c *ProjectsLocationsCollectorsCreateCall) CollectorId(collectorId string) *ProjectsLocationsCollectorsCreateCall {
1214 c.urlParams_.Set("collectorId", collectorId)
1215 return c
1216 }
1217
1218
1219
1220 func (c *ProjectsLocationsCollectorsCreateCall) RequestId(requestId string) *ProjectsLocationsCollectorsCreateCall {
1221 c.urlParams_.Set("requestId", requestId)
1222 return c
1223 }
1224
1225
1226
1227
1228 func (c *ProjectsLocationsCollectorsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsCreateCall {
1229 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1230 return c
1231 }
1232
1233
1234 func (c *ProjectsLocationsCollectorsCreateCall) Context(ctx context.Context) *ProjectsLocationsCollectorsCreateCall {
1235 c.ctx_ = ctx
1236 return c
1237 }
1238
1239
1240
1241 func (c *ProjectsLocationsCollectorsCreateCall) Header() http.Header {
1242 if c.header_ == nil {
1243 c.header_ = make(http.Header)
1244 }
1245 return c.header_
1246 }
1247
1248 func (c *ProjectsLocationsCollectorsCreateCall) doRequest(alt string) (*http.Response, error) {
1249 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1250 var body io.Reader = nil
1251 body, err := googleapi.WithoutDataWrapper.JSONReader(c.collector)
1252 if err != nil {
1253 return nil, err
1254 }
1255 c.urlParams_.Set("alt", alt)
1256 c.urlParams_.Set("prettyPrint", "false")
1257 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/collectors")
1258 urls += "?" + c.urlParams_.Encode()
1259 req, err := http.NewRequest("POST", urls, body)
1260 if err != nil {
1261 return nil, err
1262 }
1263 req.Header = reqHeaders
1264 googleapi.Expand(req.URL, map[string]string{
1265 "parent": c.parent,
1266 })
1267 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1268 }
1269
1270
1271
1272
1273
1274
1275 func (c *ProjectsLocationsCollectorsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1276 gensupport.SetOptions(c.urlParams_, opts...)
1277 res, err := c.doRequest("json")
1278 if res != nil && res.StatusCode == http.StatusNotModified {
1279 if res.Body != nil {
1280 res.Body.Close()
1281 }
1282 return nil, gensupport.WrapError(&googleapi.Error{
1283 Code: res.StatusCode,
1284 Header: res.Header,
1285 })
1286 }
1287 if err != nil {
1288 return nil, err
1289 }
1290 defer googleapi.CloseBody(res)
1291 if err := googleapi.CheckResponse(res); err != nil {
1292 return nil, gensupport.WrapError(err)
1293 }
1294 ret := &Operation{
1295 ServerResponse: googleapi.ServerResponse{
1296 Header: res.Header,
1297 HTTPStatusCode: res.StatusCode,
1298 },
1299 }
1300 target := &ret
1301 if err := gensupport.DecodeResponse(target, res); err != nil {
1302 return nil, err
1303 }
1304 return ret, nil
1305 }
1306
1307 type ProjectsLocationsCollectorsDeleteCall struct {
1308 s *Service
1309 name string
1310 urlParams_ gensupport.URLParams
1311 ctx_ context.Context
1312 header_ http.Header
1313 }
1314
1315
1316
1317
1318
1319 func (r *ProjectsLocationsCollectorsService) Delete(name string) *ProjectsLocationsCollectorsDeleteCall {
1320 c := &ProjectsLocationsCollectorsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1321 c.name = name
1322 return c
1323 }
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336 func (c *ProjectsLocationsCollectorsDeleteCall) RequestId(requestId string) *ProjectsLocationsCollectorsDeleteCall {
1337 c.urlParams_.Set("requestId", requestId)
1338 return c
1339 }
1340
1341
1342
1343
1344 func (c *ProjectsLocationsCollectorsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsDeleteCall {
1345 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1346 return c
1347 }
1348
1349
1350 func (c *ProjectsLocationsCollectorsDeleteCall) Context(ctx context.Context) *ProjectsLocationsCollectorsDeleteCall {
1351 c.ctx_ = ctx
1352 return c
1353 }
1354
1355
1356
1357 func (c *ProjectsLocationsCollectorsDeleteCall) Header() http.Header {
1358 if c.header_ == nil {
1359 c.header_ = make(http.Header)
1360 }
1361 return c.header_
1362 }
1363
1364 func (c *ProjectsLocationsCollectorsDeleteCall) doRequest(alt string) (*http.Response, error) {
1365 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1366 var body io.Reader = nil
1367 c.urlParams_.Set("alt", alt)
1368 c.urlParams_.Set("prettyPrint", "false")
1369 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1370 urls += "?" + c.urlParams_.Encode()
1371 req, err := http.NewRequest("DELETE", urls, body)
1372 if err != nil {
1373 return nil, err
1374 }
1375 req.Header = reqHeaders
1376 googleapi.Expand(req.URL, map[string]string{
1377 "name": c.name,
1378 })
1379 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1380 }
1381
1382
1383
1384
1385
1386
1387 func (c *ProjectsLocationsCollectorsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1388 gensupport.SetOptions(c.urlParams_, opts...)
1389 res, err := c.doRequest("json")
1390 if res != nil && res.StatusCode == http.StatusNotModified {
1391 if res.Body != nil {
1392 res.Body.Close()
1393 }
1394 return nil, gensupport.WrapError(&googleapi.Error{
1395 Code: res.StatusCode,
1396 Header: res.Header,
1397 })
1398 }
1399 if err != nil {
1400 return nil, err
1401 }
1402 defer googleapi.CloseBody(res)
1403 if err := googleapi.CheckResponse(res); err != nil {
1404 return nil, gensupport.WrapError(err)
1405 }
1406 ret := &Operation{
1407 ServerResponse: googleapi.ServerResponse{
1408 Header: res.Header,
1409 HTTPStatusCode: res.StatusCode,
1410 },
1411 }
1412 target := &ret
1413 if err := gensupport.DecodeResponse(target, res); err != nil {
1414 return nil, err
1415 }
1416 return ret, nil
1417 }
1418
1419 type ProjectsLocationsCollectorsGetCall struct {
1420 s *Service
1421 name string
1422 urlParams_ gensupport.URLParams
1423 ifNoneMatch_ string
1424 ctx_ context.Context
1425 header_ http.Header
1426 }
1427
1428
1429
1430
1431 func (r *ProjectsLocationsCollectorsService) Get(name string) *ProjectsLocationsCollectorsGetCall {
1432 c := &ProjectsLocationsCollectorsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1433 c.name = name
1434 return c
1435 }
1436
1437
1438
1439
1440 func (c *ProjectsLocationsCollectorsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsGetCall {
1441 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1442 return c
1443 }
1444
1445
1446
1447
1448 func (c *ProjectsLocationsCollectorsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectorsGetCall {
1449 c.ifNoneMatch_ = entityTag
1450 return c
1451 }
1452
1453
1454 func (c *ProjectsLocationsCollectorsGetCall) Context(ctx context.Context) *ProjectsLocationsCollectorsGetCall {
1455 c.ctx_ = ctx
1456 return c
1457 }
1458
1459
1460
1461 func (c *ProjectsLocationsCollectorsGetCall) Header() http.Header {
1462 if c.header_ == nil {
1463 c.header_ = make(http.Header)
1464 }
1465 return c.header_
1466 }
1467
1468 func (c *ProjectsLocationsCollectorsGetCall) doRequest(alt string) (*http.Response, error) {
1469 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1470 if c.ifNoneMatch_ != "" {
1471 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1472 }
1473 var body io.Reader = nil
1474 c.urlParams_.Set("alt", alt)
1475 c.urlParams_.Set("prettyPrint", "false")
1476 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1477 urls += "?" + c.urlParams_.Encode()
1478 req, err := http.NewRequest("GET", urls, body)
1479 if err != nil {
1480 return nil, err
1481 }
1482 req.Header = reqHeaders
1483 googleapi.Expand(req.URL, map[string]string{
1484 "name": c.name,
1485 })
1486 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1487 }
1488
1489
1490
1491
1492
1493
1494 func (c *ProjectsLocationsCollectorsGetCall) Do(opts ...googleapi.CallOption) (*Collector, error) {
1495 gensupport.SetOptions(c.urlParams_, opts...)
1496 res, err := c.doRequest("json")
1497 if res != nil && res.StatusCode == http.StatusNotModified {
1498 if res.Body != nil {
1499 res.Body.Close()
1500 }
1501 return nil, gensupport.WrapError(&googleapi.Error{
1502 Code: res.StatusCode,
1503 Header: res.Header,
1504 })
1505 }
1506 if err != nil {
1507 return nil, err
1508 }
1509 defer googleapi.CloseBody(res)
1510 if err := googleapi.CheckResponse(res); err != nil {
1511 return nil, gensupport.WrapError(err)
1512 }
1513 ret := &Collector{
1514 ServerResponse: googleapi.ServerResponse{
1515 Header: res.Header,
1516 HTTPStatusCode: res.StatusCode,
1517 },
1518 }
1519 target := &ret
1520 if err := gensupport.DecodeResponse(target, res); err != nil {
1521 return nil, err
1522 }
1523 return ret, nil
1524 }
1525
1526 type ProjectsLocationsCollectorsListCall struct {
1527 s *Service
1528 parent string
1529 urlParams_ gensupport.URLParams
1530 ifNoneMatch_ string
1531 ctx_ context.Context
1532 header_ http.Header
1533 }
1534
1535
1536
1537
1538 func (r *ProjectsLocationsCollectorsService) List(parent string) *ProjectsLocationsCollectorsListCall {
1539 c := &ProjectsLocationsCollectorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1540 c.parent = parent
1541 return c
1542 }
1543
1544
1545 func (c *ProjectsLocationsCollectorsListCall) Filter(filter string) *ProjectsLocationsCollectorsListCall {
1546 c.urlParams_.Set("filter", filter)
1547 return c
1548 }
1549
1550
1551
1552 func (c *ProjectsLocationsCollectorsListCall) OrderBy(orderBy string) *ProjectsLocationsCollectorsListCall {
1553 c.urlParams_.Set("orderBy", orderBy)
1554 return c
1555 }
1556
1557
1558
1559
1560 func (c *ProjectsLocationsCollectorsListCall) PageSize(pageSize int64) *ProjectsLocationsCollectorsListCall {
1561 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1562 return c
1563 }
1564
1565
1566
1567 func (c *ProjectsLocationsCollectorsListCall) PageToken(pageToken string) *ProjectsLocationsCollectorsListCall {
1568 c.urlParams_.Set("pageToken", pageToken)
1569 return c
1570 }
1571
1572
1573
1574
1575 func (c *ProjectsLocationsCollectorsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsListCall {
1576 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1577 return c
1578 }
1579
1580
1581
1582
1583 func (c *ProjectsLocationsCollectorsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCollectorsListCall {
1584 c.ifNoneMatch_ = entityTag
1585 return c
1586 }
1587
1588
1589 func (c *ProjectsLocationsCollectorsListCall) Context(ctx context.Context) *ProjectsLocationsCollectorsListCall {
1590 c.ctx_ = ctx
1591 return c
1592 }
1593
1594
1595
1596 func (c *ProjectsLocationsCollectorsListCall) Header() http.Header {
1597 if c.header_ == nil {
1598 c.header_ = make(http.Header)
1599 }
1600 return c.header_
1601 }
1602
1603 func (c *ProjectsLocationsCollectorsListCall) doRequest(alt string) (*http.Response, error) {
1604 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1605 if c.ifNoneMatch_ != "" {
1606 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1607 }
1608 var body io.Reader = nil
1609 c.urlParams_.Set("alt", alt)
1610 c.urlParams_.Set("prettyPrint", "false")
1611 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/collectors")
1612 urls += "?" + c.urlParams_.Encode()
1613 req, err := http.NewRequest("GET", urls, body)
1614 if err != nil {
1615 return nil, err
1616 }
1617 req.Header = reqHeaders
1618 googleapi.Expand(req.URL, map[string]string{
1619 "parent": c.parent,
1620 })
1621 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1622 }
1623
1624
1625
1626
1627
1628
1629
1630 func (c *ProjectsLocationsCollectorsListCall) Do(opts ...googleapi.CallOption) (*ListCollectorsResponse, error) {
1631 gensupport.SetOptions(c.urlParams_, opts...)
1632 res, err := c.doRequest("json")
1633 if res != nil && res.StatusCode == http.StatusNotModified {
1634 if res.Body != nil {
1635 res.Body.Close()
1636 }
1637 return nil, gensupport.WrapError(&googleapi.Error{
1638 Code: res.StatusCode,
1639 Header: res.Header,
1640 })
1641 }
1642 if err != nil {
1643 return nil, err
1644 }
1645 defer googleapi.CloseBody(res)
1646 if err := googleapi.CheckResponse(res); err != nil {
1647 return nil, gensupport.WrapError(err)
1648 }
1649 ret := &ListCollectorsResponse{
1650 ServerResponse: googleapi.ServerResponse{
1651 Header: res.Header,
1652 HTTPStatusCode: res.StatusCode,
1653 },
1654 }
1655 target := &ret
1656 if err := gensupport.DecodeResponse(target, res); err != nil {
1657 return nil, err
1658 }
1659 return ret, nil
1660 }
1661
1662
1663
1664
1665 func (c *ProjectsLocationsCollectorsListCall) Pages(ctx context.Context, f func(*ListCollectorsResponse) error) error {
1666 c.ctx_ = ctx
1667 defer c.PageToken(c.urlParams_.Get("pageToken"))
1668 for {
1669 x, err := c.Do()
1670 if err != nil {
1671 return err
1672 }
1673 if err := f(x); err != nil {
1674 return err
1675 }
1676 if x.NextPageToken == "" {
1677 return nil
1678 }
1679 c.PageToken(x.NextPageToken)
1680 }
1681 }
1682
1683 type ProjectsLocationsCollectorsPatchCall struct {
1684 s *Service
1685 name string
1686 collector *Collector
1687 urlParams_ gensupport.URLParams
1688 ctx_ context.Context
1689 header_ http.Header
1690 }
1691
1692
1693
1694
1695 func (r *ProjectsLocationsCollectorsService) Patch(name string, collector *Collector) *ProjectsLocationsCollectorsPatchCall {
1696 c := &ProjectsLocationsCollectorsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1697 c.name = name
1698 c.collector = collector
1699 return c
1700 }
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713 func (c *ProjectsLocationsCollectorsPatchCall) RequestId(requestId string) *ProjectsLocationsCollectorsPatchCall {
1714 c.urlParams_.Set("requestId", requestId)
1715 return c
1716 }
1717
1718
1719
1720
1721
1722
1723
1724 func (c *ProjectsLocationsCollectorsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsCollectorsPatchCall {
1725 c.urlParams_.Set("updateMask", updateMask)
1726 return c
1727 }
1728
1729
1730
1731
1732 func (c *ProjectsLocationsCollectorsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsPatchCall {
1733 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1734 return c
1735 }
1736
1737
1738 func (c *ProjectsLocationsCollectorsPatchCall) Context(ctx context.Context) *ProjectsLocationsCollectorsPatchCall {
1739 c.ctx_ = ctx
1740 return c
1741 }
1742
1743
1744
1745 func (c *ProjectsLocationsCollectorsPatchCall) Header() http.Header {
1746 if c.header_ == nil {
1747 c.header_ = make(http.Header)
1748 }
1749 return c.header_
1750 }
1751
1752 func (c *ProjectsLocationsCollectorsPatchCall) doRequest(alt string) (*http.Response, error) {
1753 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1754 var body io.Reader = nil
1755 body, err := googleapi.WithoutDataWrapper.JSONReader(c.collector)
1756 if err != nil {
1757 return nil, err
1758 }
1759 c.urlParams_.Set("alt", alt)
1760 c.urlParams_.Set("prettyPrint", "false")
1761 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1762 urls += "?" + c.urlParams_.Encode()
1763 req, err := http.NewRequest("PATCH", urls, body)
1764 if err != nil {
1765 return nil, err
1766 }
1767 req.Header = reqHeaders
1768 googleapi.Expand(req.URL, map[string]string{
1769 "name": c.name,
1770 })
1771 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1772 }
1773
1774
1775
1776
1777
1778
1779 func (c *ProjectsLocationsCollectorsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1780 gensupport.SetOptions(c.urlParams_, opts...)
1781 res, err := c.doRequest("json")
1782 if res != nil && res.StatusCode == http.StatusNotModified {
1783 if res.Body != nil {
1784 res.Body.Close()
1785 }
1786 return nil, gensupport.WrapError(&googleapi.Error{
1787 Code: res.StatusCode,
1788 Header: res.Header,
1789 })
1790 }
1791 if err != nil {
1792 return nil, err
1793 }
1794 defer googleapi.CloseBody(res)
1795 if err := googleapi.CheckResponse(res); err != nil {
1796 return nil, gensupport.WrapError(err)
1797 }
1798 ret := &Operation{
1799 ServerResponse: googleapi.ServerResponse{
1800 Header: res.Header,
1801 HTTPStatusCode: res.StatusCode,
1802 },
1803 }
1804 target := &ret
1805 if err := gensupport.DecodeResponse(target, res); err != nil {
1806 return nil, err
1807 }
1808 return ret, nil
1809 }
1810
1811 type ProjectsLocationsCollectorsPauseCall struct {
1812 s *Service
1813 name string
1814 pausecollectorrequest *PauseCollectorRequest
1815 urlParams_ gensupport.URLParams
1816 ctx_ context.Context
1817 header_ http.Header
1818 }
1819
1820
1821
1822
1823 func (r *ProjectsLocationsCollectorsService) Pause(name string, pausecollectorrequest *PauseCollectorRequest) *ProjectsLocationsCollectorsPauseCall {
1824 c := &ProjectsLocationsCollectorsPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1825 c.name = name
1826 c.pausecollectorrequest = pausecollectorrequest
1827 return c
1828 }
1829
1830
1831
1832
1833 func (c *ProjectsLocationsCollectorsPauseCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsPauseCall {
1834 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1835 return c
1836 }
1837
1838
1839 func (c *ProjectsLocationsCollectorsPauseCall) Context(ctx context.Context) *ProjectsLocationsCollectorsPauseCall {
1840 c.ctx_ = ctx
1841 return c
1842 }
1843
1844
1845
1846 func (c *ProjectsLocationsCollectorsPauseCall) Header() http.Header {
1847 if c.header_ == nil {
1848 c.header_ = make(http.Header)
1849 }
1850 return c.header_
1851 }
1852
1853 func (c *ProjectsLocationsCollectorsPauseCall) doRequest(alt string) (*http.Response, error) {
1854 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1855 var body io.Reader = nil
1856 body, err := googleapi.WithoutDataWrapper.JSONReader(c.pausecollectorrequest)
1857 if err != nil {
1858 return nil, err
1859 }
1860 c.urlParams_.Set("alt", alt)
1861 c.urlParams_.Set("prettyPrint", "false")
1862 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:pause")
1863 urls += "?" + c.urlParams_.Encode()
1864 req, err := http.NewRequest("POST", urls, body)
1865 if err != nil {
1866 return nil, err
1867 }
1868 req.Header = reqHeaders
1869 googleapi.Expand(req.URL, map[string]string{
1870 "name": c.name,
1871 })
1872 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1873 }
1874
1875
1876
1877
1878
1879
1880 func (c *ProjectsLocationsCollectorsPauseCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1881 gensupport.SetOptions(c.urlParams_, opts...)
1882 res, err := c.doRequest("json")
1883 if res != nil && res.StatusCode == http.StatusNotModified {
1884 if res.Body != nil {
1885 res.Body.Close()
1886 }
1887 return nil, gensupport.WrapError(&googleapi.Error{
1888 Code: res.StatusCode,
1889 Header: res.Header,
1890 })
1891 }
1892 if err != nil {
1893 return nil, err
1894 }
1895 defer googleapi.CloseBody(res)
1896 if err := googleapi.CheckResponse(res); err != nil {
1897 return nil, gensupport.WrapError(err)
1898 }
1899 ret := &Operation{
1900 ServerResponse: googleapi.ServerResponse{
1901 Header: res.Header,
1902 HTTPStatusCode: res.StatusCode,
1903 },
1904 }
1905 target := &ret
1906 if err := gensupport.DecodeResponse(target, res); err != nil {
1907 return nil, err
1908 }
1909 return ret, nil
1910 }
1911
1912 type ProjectsLocationsCollectorsRegisterCall struct {
1913 s *Service
1914 name string
1915 registercollectorrequest *RegisterCollectorRequest
1916 urlParams_ gensupport.URLParams
1917 ctx_ context.Context
1918 header_ http.Header
1919 }
1920
1921
1922
1923
1924 func (r *ProjectsLocationsCollectorsService) Register(name string, registercollectorrequest *RegisterCollectorRequest) *ProjectsLocationsCollectorsRegisterCall {
1925 c := &ProjectsLocationsCollectorsRegisterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1926 c.name = name
1927 c.registercollectorrequest = registercollectorrequest
1928 return c
1929 }
1930
1931
1932
1933
1934 func (c *ProjectsLocationsCollectorsRegisterCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsRegisterCall {
1935 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1936 return c
1937 }
1938
1939
1940 func (c *ProjectsLocationsCollectorsRegisterCall) Context(ctx context.Context) *ProjectsLocationsCollectorsRegisterCall {
1941 c.ctx_ = ctx
1942 return c
1943 }
1944
1945
1946
1947 func (c *ProjectsLocationsCollectorsRegisterCall) Header() http.Header {
1948 if c.header_ == nil {
1949 c.header_ = make(http.Header)
1950 }
1951 return c.header_
1952 }
1953
1954 func (c *ProjectsLocationsCollectorsRegisterCall) doRequest(alt string) (*http.Response, error) {
1955 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1956 var body io.Reader = nil
1957 body, err := googleapi.WithoutDataWrapper.JSONReader(c.registercollectorrequest)
1958 if err != nil {
1959 return nil, err
1960 }
1961 c.urlParams_.Set("alt", alt)
1962 c.urlParams_.Set("prettyPrint", "false")
1963 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:register")
1964 urls += "?" + c.urlParams_.Encode()
1965 req, err := http.NewRequest("POST", urls, body)
1966 if err != nil {
1967 return nil, err
1968 }
1969 req.Header = reqHeaders
1970 googleapi.Expand(req.URL, map[string]string{
1971 "name": c.name,
1972 })
1973 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1974 }
1975
1976
1977
1978
1979
1980
1981 func (c *ProjectsLocationsCollectorsRegisterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1982 gensupport.SetOptions(c.urlParams_, opts...)
1983 res, err := c.doRequest("json")
1984 if res != nil && res.StatusCode == http.StatusNotModified {
1985 if res.Body != nil {
1986 res.Body.Close()
1987 }
1988 return nil, gensupport.WrapError(&googleapi.Error{
1989 Code: res.StatusCode,
1990 Header: res.Header,
1991 })
1992 }
1993 if err != nil {
1994 return nil, err
1995 }
1996 defer googleapi.CloseBody(res)
1997 if err := googleapi.CheckResponse(res); err != nil {
1998 return nil, gensupport.WrapError(err)
1999 }
2000 ret := &Operation{
2001 ServerResponse: googleapi.ServerResponse{
2002 Header: res.Header,
2003 HTTPStatusCode: res.StatusCode,
2004 },
2005 }
2006 target := &ret
2007 if err := gensupport.DecodeResponse(target, res); err != nil {
2008 return nil, err
2009 }
2010 return ret, nil
2011 }
2012
2013 type ProjectsLocationsCollectorsResumeCall struct {
2014 s *Service
2015 name string
2016 resumecollectorrequest *ResumeCollectorRequest
2017 urlParams_ gensupport.URLParams
2018 ctx_ context.Context
2019 header_ http.Header
2020 }
2021
2022
2023
2024
2025 func (r *ProjectsLocationsCollectorsService) Resume(name string, resumecollectorrequest *ResumeCollectorRequest) *ProjectsLocationsCollectorsResumeCall {
2026 c := &ProjectsLocationsCollectorsResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2027 c.name = name
2028 c.resumecollectorrequest = resumecollectorrequest
2029 return c
2030 }
2031
2032
2033
2034
2035 func (c *ProjectsLocationsCollectorsResumeCall) Fields(s ...googleapi.Field) *ProjectsLocationsCollectorsResumeCall {
2036 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2037 return c
2038 }
2039
2040
2041 func (c *ProjectsLocationsCollectorsResumeCall) Context(ctx context.Context) *ProjectsLocationsCollectorsResumeCall {
2042 c.ctx_ = ctx
2043 return c
2044 }
2045
2046
2047
2048 func (c *ProjectsLocationsCollectorsResumeCall) Header() http.Header {
2049 if c.header_ == nil {
2050 c.header_ = make(http.Header)
2051 }
2052 return c.header_
2053 }
2054
2055 func (c *ProjectsLocationsCollectorsResumeCall) doRequest(alt string) (*http.Response, error) {
2056 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2057 var body io.Reader = nil
2058 body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumecollectorrequest)
2059 if err != nil {
2060 return nil, err
2061 }
2062 c.urlParams_.Set("alt", alt)
2063 c.urlParams_.Set("prettyPrint", "false")
2064 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:resume")
2065 urls += "?" + c.urlParams_.Encode()
2066 req, err := http.NewRequest("POST", urls, body)
2067 if err != nil {
2068 return nil, err
2069 }
2070 req.Header = reqHeaders
2071 googleapi.Expand(req.URL, map[string]string{
2072 "name": c.name,
2073 })
2074 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2075 }
2076
2077
2078
2079
2080
2081
2082 func (c *ProjectsLocationsCollectorsResumeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2083 gensupport.SetOptions(c.urlParams_, opts...)
2084 res, err := c.doRequest("json")
2085 if res != nil && res.StatusCode == http.StatusNotModified {
2086 if res.Body != nil {
2087 res.Body.Close()
2088 }
2089 return nil, gensupport.WrapError(&googleapi.Error{
2090 Code: res.StatusCode,
2091 Header: res.Header,
2092 })
2093 }
2094 if err != nil {
2095 return nil, err
2096 }
2097 defer googleapi.CloseBody(res)
2098 if err := googleapi.CheckResponse(res); err != nil {
2099 return nil, gensupport.WrapError(err)
2100 }
2101 ret := &Operation{
2102 ServerResponse: googleapi.ServerResponse{
2103 Header: res.Header,
2104 HTTPStatusCode: res.StatusCode,
2105 },
2106 }
2107 target := &ret
2108 if err := gensupport.DecodeResponse(target, res); err != nil {
2109 return nil, err
2110 }
2111 return ret, nil
2112 }
2113
2114 type ProjectsLocationsOperationsCancelCall struct {
2115 s *Service
2116 name string
2117 canceloperationrequest *CancelOperationRequest
2118 urlParams_ gensupport.URLParams
2119 ctx_ context.Context
2120 header_ http.Header
2121 }
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
2135 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2136 c.name = name
2137 c.canceloperationrequest = canceloperationrequest
2138 return c
2139 }
2140
2141
2142
2143
2144 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
2145 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2146 return c
2147 }
2148
2149
2150 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
2151 c.ctx_ = ctx
2152 return c
2153 }
2154
2155
2156
2157 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
2158 if c.header_ == nil {
2159 c.header_ = make(http.Header)
2160 }
2161 return c.header_
2162 }
2163
2164 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
2165 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2166 var body io.Reader = nil
2167 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
2168 if err != nil {
2169 return nil, err
2170 }
2171 c.urlParams_.Set("alt", alt)
2172 c.urlParams_.Set("prettyPrint", "false")
2173 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
2174 urls += "?" + c.urlParams_.Encode()
2175 req, err := http.NewRequest("POST", urls, body)
2176 if err != nil {
2177 return nil, err
2178 }
2179 req.Header = reqHeaders
2180 googleapi.Expand(req.URL, map[string]string{
2181 "name": c.name,
2182 })
2183 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2184 }
2185
2186
2187
2188
2189
2190
2191 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2192 gensupport.SetOptions(c.urlParams_, opts...)
2193 res, err := c.doRequest("json")
2194 if res != nil && res.StatusCode == http.StatusNotModified {
2195 if res.Body != nil {
2196 res.Body.Close()
2197 }
2198 return nil, gensupport.WrapError(&googleapi.Error{
2199 Code: res.StatusCode,
2200 Header: res.Header,
2201 })
2202 }
2203 if err != nil {
2204 return nil, err
2205 }
2206 defer googleapi.CloseBody(res)
2207 if err := googleapi.CheckResponse(res); err != nil {
2208 return nil, gensupport.WrapError(err)
2209 }
2210 ret := &Empty{
2211 ServerResponse: googleapi.ServerResponse{
2212 Header: res.Header,
2213 HTTPStatusCode: res.StatusCode,
2214 },
2215 }
2216 target := &ret
2217 if err := gensupport.DecodeResponse(target, res); err != nil {
2218 return nil, err
2219 }
2220 return ret, nil
2221 }
2222
2223 type ProjectsLocationsOperationsDeleteCall struct {
2224 s *Service
2225 name string
2226 urlParams_ gensupport.URLParams
2227 ctx_ context.Context
2228 header_ http.Header
2229 }
2230
2231
2232
2233
2234
2235
2236
2237 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
2238 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2239 c.name = name
2240 return c
2241 }
2242
2243
2244
2245
2246 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
2247 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2248 return c
2249 }
2250
2251
2252 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
2253 c.ctx_ = ctx
2254 return c
2255 }
2256
2257
2258
2259 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
2260 if c.header_ == nil {
2261 c.header_ = make(http.Header)
2262 }
2263 return c.header_
2264 }
2265
2266 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
2267 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2268 var body io.Reader = nil
2269 c.urlParams_.Set("alt", alt)
2270 c.urlParams_.Set("prettyPrint", "false")
2271 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2272 urls += "?" + c.urlParams_.Encode()
2273 req, err := http.NewRequest("DELETE", urls, body)
2274 if err != nil {
2275 return nil, err
2276 }
2277 req.Header = reqHeaders
2278 googleapi.Expand(req.URL, map[string]string{
2279 "name": c.name,
2280 })
2281 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2282 }
2283
2284
2285
2286
2287
2288
2289 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2290 gensupport.SetOptions(c.urlParams_, opts...)
2291 res, err := c.doRequest("json")
2292 if res != nil && res.StatusCode == http.StatusNotModified {
2293 if res.Body != nil {
2294 res.Body.Close()
2295 }
2296 return nil, gensupport.WrapError(&googleapi.Error{
2297 Code: res.StatusCode,
2298 Header: res.Header,
2299 })
2300 }
2301 if err != nil {
2302 return nil, err
2303 }
2304 defer googleapi.CloseBody(res)
2305 if err := googleapi.CheckResponse(res); err != nil {
2306 return nil, gensupport.WrapError(err)
2307 }
2308 ret := &Empty{
2309 ServerResponse: googleapi.ServerResponse{
2310 Header: res.Header,
2311 HTTPStatusCode: res.StatusCode,
2312 },
2313 }
2314 target := &ret
2315 if err := gensupport.DecodeResponse(target, res); err != nil {
2316 return nil, err
2317 }
2318 return ret, nil
2319 }
2320
2321 type ProjectsLocationsOperationsGetCall struct {
2322 s *Service
2323 name string
2324 urlParams_ gensupport.URLParams
2325 ifNoneMatch_ string
2326 ctx_ context.Context
2327 header_ http.Header
2328 }
2329
2330
2331
2332
2333
2334
2335 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
2336 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2337 c.name = name
2338 return c
2339 }
2340
2341
2342
2343
2344 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
2345 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2346 return c
2347 }
2348
2349
2350
2351
2352 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
2353 c.ifNoneMatch_ = entityTag
2354 return c
2355 }
2356
2357
2358 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
2359 c.ctx_ = ctx
2360 return c
2361 }
2362
2363
2364
2365 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
2366 if c.header_ == nil {
2367 c.header_ = make(http.Header)
2368 }
2369 return c.header_
2370 }
2371
2372 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
2373 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2374 if c.ifNoneMatch_ != "" {
2375 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2376 }
2377 var body io.Reader = nil
2378 c.urlParams_.Set("alt", alt)
2379 c.urlParams_.Set("prettyPrint", "false")
2380 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2381 urls += "?" + c.urlParams_.Encode()
2382 req, err := http.NewRequest("GET", urls, body)
2383 if err != nil {
2384 return nil, err
2385 }
2386 req.Header = reqHeaders
2387 googleapi.Expand(req.URL, map[string]string{
2388 "name": c.name,
2389 })
2390 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2391 }
2392
2393
2394
2395
2396
2397
2398 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2399 gensupport.SetOptions(c.urlParams_, opts...)
2400 res, err := c.doRequest("json")
2401 if res != nil && res.StatusCode == http.StatusNotModified {
2402 if res.Body != nil {
2403 res.Body.Close()
2404 }
2405 return nil, gensupport.WrapError(&googleapi.Error{
2406 Code: res.StatusCode,
2407 Header: res.Header,
2408 })
2409 }
2410 if err != nil {
2411 return nil, err
2412 }
2413 defer googleapi.CloseBody(res)
2414 if err := googleapi.CheckResponse(res); err != nil {
2415 return nil, gensupport.WrapError(err)
2416 }
2417 ret := &Operation{
2418 ServerResponse: googleapi.ServerResponse{
2419 Header: res.Header,
2420 HTTPStatusCode: res.StatusCode,
2421 },
2422 }
2423 target := &ret
2424 if err := gensupport.DecodeResponse(target, res); err != nil {
2425 return nil, err
2426 }
2427 return ret, nil
2428 }
2429
2430 type ProjectsLocationsOperationsListCall struct {
2431 s *Service
2432 name string
2433 urlParams_ gensupport.URLParams
2434 ifNoneMatch_ string
2435 ctx_ context.Context
2436 header_ http.Header
2437 }
2438
2439
2440
2441
2442
2443 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
2444 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2445 c.name = name
2446 return c
2447 }
2448
2449
2450 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
2451 c.urlParams_.Set("filter", filter)
2452 return c
2453 }
2454
2455
2456
2457 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
2458 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2459 return c
2460 }
2461
2462
2463
2464 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
2465 c.urlParams_.Set("pageToken", pageToken)
2466 return c
2467 }
2468
2469
2470
2471
2472 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
2473 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2474 return c
2475 }
2476
2477
2478
2479
2480 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
2481 c.ifNoneMatch_ = entityTag
2482 return c
2483 }
2484
2485
2486 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
2487 c.ctx_ = ctx
2488 return c
2489 }
2490
2491
2492
2493 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
2494 if c.header_ == nil {
2495 c.header_ = make(http.Header)
2496 }
2497 return c.header_
2498 }
2499
2500 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
2501 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2502 if c.ifNoneMatch_ != "" {
2503 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2504 }
2505 var body io.Reader = nil
2506 c.urlParams_.Set("alt", alt)
2507 c.urlParams_.Set("prettyPrint", "false")
2508 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
2509 urls += "?" + c.urlParams_.Encode()
2510 req, err := http.NewRequest("GET", urls, body)
2511 if err != nil {
2512 return nil, err
2513 }
2514 req.Header = reqHeaders
2515 googleapi.Expand(req.URL, map[string]string{
2516 "name": c.name,
2517 })
2518 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2519 }
2520
2521
2522
2523
2524
2525
2526
2527 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
2528 gensupport.SetOptions(c.urlParams_, opts...)
2529 res, err := c.doRequest("json")
2530 if res != nil && res.StatusCode == http.StatusNotModified {
2531 if res.Body != nil {
2532 res.Body.Close()
2533 }
2534 return nil, gensupport.WrapError(&googleapi.Error{
2535 Code: res.StatusCode,
2536 Header: res.Header,
2537 })
2538 }
2539 if err != nil {
2540 return nil, err
2541 }
2542 defer googleapi.CloseBody(res)
2543 if err := googleapi.CheckResponse(res); err != nil {
2544 return nil, gensupport.WrapError(err)
2545 }
2546 ret := &ListOperationsResponse{
2547 ServerResponse: googleapi.ServerResponse{
2548 Header: res.Header,
2549 HTTPStatusCode: res.StatusCode,
2550 },
2551 }
2552 target := &ret
2553 if err := gensupport.DecodeResponse(target, res); err != nil {
2554 return nil, err
2555 }
2556 return ret, nil
2557 }
2558
2559
2560
2561
2562 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
2563 c.ctx_ = ctx
2564 defer c.PageToken(c.urlParams_.Get("pageToken"))
2565 for {
2566 x, err := c.Do()
2567 if err != nil {
2568 return err
2569 }
2570 if err := f(x); err != nil {
2571 return err
2572 }
2573 if x.NextPageToken == "" {
2574 return nil
2575 }
2576 c.PageToken(x.NextPageToken)
2577 }
2578 }
2579
View as plain text