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 datamigration
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 = "datamigration:v1beta1"
90 const apiName = "datamigration"
91 const apiVersion = "v1beta1"
92 const basePath = "https://datamigration.googleapis.com/"
93 const basePathTemplate = "https://datamigration.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://datamigration.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.ConnectionProfiles = NewProjectsLocationsConnectionProfilesService(s)
172 rs.MigrationJobs = NewProjectsLocationsMigrationJobsService(s)
173 rs.Operations = NewProjectsLocationsOperationsService(s)
174 return rs
175 }
176
177 type ProjectsLocationsService struct {
178 s *Service
179
180 ConnectionProfiles *ProjectsLocationsConnectionProfilesService
181
182 MigrationJobs *ProjectsLocationsMigrationJobsService
183
184 Operations *ProjectsLocationsOperationsService
185 }
186
187 func NewProjectsLocationsConnectionProfilesService(s *Service) *ProjectsLocationsConnectionProfilesService {
188 rs := &ProjectsLocationsConnectionProfilesService{s: s}
189 return rs
190 }
191
192 type ProjectsLocationsConnectionProfilesService struct {
193 s *Service
194 }
195
196 func NewProjectsLocationsMigrationJobsService(s *Service) *ProjectsLocationsMigrationJobsService {
197 rs := &ProjectsLocationsMigrationJobsService{s: s}
198 return rs
199 }
200
201 type ProjectsLocationsMigrationJobsService struct {
202 s *Service
203 }
204
205 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
206 rs := &ProjectsLocationsOperationsService{s: s}
207 return rs
208 }
209
210 type ProjectsLocationsOperationsService struct {
211 s *Service
212 }
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230 type AuditConfig struct {
231
232 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
233
234
235
236 Service string `json:"service,omitempty"`
237
238
239
240
241
242 ForceSendFields []string `json:"-"`
243
244
245
246
247 NullFields []string `json:"-"`
248 }
249
250 func (s *AuditConfig) MarshalJSON() ([]byte, error) {
251 type NoMethod AuditConfig
252 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
253 }
254
255
256
257
258
259
260 type AuditLogConfig struct {
261
262
263 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
264
265
266
267
268
269
270
271 LogType string `json:"logType,omitempty"`
272
273
274
275
276
277 ForceSendFields []string `json:"-"`
278
279
280
281
282 NullFields []string `json:"-"`
283 }
284
285 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
286 type NoMethod AuditLogConfig
287 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
288 }
289
290
291 type Binding struct {
292
293
294
295
296
297
298
299
300 Condition *Expr `json:"condition,omitempty"`
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363 Members []string `json:"members,omitempty"`
364
365
366
367
368
369
370 Role string `json:"role,omitempty"`
371
372
373
374
375
376 ForceSendFields []string `json:"-"`
377
378
379
380
381 NullFields []string `json:"-"`
382 }
383
384 func (s *Binding) MarshalJSON() ([]byte, error) {
385 type NoMethod Binding
386 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
387 }
388
389
390 type CancelOperationRequest struct {
391 }
392
393
394
395
396 type CloudSqlConnectionProfile struct {
397
398
399 CloudSqlId string `json:"cloudSqlId,omitempty"`
400
401 PrivateIp string `json:"privateIp,omitempty"`
402
403 PublicIp string `json:"publicIp,omitempty"`
404
405
406 Settings *CloudSqlSettings `json:"settings,omitempty"`
407
408
409
410
411
412 ForceSendFields []string `json:"-"`
413
414
415
416
417 NullFields []string `json:"-"`
418 }
419
420 func (s *CloudSqlConnectionProfile) MarshalJSON() ([]byte, error) {
421 type NoMethod CloudSqlConnectionProfile
422 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
423 }
424
425
426 type CloudSqlSettings struct {
427
428
429
430
431
432
433
434
435
436
437 ActivationPolicy string `json:"activationPolicy,omitempty"`
438
439
440
441
442
443
444 AutoStorageIncrease bool `json:"autoStorageIncrease,omitempty"`
445
446
447 DataDiskSizeGb int64 `json:"dataDiskSizeGb,omitempty,string"`
448
449
450
451
452
453
454 DataDiskType string `json:"dataDiskType,omitempty"`
455
456
457
458 DatabaseFlags map[string]string `json:"databaseFlags,omitempty"`
459
460
461
462
463
464
465
466 DatabaseVersion string `json:"databaseVersion,omitempty"`
467
468
469
470 IpConfig *SqlIpConfig `json:"ipConfig,omitempty"`
471
472 RootPassword string `json:"rootPassword,omitempty"`
473
474
475 RootPasswordSet bool `json:"rootPasswordSet,omitempty"`
476
477
478
479
480 SourceId string `json:"sourceId,omitempty"`
481
482
483
484 StorageAutoResizeLimit int64 `json:"storageAutoResizeLimit,omitempty,string"`
485
486
487
488
489 Tier string `json:"tier,omitempty"`
490
491
492
493
494 UserLabels map[string]string `json:"userLabels,omitempty"`
495
496
497 Zone string `json:"zone,omitempty"`
498
499
500
501
502
503 ForceSendFields []string `json:"-"`
504
505
506
507
508 NullFields []string `json:"-"`
509 }
510
511 func (s *CloudSqlSettings) MarshalJSON() ([]byte, error) {
512 type NoMethod CloudSqlSettings
513 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
514 }
515
516
517 type ConnectionProfile struct {
518
519 Cloudsql *CloudSqlConnectionProfile `json:"cloudsql,omitempty"`
520
521
522
523 CreateTime string `json:"createTime,omitempty"`
524
525 DisplayName string `json:"displayName,omitempty"`
526
527 Error *Status `json:"error,omitempty"`
528
529
530
531
532 Labels map[string]string `json:"labels,omitempty"`
533
534 Mysql *MySqlConnectionProfile `json:"mysql,omitempty"`
535
536
537
538 Name string `json:"name,omitempty"`
539
540
541
542
543
544
545 Provider string `json:"provider,omitempty"`
546
547
548
549
550
551
552
553
554
555
556
557 State string `json:"state,omitempty"`
558
559
560
561 UpdateTime string `json:"updateTime,omitempty"`
562
563
564 googleapi.ServerResponse `json:"-"`
565
566
567
568
569
570 ForceSendFields []string `json:"-"`
571
572
573
574
575 NullFields []string `json:"-"`
576 }
577
578 func (s *ConnectionProfile) MarshalJSON() ([]byte, error) {
579 type NoMethod ConnectionProfile
580 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
581 }
582
583
584 type DatabaseType struct {
585
586
587
588
589
590
591 Engine string `json:"engine,omitempty"`
592
593
594
595
596
597
598 Provider string `json:"provider,omitempty"`
599
600
601
602
603
604 ForceSendFields []string `json:"-"`
605
606
607
608
609 NullFields []string `json:"-"`
610 }
611
612 func (s *DatabaseType) MarshalJSON() ([]byte, error) {
613 type NoMethod DatabaseType
614 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
615 }
616
617
618
619
620
621 type Empty struct {
622
623 googleapi.ServerResponse `json:"-"`
624 }
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642 type Expr struct {
643
644
645 Description string `json:"description,omitempty"`
646
647
648 Expression string `json:"expression,omitempty"`
649
650
651 Location string `json:"location,omitempty"`
652
653
654
655 Title string `json:"title,omitempty"`
656
657
658
659
660
661 ForceSendFields []string `json:"-"`
662
663
664
665
666 NullFields []string `json:"-"`
667 }
668
669 func (s *Expr) MarshalJSON() ([]byte, error) {
670 type NoMethod Expr
671 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
672 }
673
674
675 type GenerateSshScriptRequest struct {
676
677 Vm string `json:"vm,omitempty"`
678
679 VmCreationConfig *VmCreationConfig `json:"vmCreationConfig,omitempty"`
680
681 VmPort int64 `json:"vmPort,omitempty"`
682
683 VmSelectionConfig *VmSelectionConfig `json:"vmSelectionConfig,omitempty"`
684
685
686
687
688
689 ForceSendFields []string `json:"-"`
690
691
692
693
694 NullFields []string `json:"-"`
695 }
696
697 func (s *GenerateSshScriptRequest) MarshalJSON() ([]byte, error) {
698 type NoMethod GenerateSshScriptRequest
699 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
700 }
701
702
703
704 type GoogleCloudClouddmsV1beta1OperationMetadata struct {
705
706 ApiVersion string `json:"apiVersion,omitempty"`
707
708 CreateTime string `json:"createTime,omitempty"`
709
710 EndTime string `json:"endTime,omitempty"`
711
712
713
714
715 RequestedCancellation bool `json:"requestedCancellation,omitempty"`
716
717 StatusMessage string `json:"statusMessage,omitempty"`
718
719
720 Target string `json:"target,omitempty"`
721
722 Verb string `json:"verb,omitempty"`
723
724
725
726
727
728 ForceSendFields []string `json:"-"`
729
730
731
732
733 NullFields []string `json:"-"`
734 }
735
736 func (s *GoogleCloudClouddmsV1beta1OperationMetadata) MarshalJSON() ([]byte, error) {
737 type NoMethod GoogleCloudClouddmsV1beta1OperationMetadata
738 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
739 }
740
741
742
743 type ListConnectionProfilesResponse struct {
744
745 ConnectionProfiles []*ConnectionProfile `json:"connectionProfiles,omitempty"`
746
747
748 NextPageToken string `json:"nextPageToken,omitempty"`
749
750 Unreachable []string `json:"unreachable,omitempty"`
751
752
753 googleapi.ServerResponse `json:"-"`
754
755
756
757
758
759 ForceSendFields []string `json:"-"`
760
761
762
763
764 NullFields []string `json:"-"`
765 }
766
767 func (s *ListConnectionProfilesResponse) MarshalJSON() ([]byte, error) {
768 type NoMethod ListConnectionProfilesResponse
769 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
770 }
771
772
773 type ListLocationsResponse struct {
774
775
776 Locations []*Location `json:"locations,omitempty"`
777
778 NextPageToken string `json:"nextPageToken,omitempty"`
779
780
781 googleapi.ServerResponse `json:"-"`
782
783
784
785
786
787 ForceSendFields []string `json:"-"`
788
789
790
791
792 NullFields []string `json:"-"`
793 }
794
795 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
796 type NoMethod ListLocationsResponse
797 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
798 }
799
800
801 type ListMigrationJobsResponse struct {
802
803 MigrationJobs []*MigrationJob `json:"migrationJobs,omitempty"`
804
805
806 NextPageToken string `json:"nextPageToken,omitempty"`
807
808 Unreachable []string `json:"unreachable,omitempty"`
809
810
811 googleapi.ServerResponse `json:"-"`
812
813
814
815
816
817 ForceSendFields []string `json:"-"`
818
819
820
821
822 NullFields []string `json:"-"`
823 }
824
825 func (s *ListMigrationJobsResponse) MarshalJSON() ([]byte, error) {
826 type NoMethod ListMigrationJobsResponse
827 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
828 }
829
830
831 type ListOperationsResponse struct {
832
833 NextPageToken string `json:"nextPageToken,omitempty"`
834
835
836 Operations []*Operation `json:"operations,omitempty"`
837
838
839 googleapi.ServerResponse `json:"-"`
840
841
842
843
844
845 ForceSendFields []string `json:"-"`
846
847
848
849
850 NullFields []string `json:"-"`
851 }
852
853 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
854 type NoMethod ListOperationsResponse
855 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
856 }
857
858
859 type Location struct {
860
861
862 DisplayName string `json:"displayName,omitempty"`
863
864
865 Labels map[string]string `json:"labels,omitempty"`
866
867 LocationId string `json:"locationId,omitempty"`
868
869
870 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
871
872
873
874 Name string `json:"name,omitempty"`
875
876
877 googleapi.ServerResponse `json:"-"`
878
879
880
881
882
883 ForceSendFields []string `json:"-"`
884
885
886
887
888 NullFields []string `json:"-"`
889 }
890
891 func (s *Location) MarshalJSON() ([]byte, error) {
892 type NoMethod Location
893 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
894 }
895
896
897 type MigrationJob struct {
898
899
900
901 CreateTime string `json:"createTime,omitempty"`
902
903
904 Destination string `json:"destination,omitempty"`
905
906
907 DestinationDatabase *DatabaseType `json:"destinationDatabase,omitempty"`
908
909 DisplayName string `json:"displayName,omitempty"`
910
911
912 DumpPath string `json:"dumpPath,omitempty"`
913
914
915
916 Duration string `json:"duration,omitempty"`
917
918
919 EndTime string `json:"endTime,omitempty"`
920
921 Error *Status `json:"error,omitempty"`
922
923
924
925
926 Labels map[string]string `json:"labels,omitempty"`
927
928
929 Name string `json:"name,omitempty"`
930
931
932
933
934
935
936
937
938
939
940
941 Phase string `json:"phase,omitempty"`
942
943
944 ReverseSshConnectivity *ReverseSshConnectivity `json:"reverseSshConnectivity,omitempty"`
945
946 Source string `json:"source,omitempty"`
947
948 SourceDatabase *DatabaseType `json:"sourceDatabase,omitempty"`
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968 State string `json:"state,omitempty"`
969
970
971 StaticIpConnectivity *StaticIpConnectivity `json:"staticIpConnectivity,omitempty"`
972
973
974
975
976
977
978 Type string `json:"type,omitempty"`
979
980
981
982 UpdateTime string `json:"updateTime,omitempty"`
983
984
985 VpcPeeringConnectivity *VpcPeeringConnectivity `json:"vpcPeeringConnectivity,omitempty"`
986
987
988 googleapi.ServerResponse `json:"-"`
989
990
991
992
993
994 ForceSendFields []string `json:"-"`
995
996
997
998
999 NullFields []string `json:"-"`
1000 }
1001
1002 func (s *MigrationJob) MarshalJSON() ([]byte, error) {
1003 type NoMethod MigrationJob
1004 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1005 }
1006
1007
1008
1009 type MigrationJobVerificationError struct {
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049 ErrorCode string `json:"errorCode,omitempty"`
1050
1051
1052 ErrorDetailMessage string `json:"errorDetailMessage,omitempty"`
1053
1054
1055 ErrorMessage string `json:"errorMessage,omitempty"`
1056
1057
1058
1059
1060
1061 ForceSendFields []string `json:"-"`
1062
1063
1064
1065
1066 NullFields []string `json:"-"`
1067 }
1068
1069 func (s *MigrationJobVerificationError) MarshalJSON() ([]byte, error) {
1070 type NoMethod MigrationJobVerificationError
1071 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1072 }
1073
1074
1075
1076 type MySqlConnectionProfile struct {
1077
1078
1079 CloudSqlId string `json:"cloudSqlId,omitempty"`
1080
1081 Host string `json:"host,omitempty"`
1082
1083
1084
1085
1086 Password string `json:"password,omitempty"`
1087
1088
1089 PasswordSet bool `json:"passwordSet,omitempty"`
1090
1091 Port int64 `json:"port,omitempty"`
1092
1093
1094 Ssl *SslConfig `json:"ssl,omitempty"`
1095
1096
1097
1098 Username string `json:"username,omitempty"`
1099
1100
1101
1102
1103
1104 ForceSendFields []string `json:"-"`
1105
1106
1107
1108
1109 NullFields []string `json:"-"`
1110 }
1111
1112 func (s *MySqlConnectionProfile) MarshalJSON() ([]byte, error) {
1113 type NoMethod MySqlConnectionProfile
1114 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1115 }
1116
1117
1118
1119 type Operation struct {
1120
1121
1122
1123 Done bool `json:"done,omitempty"`
1124
1125 Error *Status `json:"error,omitempty"`
1126
1127
1128
1129
1130 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1131
1132
1133
1134 Name string `json:"name,omitempty"`
1135
1136
1137
1138
1139
1140
1141
1142 Response googleapi.RawMessage `json:"response,omitempty"`
1143
1144
1145 googleapi.ServerResponse `json:"-"`
1146
1147
1148
1149
1150
1151 ForceSendFields []string `json:"-"`
1152
1153
1154
1155
1156 NullFields []string `json:"-"`
1157 }
1158
1159 func (s *Operation) MarshalJSON() ([]byte, error) {
1160 type NoMethod Operation
1161 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1162 }
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194 type Policy struct {
1195
1196 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206 Bindings []*Binding `json:"bindings,omitempty"`
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218 Etag string `json:"etag,omitempty"`
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234 Version int64 `json:"version,omitempty"`
1235
1236
1237 googleapi.ServerResponse `json:"-"`
1238
1239
1240
1241
1242
1243 ForceSendFields []string `json:"-"`
1244
1245
1246
1247
1248 NullFields []string `json:"-"`
1249 }
1250
1251 func (s *Policy) MarshalJSON() ([]byte, error) {
1252 type NoMethod Policy
1253 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1254 }
1255
1256
1257
1258 type PromoteMigrationJobRequest struct {
1259 }
1260
1261
1262
1263 type RestartMigrationJobRequest struct {
1264 }
1265
1266
1267 type ResumeMigrationJobRequest struct {
1268 }
1269
1270
1271
1272
1273
1274
1275
1276 type ReverseSshConnectivity struct {
1277
1278
1279 Vm string `json:"vm,omitempty"`
1280
1281
1282 VmIp string `json:"vmIp,omitempty"`
1283
1284
1285 VmPort int64 `json:"vmPort,omitempty"`
1286
1287 Vpc string `json:"vpc,omitempty"`
1288
1289
1290
1291
1292
1293 ForceSendFields []string `json:"-"`
1294
1295
1296
1297
1298 NullFields []string `json:"-"`
1299 }
1300
1301 func (s *ReverseSshConnectivity) MarshalJSON() ([]byte, error) {
1302 type NoMethod ReverseSshConnectivity
1303 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1304 }
1305
1306
1307 type SetIamPolicyRequest struct {
1308
1309
1310
1311
1312 Policy *Policy `json:"policy,omitempty"`
1313
1314
1315
1316 UpdateMask string `json:"updateMask,omitempty"`
1317
1318
1319
1320
1321
1322 ForceSendFields []string `json:"-"`
1323
1324
1325
1326
1327 NullFields []string `json:"-"`
1328 }
1329
1330 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
1331 type NoMethod SetIamPolicyRequest
1332 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1333 }
1334
1335
1336 type SqlAclEntry struct {
1337
1338
1339
1340 ExpireTime string `json:"expireTime,omitempty"`
1341
1342 Label string `json:"label,omitempty"`
1343
1344 Ttl string `json:"ttl,omitempty"`
1345
1346 Value string `json:"value,omitempty"`
1347
1348
1349
1350
1351
1352 ForceSendFields []string `json:"-"`
1353
1354
1355
1356
1357 NullFields []string `json:"-"`
1358 }
1359
1360 func (s *SqlAclEntry) MarshalJSON() ([]byte, error) {
1361 type NoMethod SqlAclEntry
1362 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1363 }
1364
1365
1366 type SqlIpConfig struct {
1367
1368
1369
1370
1371 AuthorizedNetworks []*SqlAclEntry `json:"authorizedNetworks,omitempty"`
1372
1373 EnableIpv4 bool `json:"enableIpv4,omitempty"`
1374
1375
1376
1377
1378 PrivateNetwork string `json:"privateNetwork,omitempty"`
1379
1380 RequireSsl bool `json:"requireSsl,omitempty"`
1381
1382
1383
1384
1385
1386 ForceSendFields []string `json:"-"`
1387
1388
1389
1390
1391 NullFields []string `json:"-"`
1392 }
1393
1394 func (s *SqlIpConfig) MarshalJSON() ([]byte, error) {
1395 type NoMethod SqlIpConfig
1396 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1397 }
1398
1399
1400 type SshScript struct {
1401
1402 Script string `json:"script,omitempty"`
1403
1404
1405 googleapi.ServerResponse `json:"-"`
1406
1407
1408
1409
1410
1411 ForceSendFields []string `json:"-"`
1412
1413
1414
1415
1416 NullFields []string `json:"-"`
1417 }
1418
1419 func (s *SshScript) MarshalJSON() ([]byte, error) {
1420 type NoMethod SshScript
1421 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1422 }
1423
1424
1425 type SslConfig struct {
1426
1427
1428
1429 CaCertificate string `json:"caCertificate,omitempty"`
1430
1431
1432
1433 ClientCertificate string `json:"clientCertificate,omitempty"`
1434
1435
1436
1437 ClientKey string `json:"clientKey,omitempty"`
1438
1439
1440
1441
1442
1443
1444
1445
1446 Type string `json:"type,omitempty"`
1447
1448
1449
1450
1451
1452 ForceSendFields []string `json:"-"`
1453
1454
1455
1456
1457 NullFields []string `json:"-"`
1458 }
1459
1460 func (s *SslConfig) MarshalJSON() ([]byte, error) {
1461 type NoMethod SslConfig
1462 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1463 }
1464
1465
1466 type StartMigrationJobRequest struct {
1467 }
1468
1469
1470
1471
1472
1473 type StaticIpConnectivity struct {
1474 }
1475
1476
1477
1478
1479
1480
1481
1482 type Status struct {
1483
1484 Code int64 `json:"code,omitempty"`
1485
1486
1487 Details []googleapi.RawMessage `json:"details,omitempty"`
1488
1489
1490
1491 Message string `json:"message,omitempty"`
1492
1493
1494
1495
1496
1497 ForceSendFields []string `json:"-"`
1498
1499
1500
1501
1502 NullFields []string `json:"-"`
1503 }
1504
1505 func (s *Status) MarshalJSON() ([]byte, error) {
1506 type NoMethod Status
1507 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1508 }
1509
1510
1511 type StopMigrationJobRequest struct {
1512 }
1513
1514
1515 type TestIamPermissionsRequest struct {
1516
1517
1518
1519
1520 Permissions []string `json:"permissions,omitempty"`
1521
1522
1523
1524
1525
1526 ForceSendFields []string `json:"-"`
1527
1528
1529
1530
1531 NullFields []string `json:"-"`
1532 }
1533
1534 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
1535 type NoMethod TestIamPermissionsRequest
1536 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1537 }
1538
1539
1540
1541 type TestIamPermissionsResponse struct {
1542
1543
1544 Permissions []string `json:"permissions,omitempty"`
1545
1546
1547 googleapi.ServerResponse `json:"-"`
1548
1549
1550
1551
1552
1553 ForceSendFields []string `json:"-"`
1554
1555
1556
1557
1558 NullFields []string `json:"-"`
1559 }
1560
1561 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
1562 type NoMethod TestIamPermissionsResponse
1563 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1564 }
1565
1566
1567 type VerifyMigrationJobRequest struct {
1568 }
1569
1570
1571 type VmCreationConfig struct {
1572
1573 Subnet string `json:"subnet,omitempty"`
1574
1575 VmMachineType string `json:"vmMachineType,omitempty"`
1576
1577 VmZone string `json:"vmZone,omitempty"`
1578
1579
1580
1581
1582
1583 ForceSendFields []string `json:"-"`
1584
1585
1586
1587
1588 NullFields []string `json:"-"`
1589 }
1590
1591 func (s *VmCreationConfig) MarshalJSON() ([]byte, error) {
1592 type NoMethod VmCreationConfig
1593 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1594 }
1595
1596
1597 type VmSelectionConfig struct {
1598
1599 VmZone string `json:"vmZone,omitempty"`
1600
1601
1602
1603
1604
1605 ForceSendFields []string `json:"-"`
1606
1607
1608
1609
1610 NullFields []string `json:"-"`
1611 }
1612
1613 func (s *VmSelectionConfig) MarshalJSON() ([]byte, error) {
1614 type NoMethod VmSelectionConfig
1615 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1616 }
1617
1618
1619
1620
1621 type VpcPeeringConnectivity struct {
1622
1623 Vpc string `json:"vpc,omitempty"`
1624
1625
1626
1627
1628
1629 ForceSendFields []string `json:"-"`
1630
1631
1632
1633
1634 NullFields []string `json:"-"`
1635 }
1636
1637 func (s *VpcPeeringConnectivity) MarshalJSON() ([]byte, error) {
1638 type NoMethod VpcPeeringConnectivity
1639 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1640 }
1641
1642 type ProjectsLocationsGetCall struct {
1643 s *Service
1644 name string
1645 urlParams_ gensupport.URLParams
1646 ifNoneMatch_ string
1647 ctx_ context.Context
1648 header_ http.Header
1649 }
1650
1651
1652
1653
1654 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
1655 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1656 c.name = name
1657 return c
1658 }
1659
1660
1661
1662
1663 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
1664 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1665 return c
1666 }
1667
1668
1669
1670
1671 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
1672 c.ifNoneMatch_ = entityTag
1673 return c
1674 }
1675
1676
1677 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
1678 c.ctx_ = ctx
1679 return c
1680 }
1681
1682
1683
1684 func (c *ProjectsLocationsGetCall) Header() http.Header {
1685 if c.header_ == nil {
1686 c.header_ = make(http.Header)
1687 }
1688 return c.header_
1689 }
1690
1691 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
1692 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1693 if c.ifNoneMatch_ != "" {
1694 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1695 }
1696 var body io.Reader = nil
1697 c.urlParams_.Set("alt", alt)
1698 c.urlParams_.Set("prettyPrint", "false")
1699 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
1700 urls += "?" + c.urlParams_.Encode()
1701 req, err := http.NewRequest("GET", urls, body)
1702 if err != nil {
1703 return nil, err
1704 }
1705 req.Header = reqHeaders
1706 googleapi.Expand(req.URL, map[string]string{
1707 "name": c.name,
1708 })
1709 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1710 }
1711
1712
1713
1714
1715
1716
1717 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, 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 := &Location{
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 ProjectsLocationsListCall struct {
1750 s *Service
1751 name string
1752 urlParams_ gensupport.URLParams
1753 ifNoneMatch_ string
1754 ctx_ context.Context
1755 header_ http.Header
1756 }
1757
1758
1759
1760
1761 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
1762 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1763 c.name = name
1764 return c
1765 }
1766
1767
1768
1769
1770
1771 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
1772 c.urlParams_.Set("filter", filter)
1773 return c
1774 }
1775
1776
1777
1778 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
1779 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1780 return c
1781 }
1782
1783
1784
1785
1786 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
1787 c.urlParams_.Set("pageToken", pageToken)
1788 return c
1789 }
1790
1791
1792
1793
1794 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
1795 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1796 return c
1797 }
1798
1799
1800
1801
1802 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
1803 c.ifNoneMatch_ = entityTag
1804 return c
1805 }
1806
1807
1808 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
1809 c.ctx_ = ctx
1810 return c
1811 }
1812
1813
1814
1815 func (c *ProjectsLocationsListCall) Header() http.Header {
1816 if c.header_ == nil {
1817 c.header_ = make(http.Header)
1818 }
1819 return c.header_
1820 }
1821
1822 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
1823 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1824 if c.ifNoneMatch_ != "" {
1825 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1826 }
1827 var body io.Reader = nil
1828 c.urlParams_.Set("alt", alt)
1829 c.urlParams_.Set("prettyPrint", "false")
1830 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
1831 urls += "?" + c.urlParams_.Encode()
1832 req, err := http.NewRequest("GET", urls, body)
1833 if err != nil {
1834 return nil, err
1835 }
1836 req.Header = reqHeaders
1837 googleapi.Expand(req.URL, map[string]string{
1838 "name": c.name,
1839 })
1840 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1841 }
1842
1843
1844
1845
1846
1847
1848
1849 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
1850 gensupport.SetOptions(c.urlParams_, opts...)
1851 res, err := c.doRequest("json")
1852 if res != nil && res.StatusCode == http.StatusNotModified {
1853 if res.Body != nil {
1854 res.Body.Close()
1855 }
1856 return nil, gensupport.WrapError(&googleapi.Error{
1857 Code: res.StatusCode,
1858 Header: res.Header,
1859 })
1860 }
1861 if err != nil {
1862 return nil, err
1863 }
1864 defer googleapi.CloseBody(res)
1865 if err := googleapi.CheckResponse(res); err != nil {
1866 return nil, gensupport.WrapError(err)
1867 }
1868 ret := &ListLocationsResponse{
1869 ServerResponse: googleapi.ServerResponse{
1870 Header: res.Header,
1871 HTTPStatusCode: res.StatusCode,
1872 },
1873 }
1874 target := &ret
1875 if err := gensupport.DecodeResponse(target, res); err != nil {
1876 return nil, err
1877 }
1878 return ret, nil
1879 }
1880
1881
1882
1883
1884 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1885 c.ctx_ = ctx
1886 defer c.PageToken(c.urlParams_.Get("pageToken"))
1887 for {
1888 x, err := c.Do()
1889 if err != nil {
1890 return err
1891 }
1892 if err := f(x); err != nil {
1893 return err
1894 }
1895 if x.NextPageToken == "" {
1896 return nil
1897 }
1898 c.PageToken(x.NextPageToken)
1899 }
1900 }
1901
1902 type ProjectsLocationsConnectionProfilesCreateCall struct {
1903 s *Service
1904 parent string
1905 connectionprofile *ConnectionProfile
1906 urlParams_ gensupport.URLParams
1907 ctx_ context.Context
1908 header_ http.Header
1909 }
1910
1911
1912
1913
1914 func (r *ProjectsLocationsConnectionProfilesService) Create(parent string, connectionprofile *ConnectionProfile) *ProjectsLocationsConnectionProfilesCreateCall {
1915 c := &ProjectsLocationsConnectionProfilesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1916 c.parent = parent
1917 c.connectionprofile = connectionprofile
1918 return c
1919 }
1920
1921
1922
1923 func (c *ProjectsLocationsConnectionProfilesCreateCall) ConnectionProfileId(connectionProfileId string) *ProjectsLocationsConnectionProfilesCreateCall {
1924 c.urlParams_.Set("connectionProfileId", connectionProfileId)
1925 return c
1926 }
1927
1928
1929
1930
1931
1932
1933
1934 func (c *ProjectsLocationsConnectionProfilesCreateCall) RequestId(requestId string) *ProjectsLocationsConnectionProfilesCreateCall {
1935 c.urlParams_.Set("requestId", requestId)
1936 return c
1937 }
1938
1939
1940
1941
1942 func (c *ProjectsLocationsConnectionProfilesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionProfilesCreateCall {
1943 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1944 return c
1945 }
1946
1947
1948 func (c *ProjectsLocationsConnectionProfilesCreateCall) Context(ctx context.Context) *ProjectsLocationsConnectionProfilesCreateCall {
1949 c.ctx_ = ctx
1950 return c
1951 }
1952
1953
1954
1955 func (c *ProjectsLocationsConnectionProfilesCreateCall) Header() http.Header {
1956 if c.header_ == nil {
1957 c.header_ = make(http.Header)
1958 }
1959 return c.header_
1960 }
1961
1962 func (c *ProjectsLocationsConnectionProfilesCreateCall) doRequest(alt string) (*http.Response, error) {
1963 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1964 var body io.Reader = nil
1965 body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectionprofile)
1966 if err != nil {
1967 return nil, err
1968 }
1969 c.urlParams_.Set("alt", alt)
1970 c.urlParams_.Set("prettyPrint", "false")
1971 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/connectionProfiles")
1972 urls += "?" + c.urlParams_.Encode()
1973 req, err := http.NewRequest("POST", urls, body)
1974 if err != nil {
1975 return nil, err
1976 }
1977 req.Header = reqHeaders
1978 googleapi.Expand(req.URL, map[string]string{
1979 "parent": c.parent,
1980 })
1981 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1982 }
1983
1984
1985
1986
1987
1988
1989 func (c *ProjectsLocationsConnectionProfilesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1990 gensupport.SetOptions(c.urlParams_, opts...)
1991 res, err := c.doRequest("json")
1992 if res != nil && res.StatusCode == http.StatusNotModified {
1993 if res.Body != nil {
1994 res.Body.Close()
1995 }
1996 return nil, gensupport.WrapError(&googleapi.Error{
1997 Code: res.StatusCode,
1998 Header: res.Header,
1999 })
2000 }
2001 if err != nil {
2002 return nil, err
2003 }
2004 defer googleapi.CloseBody(res)
2005 if err := googleapi.CheckResponse(res); err != nil {
2006 return nil, gensupport.WrapError(err)
2007 }
2008 ret := &Operation{
2009 ServerResponse: googleapi.ServerResponse{
2010 Header: res.Header,
2011 HTTPStatusCode: res.StatusCode,
2012 },
2013 }
2014 target := &ret
2015 if err := gensupport.DecodeResponse(target, res); err != nil {
2016 return nil, err
2017 }
2018 return ret, nil
2019 }
2020
2021 type ProjectsLocationsConnectionProfilesDeleteCall struct {
2022 s *Service
2023 name string
2024 urlParams_ gensupport.URLParams
2025 ctx_ context.Context
2026 header_ http.Header
2027 }
2028
2029
2030
2031
2032
2033
2034 func (r *ProjectsLocationsConnectionProfilesService) Delete(name string) *ProjectsLocationsConnectionProfilesDeleteCall {
2035 c := &ProjectsLocationsConnectionProfilesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2036 c.name = name
2037 return c
2038 }
2039
2040
2041
2042
2043 func (c *ProjectsLocationsConnectionProfilesDeleteCall) Force(force bool) *ProjectsLocationsConnectionProfilesDeleteCall {
2044 c.urlParams_.Set("force", fmt.Sprint(force))
2045 return c
2046 }
2047
2048
2049
2050
2051
2052
2053
2054 func (c *ProjectsLocationsConnectionProfilesDeleteCall) RequestId(requestId string) *ProjectsLocationsConnectionProfilesDeleteCall {
2055 c.urlParams_.Set("requestId", requestId)
2056 return c
2057 }
2058
2059
2060
2061
2062 func (c *ProjectsLocationsConnectionProfilesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionProfilesDeleteCall {
2063 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2064 return c
2065 }
2066
2067
2068 func (c *ProjectsLocationsConnectionProfilesDeleteCall) Context(ctx context.Context) *ProjectsLocationsConnectionProfilesDeleteCall {
2069 c.ctx_ = ctx
2070 return c
2071 }
2072
2073
2074
2075 func (c *ProjectsLocationsConnectionProfilesDeleteCall) Header() http.Header {
2076 if c.header_ == nil {
2077 c.header_ = make(http.Header)
2078 }
2079 return c.header_
2080 }
2081
2082 func (c *ProjectsLocationsConnectionProfilesDeleteCall) doRequest(alt string) (*http.Response, error) {
2083 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2084 var body io.Reader = nil
2085 c.urlParams_.Set("alt", alt)
2086 c.urlParams_.Set("prettyPrint", "false")
2087 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2088 urls += "?" + c.urlParams_.Encode()
2089 req, err := http.NewRequest("DELETE", urls, body)
2090 if err != nil {
2091 return nil, err
2092 }
2093 req.Header = reqHeaders
2094 googleapi.Expand(req.URL, map[string]string{
2095 "name": c.name,
2096 })
2097 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2098 }
2099
2100
2101
2102
2103
2104
2105 func (c *ProjectsLocationsConnectionProfilesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2106 gensupport.SetOptions(c.urlParams_, opts...)
2107 res, err := c.doRequest("json")
2108 if res != nil && res.StatusCode == http.StatusNotModified {
2109 if res.Body != nil {
2110 res.Body.Close()
2111 }
2112 return nil, gensupport.WrapError(&googleapi.Error{
2113 Code: res.StatusCode,
2114 Header: res.Header,
2115 })
2116 }
2117 if err != nil {
2118 return nil, err
2119 }
2120 defer googleapi.CloseBody(res)
2121 if err := googleapi.CheckResponse(res); err != nil {
2122 return nil, gensupport.WrapError(err)
2123 }
2124 ret := &Operation{
2125 ServerResponse: googleapi.ServerResponse{
2126 Header: res.Header,
2127 HTTPStatusCode: res.StatusCode,
2128 },
2129 }
2130 target := &ret
2131 if err := gensupport.DecodeResponse(target, res); err != nil {
2132 return nil, err
2133 }
2134 return ret, nil
2135 }
2136
2137 type ProjectsLocationsConnectionProfilesGetCall struct {
2138 s *Service
2139 name string
2140 urlParams_ gensupport.URLParams
2141 ifNoneMatch_ string
2142 ctx_ context.Context
2143 header_ http.Header
2144 }
2145
2146
2147
2148
2149 func (r *ProjectsLocationsConnectionProfilesService) Get(name string) *ProjectsLocationsConnectionProfilesGetCall {
2150 c := &ProjectsLocationsConnectionProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2151 c.name = name
2152 return c
2153 }
2154
2155
2156
2157
2158 func (c *ProjectsLocationsConnectionProfilesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionProfilesGetCall {
2159 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2160 return c
2161 }
2162
2163
2164
2165
2166 func (c *ProjectsLocationsConnectionProfilesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionProfilesGetCall {
2167 c.ifNoneMatch_ = entityTag
2168 return c
2169 }
2170
2171
2172 func (c *ProjectsLocationsConnectionProfilesGetCall) Context(ctx context.Context) *ProjectsLocationsConnectionProfilesGetCall {
2173 c.ctx_ = ctx
2174 return c
2175 }
2176
2177
2178
2179 func (c *ProjectsLocationsConnectionProfilesGetCall) Header() http.Header {
2180 if c.header_ == nil {
2181 c.header_ = make(http.Header)
2182 }
2183 return c.header_
2184 }
2185
2186 func (c *ProjectsLocationsConnectionProfilesGetCall) doRequest(alt string) (*http.Response, error) {
2187 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2188 if c.ifNoneMatch_ != "" {
2189 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2190 }
2191 var body io.Reader = nil
2192 c.urlParams_.Set("alt", alt)
2193 c.urlParams_.Set("prettyPrint", "false")
2194 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2195 urls += "?" + c.urlParams_.Encode()
2196 req, err := http.NewRequest("GET", urls, body)
2197 if err != nil {
2198 return nil, err
2199 }
2200 req.Header = reqHeaders
2201 googleapi.Expand(req.URL, map[string]string{
2202 "name": c.name,
2203 })
2204 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2205 }
2206
2207
2208
2209
2210
2211
2212
2213 func (c *ProjectsLocationsConnectionProfilesGetCall) Do(opts ...googleapi.CallOption) (*ConnectionProfile, error) {
2214 gensupport.SetOptions(c.urlParams_, opts...)
2215 res, err := c.doRequest("json")
2216 if res != nil && res.StatusCode == http.StatusNotModified {
2217 if res.Body != nil {
2218 res.Body.Close()
2219 }
2220 return nil, gensupport.WrapError(&googleapi.Error{
2221 Code: res.StatusCode,
2222 Header: res.Header,
2223 })
2224 }
2225 if err != nil {
2226 return nil, err
2227 }
2228 defer googleapi.CloseBody(res)
2229 if err := googleapi.CheckResponse(res); err != nil {
2230 return nil, gensupport.WrapError(err)
2231 }
2232 ret := &ConnectionProfile{
2233 ServerResponse: googleapi.ServerResponse{
2234 Header: res.Header,
2235 HTTPStatusCode: res.StatusCode,
2236 },
2237 }
2238 target := &ret
2239 if err := gensupport.DecodeResponse(target, res); err != nil {
2240 return nil, err
2241 }
2242 return ret, nil
2243 }
2244
2245 type ProjectsLocationsConnectionProfilesGetIamPolicyCall struct {
2246 s *Service
2247 resource string
2248 urlParams_ gensupport.URLParams
2249 ifNoneMatch_ string
2250 ctx_ context.Context
2251 header_ http.Header
2252 }
2253
2254
2255
2256
2257
2258
2259
2260 func (r *ProjectsLocationsConnectionProfilesService) GetIamPolicy(resource string) *ProjectsLocationsConnectionProfilesGetIamPolicyCall {
2261 c := &ProjectsLocationsConnectionProfilesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2262 c.resource = resource
2263 return c
2264 }
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278 func (c *ProjectsLocationsConnectionProfilesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsConnectionProfilesGetIamPolicyCall {
2279 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
2280 return c
2281 }
2282
2283
2284
2285
2286 func (c *ProjectsLocationsConnectionProfilesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionProfilesGetIamPolicyCall {
2287 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2288 return c
2289 }
2290
2291
2292
2293
2294 func (c *ProjectsLocationsConnectionProfilesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionProfilesGetIamPolicyCall {
2295 c.ifNoneMatch_ = entityTag
2296 return c
2297 }
2298
2299
2300 func (c *ProjectsLocationsConnectionProfilesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsConnectionProfilesGetIamPolicyCall {
2301 c.ctx_ = ctx
2302 return c
2303 }
2304
2305
2306
2307 func (c *ProjectsLocationsConnectionProfilesGetIamPolicyCall) Header() http.Header {
2308 if c.header_ == nil {
2309 c.header_ = make(http.Header)
2310 }
2311 return c.header_
2312 }
2313
2314 func (c *ProjectsLocationsConnectionProfilesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2315 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2316 if c.ifNoneMatch_ != "" {
2317 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2318 }
2319 var body io.Reader = nil
2320 c.urlParams_.Set("alt", alt)
2321 c.urlParams_.Set("prettyPrint", "false")
2322 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
2323 urls += "?" + c.urlParams_.Encode()
2324 req, err := http.NewRequest("GET", urls, body)
2325 if err != nil {
2326 return nil, err
2327 }
2328 req.Header = reqHeaders
2329 googleapi.Expand(req.URL, map[string]string{
2330 "resource": c.resource,
2331 })
2332 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2333 }
2334
2335
2336
2337
2338
2339
2340 func (c *ProjectsLocationsConnectionProfilesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2341 gensupport.SetOptions(c.urlParams_, opts...)
2342 res, err := c.doRequest("json")
2343 if res != nil && res.StatusCode == http.StatusNotModified {
2344 if res.Body != nil {
2345 res.Body.Close()
2346 }
2347 return nil, gensupport.WrapError(&googleapi.Error{
2348 Code: res.StatusCode,
2349 Header: res.Header,
2350 })
2351 }
2352 if err != nil {
2353 return nil, err
2354 }
2355 defer googleapi.CloseBody(res)
2356 if err := googleapi.CheckResponse(res); err != nil {
2357 return nil, gensupport.WrapError(err)
2358 }
2359 ret := &Policy{
2360 ServerResponse: googleapi.ServerResponse{
2361 Header: res.Header,
2362 HTTPStatusCode: res.StatusCode,
2363 },
2364 }
2365 target := &ret
2366 if err := gensupport.DecodeResponse(target, res); err != nil {
2367 return nil, err
2368 }
2369 return ret, nil
2370 }
2371
2372 type ProjectsLocationsConnectionProfilesListCall struct {
2373 s *Service
2374 parent string
2375 urlParams_ gensupport.URLParams
2376 ifNoneMatch_ string
2377 ctx_ context.Context
2378 header_ http.Header
2379 }
2380
2381
2382
2383
2384
2385 func (r *ProjectsLocationsConnectionProfilesService) List(parent string) *ProjectsLocationsConnectionProfilesListCall {
2386 c := &ProjectsLocationsConnectionProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2387 c.parent = parent
2388 return c
2389 }
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400 func (c *ProjectsLocationsConnectionProfilesListCall) Filter(filter string) *ProjectsLocationsConnectionProfilesListCall {
2401 c.urlParams_.Set("filter", filter)
2402 return c
2403 }
2404
2405
2406
2407 func (c *ProjectsLocationsConnectionProfilesListCall) OrderBy(orderBy string) *ProjectsLocationsConnectionProfilesListCall {
2408 c.urlParams_.Set("orderBy", orderBy)
2409 return c
2410 }
2411
2412
2413
2414
2415
2416 func (c *ProjectsLocationsConnectionProfilesListCall) PageSize(pageSize int64) *ProjectsLocationsConnectionProfilesListCall {
2417 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2418 return c
2419 }
2420
2421
2422
2423
2424
2425 func (c *ProjectsLocationsConnectionProfilesListCall) PageToken(pageToken string) *ProjectsLocationsConnectionProfilesListCall {
2426 c.urlParams_.Set("pageToken", pageToken)
2427 return c
2428 }
2429
2430
2431
2432
2433 func (c *ProjectsLocationsConnectionProfilesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionProfilesListCall {
2434 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2435 return c
2436 }
2437
2438
2439
2440
2441 func (c *ProjectsLocationsConnectionProfilesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsConnectionProfilesListCall {
2442 c.ifNoneMatch_ = entityTag
2443 return c
2444 }
2445
2446
2447 func (c *ProjectsLocationsConnectionProfilesListCall) Context(ctx context.Context) *ProjectsLocationsConnectionProfilesListCall {
2448 c.ctx_ = ctx
2449 return c
2450 }
2451
2452
2453
2454 func (c *ProjectsLocationsConnectionProfilesListCall) Header() http.Header {
2455 if c.header_ == nil {
2456 c.header_ = make(http.Header)
2457 }
2458 return c.header_
2459 }
2460
2461 func (c *ProjectsLocationsConnectionProfilesListCall) doRequest(alt string) (*http.Response, error) {
2462 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2463 if c.ifNoneMatch_ != "" {
2464 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2465 }
2466 var body io.Reader = nil
2467 c.urlParams_.Set("alt", alt)
2468 c.urlParams_.Set("prettyPrint", "false")
2469 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/connectionProfiles")
2470 urls += "?" + c.urlParams_.Encode()
2471 req, err := http.NewRequest("GET", urls, body)
2472 if err != nil {
2473 return nil, err
2474 }
2475 req.Header = reqHeaders
2476 googleapi.Expand(req.URL, map[string]string{
2477 "parent": c.parent,
2478 })
2479 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2480 }
2481
2482
2483
2484
2485
2486
2487
2488 func (c *ProjectsLocationsConnectionProfilesListCall) Do(opts ...googleapi.CallOption) (*ListConnectionProfilesResponse, error) {
2489 gensupport.SetOptions(c.urlParams_, opts...)
2490 res, err := c.doRequest("json")
2491 if res != nil && res.StatusCode == http.StatusNotModified {
2492 if res.Body != nil {
2493 res.Body.Close()
2494 }
2495 return nil, gensupport.WrapError(&googleapi.Error{
2496 Code: res.StatusCode,
2497 Header: res.Header,
2498 })
2499 }
2500 if err != nil {
2501 return nil, err
2502 }
2503 defer googleapi.CloseBody(res)
2504 if err := googleapi.CheckResponse(res); err != nil {
2505 return nil, gensupport.WrapError(err)
2506 }
2507 ret := &ListConnectionProfilesResponse{
2508 ServerResponse: googleapi.ServerResponse{
2509 Header: res.Header,
2510 HTTPStatusCode: res.StatusCode,
2511 },
2512 }
2513 target := &ret
2514 if err := gensupport.DecodeResponse(target, res); err != nil {
2515 return nil, err
2516 }
2517 return ret, nil
2518 }
2519
2520
2521
2522
2523 func (c *ProjectsLocationsConnectionProfilesListCall) Pages(ctx context.Context, f func(*ListConnectionProfilesResponse) error) error {
2524 c.ctx_ = ctx
2525 defer c.PageToken(c.urlParams_.Get("pageToken"))
2526 for {
2527 x, err := c.Do()
2528 if err != nil {
2529 return err
2530 }
2531 if err := f(x); err != nil {
2532 return err
2533 }
2534 if x.NextPageToken == "" {
2535 return nil
2536 }
2537 c.PageToken(x.NextPageToken)
2538 }
2539 }
2540
2541 type ProjectsLocationsConnectionProfilesPatchCall struct {
2542 s *Service
2543 name string
2544 connectionprofile *ConnectionProfile
2545 urlParams_ gensupport.URLParams
2546 ctx_ context.Context
2547 header_ http.Header
2548 }
2549
2550
2551
2552
2553
2554
2555 func (r *ProjectsLocationsConnectionProfilesService) Patch(name string, connectionprofile *ConnectionProfile) *ProjectsLocationsConnectionProfilesPatchCall {
2556 c := &ProjectsLocationsConnectionProfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2557 c.name = name
2558 c.connectionprofile = connectionprofile
2559 return c
2560 }
2561
2562
2563
2564
2565
2566
2567
2568 func (c *ProjectsLocationsConnectionProfilesPatchCall) RequestId(requestId string) *ProjectsLocationsConnectionProfilesPatchCall {
2569 c.urlParams_.Set("requestId", requestId)
2570 return c
2571 }
2572
2573
2574
2575
2576 func (c *ProjectsLocationsConnectionProfilesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsConnectionProfilesPatchCall {
2577 c.urlParams_.Set("updateMask", updateMask)
2578 return c
2579 }
2580
2581
2582
2583
2584 func (c *ProjectsLocationsConnectionProfilesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionProfilesPatchCall {
2585 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2586 return c
2587 }
2588
2589
2590 func (c *ProjectsLocationsConnectionProfilesPatchCall) Context(ctx context.Context) *ProjectsLocationsConnectionProfilesPatchCall {
2591 c.ctx_ = ctx
2592 return c
2593 }
2594
2595
2596
2597 func (c *ProjectsLocationsConnectionProfilesPatchCall) Header() http.Header {
2598 if c.header_ == nil {
2599 c.header_ = make(http.Header)
2600 }
2601 return c.header_
2602 }
2603
2604 func (c *ProjectsLocationsConnectionProfilesPatchCall) doRequest(alt string) (*http.Response, error) {
2605 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2606 var body io.Reader = nil
2607 body, err := googleapi.WithoutDataWrapper.JSONReader(c.connectionprofile)
2608 if err != nil {
2609 return nil, err
2610 }
2611 c.urlParams_.Set("alt", alt)
2612 c.urlParams_.Set("prettyPrint", "false")
2613 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2614 urls += "?" + c.urlParams_.Encode()
2615 req, err := http.NewRequest("PATCH", urls, body)
2616 if err != nil {
2617 return nil, err
2618 }
2619 req.Header = reqHeaders
2620 googleapi.Expand(req.URL, map[string]string{
2621 "name": c.name,
2622 })
2623 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2624 }
2625
2626
2627
2628
2629
2630
2631 func (c *ProjectsLocationsConnectionProfilesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2632 gensupport.SetOptions(c.urlParams_, opts...)
2633 res, err := c.doRequest("json")
2634 if res != nil && res.StatusCode == http.StatusNotModified {
2635 if res.Body != nil {
2636 res.Body.Close()
2637 }
2638 return nil, gensupport.WrapError(&googleapi.Error{
2639 Code: res.StatusCode,
2640 Header: res.Header,
2641 })
2642 }
2643 if err != nil {
2644 return nil, err
2645 }
2646 defer googleapi.CloseBody(res)
2647 if err := googleapi.CheckResponse(res); err != nil {
2648 return nil, gensupport.WrapError(err)
2649 }
2650 ret := &Operation{
2651 ServerResponse: googleapi.ServerResponse{
2652 Header: res.Header,
2653 HTTPStatusCode: res.StatusCode,
2654 },
2655 }
2656 target := &ret
2657 if err := gensupport.DecodeResponse(target, res); err != nil {
2658 return nil, err
2659 }
2660 return ret, nil
2661 }
2662
2663 type ProjectsLocationsConnectionProfilesSetIamPolicyCall struct {
2664 s *Service
2665 resource string
2666 setiampolicyrequest *SetIamPolicyRequest
2667 urlParams_ gensupport.URLParams
2668 ctx_ context.Context
2669 header_ http.Header
2670 }
2671
2672
2673
2674
2675
2676
2677
2678
2679 func (r *ProjectsLocationsConnectionProfilesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsConnectionProfilesSetIamPolicyCall {
2680 c := &ProjectsLocationsConnectionProfilesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2681 c.resource = resource
2682 c.setiampolicyrequest = setiampolicyrequest
2683 return c
2684 }
2685
2686
2687
2688
2689 func (c *ProjectsLocationsConnectionProfilesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionProfilesSetIamPolicyCall {
2690 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2691 return c
2692 }
2693
2694
2695 func (c *ProjectsLocationsConnectionProfilesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsConnectionProfilesSetIamPolicyCall {
2696 c.ctx_ = ctx
2697 return c
2698 }
2699
2700
2701
2702 func (c *ProjectsLocationsConnectionProfilesSetIamPolicyCall) Header() http.Header {
2703 if c.header_ == nil {
2704 c.header_ = make(http.Header)
2705 }
2706 return c.header_
2707 }
2708
2709 func (c *ProjectsLocationsConnectionProfilesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2710 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2711 var body io.Reader = nil
2712 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
2713 if err != nil {
2714 return nil, err
2715 }
2716 c.urlParams_.Set("alt", alt)
2717 c.urlParams_.Set("prettyPrint", "false")
2718 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
2719 urls += "?" + c.urlParams_.Encode()
2720 req, err := http.NewRequest("POST", urls, body)
2721 if err != nil {
2722 return nil, err
2723 }
2724 req.Header = reqHeaders
2725 googleapi.Expand(req.URL, map[string]string{
2726 "resource": c.resource,
2727 })
2728 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2729 }
2730
2731
2732
2733
2734
2735
2736 func (c *ProjectsLocationsConnectionProfilesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2737 gensupport.SetOptions(c.urlParams_, opts...)
2738 res, err := c.doRequest("json")
2739 if res != nil && res.StatusCode == http.StatusNotModified {
2740 if res.Body != nil {
2741 res.Body.Close()
2742 }
2743 return nil, gensupport.WrapError(&googleapi.Error{
2744 Code: res.StatusCode,
2745 Header: res.Header,
2746 })
2747 }
2748 if err != nil {
2749 return nil, err
2750 }
2751 defer googleapi.CloseBody(res)
2752 if err := googleapi.CheckResponse(res); err != nil {
2753 return nil, gensupport.WrapError(err)
2754 }
2755 ret := &Policy{
2756 ServerResponse: googleapi.ServerResponse{
2757 Header: res.Header,
2758 HTTPStatusCode: res.StatusCode,
2759 },
2760 }
2761 target := &ret
2762 if err := gensupport.DecodeResponse(target, res); err != nil {
2763 return nil, err
2764 }
2765 return ret, nil
2766 }
2767
2768 type ProjectsLocationsConnectionProfilesTestIamPermissionsCall struct {
2769 s *Service
2770 resource string
2771 testiampermissionsrequest *TestIamPermissionsRequest
2772 urlParams_ gensupport.URLParams
2773 ctx_ context.Context
2774 header_ http.Header
2775 }
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787 func (r *ProjectsLocationsConnectionProfilesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsConnectionProfilesTestIamPermissionsCall {
2788 c := &ProjectsLocationsConnectionProfilesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2789 c.resource = resource
2790 c.testiampermissionsrequest = testiampermissionsrequest
2791 return c
2792 }
2793
2794
2795
2796
2797 func (c *ProjectsLocationsConnectionProfilesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsConnectionProfilesTestIamPermissionsCall {
2798 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2799 return c
2800 }
2801
2802
2803 func (c *ProjectsLocationsConnectionProfilesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsConnectionProfilesTestIamPermissionsCall {
2804 c.ctx_ = ctx
2805 return c
2806 }
2807
2808
2809
2810 func (c *ProjectsLocationsConnectionProfilesTestIamPermissionsCall) Header() http.Header {
2811 if c.header_ == nil {
2812 c.header_ = make(http.Header)
2813 }
2814 return c.header_
2815 }
2816
2817 func (c *ProjectsLocationsConnectionProfilesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
2818 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2819 var body io.Reader = nil
2820 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
2821 if err != nil {
2822 return nil, err
2823 }
2824 c.urlParams_.Set("alt", alt)
2825 c.urlParams_.Set("prettyPrint", "false")
2826 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
2827 urls += "?" + c.urlParams_.Encode()
2828 req, err := http.NewRequest("POST", urls, body)
2829 if err != nil {
2830 return nil, err
2831 }
2832 req.Header = reqHeaders
2833 googleapi.Expand(req.URL, map[string]string{
2834 "resource": c.resource,
2835 })
2836 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2837 }
2838
2839
2840
2841
2842
2843
2844
2845 func (c *ProjectsLocationsConnectionProfilesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
2846 gensupport.SetOptions(c.urlParams_, opts...)
2847 res, err := c.doRequest("json")
2848 if res != nil && res.StatusCode == http.StatusNotModified {
2849 if res.Body != nil {
2850 res.Body.Close()
2851 }
2852 return nil, gensupport.WrapError(&googleapi.Error{
2853 Code: res.StatusCode,
2854 Header: res.Header,
2855 })
2856 }
2857 if err != nil {
2858 return nil, err
2859 }
2860 defer googleapi.CloseBody(res)
2861 if err := googleapi.CheckResponse(res); err != nil {
2862 return nil, gensupport.WrapError(err)
2863 }
2864 ret := &TestIamPermissionsResponse{
2865 ServerResponse: googleapi.ServerResponse{
2866 Header: res.Header,
2867 HTTPStatusCode: res.StatusCode,
2868 },
2869 }
2870 target := &ret
2871 if err := gensupport.DecodeResponse(target, res); err != nil {
2872 return nil, err
2873 }
2874 return ret, nil
2875 }
2876
2877 type ProjectsLocationsMigrationJobsCreateCall struct {
2878 s *Service
2879 parent string
2880 migrationjob *MigrationJob
2881 urlParams_ gensupport.URLParams
2882 ctx_ context.Context
2883 header_ http.Header
2884 }
2885
2886
2887
2888
2889 func (r *ProjectsLocationsMigrationJobsService) Create(parent string, migrationjob *MigrationJob) *ProjectsLocationsMigrationJobsCreateCall {
2890 c := &ProjectsLocationsMigrationJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2891 c.parent = parent
2892 c.migrationjob = migrationjob
2893 return c
2894 }
2895
2896
2897
2898 func (c *ProjectsLocationsMigrationJobsCreateCall) MigrationJobId(migrationJobId string) *ProjectsLocationsMigrationJobsCreateCall {
2899 c.urlParams_.Set("migrationJobId", migrationJobId)
2900 return c
2901 }
2902
2903
2904
2905
2906
2907
2908
2909 func (c *ProjectsLocationsMigrationJobsCreateCall) RequestId(requestId string) *ProjectsLocationsMigrationJobsCreateCall {
2910 c.urlParams_.Set("requestId", requestId)
2911 return c
2912 }
2913
2914
2915
2916
2917 func (c *ProjectsLocationsMigrationJobsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsCreateCall {
2918 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2919 return c
2920 }
2921
2922
2923 func (c *ProjectsLocationsMigrationJobsCreateCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsCreateCall {
2924 c.ctx_ = ctx
2925 return c
2926 }
2927
2928
2929
2930 func (c *ProjectsLocationsMigrationJobsCreateCall) Header() http.Header {
2931 if c.header_ == nil {
2932 c.header_ = make(http.Header)
2933 }
2934 return c.header_
2935 }
2936
2937 func (c *ProjectsLocationsMigrationJobsCreateCall) doRequest(alt string) (*http.Response, error) {
2938 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2939 var body io.Reader = nil
2940 body, err := googleapi.WithoutDataWrapper.JSONReader(c.migrationjob)
2941 if err != nil {
2942 return nil, err
2943 }
2944 c.urlParams_.Set("alt", alt)
2945 c.urlParams_.Set("prettyPrint", "false")
2946 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/migrationJobs")
2947 urls += "?" + c.urlParams_.Encode()
2948 req, err := http.NewRequest("POST", urls, body)
2949 if err != nil {
2950 return nil, err
2951 }
2952 req.Header = reqHeaders
2953 googleapi.Expand(req.URL, map[string]string{
2954 "parent": c.parent,
2955 })
2956 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2957 }
2958
2959
2960
2961
2962
2963
2964 func (c *ProjectsLocationsMigrationJobsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2965 gensupport.SetOptions(c.urlParams_, opts...)
2966 res, err := c.doRequest("json")
2967 if res != nil && res.StatusCode == http.StatusNotModified {
2968 if res.Body != nil {
2969 res.Body.Close()
2970 }
2971 return nil, gensupport.WrapError(&googleapi.Error{
2972 Code: res.StatusCode,
2973 Header: res.Header,
2974 })
2975 }
2976 if err != nil {
2977 return nil, err
2978 }
2979 defer googleapi.CloseBody(res)
2980 if err := googleapi.CheckResponse(res); err != nil {
2981 return nil, gensupport.WrapError(err)
2982 }
2983 ret := &Operation{
2984 ServerResponse: googleapi.ServerResponse{
2985 Header: res.Header,
2986 HTTPStatusCode: res.StatusCode,
2987 },
2988 }
2989 target := &ret
2990 if err := gensupport.DecodeResponse(target, res); err != nil {
2991 return nil, err
2992 }
2993 return ret, nil
2994 }
2995
2996 type ProjectsLocationsMigrationJobsDeleteCall struct {
2997 s *Service
2998 name string
2999 urlParams_ gensupport.URLParams
3000 ctx_ context.Context
3001 header_ http.Header
3002 }
3003
3004
3005
3006
3007 func (r *ProjectsLocationsMigrationJobsService) Delete(name string) *ProjectsLocationsMigrationJobsDeleteCall {
3008 c := &ProjectsLocationsMigrationJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3009 c.name = name
3010 return c
3011 }
3012
3013
3014
3015
3016 func (c *ProjectsLocationsMigrationJobsDeleteCall) Force(force bool) *ProjectsLocationsMigrationJobsDeleteCall {
3017 c.urlParams_.Set("force", fmt.Sprint(force))
3018 return c
3019 }
3020
3021
3022
3023
3024
3025
3026
3027 func (c *ProjectsLocationsMigrationJobsDeleteCall) RequestId(requestId string) *ProjectsLocationsMigrationJobsDeleteCall {
3028 c.urlParams_.Set("requestId", requestId)
3029 return c
3030 }
3031
3032
3033
3034
3035 func (c *ProjectsLocationsMigrationJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsDeleteCall {
3036 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3037 return c
3038 }
3039
3040
3041 func (c *ProjectsLocationsMigrationJobsDeleteCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsDeleteCall {
3042 c.ctx_ = ctx
3043 return c
3044 }
3045
3046
3047
3048 func (c *ProjectsLocationsMigrationJobsDeleteCall) Header() http.Header {
3049 if c.header_ == nil {
3050 c.header_ = make(http.Header)
3051 }
3052 return c.header_
3053 }
3054
3055 func (c *ProjectsLocationsMigrationJobsDeleteCall) doRequest(alt string) (*http.Response, error) {
3056 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3057 var body io.Reader = nil
3058 c.urlParams_.Set("alt", alt)
3059 c.urlParams_.Set("prettyPrint", "false")
3060 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
3061 urls += "?" + c.urlParams_.Encode()
3062 req, err := http.NewRequest("DELETE", urls, body)
3063 if err != nil {
3064 return nil, err
3065 }
3066 req.Header = reqHeaders
3067 googleapi.Expand(req.URL, map[string]string{
3068 "name": c.name,
3069 })
3070 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3071 }
3072
3073
3074
3075
3076
3077
3078 func (c *ProjectsLocationsMigrationJobsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3079 gensupport.SetOptions(c.urlParams_, opts...)
3080 res, err := c.doRequest("json")
3081 if res != nil && res.StatusCode == http.StatusNotModified {
3082 if res.Body != nil {
3083 res.Body.Close()
3084 }
3085 return nil, gensupport.WrapError(&googleapi.Error{
3086 Code: res.StatusCode,
3087 Header: res.Header,
3088 })
3089 }
3090 if err != nil {
3091 return nil, err
3092 }
3093 defer googleapi.CloseBody(res)
3094 if err := googleapi.CheckResponse(res); err != nil {
3095 return nil, gensupport.WrapError(err)
3096 }
3097 ret := &Operation{
3098 ServerResponse: googleapi.ServerResponse{
3099 Header: res.Header,
3100 HTTPStatusCode: res.StatusCode,
3101 },
3102 }
3103 target := &ret
3104 if err := gensupport.DecodeResponse(target, res); err != nil {
3105 return nil, err
3106 }
3107 return ret, nil
3108 }
3109
3110 type ProjectsLocationsMigrationJobsGenerateSshScriptCall struct {
3111 s *Service
3112 migrationJob string
3113 generatesshscriptrequest *GenerateSshScriptRequest
3114 urlParams_ gensupport.URLParams
3115 ctx_ context.Context
3116 header_ http.Header
3117 }
3118
3119
3120
3121
3122
3123
3124 func (r *ProjectsLocationsMigrationJobsService) GenerateSshScript(migrationJob string, generatesshscriptrequest *GenerateSshScriptRequest) *ProjectsLocationsMigrationJobsGenerateSshScriptCall {
3125 c := &ProjectsLocationsMigrationJobsGenerateSshScriptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3126 c.migrationJob = migrationJob
3127 c.generatesshscriptrequest = generatesshscriptrequest
3128 return c
3129 }
3130
3131
3132
3133
3134 func (c *ProjectsLocationsMigrationJobsGenerateSshScriptCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsGenerateSshScriptCall {
3135 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3136 return c
3137 }
3138
3139
3140 func (c *ProjectsLocationsMigrationJobsGenerateSshScriptCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsGenerateSshScriptCall {
3141 c.ctx_ = ctx
3142 return c
3143 }
3144
3145
3146
3147 func (c *ProjectsLocationsMigrationJobsGenerateSshScriptCall) Header() http.Header {
3148 if c.header_ == nil {
3149 c.header_ = make(http.Header)
3150 }
3151 return c.header_
3152 }
3153
3154 func (c *ProjectsLocationsMigrationJobsGenerateSshScriptCall) doRequest(alt string) (*http.Response, error) {
3155 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3156 var body io.Reader = nil
3157 body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatesshscriptrequest)
3158 if err != nil {
3159 return nil, err
3160 }
3161 c.urlParams_.Set("alt", alt)
3162 c.urlParams_.Set("prettyPrint", "false")
3163 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+migrationJob}:generateSshScript")
3164 urls += "?" + c.urlParams_.Encode()
3165 req, err := http.NewRequest("POST", urls, body)
3166 if err != nil {
3167 return nil, err
3168 }
3169 req.Header = reqHeaders
3170 googleapi.Expand(req.URL, map[string]string{
3171 "migrationJob": c.migrationJob,
3172 })
3173 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3174 }
3175
3176
3177
3178
3179
3180
3181 func (c *ProjectsLocationsMigrationJobsGenerateSshScriptCall) Do(opts ...googleapi.CallOption) (*SshScript, error) {
3182 gensupport.SetOptions(c.urlParams_, opts...)
3183 res, err := c.doRequest("json")
3184 if res != nil && res.StatusCode == http.StatusNotModified {
3185 if res.Body != nil {
3186 res.Body.Close()
3187 }
3188 return nil, gensupport.WrapError(&googleapi.Error{
3189 Code: res.StatusCode,
3190 Header: res.Header,
3191 })
3192 }
3193 if err != nil {
3194 return nil, err
3195 }
3196 defer googleapi.CloseBody(res)
3197 if err := googleapi.CheckResponse(res); err != nil {
3198 return nil, gensupport.WrapError(err)
3199 }
3200 ret := &SshScript{
3201 ServerResponse: googleapi.ServerResponse{
3202 Header: res.Header,
3203 HTTPStatusCode: res.StatusCode,
3204 },
3205 }
3206 target := &ret
3207 if err := gensupport.DecodeResponse(target, res); err != nil {
3208 return nil, err
3209 }
3210 return ret, nil
3211 }
3212
3213 type ProjectsLocationsMigrationJobsGetCall struct {
3214 s *Service
3215 name string
3216 urlParams_ gensupport.URLParams
3217 ifNoneMatch_ string
3218 ctx_ context.Context
3219 header_ http.Header
3220 }
3221
3222
3223
3224
3225 func (r *ProjectsLocationsMigrationJobsService) Get(name string) *ProjectsLocationsMigrationJobsGetCall {
3226 c := &ProjectsLocationsMigrationJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3227 c.name = name
3228 return c
3229 }
3230
3231
3232
3233
3234 func (c *ProjectsLocationsMigrationJobsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsGetCall {
3235 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3236 return c
3237 }
3238
3239
3240
3241
3242 func (c *ProjectsLocationsMigrationJobsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsMigrationJobsGetCall {
3243 c.ifNoneMatch_ = entityTag
3244 return c
3245 }
3246
3247
3248 func (c *ProjectsLocationsMigrationJobsGetCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsGetCall {
3249 c.ctx_ = ctx
3250 return c
3251 }
3252
3253
3254
3255 func (c *ProjectsLocationsMigrationJobsGetCall) Header() http.Header {
3256 if c.header_ == nil {
3257 c.header_ = make(http.Header)
3258 }
3259 return c.header_
3260 }
3261
3262 func (c *ProjectsLocationsMigrationJobsGetCall) doRequest(alt string) (*http.Response, error) {
3263 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3264 if c.ifNoneMatch_ != "" {
3265 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3266 }
3267 var body io.Reader = nil
3268 c.urlParams_.Set("alt", alt)
3269 c.urlParams_.Set("prettyPrint", "false")
3270 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
3271 urls += "?" + c.urlParams_.Encode()
3272 req, err := http.NewRequest("GET", urls, body)
3273 if err != nil {
3274 return nil, err
3275 }
3276 req.Header = reqHeaders
3277 googleapi.Expand(req.URL, map[string]string{
3278 "name": c.name,
3279 })
3280 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3281 }
3282
3283
3284
3285
3286
3287
3288 func (c *ProjectsLocationsMigrationJobsGetCall) Do(opts ...googleapi.CallOption) (*MigrationJob, error) {
3289 gensupport.SetOptions(c.urlParams_, opts...)
3290 res, err := c.doRequest("json")
3291 if res != nil && res.StatusCode == http.StatusNotModified {
3292 if res.Body != nil {
3293 res.Body.Close()
3294 }
3295 return nil, gensupport.WrapError(&googleapi.Error{
3296 Code: res.StatusCode,
3297 Header: res.Header,
3298 })
3299 }
3300 if err != nil {
3301 return nil, err
3302 }
3303 defer googleapi.CloseBody(res)
3304 if err := googleapi.CheckResponse(res); err != nil {
3305 return nil, gensupport.WrapError(err)
3306 }
3307 ret := &MigrationJob{
3308 ServerResponse: googleapi.ServerResponse{
3309 Header: res.Header,
3310 HTTPStatusCode: res.StatusCode,
3311 },
3312 }
3313 target := &ret
3314 if err := gensupport.DecodeResponse(target, res); err != nil {
3315 return nil, err
3316 }
3317 return ret, nil
3318 }
3319
3320 type ProjectsLocationsMigrationJobsGetIamPolicyCall struct {
3321 s *Service
3322 resource string
3323 urlParams_ gensupport.URLParams
3324 ifNoneMatch_ string
3325 ctx_ context.Context
3326 header_ http.Header
3327 }
3328
3329
3330
3331
3332
3333
3334
3335 func (r *ProjectsLocationsMigrationJobsService) GetIamPolicy(resource string) *ProjectsLocationsMigrationJobsGetIamPolicyCall {
3336 c := &ProjectsLocationsMigrationJobsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3337 c.resource = resource
3338 return c
3339 }
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353 func (c *ProjectsLocationsMigrationJobsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsMigrationJobsGetIamPolicyCall {
3354 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
3355 return c
3356 }
3357
3358
3359
3360
3361 func (c *ProjectsLocationsMigrationJobsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsGetIamPolicyCall {
3362 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3363 return c
3364 }
3365
3366
3367
3368
3369 func (c *ProjectsLocationsMigrationJobsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsMigrationJobsGetIamPolicyCall {
3370 c.ifNoneMatch_ = entityTag
3371 return c
3372 }
3373
3374
3375 func (c *ProjectsLocationsMigrationJobsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsGetIamPolicyCall {
3376 c.ctx_ = ctx
3377 return c
3378 }
3379
3380
3381
3382 func (c *ProjectsLocationsMigrationJobsGetIamPolicyCall) Header() http.Header {
3383 if c.header_ == nil {
3384 c.header_ = make(http.Header)
3385 }
3386 return c.header_
3387 }
3388
3389 func (c *ProjectsLocationsMigrationJobsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3390 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3391 if c.ifNoneMatch_ != "" {
3392 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3393 }
3394 var body io.Reader = nil
3395 c.urlParams_.Set("alt", alt)
3396 c.urlParams_.Set("prettyPrint", "false")
3397 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
3398 urls += "?" + c.urlParams_.Encode()
3399 req, err := http.NewRequest("GET", urls, body)
3400 if err != nil {
3401 return nil, err
3402 }
3403 req.Header = reqHeaders
3404 googleapi.Expand(req.URL, map[string]string{
3405 "resource": c.resource,
3406 })
3407 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3408 }
3409
3410
3411
3412
3413
3414
3415 func (c *ProjectsLocationsMigrationJobsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3416 gensupport.SetOptions(c.urlParams_, opts...)
3417 res, err := c.doRequest("json")
3418 if res != nil && res.StatusCode == http.StatusNotModified {
3419 if res.Body != nil {
3420 res.Body.Close()
3421 }
3422 return nil, gensupport.WrapError(&googleapi.Error{
3423 Code: res.StatusCode,
3424 Header: res.Header,
3425 })
3426 }
3427 if err != nil {
3428 return nil, err
3429 }
3430 defer googleapi.CloseBody(res)
3431 if err := googleapi.CheckResponse(res); err != nil {
3432 return nil, gensupport.WrapError(err)
3433 }
3434 ret := &Policy{
3435 ServerResponse: googleapi.ServerResponse{
3436 Header: res.Header,
3437 HTTPStatusCode: res.StatusCode,
3438 },
3439 }
3440 target := &ret
3441 if err := gensupport.DecodeResponse(target, res); err != nil {
3442 return nil, err
3443 }
3444 return ret, nil
3445 }
3446
3447 type ProjectsLocationsMigrationJobsListCall struct {
3448 s *Service
3449 parent string
3450 urlParams_ gensupport.URLParams
3451 ifNoneMatch_ string
3452 ctx_ context.Context
3453 header_ http.Header
3454 }
3455
3456
3457
3458
3459 func (r *ProjectsLocationsMigrationJobsService) List(parent string) *ProjectsLocationsMigrationJobsListCall {
3460 c := &ProjectsLocationsMigrationJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3461 c.parent = parent
3462 return c
3463 }
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475 func (c *ProjectsLocationsMigrationJobsListCall) Filter(filter string) *ProjectsLocationsMigrationJobsListCall {
3476 c.urlParams_.Set("filter", filter)
3477 return c
3478 }
3479
3480
3481
3482 func (c *ProjectsLocationsMigrationJobsListCall) OrderBy(orderBy string) *ProjectsLocationsMigrationJobsListCall {
3483 c.urlParams_.Set("orderBy", orderBy)
3484 return c
3485 }
3486
3487
3488
3489
3490
3491 func (c *ProjectsLocationsMigrationJobsListCall) PageSize(pageSize int64) *ProjectsLocationsMigrationJobsListCall {
3492 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3493 return c
3494 }
3495
3496
3497
3498
3499
3500
3501 func (c *ProjectsLocationsMigrationJobsListCall) PageToken(pageToken string) *ProjectsLocationsMigrationJobsListCall {
3502 c.urlParams_.Set("pageToken", pageToken)
3503 return c
3504 }
3505
3506
3507
3508
3509 func (c *ProjectsLocationsMigrationJobsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsListCall {
3510 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3511 return c
3512 }
3513
3514
3515
3516
3517 func (c *ProjectsLocationsMigrationJobsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsMigrationJobsListCall {
3518 c.ifNoneMatch_ = entityTag
3519 return c
3520 }
3521
3522
3523 func (c *ProjectsLocationsMigrationJobsListCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsListCall {
3524 c.ctx_ = ctx
3525 return c
3526 }
3527
3528
3529
3530 func (c *ProjectsLocationsMigrationJobsListCall) Header() http.Header {
3531 if c.header_ == nil {
3532 c.header_ = make(http.Header)
3533 }
3534 return c.header_
3535 }
3536
3537 func (c *ProjectsLocationsMigrationJobsListCall) doRequest(alt string) (*http.Response, error) {
3538 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3539 if c.ifNoneMatch_ != "" {
3540 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3541 }
3542 var body io.Reader = nil
3543 c.urlParams_.Set("alt", alt)
3544 c.urlParams_.Set("prettyPrint", "false")
3545 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/migrationJobs")
3546 urls += "?" + c.urlParams_.Encode()
3547 req, err := http.NewRequest("GET", urls, body)
3548 if err != nil {
3549 return nil, err
3550 }
3551 req.Header = reqHeaders
3552 googleapi.Expand(req.URL, map[string]string{
3553 "parent": c.parent,
3554 })
3555 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3556 }
3557
3558
3559
3560
3561
3562
3563
3564 func (c *ProjectsLocationsMigrationJobsListCall) Do(opts ...googleapi.CallOption) (*ListMigrationJobsResponse, error) {
3565 gensupport.SetOptions(c.urlParams_, opts...)
3566 res, err := c.doRequest("json")
3567 if res != nil && res.StatusCode == http.StatusNotModified {
3568 if res.Body != nil {
3569 res.Body.Close()
3570 }
3571 return nil, gensupport.WrapError(&googleapi.Error{
3572 Code: res.StatusCode,
3573 Header: res.Header,
3574 })
3575 }
3576 if err != nil {
3577 return nil, err
3578 }
3579 defer googleapi.CloseBody(res)
3580 if err := googleapi.CheckResponse(res); err != nil {
3581 return nil, gensupport.WrapError(err)
3582 }
3583 ret := &ListMigrationJobsResponse{
3584 ServerResponse: googleapi.ServerResponse{
3585 Header: res.Header,
3586 HTTPStatusCode: res.StatusCode,
3587 },
3588 }
3589 target := &ret
3590 if err := gensupport.DecodeResponse(target, res); err != nil {
3591 return nil, err
3592 }
3593 return ret, nil
3594 }
3595
3596
3597
3598
3599 func (c *ProjectsLocationsMigrationJobsListCall) Pages(ctx context.Context, f func(*ListMigrationJobsResponse) error) error {
3600 c.ctx_ = ctx
3601 defer c.PageToken(c.urlParams_.Get("pageToken"))
3602 for {
3603 x, err := c.Do()
3604 if err != nil {
3605 return err
3606 }
3607 if err := f(x); err != nil {
3608 return err
3609 }
3610 if x.NextPageToken == "" {
3611 return nil
3612 }
3613 c.PageToken(x.NextPageToken)
3614 }
3615 }
3616
3617 type ProjectsLocationsMigrationJobsPatchCall struct {
3618 s *Service
3619 name string
3620 migrationjob *MigrationJob
3621 urlParams_ gensupport.URLParams
3622 ctx_ context.Context
3623 header_ http.Header
3624 }
3625
3626
3627
3628
3629
3630 func (r *ProjectsLocationsMigrationJobsService) Patch(name string, migrationjob *MigrationJob) *ProjectsLocationsMigrationJobsPatchCall {
3631 c := &ProjectsLocationsMigrationJobsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3632 c.name = name
3633 c.migrationjob = migrationjob
3634 return c
3635 }
3636
3637
3638
3639
3640
3641
3642
3643 func (c *ProjectsLocationsMigrationJobsPatchCall) RequestId(requestId string) *ProjectsLocationsMigrationJobsPatchCall {
3644 c.urlParams_.Set("requestId", requestId)
3645 return c
3646 }
3647
3648
3649
3650
3651 func (c *ProjectsLocationsMigrationJobsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsMigrationJobsPatchCall {
3652 c.urlParams_.Set("updateMask", updateMask)
3653 return c
3654 }
3655
3656
3657
3658
3659 func (c *ProjectsLocationsMigrationJobsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsPatchCall {
3660 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3661 return c
3662 }
3663
3664
3665 func (c *ProjectsLocationsMigrationJobsPatchCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsPatchCall {
3666 c.ctx_ = ctx
3667 return c
3668 }
3669
3670
3671
3672 func (c *ProjectsLocationsMigrationJobsPatchCall) Header() http.Header {
3673 if c.header_ == nil {
3674 c.header_ = make(http.Header)
3675 }
3676 return c.header_
3677 }
3678
3679 func (c *ProjectsLocationsMigrationJobsPatchCall) doRequest(alt string) (*http.Response, error) {
3680 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3681 var body io.Reader = nil
3682 body, err := googleapi.WithoutDataWrapper.JSONReader(c.migrationjob)
3683 if err != nil {
3684 return nil, err
3685 }
3686 c.urlParams_.Set("alt", alt)
3687 c.urlParams_.Set("prettyPrint", "false")
3688 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
3689 urls += "?" + c.urlParams_.Encode()
3690 req, err := http.NewRequest("PATCH", urls, body)
3691 if err != nil {
3692 return nil, err
3693 }
3694 req.Header = reqHeaders
3695 googleapi.Expand(req.URL, map[string]string{
3696 "name": c.name,
3697 })
3698 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3699 }
3700
3701
3702
3703
3704
3705
3706 func (c *ProjectsLocationsMigrationJobsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3707 gensupport.SetOptions(c.urlParams_, opts...)
3708 res, err := c.doRequest("json")
3709 if res != nil && res.StatusCode == http.StatusNotModified {
3710 if res.Body != nil {
3711 res.Body.Close()
3712 }
3713 return nil, gensupport.WrapError(&googleapi.Error{
3714 Code: res.StatusCode,
3715 Header: res.Header,
3716 })
3717 }
3718 if err != nil {
3719 return nil, err
3720 }
3721 defer googleapi.CloseBody(res)
3722 if err := googleapi.CheckResponse(res); err != nil {
3723 return nil, gensupport.WrapError(err)
3724 }
3725 ret := &Operation{
3726 ServerResponse: googleapi.ServerResponse{
3727 Header: res.Header,
3728 HTTPStatusCode: res.StatusCode,
3729 },
3730 }
3731 target := &ret
3732 if err := gensupport.DecodeResponse(target, res); err != nil {
3733 return nil, err
3734 }
3735 return ret, nil
3736 }
3737
3738 type ProjectsLocationsMigrationJobsPromoteCall struct {
3739 s *Service
3740 name string
3741 promotemigrationjobrequest *PromoteMigrationJobRequest
3742 urlParams_ gensupport.URLParams
3743 ctx_ context.Context
3744 header_ http.Header
3745 }
3746
3747
3748
3749
3750
3751 func (r *ProjectsLocationsMigrationJobsService) Promote(name string, promotemigrationjobrequest *PromoteMigrationJobRequest) *ProjectsLocationsMigrationJobsPromoteCall {
3752 c := &ProjectsLocationsMigrationJobsPromoteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3753 c.name = name
3754 c.promotemigrationjobrequest = promotemigrationjobrequest
3755 return c
3756 }
3757
3758
3759
3760
3761 func (c *ProjectsLocationsMigrationJobsPromoteCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsPromoteCall {
3762 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3763 return c
3764 }
3765
3766
3767 func (c *ProjectsLocationsMigrationJobsPromoteCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsPromoteCall {
3768 c.ctx_ = ctx
3769 return c
3770 }
3771
3772
3773
3774 func (c *ProjectsLocationsMigrationJobsPromoteCall) Header() http.Header {
3775 if c.header_ == nil {
3776 c.header_ = make(http.Header)
3777 }
3778 return c.header_
3779 }
3780
3781 func (c *ProjectsLocationsMigrationJobsPromoteCall) doRequest(alt string) (*http.Response, error) {
3782 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3783 var body io.Reader = nil
3784 body, err := googleapi.WithoutDataWrapper.JSONReader(c.promotemigrationjobrequest)
3785 if err != nil {
3786 return nil, err
3787 }
3788 c.urlParams_.Set("alt", alt)
3789 c.urlParams_.Set("prettyPrint", "false")
3790 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:promote")
3791 urls += "?" + c.urlParams_.Encode()
3792 req, err := http.NewRequest("POST", urls, body)
3793 if err != nil {
3794 return nil, err
3795 }
3796 req.Header = reqHeaders
3797 googleapi.Expand(req.URL, map[string]string{
3798 "name": c.name,
3799 })
3800 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3801 }
3802
3803
3804
3805
3806
3807
3808 func (c *ProjectsLocationsMigrationJobsPromoteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3809 gensupport.SetOptions(c.urlParams_, opts...)
3810 res, err := c.doRequest("json")
3811 if res != nil && res.StatusCode == http.StatusNotModified {
3812 if res.Body != nil {
3813 res.Body.Close()
3814 }
3815 return nil, gensupport.WrapError(&googleapi.Error{
3816 Code: res.StatusCode,
3817 Header: res.Header,
3818 })
3819 }
3820 if err != nil {
3821 return nil, err
3822 }
3823 defer googleapi.CloseBody(res)
3824 if err := googleapi.CheckResponse(res); err != nil {
3825 return nil, gensupport.WrapError(err)
3826 }
3827 ret := &Operation{
3828 ServerResponse: googleapi.ServerResponse{
3829 Header: res.Header,
3830 HTTPStatusCode: res.StatusCode,
3831 },
3832 }
3833 target := &ret
3834 if err := gensupport.DecodeResponse(target, res); err != nil {
3835 return nil, err
3836 }
3837 return ret, nil
3838 }
3839
3840 type ProjectsLocationsMigrationJobsRestartCall struct {
3841 s *Service
3842 name string
3843 restartmigrationjobrequest *RestartMigrationJobRequest
3844 urlParams_ gensupport.URLParams
3845 ctx_ context.Context
3846 header_ http.Header
3847 }
3848
3849
3850
3851
3852
3853
3854 func (r *ProjectsLocationsMigrationJobsService) Restart(name string, restartmigrationjobrequest *RestartMigrationJobRequest) *ProjectsLocationsMigrationJobsRestartCall {
3855 c := &ProjectsLocationsMigrationJobsRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3856 c.name = name
3857 c.restartmigrationjobrequest = restartmigrationjobrequest
3858 return c
3859 }
3860
3861
3862
3863
3864 func (c *ProjectsLocationsMigrationJobsRestartCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsRestartCall {
3865 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3866 return c
3867 }
3868
3869
3870 func (c *ProjectsLocationsMigrationJobsRestartCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsRestartCall {
3871 c.ctx_ = ctx
3872 return c
3873 }
3874
3875
3876
3877 func (c *ProjectsLocationsMigrationJobsRestartCall) Header() http.Header {
3878 if c.header_ == nil {
3879 c.header_ = make(http.Header)
3880 }
3881 return c.header_
3882 }
3883
3884 func (c *ProjectsLocationsMigrationJobsRestartCall) doRequest(alt string) (*http.Response, error) {
3885 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3886 var body io.Reader = nil
3887 body, err := googleapi.WithoutDataWrapper.JSONReader(c.restartmigrationjobrequest)
3888 if err != nil {
3889 return nil, err
3890 }
3891 c.urlParams_.Set("alt", alt)
3892 c.urlParams_.Set("prettyPrint", "false")
3893 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:restart")
3894 urls += "?" + c.urlParams_.Encode()
3895 req, err := http.NewRequest("POST", urls, body)
3896 if err != nil {
3897 return nil, err
3898 }
3899 req.Header = reqHeaders
3900 googleapi.Expand(req.URL, map[string]string{
3901 "name": c.name,
3902 })
3903 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3904 }
3905
3906
3907
3908
3909
3910
3911 func (c *ProjectsLocationsMigrationJobsRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3912 gensupport.SetOptions(c.urlParams_, opts...)
3913 res, err := c.doRequest("json")
3914 if res != nil && res.StatusCode == http.StatusNotModified {
3915 if res.Body != nil {
3916 res.Body.Close()
3917 }
3918 return nil, gensupport.WrapError(&googleapi.Error{
3919 Code: res.StatusCode,
3920 Header: res.Header,
3921 })
3922 }
3923 if err != nil {
3924 return nil, err
3925 }
3926 defer googleapi.CloseBody(res)
3927 if err := googleapi.CheckResponse(res); err != nil {
3928 return nil, gensupport.WrapError(err)
3929 }
3930 ret := &Operation{
3931 ServerResponse: googleapi.ServerResponse{
3932 Header: res.Header,
3933 HTTPStatusCode: res.StatusCode,
3934 },
3935 }
3936 target := &ret
3937 if err := gensupport.DecodeResponse(target, res); err != nil {
3938 return nil, err
3939 }
3940 return ret, nil
3941 }
3942
3943 type ProjectsLocationsMigrationJobsResumeCall struct {
3944 s *Service
3945 name string
3946 resumemigrationjobrequest *ResumeMigrationJobRequest
3947 urlParams_ gensupport.URLParams
3948 ctx_ context.Context
3949 header_ http.Header
3950 }
3951
3952
3953
3954
3955
3956 func (r *ProjectsLocationsMigrationJobsService) Resume(name string, resumemigrationjobrequest *ResumeMigrationJobRequest) *ProjectsLocationsMigrationJobsResumeCall {
3957 c := &ProjectsLocationsMigrationJobsResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3958 c.name = name
3959 c.resumemigrationjobrequest = resumemigrationjobrequest
3960 return c
3961 }
3962
3963
3964
3965
3966 func (c *ProjectsLocationsMigrationJobsResumeCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsResumeCall {
3967 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3968 return c
3969 }
3970
3971
3972 func (c *ProjectsLocationsMigrationJobsResumeCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsResumeCall {
3973 c.ctx_ = ctx
3974 return c
3975 }
3976
3977
3978
3979 func (c *ProjectsLocationsMigrationJobsResumeCall) Header() http.Header {
3980 if c.header_ == nil {
3981 c.header_ = make(http.Header)
3982 }
3983 return c.header_
3984 }
3985
3986 func (c *ProjectsLocationsMigrationJobsResumeCall) doRequest(alt string) (*http.Response, error) {
3987 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3988 var body io.Reader = nil
3989 body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumemigrationjobrequest)
3990 if err != nil {
3991 return nil, err
3992 }
3993 c.urlParams_.Set("alt", alt)
3994 c.urlParams_.Set("prettyPrint", "false")
3995 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:resume")
3996 urls += "?" + c.urlParams_.Encode()
3997 req, err := http.NewRequest("POST", urls, body)
3998 if err != nil {
3999 return nil, err
4000 }
4001 req.Header = reqHeaders
4002 googleapi.Expand(req.URL, map[string]string{
4003 "name": c.name,
4004 })
4005 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4006 }
4007
4008
4009
4010
4011
4012
4013 func (c *ProjectsLocationsMigrationJobsResumeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4014 gensupport.SetOptions(c.urlParams_, opts...)
4015 res, err := c.doRequest("json")
4016 if res != nil && res.StatusCode == http.StatusNotModified {
4017 if res.Body != nil {
4018 res.Body.Close()
4019 }
4020 return nil, gensupport.WrapError(&googleapi.Error{
4021 Code: res.StatusCode,
4022 Header: res.Header,
4023 })
4024 }
4025 if err != nil {
4026 return nil, err
4027 }
4028 defer googleapi.CloseBody(res)
4029 if err := googleapi.CheckResponse(res); err != nil {
4030 return nil, gensupport.WrapError(err)
4031 }
4032 ret := &Operation{
4033 ServerResponse: googleapi.ServerResponse{
4034 Header: res.Header,
4035 HTTPStatusCode: res.StatusCode,
4036 },
4037 }
4038 target := &ret
4039 if err := gensupport.DecodeResponse(target, res); err != nil {
4040 return nil, err
4041 }
4042 return ret, nil
4043 }
4044
4045 type ProjectsLocationsMigrationJobsSetIamPolicyCall struct {
4046 s *Service
4047 resource string
4048 setiampolicyrequest *SetIamPolicyRequest
4049 urlParams_ gensupport.URLParams
4050 ctx_ context.Context
4051 header_ http.Header
4052 }
4053
4054
4055
4056
4057
4058
4059
4060
4061 func (r *ProjectsLocationsMigrationJobsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsMigrationJobsSetIamPolicyCall {
4062 c := &ProjectsLocationsMigrationJobsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4063 c.resource = resource
4064 c.setiampolicyrequest = setiampolicyrequest
4065 return c
4066 }
4067
4068
4069
4070
4071 func (c *ProjectsLocationsMigrationJobsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsSetIamPolicyCall {
4072 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4073 return c
4074 }
4075
4076
4077 func (c *ProjectsLocationsMigrationJobsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsSetIamPolicyCall {
4078 c.ctx_ = ctx
4079 return c
4080 }
4081
4082
4083
4084 func (c *ProjectsLocationsMigrationJobsSetIamPolicyCall) Header() http.Header {
4085 if c.header_ == nil {
4086 c.header_ = make(http.Header)
4087 }
4088 return c.header_
4089 }
4090
4091 func (c *ProjectsLocationsMigrationJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4092 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4093 var body io.Reader = nil
4094 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
4095 if err != nil {
4096 return nil, err
4097 }
4098 c.urlParams_.Set("alt", alt)
4099 c.urlParams_.Set("prettyPrint", "false")
4100 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
4101 urls += "?" + c.urlParams_.Encode()
4102 req, err := http.NewRequest("POST", urls, body)
4103 if err != nil {
4104 return nil, err
4105 }
4106 req.Header = reqHeaders
4107 googleapi.Expand(req.URL, map[string]string{
4108 "resource": c.resource,
4109 })
4110 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4111 }
4112
4113
4114
4115
4116
4117
4118 func (c *ProjectsLocationsMigrationJobsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4119 gensupport.SetOptions(c.urlParams_, opts...)
4120 res, err := c.doRequest("json")
4121 if res != nil && res.StatusCode == http.StatusNotModified {
4122 if res.Body != nil {
4123 res.Body.Close()
4124 }
4125 return nil, gensupport.WrapError(&googleapi.Error{
4126 Code: res.StatusCode,
4127 Header: res.Header,
4128 })
4129 }
4130 if err != nil {
4131 return nil, err
4132 }
4133 defer googleapi.CloseBody(res)
4134 if err := googleapi.CheckResponse(res); err != nil {
4135 return nil, gensupport.WrapError(err)
4136 }
4137 ret := &Policy{
4138 ServerResponse: googleapi.ServerResponse{
4139 Header: res.Header,
4140 HTTPStatusCode: res.StatusCode,
4141 },
4142 }
4143 target := &ret
4144 if err := gensupport.DecodeResponse(target, res); err != nil {
4145 return nil, err
4146 }
4147 return ret, nil
4148 }
4149
4150 type ProjectsLocationsMigrationJobsStartCall struct {
4151 s *Service
4152 name string
4153 startmigrationjobrequest *StartMigrationJobRequest
4154 urlParams_ gensupport.URLParams
4155 ctx_ context.Context
4156 header_ http.Header
4157 }
4158
4159
4160
4161
4162 func (r *ProjectsLocationsMigrationJobsService) Start(name string, startmigrationjobrequest *StartMigrationJobRequest) *ProjectsLocationsMigrationJobsStartCall {
4163 c := &ProjectsLocationsMigrationJobsStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4164 c.name = name
4165 c.startmigrationjobrequest = startmigrationjobrequest
4166 return c
4167 }
4168
4169
4170
4171
4172 func (c *ProjectsLocationsMigrationJobsStartCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsStartCall {
4173 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4174 return c
4175 }
4176
4177
4178 func (c *ProjectsLocationsMigrationJobsStartCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsStartCall {
4179 c.ctx_ = ctx
4180 return c
4181 }
4182
4183
4184
4185 func (c *ProjectsLocationsMigrationJobsStartCall) Header() http.Header {
4186 if c.header_ == nil {
4187 c.header_ = make(http.Header)
4188 }
4189 return c.header_
4190 }
4191
4192 func (c *ProjectsLocationsMigrationJobsStartCall) doRequest(alt string) (*http.Response, error) {
4193 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4194 var body io.Reader = nil
4195 body, err := googleapi.WithoutDataWrapper.JSONReader(c.startmigrationjobrequest)
4196 if err != nil {
4197 return nil, err
4198 }
4199 c.urlParams_.Set("alt", alt)
4200 c.urlParams_.Set("prettyPrint", "false")
4201 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:start")
4202 urls += "?" + c.urlParams_.Encode()
4203 req, err := http.NewRequest("POST", urls, body)
4204 if err != nil {
4205 return nil, err
4206 }
4207 req.Header = reqHeaders
4208 googleapi.Expand(req.URL, map[string]string{
4209 "name": c.name,
4210 })
4211 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4212 }
4213
4214
4215
4216
4217
4218
4219 func (c *ProjectsLocationsMigrationJobsStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4220 gensupport.SetOptions(c.urlParams_, opts...)
4221 res, err := c.doRequest("json")
4222 if res != nil && res.StatusCode == http.StatusNotModified {
4223 if res.Body != nil {
4224 res.Body.Close()
4225 }
4226 return nil, gensupport.WrapError(&googleapi.Error{
4227 Code: res.StatusCode,
4228 Header: res.Header,
4229 })
4230 }
4231 if err != nil {
4232 return nil, err
4233 }
4234 defer googleapi.CloseBody(res)
4235 if err := googleapi.CheckResponse(res); err != nil {
4236 return nil, gensupport.WrapError(err)
4237 }
4238 ret := &Operation{
4239 ServerResponse: googleapi.ServerResponse{
4240 Header: res.Header,
4241 HTTPStatusCode: res.StatusCode,
4242 },
4243 }
4244 target := &ret
4245 if err := gensupport.DecodeResponse(target, res); err != nil {
4246 return nil, err
4247 }
4248 return ret, nil
4249 }
4250
4251 type ProjectsLocationsMigrationJobsStopCall struct {
4252 s *Service
4253 name string
4254 stopmigrationjobrequest *StopMigrationJobRequest
4255 urlParams_ gensupport.URLParams
4256 ctx_ context.Context
4257 header_ http.Header
4258 }
4259
4260
4261
4262
4263 func (r *ProjectsLocationsMigrationJobsService) Stop(name string, stopmigrationjobrequest *StopMigrationJobRequest) *ProjectsLocationsMigrationJobsStopCall {
4264 c := &ProjectsLocationsMigrationJobsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4265 c.name = name
4266 c.stopmigrationjobrequest = stopmigrationjobrequest
4267 return c
4268 }
4269
4270
4271
4272
4273 func (c *ProjectsLocationsMigrationJobsStopCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsStopCall {
4274 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4275 return c
4276 }
4277
4278
4279 func (c *ProjectsLocationsMigrationJobsStopCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsStopCall {
4280 c.ctx_ = ctx
4281 return c
4282 }
4283
4284
4285
4286 func (c *ProjectsLocationsMigrationJobsStopCall) Header() http.Header {
4287 if c.header_ == nil {
4288 c.header_ = make(http.Header)
4289 }
4290 return c.header_
4291 }
4292
4293 func (c *ProjectsLocationsMigrationJobsStopCall) doRequest(alt string) (*http.Response, error) {
4294 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4295 var body io.Reader = nil
4296 body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopmigrationjobrequest)
4297 if err != nil {
4298 return nil, err
4299 }
4300 c.urlParams_.Set("alt", alt)
4301 c.urlParams_.Set("prettyPrint", "false")
4302 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:stop")
4303 urls += "?" + c.urlParams_.Encode()
4304 req, err := http.NewRequest("POST", urls, body)
4305 if err != nil {
4306 return nil, err
4307 }
4308 req.Header = reqHeaders
4309 googleapi.Expand(req.URL, map[string]string{
4310 "name": c.name,
4311 })
4312 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4313 }
4314
4315
4316
4317
4318
4319
4320 func (c *ProjectsLocationsMigrationJobsStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4321 gensupport.SetOptions(c.urlParams_, opts...)
4322 res, err := c.doRequest("json")
4323 if res != nil && res.StatusCode == http.StatusNotModified {
4324 if res.Body != nil {
4325 res.Body.Close()
4326 }
4327 return nil, gensupport.WrapError(&googleapi.Error{
4328 Code: res.StatusCode,
4329 Header: res.Header,
4330 })
4331 }
4332 if err != nil {
4333 return nil, err
4334 }
4335 defer googleapi.CloseBody(res)
4336 if err := googleapi.CheckResponse(res); err != nil {
4337 return nil, gensupport.WrapError(err)
4338 }
4339 ret := &Operation{
4340 ServerResponse: googleapi.ServerResponse{
4341 Header: res.Header,
4342 HTTPStatusCode: res.StatusCode,
4343 },
4344 }
4345 target := &ret
4346 if err := gensupport.DecodeResponse(target, res); err != nil {
4347 return nil, err
4348 }
4349 return ret, nil
4350 }
4351
4352 type ProjectsLocationsMigrationJobsTestIamPermissionsCall struct {
4353 s *Service
4354 resource string
4355 testiampermissionsrequest *TestIamPermissionsRequest
4356 urlParams_ gensupport.URLParams
4357 ctx_ context.Context
4358 header_ http.Header
4359 }
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371 func (r *ProjectsLocationsMigrationJobsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsMigrationJobsTestIamPermissionsCall {
4372 c := &ProjectsLocationsMigrationJobsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4373 c.resource = resource
4374 c.testiampermissionsrequest = testiampermissionsrequest
4375 return c
4376 }
4377
4378
4379
4380
4381 func (c *ProjectsLocationsMigrationJobsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsTestIamPermissionsCall {
4382 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4383 return c
4384 }
4385
4386
4387 func (c *ProjectsLocationsMigrationJobsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsTestIamPermissionsCall {
4388 c.ctx_ = ctx
4389 return c
4390 }
4391
4392
4393
4394 func (c *ProjectsLocationsMigrationJobsTestIamPermissionsCall) Header() http.Header {
4395 if c.header_ == nil {
4396 c.header_ = make(http.Header)
4397 }
4398 return c.header_
4399 }
4400
4401 func (c *ProjectsLocationsMigrationJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
4402 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4403 var body io.Reader = nil
4404 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
4405 if err != nil {
4406 return nil, err
4407 }
4408 c.urlParams_.Set("alt", alt)
4409 c.urlParams_.Set("prettyPrint", "false")
4410 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
4411 urls += "?" + c.urlParams_.Encode()
4412 req, err := http.NewRequest("POST", urls, body)
4413 if err != nil {
4414 return nil, err
4415 }
4416 req.Header = reqHeaders
4417 googleapi.Expand(req.URL, map[string]string{
4418 "resource": c.resource,
4419 })
4420 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4421 }
4422
4423
4424
4425
4426
4427
4428
4429 func (c *ProjectsLocationsMigrationJobsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
4430 gensupport.SetOptions(c.urlParams_, opts...)
4431 res, err := c.doRequest("json")
4432 if res != nil && res.StatusCode == http.StatusNotModified {
4433 if res.Body != nil {
4434 res.Body.Close()
4435 }
4436 return nil, gensupport.WrapError(&googleapi.Error{
4437 Code: res.StatusCode,
4438 Header: res.Header,
4439 })
4440 }
4441 if err != nil {
4442 return nil, err
4443 }
4444 defer googleapi.CloseBody(res)
4445 if err := googleapi.CheckResponse(res); err != nil {
4446 return nil, gensupport.WrapError(err)
4447 }
4448 ret := &TestIamPermissionsResponse{
4449 ServerResponse: googleapi.ServerResponse{
4450 Header: res.Header,
4451 HTTPStatusCode: res.StatusCode,
4452 },
4453 }
4454 target := &ret
4455 if err := gensupport.DecodeResponse(target, res); err != nil {
4456 return nil, err
4457 }
4458 return ret, nil
4459 }
4460
4461 type ProjectsLocationsMigrationJobsVerifyCall struct {
4462 s *Service
4463 name string
4464 verifymigrationjobrequest *VerifyMigrationJobRequest
4465 urlParams_ gensupport.URLParams
4466 ctx_ context.Context
4467 header_ http.Header
4468 }
4469
4470
4471
4472
4473
4474 func (r *ProjectsLocationsMigrationJobsService) Verify(name string, verifymigrationjobrequest *VerifyMigrationJobRequest) *ProjectsLocationsMigrationJobsVerifyCall {
4475 c := &ProjectsLocationsMigrationJobsVerifyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4476 c.name = name
4477 c.verifymigrationjobrequest = verifymigrationjobrequest
4478 return c
4479 }
4480
4481
4482
4483
4484 func (c *ProjectsLocationsMigrationJobsVerifyCall) Fields(s ...googleapi.Field) *ProjectsLocationsMigrationJobsVerifyCall {
4485 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4486 return c
4487 }
4488
4489
4490 func (c *ProjectsLocationsMigrationJobsVerifyCall) Context(ctx context.Context) *ProjectsLocationsMigrationJobsVerifyCall {
4491 c.ctx_ = ctx
4492 return c
4493 }
4494
4495
4496
4497 func (c *ProjectsLocationsMigrationJobsVerifyCall) Header() http.Header {
4498 if c.header_ == nil {
4499 c.header_ = make(http.Header)
4500 }
4501 return c.header_
4502 }
4503
4504 func (c *ProjectsLocationsMigrationJobsVerifyCall) doRequest(alt string) (*http.Response, error) {
4505 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4506 var body io.Reader = nil
4507 body, err := googleapi.WithoutDataWrapper.JSONReader(c.verifymigrationjobrequest)
4508 if err != nil {
4509 return nil, err
4510 }
4511 c.urlParams_.Set("alt", alt)
4512 c.urlParams_.Set("prettyPrint", "false")
4513 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:verify")
4514 urls += "?" + c.urlParams_.Encode()
4515 req, err := http.NewRequest("POST", urls, body)
4516 if err != nil {
4517 return nil, err
4518 }
4519 req.Header = reqHeaders
4520 googleapi.Expand(req.URL, map[string]string{
4521 "name": c.name,
4522 })
4523 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4524 }
4525
4526
4527
4528
4529
4530
4531 func (c *ProjectsLocationsMigrationJobsVerifyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4532 gensupport.SetOptions(c.urlParams_, opts...)
4533 res, err := c.doRequest("json")
4534 if res != nil && res.StatusCode == http.StatusNotModified {
4535 if res.Body != nil {
4536 res.Body.Close()
4537 }
4538 return nil, gensupport.WrapError(&googleapi.Error{
4539 Code: res.StatusCode,
4540 Header: res.Header,
4541 })
4542 }
4543 if err != nil {
4544 return nil, err
4545 }
4546 defer googleapi.CloseBody(res)
4547 if err := googleapi.CheckResponse(res); err != nil {
4548 return nil, gensupport.WrapError(err)
4549 }
4550 ret := &Operation{
4551 ServerResponse: googleapi.ServerResponse{
4552 Header: res.Header,
4553 HTTPStatusCode: res.StatusCode,
4554 },
4555 }
4556 target := &ret
4557 if err := gensupport.DecodeResponse(target, res); err != nil {
4558 return nil, err
4559 }
4560 return ret, nil
4561 }
4562
4563 type ProjectsLocationsOperationsCancelCall struct {
4564 s *Service
4565 name string
4566 canceloperationrequest *CancelOperationRequest
4567 urlParams_ gensupport.URLParams
4568 ctx_ context.Context
4569 header_ http.Header
4570 }
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
4584 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4585 c.name = name
4586 c.canceloperationrequest = canceloperationrequest
4587 return c
4588 }
4589
4590
4591
4592
4593 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
4594 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4595 return c
4596 }
4597
4598
4599 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
4600 c.ctx_ = ctx
4601 return c
4602 }
4603
4604
4605
4606 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
4607 if c.header_ == nil {
4608 c.header_ = make(http.Header)
4609 }
4610 return c.header_
4611 }
4612
4613 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
4614 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4615 var body io.Reader = nil
4616 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
4617 if err != nil {
4618 return nil, err
4619 }
4620 c.urlParams_.Set("alt", alt)
4621 c.urlParams_.Set("prettyPrint", "false")
4622 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel")
4623 urls += "?" + c.urlParams_.Encode()
4624 req, err := http.NewRequest("POST", urls, body)
4625 if err != nil {
4626 return nil, err
4627 }
4628 req.Header = reqHeaders
4629 googleapi.Expand(req.URL, map[string]string{
4630 "name": c.name,
4631 })
4632 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4633 }
4634
4635
4636
4637
4638
4639
4640 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4641 gensupport.SetOptions(c.urlParams_, opts...)
4642 res, err := c.doRequest("json")
4643 if res != nil && res.StatusCode == http.StatusNotModified {
4644 if res.Body != nil {
4645 res.Body.Close()
4646 }
4647 return nil, gensupport.WrapError(&googleapi.Error{
4648 Code: res.StatusCode,
4649 Header: res.Header,
4650 })
4651 }
4652 if err != nil {
4653 return nil, err
4654 }
4655 defer googleapi.CloseBody(res)
4656 if err := googleapi.CheckResponse(res); err != nil {
4657 return nil, gensupport.WrapError(err)
4658 }
4659 ret := &Empty{
4660 ServerResponse: googleapi.ServerResponse{
4661 Header: res.Header,
4662 HTTPStatusCode: res.StatusCode,
4663 },
4664 }
4665 target := &ret
4666 if err := gensupport.DecodeResponse(target, res); err != nil {
4667 return nil, err
4668 }
4669 return ret, nil
4670 }
4671
4672 type ProjectsLocationsOperationsDeleteCall struct {
4673 s *Service
4674 name string
4675 urlParams_ gensupport.URLParams
4676 ctx_ context.Context
4677 header_ http.Header
4678 }
4679
4680
4681
4682
4683
4684
4685
4686 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
4687 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4688 c.name = name
4689 return c
4690 }
4691
4692
4693
4694
4695 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
4696 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4697 return c
4698 }
4699
4700
4701 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
4702 c.ctx_ = ctx
4703 return c
4704 }
4705
4706
4707
4708 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
4709 if c.header_ == nil {
4710 c.header_ = make(http.Header)
4711 }
4712 return c.header_
4713 }
4714
4715 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
4716 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4717 var body io.Reader = nil
4718 c.urlParams_.Set("alt", alt)
4719 c.urlParams_.Set("prettyPrint", "false")
4720 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
4721 urls += "?" + c.urlParams_.Encode()
4722 req, err := http.NewRequest("DELETE", urls, body)
4723 if err != nil {
4724 return nil, err
4725 }
4726 req.Header = reqHeaders
4727 googleapi.Expand(req.URL, map[string]string{
4728 "name": c.name,
4729 })
4730 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4731 }
4732
4733
4734
4735
4736
4737
4738 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4739 gensupport.SetOptions(c.urlParams_, opts...)
4740 res, err := c.doRequest("json")
4741 if res != nil && res.StatusCode == http.StatusNotModified {
4742 if res.Body != nil {
4743 res.Body.Close()
4744 }
4745 return nil, gensupport.WrapError(&googleapi.Error{
4746 Code: res.StatusCode,
4747 Header: res.Header,
4748 })
4749 }
4750 if err != nil {
4751 return nil, err
4752 }
4753 defer googleapi.CloseBody(res)
4754 if err := googleapi.CheckResponse(res); err != nil {
4755 return nil, gensupport.WrapError(err)
4756 }
4757 ret := &Empty{
4758 ServerResponse: googleapi.ServerResponse{
4759 Header: res.Header,
4760 HTTPStatusCode: res.StatusCode,
4761 },
4762 }
4763 target := &ret
4764 if err := gensupport.DecodeResponse(target, res); err != nil {
4765 return nil, err
4766 }
4767 return ret, nil
4768 }
4769
4770 type ProjectsLocationsOperationsGetCall struct {
4771 s *Service
4772 name string
4773 urlParams_ gensupport.URLParams
4774 ifNoneMatch_ string
4775 ctx_ context.Context
4776 header_ http.Header
4777 }
4778
4779
4780
4781
4782
4783
4784 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
4785 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4786 c.name = name
4787 return c
4788 }
4789
4790
4791
4792
4793 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
4794 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4795 return c
4796 }
4797
4798
4799
4800
4801 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
4802 c.ifNoneMatch_ = entityTag
4803 return c
4804 }
4805
4806
4807 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
4808 c.ctx_ = ctx
4809 return c
4810 }
4811
4812
4813
4814 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
4815 if c.header_ == nil {
4816 c.header_ = make(http.Header)
4817 }
4818 return c.header_
4819 }
4820
4821 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
4822 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4823 if c.ifNoneMatch_ != "" {
4824 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4825 }
4826 var body io.Reader = nil
4827 c.urlParams_.Set("alt", alt)
4828 c.urlParams_.Set("prettyPrint", "false")
4829 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
4830 urls += "?" + c.urlParams_.Encode()
4831 req, err := http.NewRequest("GET", urls, body)
4832 if err != nil {
4833 return nil, err
4834 }
4835 req.Header = reqHeaders
4836 googleapi.Expand(req.URL, map[string]string{
4837 "name": c.name,
4838 })
4839 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4840 }
4841
4842
4843
4844
4845
4846
4847 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4848 gensupport.SetOptions(c.urlParams_, opts...)
4849 res, err := c.doRequest("json")
4850 if res != nil && res.StatusCode == http.StatusNotModified {
4851 if res.Body != nil {
4852 res.Body.Close()
4853 }
4854 return nil, gensupport.WrapError(&googleapi.Error{
4855 Code: res.StatusCode,
4856 Header: res.Header,
4857 })
4858 }
4859 if err != nil {
4860 return nil, err
4861 }
4862 defer googleapi.CloseBody(res)
4863 if err := googleapi.CheckResponse(res); err != nil {
4864 return nil, gensupport.WrapError(err)
4865 }
4866 ret := &Operation{
4867 ServerResponse: googleapi.ServerResponse{
4868 Header: res.Header,
4869 HTTPStatusCode: res.StatusCode,
4870 },
4871 }
4872 target := &ret
4873 if err := gensupport.DecodeResponse(target, res); err != nil {
4874 return nil, err
4875 }
4876 return ret, nil
4877 }
4878
4879 type ProjectsLocationsOperationsListCall struct {
4880 s *Service
4881 name string
4882 urlParams_ gensupport.URLParams
4883 ifNoneMatch_ string
4884 ctx_ context.Context
4885 header_ http.Header
4886 }
4887
4888
4889
4890
4891
4892 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
4893 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4894 c.name = name
4895 return c
4896 }
4897
4898
4899 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
4900 c.urlParams_.Set("filter", filter)
4901 return c
4902 }
4903
4904
4905
4906 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
4907 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4908 return c
4909 }
4910
4911
4912
4913 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
4914 c.urlParams_.Set("pageToken", pageToken)
4915 return c
4916 }
4917
4918
4919
4920
4921 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
4922 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4923 return c
4924 }
4925
4926
4927
4928
4929 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
4930 c.ifNoneMatch_ = entityTag
4931 return c
4932 }
4933
4934
4935 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
4936 c.ctx_ = ctx
4937 return c
4938 }
4939
4940
4941
4942 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
4943 if c.header_ == nil {
4944 c.header_ = make(http.Header)
4945 }
4946 return c.header_
4947 }
4948
4949 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
4950 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4951 if c.ifNoneMatch_ != "" {
4952 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4953 }
4954 var body io.Reader = nil
4955 c.urlParams_.Set("alt", alt)
4956 c.urlParams_.Set("prettyPrint", "false")
4957 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations")
4958 urls += "?" + c.urlParams_.Encode()
4959 req, err := http.NewRequest("GET", urls, body)
4960 if err != nil {
4961 return nil, err
4962 }
4963 req.Header = reqHeaders
4964 googleapi.Expand(req.URL, map[string]string{
4965 "name": c.name,
4966 })
4967 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4968 }
4969
4970
4971
4972
4973
4974
4975
4976 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
4977 gensupport.SetOptions(c.urlParams_, opts...)
4978 res, err := c.doRequest("json")
4979 if res != nil && res.StatusCode == http.StatusNotModified {
4980 if res.Body != nil {
4981 res.Body.Close()
4982 }
4983 return nil, gensupport.WrapError(&googleapi.Error{
4984 Code: res.StatusCode,
4985 Header: res.Header,
4986 })
4987 }
4988 if err != nil {
4989 return nil, err
4990 }
4991 defer googleapi.CloseBody(res)
4992 if err := googleapi.CheckResponse(res); err != nil {
4993 return nil, gensupport.WrapError(err)
4994 }
4995 ret := &ListOperationsResponse{
4996 ServerResponse: googleapi.ServerResponse{
4997 Header: res.Header,
4998 HTTPStatusCode: res.StatusCode,
4999 },
5000 }
5001 target := &ret
5002 if err := gensupport.DecodeResponse(target, res); err != nil {
5003 return nil, err
5004 }
5005 return ret, nil
5006 }
5007
5008
5009
5010
5011 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
5012 c.ctx_ = ctx
5013 defer c.PageToken(c.urlParams_.Get("pageToken"))
5014 for {
5015 x, err := c.Do()
5016 if err != nil {
5017 return err
5018 }
5019 if err := f(x); err != nil {
5020 return err
5021 }
5022 if x.NextPageToken == "" {
5023 return nil
5024 }
5025 c.PageToken(x.NextPageToken)
5026 }
5027 }
5028
View as plain text