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 workflows
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 = "workflows:v1beta"
90 const apiName = "workflows"
91 const apiVersion = "v1beta"
92 const basePath = "https://workflows.googleapis.com/"
93 const basePathTemplate = "https://workflows.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://workflows.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.Operations = NewProjectsLocationsOperationsService(s)
172 rs.Workflows = NewProjectsLocationsWorkflowsService(s)
173 return rs
174 }
175
176 type ProjectsLocationsService struct {
177 s *Service
178
179 Operations *ProjectsLocationsOperationsService
180
181 Workflows *ProjectsLocationsWorkflowsService
182 }
183
184 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
185 rs := &ProjectsLocationsOperationsService{s: s}
186 return rs
187 }
188
189 type ProjectsLocationsOperationsService struct {
190 s *Service
191 }
192
193 func NewProjectsLocationsWorkflowsService(s *Service) *ProjectsLocationsWorkflowsService {
194 rs := &ProjectsLocationsWorkflowsService{s: s}
195 return rs
196 }
197
198 type ProjectsLocationsWorkflowsService struct {
199 s *Service
200 }
201
202
203
204
205
206 type Empty struct {
207
208 googleapi.ServerResponse `json:"-"`
209 }
210
211
212 type ListLocationsResponse struct {
213
214
215 Locations []*Location `json:"locations,omitempty"`
216
217 NextPageToken string `json:"nextPageToken,omitempty"`
218
219
220 googleapi.ServerResponse `json:"-"`
221
222
223
224
225
226 ForceSendFields []string `json:"-"`
227
228
229
230
231 NullFields []string `json:"-"`
232 }
233
234 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
235 type NoMethod ListLocationsResponse
236 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
237 }
238
239
240 type ListOperationsResponse struct {
241
242 NextPageToken string `json:"nextPageToken,omitempty"`
243
244
245 Operations []*Operation `json:"operations,omitempty"`
246
247
248 googleapi.ServerResponse `json:"-"`
249
250
251
252
253
254 ForceSendFields []string `json:"-"`
255
256
257
258
259 NullFields []string `json:"-"`
260 }
261
262 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
263 type NoMethod ListOperationsResponse
264 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
265 }
266
267
268 type ListWorkflowsResponse struct {
269
270
271 NextPageToken string `json:"nextPageToken,omitempty"`
272
273 Unreachable []string `json:"unreachable,omitempty"`
274
275 Workflows []*Workflow `json:"workflows,omitempty"`
276
277
278 googleapi.ServerResponse `json:"-"`
279
280
281
282
283
284 ForceSendFields []string `json:"-"`
285
286
287
288
289 NullFields []string `json:"-"`
290 }
291
292 func (s *ListWorkflowsResponse) MarshalJSON() ([]byte, error) {
293 type NoMethod ListWorkflowsResponse
294 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
295 }
296
297
298 type Location struct {
299
300
301 DisplayName string `json:"displayName,omitempty"`
302
303
304 Labels map[string]string `json:"labels,omitempty"`
305
306 LocationId string `json:"locationId,omitempty"`
307
308
309 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
310
311
312
313 Name string `json:"name,omitempty"`
314
315
316 googleapi.ServerResponse `json:"-"`
317
318
319
320
321
322 ForceSendFields []string `json:"-"`
323
324
325
326
327 NullFields []string `json:"-"`
328 }
329
330 func (s *Location) MarshalJSON() ([]byte, error) {
331 type NoMethod Location
332 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
333 }
334
335
336
337 type Operation struct {
338
339
340
341 Done bool `json:"done,omitempty"`
342
343 Error *Status `json:"error,omitempty"`
344
345
346
347
348 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
349
350
351
352 Name string `json:"name,omitempty"`
353
354
355
356
357
358
359
360 Response googleapi.RawMessage `json:"response,omitempty"`
361
362
363 googleapi.ServerResponse `json:"-"`
364
365
366
367
368
369 ForceSendFields []string `json:"-"`
370
371
372
373
374 NullFields []string `json:"-"`
375 }
376
377 func (s *Operation) MarshalJSON() ([]byte, error) {
378 type NoMethod Operation
379 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
380 }
381
382
383 type OperationMetadata struct {
384
385 ApiVersion string `json:"apiVersion,omitempty"`
386
387 CreateTime string `json:"createTime,omitempty"`
388
389 EndTime string `json:"endTime,omitempty"`
390
391 Target string `json:"target,omitempty"`
392
393 Verb string `json:"verb,omitempty"`
394
395
396
397
398
399 ForceSendFields []string `json:"-"`
400
401
402
403
404 NullFields []string `json:"-"`
405 }
406
407 func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
408 type NoMethod OperationMetadata
409 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
410 }
411
412
413
414
415
416
417
418 type Status struct {
419
420 Code int64 `json:"code,omitempty"`
421
422
423 Details []googleapi.RawMessage `json:"details,omitempty"`
424
425
426
427 Message string `json:"message,omitempty"`
428
429
430
431
432
433 ForceSendFields []string `json:"-"`
434
435
436
437
438 NullFields []string `json:"-"`
439 }
440
441 func (s *Status) MarshalJSON() ([]byte, error) {
442 type NoMethod Status
443 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
444 }
445
446
447 type Workflow struct {
448
449 CreateTime string `json:"createTime,omitempty"`
450
451
452 Description string `json:"description,omitempty"`
453
454
455
456
457 Labels map[string]string `json:"labels,omitempty"`
458
459
460 Name string `json:"name,omitempty"`
461
462
463 RevisionCreateTime string `json:"revisionCreateTime,omitempty"`
464
465
466
467
468
469
470 RevisionId string `json:"revisionId,omitempty"`
471
472
473
474
475
476
477
478
479
480 ServiceAccount string `json:"serviceAccount,omitempty"`
481
482 SourceContents string `json:"sourceContents,omitempty"`
483
484
485
486
487
488 State string `json:"state,omitempty"`
489
490 UpdateTime string `json:"updateTime,omitempty"`
491
492
493 googleapi.ServerResponse `json:"-"`
494
495
496
497
498
499 ForceSendFields []string `json:"-"`
500
501
502
503
504 NullFields []string `json:"-"`
505 }
506
507 func (s *Workflow) MarshalJSON() ([]byte, error) {
508 type NoMethod Workflow
509 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
510 }
511
512 type ProjectsLocationsGetCall struct {
513 s *Service
514 name string
515 urlParams_ gensupport.URLParams
516 ifNoneMatch_ string
517 ctx_ context.Context
518 header_ http.Header
519 }
520
521
522
523
524 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
525 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
526 c.name = name
527 return c
528 }
529
530
531
532
533 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
534 c.urlParams_.Set("fields", googleapi.CombineFields(s))
535 return c
536 }
537
538
539
540
541 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
542 c.ifNoneMatch_ = entityTag
543 return c
544 }
545
546
547 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
548 c.ctx_ = ctx
549 return c
550 }
551
552
553
554 func (c *ProjectsLocationsGetCall) Header() http.Header {
555 if c.header_ == nil {
556 c.header_ = make(http.Header)
557 }
558 return c.header_
559 }
560
561 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
562 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
563 if c.ifNoneMatch_ != "" {
564 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
565 }
566 var body io.Reader = nil
567 c.urlParams_.Set("alt", alt)
568 c.urlParams_.Set("prettyPrint", "false")
569 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
570 urls += "?" + c.urlParams_.Encode()
571 req, err := http.NewRequest("GET", urls, body)
572 if err != nil {
573 return nil, err
574 }
575 req.Header = reqHeaders
576 googleapi.Expand(req.URL, map[string]string{
577 "name": c.name,
578 })
579 return gensupport.SendRequest(c.ctx_, c.s.client, req)
580 }
581
582
583
584
585
586
587 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
588 gensupport.SetOptions(c.urlParams_, opts...)
589 res, err := c.doRequest("json")
590 if res != nil && res.StatusCode == http.StatusNotModified {
591 if res.Body != nil {
592 res.Body.Close()
593 }
594 return nil, gensupport.WrapError(&googleapi.Error{
595 Code: res.StatusCode,
596 Header: res.Header,
597 })
598 }
599 if err != nil {
600 return nil, err
601 }
602 defer googleapi.CloseBody(res)
603 if err := googleapi.CheckResponse(res); err != nil {
604 return nil, gensupport.WrapError(err)
605 }
606 ret := &Location{
607 ServerResponse: googleapi.ServerResponse{
608 Header: res.Header,
609 HTTPStatusCode: res.StatusCode,
610 },
611 }
612 target := &ret
613 if err := gensupport.DecodeResponse(target, res); err != nil {
614 return nil, err
615 }
616 return ret, nil
617 }
618
619 type ProjectsLocationsListCall struct {
620 s *Service
621 name string
622 urlParams_ gensupport.URLParams
623 ifNoneMatch_ string
624 ctx_ context.Context
625 header_ http.Header
626 }
627
628
629
630
631 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
632 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
633 c.name = name
634 return c
635 }
636
637
638
639
640
641 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
642 c.urlParams_.Set("filter", filter)
643 return c
644 }
645
646
647
648 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
649 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
650 return c
651 }
652
653
654
655
656 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
657 c.urlParams_.Set("pageToken", pageToken)
658 return c
659 }
660
661
662
663
664 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
665 c.urlParams_.Set("fields", googleapi.CombineFields(s))
666 return c
667 }
668
669
670
671
672 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
673 c.ifNoneMatch_ = entityTag
674 return c
675 }
676
677
678 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
679 c.ctx_ = ctx
680 return c
681 }
682
683
684
685 func (c *ProjectsLocationsListCall) Header() http.Header {
686 if c.header_ == nil {
687 c.header_ = make(http.Header)
688 }
689 return c.header_
690 }
691
692 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
693 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
694 if c.ifNoneMatch_ != "" {
695 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
696 }
697 var body io.Reader = nil
698 c.urlParams_.Set("alt", alt)
699 c.urlParams_.Set("prettyPrint", "false")
700 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/locations")
701 urls += "?" + c.urlParams_.Encode()
702 req, err := http.NewRequest("GET", urls, body)
703 if err != nil {
704 return nil, err
705 }
706 req.Header = reqHeaders
707 googleapi.Expand(req.URL, map[string]string{
708 "name": c.name,
709 })
710 return gensupport.SendRequest(c.ctx_, c.s.client, req)
711 }
712
713
714
715
716
717
718
719 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
720 gensupport.SetOptions(c.urlParams_, opts...)
721 res, err := c.doRequest("json")
722 if res != nil && res.StatusCode == http.StatusNotModified {
723 if res.Body != nil {
724 res.Body.Close()
725 }
726 return nil, gensupport.WrapError(&googleapi.Error{
727 Code: res.StatusCode,
728 Header: res.Header,
729 })
730 }
731 if err != nil {
732 return nil, err
733 }
734 defer googleapi.CloseBody(res)
735 if err := googleapi.CheckResponse(res); err != nil {
736 return nil, gensupport.WrapError(err)
737 }
738 ret := &ListLocationsResponse{
739 ServerResponse: googleapi.ServerResponse{
740 Header: res.Header,
741 HTTPStatusCode: res.StatusCode,
742 },
743 }
744 target := &ret
745 if err := gensupport.DecodeResponse(target, res); err != nil {
746 return nil, err
747 }
748 return ret, nil
749 }
750
751
752
753
754 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
755 c.ctx_ = ctx
756 defer c.PageToken(c.urlParams_.Get("pageToken"))
757 for {
758 x, err := c.Do()
759 if err != nil {
760 return err
761 }
762 if err := f(x); err != nil {
763 return err
764 }
765 if x.NextPageToken == "" {
766 return nil
767 }
768 c.PageToken(x.NextPageToken)
769 }
770 }
771
772 type ProjectsLocationsOperationsDeleteCall struct {
773 s *Service
774 name string
775 urlParams_ gensupport.URLParams
776 ctx_ context.Context
777 header_ http.Header
778 }
779
780
781
782
783
784
785
786 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
787 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
788 c.name = name
789 return c
790 }
791
792
793
794
795 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
796 c.urlParams_.Set("fields", googleapi.CombineFields(s))
797 return c
798 }
799
800
801 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
802 c.ctx_ = ctx
803 return c
804 }
805
806
807
808 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
809 if c.header_ == nil {
810 c.header_ = make(http.Header)
811 }
812 return c.header_
813 }
814
815 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
816 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
817 var body io.Reader = nil
818 c.urlParams_.Set("alt", alt)
819 c.urlParams_.Set("prettyPrint", "false")
820 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
821 urls += "?" + c.urlParams_.Encode()
822 req, err := http.NewRequest("DELETE", urls, body)
823 if err != nil {
824 return nil, err
825 }
826 req.Header = reqHeaders
827 googleapi.Expand(req.URL, map[string]string{
828 "name": c.name,
829 })
830 return gensupport.SendRequest(c.ctx_, c.s.client, req)
831 }
832
833
834
835
836
837
838 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
839 gensupport.SetOptions(c.urlParams_, opts...)
840 res, err := c.doRequest("json")
841 if res != nil && res.StatusCode == http.StatusNotModified {
842 if res.Body != nil {
843 res.Body.Close()
844 }
845 return nil, gensupport.WrapError(&googleapi.Error{
846 Code: res.StatusCode,
847 Header: res.Header,
848 })
849 }
850 if err != nil {
851 return nil, err
852 }
853 defer googleapi.CloseBody(res)
854 if err := googleapi.CheckResponse(res); err != nil {
855 return nil, gensupport.WrapError(err)
856 }
857 ret := &Empty{
858 ServerResponse: googleapi.ServerResponse{
859 Header: res.Header,
860 HTTPStatusCode: res.StatusCode,
861 },
862 }
863 target := &ret
864 if err := gensupport.DecodeResponse(target, res); err != nil {
865 return nil, err
866 }
867 return ret, nil
868 }
869
870 type ProjectsLocationsOperationsGetCall struct {
871 s *Service
872 name string
873 urlParams_ gensupport.URLParams
874 ifNoneMatch_ string
875 ctx_ context.Context
876 header_ http.Header
877 }
878
879
880
881
882
883
884 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
885 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
886 c.name = name
887 return c
888 }
889
890
891
892
893 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
894 c.urlParams_.Set("fields", googleapi.CombineFields(s))
895 return c
896 }
897
898
899
900
901 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
902 c.ifNoneMatch_ = entityTag
903 return c
904 }
905
906
907 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
908 c.ctx_ = ctx
909 return c
910 }
911
912
913
914 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
915 if c.header_ == nil {
916 c.header_ = make(http.Header)
917 }
918 return c.header_
919 }
920
921 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
922 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
923 if c.ifNoneMatch_ != "" {
924 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
925 }
926 var body io.Reader = nil
927 c.urlParams_.Set("alt", alt)
928 c.urlParams_.Set("prettyPrint", "false")
929 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
930 urls += "?" + c.urlParams_.Encode()
931 req, err := http.NewRequest("GET", urls, body)
932 if err != nil {
933 return nil, err
934 }
935 req.Header = reqHeaders
936 googleapi.Expand(req.URL, map[string]string{
937 "name": c.name,
938 })
939 return gensupport.SendRequest(c.ctx_, c.s.client, req)
940 }
941
942
943
944
945
946
947 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
948 gensupport.SetOptions(c.urlParams_, opts...)
949 res, err := c.doRequest("json")
950 if res != nil && res.StatusCode == http.StatusNotModified {
951 if res.Body != nil {
952 res.Body.Close()
953 }
954 return nil, gensupport.WrapError(&googleapi.Error{
955 Code: res.StatusCode,
956 Header: res.Header,
957 })
958 }
959 if err != nil {
960 return nil, err
961 }
962 defer googleapi.CloseBody(res)
963 if err := googleapi.CheckResponse(res); err != nil {
964 return nil, gensupport.WrapError(err)
965 }
966 ret := &Operation{
967 ServerResponse: googleapi.ServerResponse{
968 Header: res.Header,
969 HTTPStatusCode: res.StatusCode,
970 },
971 }
972 target := &ret
973 if err := gensupport.DecodeResponse(target, res); err != nil {
974 return nil, err
975 }
976 return ret, nil
977 }
978
979 type ProjectsLocationsOperationsListCall struct {
980 s *Service
981 name string
982 urlParams_ gensupport.URLParams
983 ifNoneMatch_ string
984 ctx_ context.Context
985 header_ http.Header
986 }
987
988
989
990
991
992 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
993 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
994 c.name = name
995 return c
996 }
997
998
999 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
1000 c.urlParams_.Set("filter", filter)
1001 return c
1002 }
1003
1004
1005
1006 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
1007 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1008 return c
1009 }
1010
1011
1012
1013 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
1014 c.urlParams_.Set("pageToken", pageToken)
1015 return c
1016 }
1017
1018
1019
1020
1021 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
1022 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1023 return c
1024 }
1025
1026
1027
1028
1029 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
1030 c.ifNoneMatch_ = entityTag
1031 return c
1032 }
1033
1034
1035 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
1036 c.ctx_ = ctx
1037 return c
1038 }
1039
1040
1041
1042 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
1043 if c.header_ == nil {
1044 c.header_ = make(http.Header)
1045 }
1046 return c.header_
1047 }
1048
1049 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
1050 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1051 if c.ifNoneMatch_ != "" {
1052 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1053 }
1054 var body io.Reader = nil
1055 c.urlParams_.Set("alt", alt)
1056 c.urlParams_.Set("prettyPrint", "false")
1057 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}/operations")
1058 urls += "?" + c.urlParams_.Encode()
1059 req, err := http.NewRequest("GET", urls, body)
1060 if err != nil {
1061 return nil, err
1062 }
1063 req.Header = reqHeaders
1064 googleapi.Expand(req.URL, map[string]string{
1065 "name": c.name,
1066 })
1067 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1068 }
1069
1070
1071
1072
1073
1074
1075
1076 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
1077 gensupport.SetOptions(c.urlParams_, opts...)
1078 res, err := c.doRequest("json")
1079 if res != nil && res.StatusCode == http.StatusNotModified {
1080 if res.Body != nil {
1081 res.Body.Close()
1082 }
1083 return nil, gensupport.WrapError(&googleapi.Error{
1084 Code: res.StatusCode,
1085 Header: res.Header,
1086 })
1087 }
1088 if err != nil {
1089 return nil, err
1090 }
1091 defer googleapi.CloseBody(res)
1092 if err := googleapi.CheckResponse(res); err != nil {
1093 return nil, gensupport.WrapError(err)
1094 }
1095 ret := &ListOperationsResponse{
1096 ServerResponse: googleapi.ServerResponse{
1097 Header: res.Header,
1098 HTTPStatusCode: res.StatusCode,
1099 },
1100 }
1101 target := &ret
1102 if err := gensupport.DecodeResponse(target, res); err != nil {
1103 return nil, err
1104 }
1105 return ret, nil
1106 }
1107
1108
1109
1110
1111 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
1112 c.ctx_ = ctx
1113 defer c.PageToken(c.urlParams_.Get("pageToken"))
1114 for {
1115 x, err := c.Do()
1116 if err != nil {
1117 return err
1118 }
1119 if err := f(x); err != nil {
1120 return err
1121 }
1122 if x.NextPageToken == "" {
1123 return nil
1124 }
1125 c.PageToken(x.NextPageToken)
1126 }
1127 }
1128
1129 type ProjectsLocationsWorkflowsCreateCall struct {
1130 s *Service
1131 parent string
1132 workflow *Workflow
1133 urlParams_ gensupport.URLParams
1134 ctx_ context.Context
1135 header_ http.Header
1136 }
1137
1138
1139
1140
1141
1142
1143
1144 func (r *ProjectsLocationsWorkflowsService) Create(parent string, workflow *Workflow) *ProjectsLocationsWorkflowsCreateCall {
1145 c := &ProjectsLocationsWorkflowsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1146 c.parent = parent
1147 c.workflow = workflow
1148 return c
1149 }
1150
1151
1152
1153
1154
1155
1156 func (c *ProjectsLocationsWorkflowsCreateCall) WorkflowId(workflowId string) *ProjectsLocationsWorkflowsCreateCall {
1157 c.urlParams_.Set("workflowId", workflowId)
1158 return c
1159 }
1160
1161
1162
1163
1164 func (c *ProjectsLocationsWorkflowsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsCreateCall {
1165 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1166 return c
1167 }
1168
1169
1170 func (c *ProjectsLocationsWorkflowsCreateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsCreateCall {
1171 c.ctx_ = ctx
1172 return c
1173 }
1174
1175
1176
1177 func (c *ProjectsLocationsWorkflowsCreateCall) Header() http.Header {
1178 if c.header_ == nil {
1179 c.header_ = make(http.Header)
1180 }
1181 return c.header_
1182 }
1183
1184 func (c *ProjectsLocationsWorkflowsCreateCall) doRequest(alt string) (*http.Response, error) {
1185 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1186 var body io.Reader = nil
1187 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflow)
1188 if err != nil {
1189 return nil, err
1190 }
1191 c.urlParams_.Set("alt", alt)
1192 c.urlParams_.Set("prettyPrint", "false")
1193 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/workflows")
1194 urls += "?" + c.urlParams_.Encode()
1195 req, err := http.NewRequest("POST", urls, body)
1196 if err != nil {
1197 return nil, err
1198 }
1199 req.Header = reqHeaders
1200 googleapi.Expand(req.URL, map[string]string{
1201 "parent": c.parent,
1202 })
1203 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1204 }
1205
1206
1207
1208
1209
1210
1211 func (c *ProjectsLocationsWorkflowsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1212 gensupport.SetOptions(c.urlParams_, opts...)
1213 res, err := c.doRequest("json")
1214 if res != nil && res.StatusCode == http.StatusNotModified {
1215 if res.Body != nil {
1216 res.Body.Close()
1217 }
1218 return nil, gensupport.WrapError(&googleapi.Error{
1219 Code: res.StatusCode,
1220 Header: res.Header,
1221 })
1222 }
1223 if err != nil {
1224 return nil, err
1225 }
1226 defer googleapi.CloseBody(res)
1227 if err := googleapi.CheckResponse(res); err != nil {
1228 return nil, gensupport.WrapError(err)
1229 }
1230 ret := &Operation{
1231 ServerResponse: googleapi.ServerResponse{
1232 Header: res.Header,
1233 HTTPStatusCode: res.StatusCode,
1234 },
1235 }
1236 target := &ret
1237 if err := gensupport.DecodeResponse(target, res); err != nil {
1238 return nil, err
1239 }
1240 return ret, nil
1241 }
1242
1243 type ProjectsLocationsWorkflowsDeleteCall struct {
1244 s *Service
1245 name string
1246 urlParams_ gensupport.URLParams
1247 ctx_ context.Context
1248 header_ http.Header
1249 }
1250
1251
1252
1253
1254
1255
1256 func (r *ProjectsLocationsWorkflowsService) Delete(name string) *ProjectsLocationsWorkflowsDeleteCall {
1257 c := &ProjectsLocationsWorkflowsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1258 c.name = name
1259 return c
1260 }
1261
1262
1263
1264
1265 func (c *ProjectsLocationsWorkflowsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsDeleteCall {
1266 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1267 return c
1268 }
1269
1270
1271 func (c *ProjectsLocationsWorkflowsDeleteCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsDeleteCall {
1272 c.ctx_ = ctx
1273 return c
1274 }
1275
1276
1277
1278 func (c *ProjectsLocationsWorkflowsDeleteCall) Header() http.Header {
1279 if c.header_ == nil {
1280 c.header_ = make(http.Header)
1281 }
1282 return c.header_
1283 }
1284
1285 func (c *ProjectsLocationsWorkflowsDeleteCall) doRequest(alt string) (*http.Response, error) {
1286 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1287 var body io.Reader = nil
1288 c.urlParams_.Set("alt", alt)
1289 c.urlParams_.Set("prettyPrint", "false")
1290 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
1291 urls += "?" + c.urlParams_.Encode()
1292 req, err := http.NewRequest("DELETE", urls, body)
1293 if err != nil {
1294 return nil, err
1295 }
1296 req.Header = reqHeaders
1297 googleapi.Expand(req.URL, map[string]string{
1298 "name": c.name,
1299 })
1300 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1301 }
1302
1303
1304
1305
1306
1307
1308 func (c *ProjectsLocationsWorkflowsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1309 gensupport.SetOptions(c.urlParams_, opts...)
1310 res, err := c.doRequest("json")
1311 if res != nil && res.StatusCode == http.StatusNotModified {
1312 if res.Body != nil {
1313 res.Body.Close()
1314 }
1315 return nil, gensupport.WrapError(&googleapi.Error{
1316 Code: res.StatusCode,
1317 Header: res.Header,
1318 })
1319 }
1320 if err != nil {
1321 return nil, err
1322 }
1323 defer googleapi.CloseBody(res)
1324 if err := googleapi.CheckResponse(res); err != nil {
1325 return nil, gensupport.WrapError(err)
1326 }
1327 ret := &Operation{
1328 ServerResponse: googleapi.ServerResponse{
1329 Header: res.Header,
1330 HTTPStatusCode: res.StatusCode,
1331 },
1332 }
1333 target := &ret
1334 if err := gensupport.DecodeResponse(target, res); err != nil {
1335 return nil, err
1336 }
1337 return ret, nil
1338 }
1339
1340 type ProjectsLocationsWorkflowsGetCall struct {
1341 s *Service
1342 name string
1343 urlParams_ gensupport.URLParams
1344 ifNoneMatch_ string
1345 ctx_ context.Context
1346 header_ http.Header
1347 }
1348
1349
1350
1351
1352
1353 func (r *ProjectsLocationsWorkflowsService) Get(name string) *ProjectsLocationsWorkflowsGetCall {
1354 c := &ProjectsLocationsWorkflowsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1355 c.name = name
1356 return c
1357 }
1358
1359
1360
1361
1362 func (c *ProjectsLocationsWorkflowsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsGetCall {
1363 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1364 return c
1365 }
1366
1367
1368
1369
1370 func (c *ProjectsLocationsWorkflowsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowsGetCall {
1371 c.ifNoneMatch_ = entityTag
1372 return c
1373 }
1374
1375
1376 func (c *ProjectsLocationsWorkflowsGetCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsGetCall {
1377 c.ctx_ = ctx
1378 return c
1379 }
1380
1381
1382
1383 func (c *ProjectsLocationsWorkflowsGetCall) Header() http.Header {
1384 if c.header_ == nil {
1385 c.header_ = make(http.Header)
1386 }
1387 return c.header_
1388 }
1389
1390 func (c *ProjectsLocationsWorkflowsGetCall) doRequest(alt string) (*http.Response, error) {
1391 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1392 if c.ifNoneMatch_ != "" {
1393 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1394 }
1395 var body io.Reader = nil
1396 c.urlParams_.Set("alt", alt)
1397 c.urlParams_.Set("prettyPrint", "false")
1398 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
1399 urls += "?" + c.urlParams_.Encode()
1400 req, err := http.NewRequest("GET", urls, body)
1401 if err != nil {
1402 return nil, err
1403 }
1404 req.Header = reqHeaders
1405 googleapi.Expand(req.URL, map[string]string{
1406 "name": c.name,
1407 })
1408 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1409 }
1410
1411
1412
1413
1414
1415
1416 func (c *ProjectsLocationsWorkflowsGetCall) Do(opts ...googleapi.CallOption) (*Workflow, error) {
1417 gensupport.SetOptions(c.urlParams_, opts...)
1418 res, err := c.doRequest("json")
1419 if res != nil && res.StatusCode == http.StatusNotModified {
1420 if res.Body != nil {
1421 res.Body.Close()
1422 }
1423 return nil, gensupport.WrapError(&googleapi.Error{
1424 Code: res.StatusCode,
1425 Header: res.Header,
1426 })
1427 }
1428 if err != nil {
1429 return nil, err
1430 }
1431 defer googleapi.CloseBody(res)
1432 if err := googleapi.CheckResponse(res); err != nil {
1433 return nil, gensupport.WrapError(err)
1434 }
1435 ret := &Workflow{
1436 ServerResponse: googleapi.ServerResponse{
1437 Header: res.Header,
1438 HTTPStatusCode: res.StatusCode,
1439 },
1440 }
1441 target := &ret
1442 if err := gensupport.DecodeResponse(target, res); err != nil {
1443 return nil, err
1444 }
1445 return ret, nil
1446 }
1447
1448 type ProjectsLocationsWorkflowsListCall struct {
1449 s *Service
1450 parent string
1451 urlParams_ gensupport.URLParams
1452 ifNoneMatch_ string
1453 ctx_ context.Context
1454 header_ http.Header
1455 }
1456
1457
1458
1459
1460
1461
1462 func (r *ProjectsLocationsWorkflowsService) List(parent string) *ProjectsLocationsWorkflowsListCall {
1463 c := &ProjectsLocationsWorkflowsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1464 c.parent = parent
1465 return c
1466 }
1467
1468
1469
1470 func (c *ProjectsLocationsWorkflowsListCall) Filter(filter string) *ProjectsLocationsWorkflowsListCall {
1471 c.urlParams_.Set("filter", filter)
1472 return c
1473 }
1474
1475
1476
1477
1478
1479
1480 func (c *ProjectsLocationsWorkflowsListCall) OrderBy(orderBy string) *ProjectsLocationsWorkflowsListCall {
1481 c.urlParams_.Set("orderBy", orderBy)
1482 return c
1483 }
1484
1485
1486
1487
1488
1489
1490 func (c *ProjectsLocationsWorkflowsListCall) PageSize(pageSize int64) *ProjectsLocationsWorkflowsListCall {
1491 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1492 return c
1493 }
1494
1495
1496
1497
1498
1499 func (c *ProjectsLocationsWorkflowsListCall) PageToken(pageToken string) *ProjectsLocationsWorkflowsListCall {
1500 c.urlParams_.Set("pageToken", pageToken)
1501 return c
1502 }
1503
1504
1505
1506
1507 func (c *ProjectsLocationsWorkflowsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsListCall {
1508 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1509 return c
1510 }
1511
1512
1513
1514
1515 func (c *ProjectsLocationsWorkflowsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowsListCall {
1516 c.ifNoneMatch_ = entityTag
1517 return c
1518 }
1519
1520
1521 func (c *ProjectsLocationsWorkflowsListCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsListCall {
1522 c.ctx_ = ctx
1523 return c
1524 }
1525
1526
1527
1528 func (c *ProjectsLocationsWorkflowsListCall) Header() http.Header {
1529 if c.header_ == nil {
1530 c.header_ = make(http.Header)
1531 }
1532 return c.header_
1533 }
1534
1535 func (c *ProjectsLocationsWorkflowsListCall) doRequest(alt string) (*http.Response, error) {
1536 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1537 if c.ifNoneMatch_ != "" {
1538 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1539 }
1540 var body io.Reader = nil
1541 c.urlParams_.Set("alt", alt)
1542 c.urlParams_.Set("prettyPrint", "false")
1543 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/workflows")
1544 urls += "?" + c.urlParams_.Encode()
1545 req, err := http.NewRequest("GET", urls, body)
1546 if err != nil {
1547 return nil, err
1548 }
1549 req.Header = reqHeaders
1550 googleapi.Expand(req.URL, map[string]string{
1551 "parent": c.parent,
1552 })
1553 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1554 }
1555
1556
1557
1558
1559
1560
1561
1562 func (c *ProjectsLocationsWorkflowsListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowsResponse, error) {
1563 gensupport.SetOptions(c.urlParams_, opts...)
1564 res, err := c.doRequest("json")
1565 if res != nil && res.StatusCode == http.StatusNotModified {
1566 if res.Body != nil {
1567 res.Body.Close()
1568 }
1569 return nil, gensupport.WrapError(&googleapi.Error{
1570 Code: res.StatusCode,
1571 Header: res.Header,
1572 })
1573 }
1574 if err != nil {
1575 return nil, err
1576 }
1577 defer googleapi.CloseBody(res)
1578 if err := googleapi.CheckResponse(res); err != nil {
1579 return nil, gensupport.WrapError(err)
1580 }
1581 ret := &ListWorkflowsResponse{
1582 ServerResponse: googleapi.ServerResponse{
1583 Header: res.Header,
1584 HTTPStatusCode: res.StatusCode,
1585 },
1586 }
1587 target := &ret
1588 if err := gensupport.DecodeResponse(target, res); err != nil {
1589 return nil, err
1590 }
1591 return ret, nil
1592 }
1593
1594
1595
1596
1597 func (c *ProjectsLocationsWorkflowsListCall) Pages(ctx context.Context, f func(*ListWorkflowsResponse) error) error {
1598 c.ctx_ = ctx
1599 defer c.PageToken(c.urlParams_.Get("pageToken"))
1600 for {
1601 x, err := c.Do()
1602 if err != nil {
1603 return err
1604 }
1605 if err := f(x); err != nil {
1606 return err
1607 }
1608 if x.NextPageToken == "" {
1609 return nil
1610 }
1611 c.PageToken(x.NextPageToken)
1612 }
1613 }
1614
1615 type ProjectsLocationsWorkflowsPatchCall struct {
1616 s *Service
1617 name string
1618 workflow *Workflow
1619 urlParams_ gensupport.URLParams
1620 ctx_ context.Context
1621 header_ http.Header
1622 }
1623
1624
1625
1626
1627
1628
1629
1630
1631 func (r *ProjectsLocationsWorkflowsService) Patch(name string, workflow *Workflow) *ProjectsLocationsWorkflowsPatchCall {
1632 c := &ProjectsLocationsWorkflowsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1633 c.name = name
1634 c.workflow = workflow
1635 return c
1636 }
1637
1638
1639
1640 func (c *ProjectsLocationsWorkflowsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsWorkflowsPatchCall {
1641 c.urlParams_.Set("updateMask", updateMask)
1642 return c
1643 }
1644
1645
1646
1647
1648 func (c *ProjectsLocationsWorkflowsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowsPatchCall {
1649 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1650 return c
1651 }
1652
1653
1654 func (c *ProjectsLocationsWorkflowsPatchCall) Context(ctx context.Context) *ProjectsLocationsWorkflowsPatchCall {
1655 c.ctx_ = ctx
1656 return c
1657 }
1658
1659
1660
1661 func (c *ProjectsLocationsWorkflowsPatchCall) Header() http.Header {
1662 if c.header_ == nil {
1663 c.header_ = make(http.Header)
1664 }
1665 return c.header_
1666 }
1667
1668 func (c *ProjectsLocationsWorkflowsPatchCall) doRequest(alt string) (*http.Response, error) {
1669 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1670 var body io.Reader = nil
1671 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflow)
1672 if err != nil {
1673 return nil, err
1674 }
1675 c.urlParams_.Set("alt", alt)
1676 c.urlParams_.Set("prettyPrint", "false")
1677 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
1678 urls += "?" + c.urlParams_.Encode()
1679 req, err := http.NewRequest("PATCH", urls, body)
1680 if err != nil {
1681 return nil, err
1682 }
1683 req.Header = reqHeaders
1684 googleapi.Expand(req.URL, map[string]string{
1685 "name": c.name,
1686 })
1687 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1688 }
1689
1690
1691
1692
1693
1694
1695 func (c *ProjectsLocationsWorkflowsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1696 gensupport.SetOptions(c.urlParams_, opts...)
1697 res, err := c.doRequest("json")
1698 if res != nil && res.StatusCode == http.StatusNotModified {
1699 if res.Body != nil {
1700 res.Body.Close()
1701 }
1702 return nil, gensupport.WrapError(&googleapi.Error{
1703 Code: res.StatusCode,
1704 Header: res.Header,
1705 })
1706 }
1707 if err != nil {
1708 return nil, err
1709 }
1710 defer googleapi.CloseBody(res)
1711 if err := googleapi.CheckResponse(res); err != nil {
1712 return nil, gensupport.WrapError(err)
1713 }
1714 ret := &Operation{
1715 ServerResponse: googleapi.ServerResponse{
1716 Header: res.Header,
1717 HTTPStatusCode: res.StatusCode,
1718 },
1719 }
1720 target := &ret
1721 if err := gensupport.DecodeResponse(target, res); err != nil {
1722 return nil, err
1723 }
1724 return ret, nil
1725 }
1726
View as plain text