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