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