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 looker
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 = "looker:v1"
90 const apiName = "looker"
91 const apiVersion = "v1"
92 const basePath = "https://looker.googleapis.com/"
93 const basePathTemplate = "https://looker.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://looker.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.Instances = NewProjectsLocationsInstancesService(s)
172 rs.Operations = NewProjectsLocationsOperationsService(s)
173 return rs
174 }
175
176 type ProjectsLocationsService struct {
177 s *Service
178
179 Instances *ProjectsLocationsInstancesService
180
181 Operations *ProjectsLocationsOperationsService
182 }
183
184 func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService {
185 rs := &ProjectsLocationsInstancesService{s: s}
186 rs.Backups = NewProjectsLocationsInstancesBackupsService(s)
187 return rs
188 }
189
190 type ProjectsLocationsInstancesService struct {
191 s *Service
192
193 Backups *ProjectsLocationsInstancesBackupsService
194 }
195
196 func NewProjectsLocationsInstancesBackupsService(s *Service) *ProjectsLocationsInstancesBackupsService {
197 rs := &ProjectsLocationsInstancesBackupsService{s: s}
198 return rs
199 }
200
201 type ProjectsLocationsInstancesBackupsService struct {
202 s *Service
203 }
204
205 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
206 rs := &ProjectsLocationsOperationsService{s: s}
207 return rs
208 }
209
210 type ProjectsLocationsOperationsService struct {
211 s *Service
212 }
213
214
215 type AdminSettings struct {
216
217 AllowedEmailDomains []string `json:"allowedEmailDomains,omitempty"`
218
219
220
221
222
223 ForceSendFields []string `json:"-"`
224
225
226
227
228 NullFields []string `json:"-"`
229 }
230
231 func (s *AdminSettings) MarshalJSON() ([]byte, error) {
232 type NoMethod AdminSettings
233 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
234 }
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252 type AuditConfig struct {
253
254 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
255
256
257
258 Service string `json:"service,omitempty"`
259
260
261
262
263
264 ForceSendFields []string `json:"-"`
265
266
267
268
269 NullFields []string `json:"-"`
270 }
271
272 func (s *AuditConfig) MarshalJSON() ([]byte, error) {
273 type NoMethod AuditConfig
274 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
275 }
276
277
278
279
280
281
282 type AuditLogConfig struct {
283
284
285 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
286
287
288
289
290
291
292
293 LogType string `json:"logType,omitempty"`
294
295
296
297
298
299 ForceSendFields []string `json:"-"`
300
301
302
303
304 NullFields []string `json:"-"`
305 }
306
307 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
308 type NoMethod AuditLogConfig
309 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
310 }
311
312
313 type Binding struct {
314
315
316
317
318
319
320
321
322 Condition *Expr `json:"condition,omitempty"`
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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385 Members []string `json:"members,omitempty"`
386
387
388
389
390
391
392 Role string `json:"role,omitempty"`
393
394
395
396
397
398 ForceSendFields []string `json:"-"`
399
400
401
402
403 NullFields []string `json:"-"`
404 }
405
406 func (s *Binding) MarshalJSON() ([]byte, error) {
407 type NoMethod Binding
408 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
409 }
410
411
412 type CancelOperationRequest struct {
413 }
414
415
416 type CustomDomain struct {
417
418 Domain string `json:"domain,omitempty"`
419
420
421
422
423
424
425
426
427
428
429 State string `json:"state,omitempty"`
430
431
432
433
434
435 ForceSendFields []string `json:"-"`
436
437
438
439
440 NullFields []string `json:"-"`
441 }
442
443 func (s *CustomDomain) MarshalJSON() ([]byte, error) {
444 type NoMethod CustomDomain
445 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
446 }
447
448
449
450
451
452
453
454
455
456
457 type Date struct {
458
459
460
461 Day int64 `json:"day,omitempty"`
462
463
464 Month int64 `json:"month,omitempty"`
465
466
467 Year int64 `json:"year,omitempty"`
468
469
470
471
472
473 ForceSendFields []string `json:"-"`
474
475
476
477
478 NullFields []string `json:"-"`
479 }
480
481 func (s *Date) MarshalJSON() ([]byte, error) {
482 type NoMethod Date
483 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
484 }
485
486
487 type DenyMaintenancePeriod struct {
488
489 EndDate *Date `json:"endDate,omitempty"`
490
491 StartDate *Date `json:"startDate,omitempty"`
492
493 Time *TimeOfDay `json:"time,omitempty"`
494
495
496
497
498
499 ForceSendFields []string `json:"-"`
500
501
502
503
504 NullFields []string `json:"-"`
505 }
506
507 func (s *DenyMaintenancePeriod) MarshalJSON() ([]byte, error) {
508 type NoMethod DenyMaintenancePeriod
509 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
510 }
511
512
513
514
515
516 type Empty struct {
517
518 googleapi.ServerResponse `json:"-"`
519 }
520
521
522 type EncryptionConfig struct {
523
524 KmsKeyName string `json:"kmsKeyName,omitempty"`
525
526
527
528
529 KmsKeyNameVersion string `json:"kmsKeyNameVersion,omitempty"`
530
531
532
533
534
535
536
537 KmsKeyState string `json:"kmsKeyState,omitempty"`
538
539
540
541
542
543 ForceSendFields []string `json:"-"`
544
545
546
547
548 NullFields []string `json:"-"`
549 }
550
551 func (s *EncryptionConfig) MarshalJSON() ([]byte, error) {
552 type NoMethod EncryptionConfig
553 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
554 }
555
556
557 type ExportEncryptionConfig struct {
558
559 KmsKeyName string `json:"kmsKeyName,omitempty"`
560
561
562
563
564
565 ForceSendFields []string `json:"-"`
566
567
568
569
570 NullFields []string `json:"-"`
571 }
572
573 func (s *ExportEncryptionConfig) MarshalJSON() ([]byte, error) {
574 type NoMethod ExportEncryptionConfig
575 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
576 }
577
578
579 type ExportInstanceRequest struct {
580
581
582 EncryptionConfig *ExportEncryptionConfig `json:"encryptionConfig,omitempty"`
583
584
585 GcsUri string `json:"gcsUri,omitempty"`
586
587
588
589
590
591 ForceSendFields []string `json:"-"`
592
593
594
595
596 NullFields []string `json:"-"`
597 }
598
599 func (s *ExportInstanceRequest) MarshalJSON() ([]byte, error) {
600 type NoMethod ExportInstanceRequest
601 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
602 }
603
604
605
606
607 type ExportMetadata struct {
608
609
610 ExportEncryptionKey *ExportMetadataEncryptionKey `json:"exportEncryptionKey,omitempty"`
611
612
613 FilePaths []string `json:"filePaths,omitempty"`
614
615
616
617 LookerEncryptionKey string `json:"lookerEncryptionKey,omitempty"`
618
619
620 LookerInstance string `json:"lookerInstance,omitempty"`
621
622 LookerPlatformEdition string `json:"lookerPlatformEdition,omitempty"`
623
624 LookerVersion string `json:"lookerVersion,omitempty"`
625
626
627
628
629
630
631 Source string `json:"source,omitempty"`
632
633
634
635
636
637 ForceSendFields []string `json:"-"`
638
639
640
641
642 NullFields []string `json:"-"`
643 }
644
645 func (s *ExportMetadata) MarshalJSON() ([]byte, error) {
646 type NoMethod ExportMetadata
647 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
648 }
649
650
651
652 type ExportMetadataEncryptionKey struct {
653
654 Cmek string `json:"cmek,omitempty"`
655
656 Version string `json:"version,omitempty"`
657
658
659
660
661
662 ForceSendFields []string `json:"-"`
663
664
665
666
667 NullFields []string `json:"-"`
668 }
669
670 func (s *ExportMetadataEncryptionKey) MarshalJSON() ([]byte, error) {
671 type NoMethod ExportMetadataEncryptionKey
672 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
673 }
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691 type Expr struct {
692
693
694 Description string `json:"description,omitempty"`
695
696
697 Expression string `json:"expression,omitempty"`
698
699
700 Location string `json:"location,omitempty"`
701
702
703
704 Title string `json:"title,omitempty"`
705
706
707
708
709
710 ForceSendFields []string `json:"-"`
711
712
713
714
715 NullFields []string `json:"-"`
716 }
717
718 func (s *Expr) MarshalJSON() ([]byte, error) {
719 type NoMethod Expr
720 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
721 }
722
723
724
725 type ImportInstanceRequest struct {
726
727
728 GcsUri string `json:"gcsUri,omitempty"`
729
730
731
732
733
734 ForceSendFields []string `json:"-"`
735
736
737
738
739 NullFields []string `json:"-"`
740 }
741
742 func (s *ImportInstanceRequest) MarshalJSON() ([]byte, error) {
743 type NoMethod ImportInstanceRequest
744 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
745 }
746
747
748 type Instance struct {
749
750 AdminSettings *AdminSettings `json:"adminSettings,omitempty"`
751
752
753
754
755 ConsumerNetwork string `json:"consumerNetwork,omitempty"`
756
757
758 CreateTime string `json:"createTime,omitempty"`
759 CustomDomain *CustomDomain `json:"customDomain,omitempty"`
760
761 DenyMaintenancePeriod *DenyMaintenancePeriod `json:"denyMaintenancePeriod,omitempty"`
762
763 EgressPublicIp string `json:"egressPublicIp,omitempty"`
764
765
766 EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"`
767
768 IngressPrivateIp string `json:"ingressPrivateIp,omitempty"`
769
770 IngressPublicIp string `json:"ingressPublicIp,omitempty"`
771
772
773 LastDenyMaintenancePeriod *DenyMaintenancePeriod `json:"lastDenyMaintenancePeriod,omitempty"`
774
775
776 LinkedLspProjectNumber int64 `json:"linkedLspProjectNumber,omitempty,string"`
777
778
779 LookerUri string `json:"lookerUri,omitempty"`
780
781 LookerVersion string `json:"lookerVersion,omitempty"`
782
783 MaintenanceSchedule *MaintenanceSchedule `json:"maintenanceSchedule,omitempty"`
784
785 MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
786
787
788 Name string `json:"name,omitempty"`
789
790 OauthConfig *OAuthConfig `json:"oauthConfig,omitempty"`
791
792
793
794
795
796
797
798
799
800 PlatformEdition string `json:"platformEdition,omitempty"`
801
802 PrivateIpEnabled bool `json:"privateIpEnabled,omitempty"`
803
804 PublicIpEnabled bool `json:"publicIpEnabled,omitempty"`
805
806
807
808 ReservedRange string `json:"reservedRange,omitempty"`
809
810
811
812
813
814
815
816
817
818
819
820
821 State string `json:"state,omitempty"`
822
823 UpdateTime string `json:"updateTime,omitempty"`
824
825 UserMetadata *UserMetadata `json:"userMetadata,omitempty"`
826
827
828 googleapi.ServerResponse `json:"-"`
829
830
831
832
833
834 ForceSendFields []string `json:"-"`
835
836
837
838
839 NullFields []string `json:"-"`
840 }
841
842 func (s *Instance) MarshalJSON() ([]byte, error) {
843 type NoMethod Instance
844 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
845 }
846
847
848 type ListInstancesResponse struct {
849
850
851 Instances []*Instance `json:"instances,omitempty"`
852
853
854
855 NextPageToken string `json:"nextPageToken,omitempty"`
856
857 Unreachable []string `json:"unreachable,omitempty"`
858
859
860 googleapi.ServerResponse `json:"-"`
861
862
863
864
865
866 ForceSendFields []string `json:"-"`
867
868
869
870
871 NullFields []string `json:"-"`
872 }
873
874 func (s *ListInstancesResponse) MarshalJSON() ([]byte, error) {
875 type NoMethod ListInstancesResponse
876 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
877 }
878
879
880 type ListLocationsResponse struct {
881
882
883 Locations []*Location `json:"locations,omitempty"`
884
885 NextPageToken string `json:"nextPageToken,omitempty"`
886
887
888 googleapi.ServerResponse `json:"-"`
889
890
891
892
893
894 ForceSendFields []string `json:"-"`
895
896
897
898
899 NullFields []string `json:"-"`
900 }
901
902 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
903 type NoMethod ListLocationsResponse
904 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
905 }
906
907
908 type ListOperationsResponse struct {
909
910 NextPageToken string `json:"nextPageToken,omitempty"`
911
912
913 Operations []*Operation `json:"operations,omitempty"`
914
915
916 googleapi.ServerResponse `json:"-"`
917
918
919
920
921
922 ForceSendFields []string `json:"-"`
923
924
925
926
927 NullFields []string `json:"-"`
928 }
929
930 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
931 type NoMethod ListOperationsResponse
932 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
933 }
934
935
936 type Location struct {
937
938
939 DisplayName string `json:"displayName,omitempty"`
940
941
942 Labels map[string]string `json:"labels,omitempty"`
943
944 LocationId string `json:"locationId,omitempty"`
945
946
947 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
948
949
950
951 Name string `json:"name,omitempty"`
952
953
954 googleapi.ServerResponse `json:"-"`
955
956
957
958
959
960 ForceSendFields []string `json:"-"`
961
962
963
964
965 NullFields []string `json:"-"`
966 }
967
968 func (s *Location) MarshalJSON() ([]byte, error) {
969 type NoMethod Location
970 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
971 }
972
973
974 type MaintenanceSchedule struct {
975
976 EndTime string `json:"endTime,omitempty"`
977
978 StartTime string `json:"startTime,omitempty"`
979
980
981
982
983
984 ForceSendFields []string `json:"-"`
985
986
987
988
989 NullFields []string `json:"-"`
990 }
991
992 func (s *MaintenanceSchedule) MarshalJSON() ([]byte, error) {
993 type NoMethod MaintenanceSchedule
994 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
995 }
996
997
998 type MaintenanceWindow struct {
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010 DayOfWeek string `json:"dayOfWeek,omitempty"`
1011
1012
1013 StartTime *TimeOfDay `json:"startTime,omitempty"`
1014
1015
1016
1017
1018
1019 ForceSendFields []string `json:"-"`
1020
1021
1022
1023
1024 NullFields []string `json:"-"`
1025 }
1026
1027 func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
1028 type NoMethod MaintenanceWindow
1029 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1030 }
1031
1032
1033 type OAuthConfig struct {
1034
1035
1036 ClientId string `json:"clientId,omitempty"`
1037
1038
1039 ClientSecret string `json:"clientSecret,omitempty"`
1040
1041
1042
1043
1044
1045 ForceSendFields []string `json:"-"`
1046
1047
1048
1049
1050 NullFields []string `json:"-"`
1051 }
1052
1053 func (s *OAuthConfig) MarshalJSON() ([]byte, error) {
1054 type NoMethod OAuthConfig
1055 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1056 }
1057
1058
1059
1060 type Operation struct {
1061
1062
1063
1064 Done bool `json:"done,omitempty"`
1065
1066 Error *Status `json:"error,omitempty"`
1067
1068
1069
1070
1071 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1072
1073
1074
1075 Name string `json:"name,omitempty"`
1076
1077
1078
1079
1080
1081
1082
1083 Response googleapi.RawMessage `json:"response,omitempty"`
1084
1085
1086 googleapi.ServerResponse `json:"-"`
1087
1088
1089
1090
1091
1092 ForceSendFields []string `json:"-"`
1093
1094
1095
1096
1097 NullFields []string `json:"-"`
1098 }
1099
1100 func (s *Operation) MarshalJSON() ([]byte, error) {
1101 type NoMethod Operation
1102 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1103 }
1104
1105
1106 type OperationMetadata struct {
1107
1108 ApiVersion string `json:"apiVersion,omitempty"`
1109
1110 CreateTime string `json:"createTime,omitempty"`
1111
1112 EndTime string `json:"endTime,omitempty"`
1113
1114
1115
1116
1117 RequestedCancellation bool `json:"requestedCancellation,omitempty"`
1118
1119 StatusMessage string `json:"statusMessage,omitempty"`
1120
1121 Target string `json:"target,omitempty"`
1122
1123 Verb string `json:"verb,omitempty"`
1124
1125
1126
1127
1128
1129 ForceSendFields []string `json:"-"`
1130
1131
1132
1133
1134 NullFields []string `json:"-"`
1135 }
1136
1137 func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
1138 type NoMethod OperationMetadata
1139 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1140 }
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172 type Policy struct {
1173
1174 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184 Bindings []*Binding `json:"bindings,omitempty"`
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196 Etag string `json:"etag,omitempty"`
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212 Version int64 `json:"version,omitempty"`
1213
1214
1215 googleapi.ServerResponse `json:"-"`
1216
1217
1218
1219
1220
1221 ForceSendFields []string `json:"-"`
1222
1223
1224
1225
1226 NullFields []string `json:"-"`
1227 }
1228
1229 func (s *Policy) MarshalJSON() ([]byte, error) {
1230 type NoMethod Policy
1231 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1232 }
1233
1234
1235 type RestartInstanceRequest struct {
1236 }
1237
1238
1239 type SetIamPolicyRequest struct {
1240
1241
1242
1243
1244 Policy *Policy `json:"policy,omitempty"`
1245
1246
1247
1248 UpdateMask string `json:"updateMask,omitempty"`
1249
1250
1251
1252
1253
1254 ForceSendFields []string `json:"-"`
1255
1256
1257
1258
1259 NullFields []string `json:"-"`
1260 }
1261
1262 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
1263 type NoMethod SetIamPolicyRequest
1264 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1265 }
1266
1267
1268
1269
1270
1271
1272
1273 type Status struct {
1274
1275 Code int64 `json:"code,omitempty"`
1276
1277
1278 Details []googleapi.RawMessage `json:"details,omitempty"`
1279
1280
1281
1282 Message string `json:"message,omitempty"`
1283
1284
1285
1286
1287
1288 ForceSendFields []string `json:"-"`
1289
1290
1291
1292
1293 NullFields []string `json:"-"`
1294 }
1295
1296 func (s *Status) MarshalJSON() ([]byte, error) {
1297 type NoMethod Status
1298 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1299 }
1300
1301
1302 type TestIamPermissionsRequest struct {
1303
1304
1305
1306
1307 Permissions []string `json:"permissions,omitempty"`
1308
1309
1310
1311
1312
1313 ForceSendFields []string `json:"-"`
1314
1315
1316
1317
1318 NullFields []string `json:"-"`
1319 }
1320
1321 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
1322 type NoMethod TestIamPermissionsRequest
1323 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1324 }
1325
1326
1327
1328 type TestIamPermissionsResponse struct {
1329
1330
1331 Permissions []string `json:"permissions,omitempty"`
1332
1333
1334 googleapi.ServerResponse `json:"-"`
1335
1336
1337
1338
1339
1340 ForceSendFields []string `json:"-"`
1341
1342
1343
1344
1345 NullFields []string `json:"-"`
1346 }
1347
1348 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
1349 type NoMethod TestIamPermissionsResponse
1350 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1351 }
1352
1353
1354
1355
1356 type TimeOfDay struct {
1357
1358
1359
1360 Hours int64 `json:"hours,omitempty"`
1361
1362 Minutes int64 `json:"minutes,omitempty"`
1363
1364 Nanos int64 `json:"nanos,omitempty"`
1365
1366
1367 Seconds int64 `json:"seconds,omitempty"`
1368
1369
1370
1371
1372
1373 ForceSendFields []string `json:"-"`
1374
1375
1376
1377
1378 NullFields []string `json:"-"`
1379 }
1380
1381 func (s *TimeOfDay) MarshalJSON() ([]byte, error) {
1382 type NoMethod TimeOfDay
1383 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1384 }
1385
1386
1387 type UserMetadata struct {
1388
1389
1390 AdditionalDeveloperUserCount int64 `json:"additionalDeveloperUserCount,omitempty"`
1391
1392
1393 AdditionalStandardUserCount int64 `json:"additionalStandardUserCount,omitempty"`
1394
1395
1396 AdditionalViewerUserCount int64 `json:"additionalViewerUserCount,omitempty"`
1397
1398
1399
1400
1401
1402 ForceSendFields []string `json:"-"`
1403
1404
1405
1406
1407 NullFields []string `json:"-"`
1408 }
1409
1410 func (s *UserMetadata) MarshalJSON() ([]byte, error) {
1411 type NoMethod UserMetadata
1412 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1413 }
1414
1415 type ProjectsLocationsGetCall struct {
1416 s *Service
1417 name string
1418 urlParams_ gensupport.URLParams
1419 ifNoneMatch_ string
1420 ctx_ context.Context
1421 header_ http.Header
1422 }
1423
1424
1425
1426
1427 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
1428 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1429 c.name = name
1430 return c
1431 }
1432
1433
1434
1435
1436 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
1437 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1438 return c
1439 }
1440
1441
1442
1443
1444 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
1445 c.ifNoneMatch_ = entityTag
1446 return c
1447 }
1448
1449
1450 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
1451 c.ctx_ = ctx
1452 return c
1453 }
1454
1455
1456
1457 func (c *ProjectsLocationsGetCall) Header() http.Header {
1458 if c.header_ == nil {
1459 c.header_ = make(http.Header)
1460 }
1461 return c.header_
1462 }
1463
1464 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
1465 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1466 if c.ifNoneMatch_ != "" {
1467 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1468 }
1469 var body io.Reader = nil
1470 c.urlParams_.Set("alt", alt)
1471 c.urlParams_.Set("prettyPrint", "false")
1472 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1473 urls += "?" + c.urlParams_.Encode()
1474 req, err := http.NewRequest("GET", urls, body)
1475 if err != nil {
1476 return nil, err
1477 }
1478 req.Header = reqHeaders
1479 googleapi.Expand(req.URL, map[string]string{
1480 "name": c.name,
1481 })
1482 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1483 }
1484
1485
1486
1487
1488
1489
1490 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
1491 gensupport.SetOptions(c.urlParams_, opts...)
1492 res, err := c.doRequest("json")
1493 if res != nil && res.StatusCode == http.StatusNotModified {
1494 if res.Body != nil {
1495 res.Body.Close()
1496 }
1497 return nil, gensupport.WrapError(&googleapi.Error{
1498 Code: res.StatusCode,
1499 Header: res.Header,
1500 })
1501 }
1502 if err != nil {
1503 return nil, err
1504 }
1505 defer googleapi.CloseBody(res)
1506 if err := googleapi.CheckResponse(res); err != nil {
1507 return nil, gensupport.WrapError(err)
1508 }
1509 ret := &Location{
1510 ServerResponse: googleapi.ServerResponse{
1511 Header: res.Header,
1512 HTTPStatusCode: res.StatusCode,
1513 },
1514 }
1515 target := &ret
1516 if err := gensupport.DecodeResponse(target, res); err != nil {
1517 return nil, err
1518 }
1519 return ret, nil
1520 }
1521
1522 type ProjectsLocationsListCall struct {
1523 s *Service
1524 name string
1525 urlParams_ gensupport.URLParams
1526 ifNoneMatch_ string
1527 ctx_ context.Context
1528 header_ http.Header
1529 }
1530
1531
1532
1533
1534 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
1535 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1536 c.name = name
1537 return c
1538 }
1539
1540
1541
1542
1543
1544 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
1545 c.urlParams_.Set("filter", filter)
1546 return c
1547 }
1548
1549
1550
1551 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
1552 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1553 return c
1554 }
1555
1556
1557
1558
1559 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
1560 c.urlParams_.Set("pageToken", pageToken)
1561 return c
1562 }
1563
1564
1565
1566
1567 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
1568 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1569 return c
1570 }
1571
1572
1573
1574
1575 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
1576 c.ifNoneMatch_ = entityTag
1577 return c
1578 }
1579
1580
1581 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
1582 c.ctx_ = ctx
1583 return c
1584 }
1585
1586
1587
1588 func (c *ProjectsLocationsListCall) Header() http.Header {
1589 if c.header_ == nil {
1590 c.header_ = make(http.Header)
1591 }
1592 return c.header_
1593 }
1594
1595 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
1596 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1597 if c.ifNoneMatch_ != "" {
1598 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1599 }
1600 var body io.Reader = nil
1601 c.urlParams_.Set("alt", alt)
1602 c.urlParams_.Set("prettyPrint", "false")
1603 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
1604 urls += "?" + c.urlParams_.Encode()
1605 req, err := http.NewRequest("GET", urls, body)
1606 if err != nil {
1607 return nil, err
1608 }
1609 req.Header = reqHeaders
1610 googleapi.Expand(req.URL, map[string]string{
1611 "name": c.name,
1612 })
1613 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1614 }
1615
1616
1617
1618
1619
1620
1621
1622 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
1623 gensupport.SetOptions(c.urlParams_, opts...)
1624 res, err := c.doRequest("json")
1625 if res != nil && res.StatusCode == http.StatusNotModified {
1626 if res.Body != nil {
1627 res.Body.Close()
1628 }
1629 return nil, gensupport.WrapError(&googleapi.Error{
1630 Code: res.StatusCode,
1631 Header: res.Header,
1632 })
1633 }
1634 if err != nil {
1635 return nil, err
1636 }
1637 defer googleapi.CloseBody(res)
1638 if err := googleapi.CheckResponse(res); err != nil {
1639 return nil, gensupport.WrapError(err)
1640 }
1641 ret := &ListLocationsResponse{
1642 ServerResponse: googleapi.ServerResponse{
1643 Header: res.Header,
1644 HTTPStatusCode: res.StatusCode,
1645 },
1646 }
1647 target := &ret
1648 if err := gensupport.DecodeResponse(target, res); err != nil {
1649 return nil, err
1650 }
1651 return ret, nil
1652 }
1653
1654
1655
1656
1657 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1658 c.ctx_ = ctx
1659 defer c.PageToken(c.urlParams_.Get("pageToken"))
1660 for {
1661 x, err := c.Do()
1662 if err != nil {
1663 return err
1664 }
1665 if err := f(x); err != nil {
1666 return err
1667 }
1668 if x.NextPageToken == "" {
1669 return nil
1670 }
1671 c.PageToken(x.NextPageToken)
1672 }
1673 }
1674
1675 type ProjectsLocationsInstancesCreateCall struct {
1676 s *Service
1677 parent string
1678 instance *Instance
1679 urlParams_ gensupport.URLParams
1680 ctx_ context.Context
1681 header_ http.Header
1682 }
1683
1684
1685
1686
1687 func (r *ProjectsLocationsInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsInstancesCreateCall {
1688 c := &ProjectsLocationsInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1689 c.parent = parent
1690 c.instance = instance
1691 return c
1692 }
1693
1694
1695
1696
1697
1698 func (c *ProjectsLocationsInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsInstancesCreateCall {
1699 c.urlParams_.Set("instanceId", instanceId)
1700 return c
1701 }
1702
1703
1704
1705
1706 func (c *ProjectsLocationsInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCreateCall {
1707 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1708 return c
1709 }
1710
1711
1712 func (c *ProjectsLocationsInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesCreateCall {
1713 c.ctx_ = ctx
1714 return c
1715 }
1716
1717
1718
1719 func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header {
1720 if c.header_ == nil {
1721 c.header_ = make(http.Header)
1722 }
1723 return c.header_
1724 }
1725
1726 func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) {
1727 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1728 var body io.Reader = nil
1729 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
1730 if err != nil {
1731 return nil, err
1732 }
1733 c.urlParams_.Set("alt", alt)
1734 c.urlParams_.Set("prettyPrint", "false")
1735 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances")
1736 urls += "?" + c.urlParams_.Encode()
1737 req, err := http.NewRequest("POST", urls, body)
1738 if err != nil {
1739 return nil, err
1740 }
1741 req.Header = reqHeaders
1742 googleapi.Expand(req.URL, map[string]string{
1743 "parent": c.parent,
1744 })
1745 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1746 }
1747
1748
1749
1750
1751
1752
1753 func (c *ProjectsLocationsInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1754 gensupport.SetOptions(c.urlParams_, opts...)
1755 res, err := c.doRequest("json")
1756 if res != nil && res.StatusCode == http.StatusNotModified {
1757 if res.Body != nil {
1758 res.Body.Close()
1759 }
1760 return nil, gensupport.WrapError(&googleapi.Error{
1761 Code: res.StatusCode,
1762 Header: res.Header,
1763 })
1764 }
1765 if err != nil {
1766 return nil, err
1767 }
1768 defer googleapi.CloseBody(res)
1769 if err := googleapi.CheckResponse(res); err != nil {
1770 return nil, gensupport.WrapError(err)
1771 }
1772 ret := &Operation{
1773 ServerResponse: googleapi.ServerResponse{
1774 Header: res.Header,
1775 HTTPStatusCode: res.StatusCode,
1776 },
1777 }
1778 target := &ret
1779 if err := gensupport.DecodeResponse(target, res); err != nil {
1780 return nil, err
1781 }
1782 return ret, nil
1783 }
1784
1785 type ProjectsLocationsInstancesDeleteCall struct {
1786 s *Service
1787 name string
1788 urlParams_ gensupport.URLParams
1789 ctx_ context.Context
1790 header_ http.Header
1791 }
1792
1793
1794
1795
1796
1797 func (r *ProjectsLocationsInstancesService) Delete(name string) *ProjectsLocationsInstancesDeleteCall {
1798 c := &ProjectsLocationsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1799 c.name = name
1800 return c
1801 }
1802
1803
1804
1805 func (c *ProjectsLocationsInstancesDeleteCall) Force(force bool) *ProjectsLocationsInstancesDeleteCall {
1806 c.urlParams_.Set("force", fmt.Sprint(force))
1807 return c
1808 }
1809
1810
1811
1812
1813 func (c *ProjectsLocationsInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDeleteCall {
1814 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1815 return c
1816 }
1817
1818
1819 func (c *ProjectsLocationsInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDeleteCall {
1820 c.ctx_ = ctx
1821 return c
1822 }
1823
1824
1825
1826 func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header {
1827 if c.header_ == nil {
1828 c.header_ = make(http.Header)
1829 }
1830 return c.header_
1831 }
1832
1833 func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
1834 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1835 var body io.Reader = nil
1836 c.urlParams_.Set("alt", alt)
1837 c.urlParams_.Set("prettyPrint", "false")
1838 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1839 urls += "?" + c.urlParams_.Encode()
1840 req, err := http.NewRequest("DELETE", urls, body)
1841 if err != nil {
1842 return nil, err
1843 }
1844 req.Header = reqHeaders
1845 googleapi.Expand(req.URL, map[string]string{
1846 "name": c.name,
1847 })
1848 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1849 }
1850
1851
1852
1853
1854
1855
1856 func (c *ProjectsLocationsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1857 gensupport.SetOptions(c.urlParams_, opts...)
1858 res, err := c.doRequest("json")
1859 if res != nil && res.StatusCode == http.StatusNotModified {
1860 if res.Body != nil {
1861 res.Body.Close()
1862 }
1863 return nil, gensupport.WrapError(&googleapi.Error{
1864 Code: res.StatusCode,
1865 Header: res.Header,
1866 })
1867 }
1868 if err != nil {
1869 return nil, err
1870 }
1871 defer googleapi.CloseBody(res)
1872 if err := googleapi.CheckResponse(res); err != nil {
1873 return nil, gensupport.WrapError(err)
1874 }
1875 ret := &Operation{
1876 ServerResponse: googleapi.ServerResponse{
1877 Header: res.Header,
1878 HTTPStatusCode: res.StatusCode,
1879 },
1880 }
1881 target := &ret
1882 if err := gensupport.DecodeResponse(target, res); err != nil {
1883 return nil, err
1884 }
1885 return ret, nil
1886 }
1887
1888 type ProjectsLocationsInstancesExportCall struct {
1889 s *Service
1890 name string
1891 exportinstancerequest *ExportInstanceRequest
1892 urlParams_ gensupport.URLParams
1893 ctx_ context.Context
1894 header_ http.Header
1895 }
1896
1897
1898
1899
1900
1901 func (r *ProjectsLocationsInstancesService) Export(name string, exportinstancerequest *ExportInstanceRequest) *ProjectsLocationsInstancesExportCall {
1902 c := &ProjectsLocationsInstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1903 c.name = name
1904 c.exportinstancerequest = exportinstancerequest
1905 return c
1906 }
1907
1908
1909
1910
1911 func (c *ProjectsLocationsInstancesExportCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesExportCall {
1912 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1913 return c
1914 }
1915
1916
1917 func (c *ProjectsLocationsInstancesExportCall) Context(ctx context.Context) *ProjectsLocationsInstancesExportCall {
1918 c.ctx_ = ctx
1919 return c
1920 }
1921
1922
1923
1924 func (c *ProjectsLocationsInstancesExportCall) Header() http.Header {
1925 if c.header_ == nil {
1926 c.header_ = make(http.Header)
1927 }
1928 return c.header_
1929 }
1930
1931 func (c *ProjectsLocationsInstancesExportCall) doRequest(alt string) (*http.Response, error) {
1932 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1933 var body io.Reader = nil
1934 body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportinstancerequest)
1935 if err != nil {
1936 return nil, err
1937 }
1938 c.urlParams_.Set("alt", alt)
1939 c.urlParams_.Set("prettyPrint", "false")
1940 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:export")
1941 urls += "?" + c.urlParams_.Encode()
1942 req, err := http.NewRequest("POST", urls, body)
1943 if err != nil {
1944 return nil, err
1945 }
1946 req.Header = reqHeaders
1947 googleapi.Expand(req.URL, map[string]string{
1948 "name": c.name,
1949 })
1950 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1951 }
1952
1953
1954
1955
1956
1957
1958 func (c *ProjectsLocationsInstancesExportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1959 gensupport.SetOptions(c.urlParams_, opts...)
1960 res, err := c.doRequest("json")
1961 if res != nil && res.StatusCode == http.StatusNotModified {
1962 if res.Body != nil {
1963 res.Body.Close()
1964 }
1965 return nil, gensupport.WrapError(&googleapi.Error{
1966 Code: res.StatusCode,
1967 Header: res.Header,
1968 })
1969 }
1970 if err != nil {
1971 return nil, err
1972 }
1973 defer googleapi.CloseBody(res)
1974 if err := googleapi.CheckResponse(res); err != nil {
1975 return nil, gensupport.WrapError(err)
1976 }
1977 ret := &Operation{
1978 ServerResponse: googleapi.ServerResponse{
1979 Header: res.Header,
1980 HTTPStatusCode: res.StatusCode,
1981 },
1982 }
1983 target := &ret
1984 if err := gensupport.DecodeResponse(target, res); err != nil {
1985 return nil, err
1986 }
1987 return ret, nil
1988 }
1989
1990 type ProjectsLocationsInstancesGetCall struct {
1991 s *Service
1992 name string
1993 urlParams_ gensupport.URLParams
1994 ifNoneMatch_ string
1995 ctx_ context.Context
1996 header_ http.Header
1997 }
1998
1999
2000
2001
2002
2003 func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall {
2004 c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2005 c.name = name
2006 return c
2007 }
2008
2009
2010
2011
2012 func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall {
2013 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2014 return c
2015 }
2016
2017
2018
2019
2020 func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall {
2021 c.ifNoneMatch_ = entityTag
2022 return c
2023 }
2024
2025
2026 func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall {
2027 c.ctx_ = ctx
2028 return c
2029 }
2030
2031
2032
2033 func (c *ProjectsLocationsInstancesGetCall) Header() http.Header {
2034 if c.header_ == nil {
2035 c.header_ = make(http.Header)
2036 }
2037 return c.header_
2038 }
2039
2040 func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) {
2041 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2042 if c.ifNoneMatch_ != "" {
2043 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2044 }
2045 var body io.Reader = nil
2046 c.urlParams_.Set("alt", alt)
2047 c.urlParams_.Set("prettyPrint", "false")
2048 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2049 urls += "?" + c.urlParams_.Encode()
2050 req, err := http.NewRequest("GET", urls, body)
2051 if err != nil {
2052 return nil, err
2053 }
2054 req.Header = reqHeaders
2055 googleapi.Expand(req.URL, map[string]string{
2056 "name": c.name,
2057 })
2058 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2059 }
2060
2061
2062
2063
2064
2065
2066 func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
2067 gensupport.SetOptions(c.urlParams_, opts...)
2068 res, err := c.doRequest("json")
2069 if res != nil && res.StatusCode == http.StatusNotModified {
2070 if res.Body != nil {
2071 res.Body.Close()
2072 }
2073 return nil, gensupport.WrapError(&googleapi.Error{
2074 Code: res.StatusCode,
2075 Header: res.Header,
2076 })
2077 }
2078 if err != nil {
2079 return nil, err
2080 }
2081 defer googleapi.CloseBody(res)
2082 if err := googleapi.CheckResponse(res); err != nil {
2083 return nil, gensupport.WrapError(err)
2084 }
2085 ret := &Instance{
2086 ServerResponse: googleapi.ServerResponse{
2087 Header: res.Header,
2088 HTTPStatusCode: res.StatusCode,
2089 },
2090 }
2091 target := &ret
2092 if err := gensupport.DecodeResponse(target, res); err != nil {
2093 return nil, err
2094 }
2095 return ret, nil
2096 }
2097
2098 type ProjectsLocationsInstancesGetIamPolicyCall struct {
2099 s *Service
2100 resource string
2101 urlParams_ gensupport.URLParams
2102 ifNoneMatch_ string
2103 ctx_ context.Context
2104 header_ http.Header
2105 }
2106
2107
2108
2109
2110
2111
2112
2113 func (r *ProjectsLocationsInstancesService) GetIamPolicy(resource string) *ProjectsLocationsInstancesGetIamPolicyCall {
2114 c := &ProjectsLocationsInstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2115 c.resource = resource
2116 return c
2117 }
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131 func (c *ProjectsLocationsInstancesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsInstancesGetIamPolicyCall {
2132 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
2133 return c
2134 }
2135
2136
2137
2138
2139 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetIamPolicyCall {
2140 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2141 return c
2142 }
2143
2144
2145
2146
2147 func (c *ProjectsLocationsInstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetIamPolicyCall {
2148 c.ifNoneMatch_ = entityTag
2149 return c
2150 }
2151
2152
2153 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetIamPolicyCall {
2154 c.ctx_ = ctx
2155 return c
2156 }
2157
2158
2159
2160 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Header() http.Header {
2161 if c.header_ == nil {
2162 c.header_ = make(http.Header)
2163 }
2164 return c.header_
2165 }
2166
2167 func (c *ProjectsLocationsInstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2168 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2169 if c.ifNoneMatch_ != "" {
2170 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2171 }
2172 var body io.Reader = nil
2173 c.urlParams_.Set("alt", alt)
2174 c.urlParams_.Set("prettyPrint", "false")
2175 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
2176 urls += "?" + c.urlParams_.Encode()
2177 req, err := http.NewRequest("GET", urls, body)
2178 if err != nil {
2179 return nil, err
2180 }
2181 req.Header = reqHeaders
2182 googleapi.Expand(req.URL, map[string]string{
2183 "resource": c.resource,
2184 })
2185 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2186 }
2187
2188
2189
2190
2191
2192
2193 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2194 gensupport.SetOptions(c.urlParams_, opts...)
2195 res, err := c.doRequest("json")
2196 if res != nil && res.StatusCode == http.StatusNotModified {
2197 if res.Body != nil {
2198 res.Body.Close()
2199 }
2200 return nil, gensupport.WrapError(&googleapi.Error{
2201 Code: res.StatusCode,
2202 Header: res.Header,
2203 })
2204 }
2205 if err != nil {
2206 return nil, err
2207 }
2208 defer googleapi.CloseBody(res)
2209 if err := googleapi.CheckResponse(res); err != nil {
2210 return nil, gensupport.WrapError(err)
2211 }
2212 ret := &Policy{
2213 ServerResponse: googleapi.ServerResponse{
2214 Header: res.Header,
2215 HTTPStatusCode: res.StatusCode,
2216 },
2217 }
2218 target := &ret
2219 if err := gensupport.DecodeResponse(target, res); err != nil {
2220 return nil, err
2221 }
2222 return ret, nil
2223 }
2224
2225 type ProjectsLocationsInstancesImportCall struct {
2226 s *Service
2227 name string
2228 importinstancerequest *ImportInstanceRequest
2229 urlParams_ gensupport.URLParams
2230 ctx_ context.Context
2231 header_ http.Header
2232 }
2233
2234
2235
2236
2237
2238 func (r *ProjectsLocationsInstancesService) Import(name string, importinstancerequest *ImportInstanceRequest) *ProjectsLocationsInstancesImportCall {
2239 c := &ProjectsLocationsInstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2240 c.name = name
2241 c.importinstancerequest = importinstancerequest
2242 return c
2243 }
2244
2245
2246
2247
2248 func (c *ProjectsLocationsInstancesImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesImportCall {
2249 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2250 return c
2251 }
2252
2253
2254 func (c *ProjectsLocationsInstancesImportCall) Context(ctx context.Context) *ProjectsLocationsInstancesImportCall {
2255 c.ctx_ = ctx
2256 return c
2257 }
2258
2259
2260
2261 func (c *ProjectsLocationsInstancesImportCall) Header() http.Header {
2262 if c.header_ == nil {
2263 c.header_ = make(http.Header)
2264 }
2265 return c.header_
2266 }
2267
2268 func (c *ProjectsLocationsInstancesImportCall) doRequest(alt string) (*http.Response, error) {
2269 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2270 var body io.Reader = nil
2271 body, err := googleapi.WithoutDataWrapper.JSONReader(c.importinstancerequest)
2272 if err != nil {
2273 return nil, err
2274 }
2275 c.urlParams_.Set("alt", alt)
2276 c.urlParams_.Set("prettyPrint", "false")
2277 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:import")
2278 urls += "?" + c.urlParams_.Encode()
2279 req, err := http.NewRequest("POST", urls, body)
2280 if err != nil {
2281 return nil, err
2282 }
2283 req.Header = reqHeaders
2284 googleapi.Expand(req.URL, map[string]string{
2285 "name": c.name,
2286 })
2287 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2288 }
2289
2290
2291
2292
2293
2294
2295 func (c *ProjectsLocationsInstancesImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2296 gensupport.SetOptions(c.urlParams_, opts...)
2297 res, err := c.doRequest("json")
2298 if res != nil && res.StatusCode == http.StatusNotModified {
2299 if res.Body != nil {
2300 res.Body.Close()
2301 }
2302 return nil, gensupport.WrapError(&googleapi.Error{
2303 Code: res.StatusCode,
2304 Header: res.Header,
2305 })
2306 }
2307 if err != nil {
2308 return nil, err
2309 }
2310 defer googleapi.CloseBody(res)
2311 if err := googleapi.CheckResponse(res); err != nil {
2312 return nil, gensupport.WrapError(err)
2313 }
2314 ret := &Operation{
2315 ServerResponse: googleapi.ServerResponse{
2316 Header: res.Header,
2317 HTTPStatusCode: res.StatusCode,
2318 },
2319 }
2320 target := &ret
2321 if err := gensupport.DecodeResponse(target, res); err != nil {
2322 return nil, err
2323 }
2324 return ret, nil
2325 }
2326
2327 type ProjectsLocationsInstancesListCall struct {
2328 s *Service
2329 parent string
2330 urlParams_ gensupport.URLParams
2331 ifNoneMatch_ string
2332 ctx_ context.Context
2333 header_ http.Header
2334 }
2335
2336
2337
2338
2339 func (r *ProjectsLocationsInstancesService) List(parent string) *ProjectsLocationsInstancesListCall {
2340 c := &ProjectsLocationsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2341 c.parent = parent
2342 return c
2343 }
2344
2345
2346
2347
2348 func (c *ProjectsLocationsInstancesListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesListCall {
2349 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2350 return c
2351 }
2352
2353
2354
2355 func (c *ProjectsLocationsInstancesListCall) PageToken(pageToken string) *ProjectsLocationsInstancesListCall {
2356 c.urlParams_.Set("pageToken", pageToken)
2357 return c
2358 }
2359
2360
2361
2362
2363 func (c *ProjectsLocationsInstancesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesListCall {
2364 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2365 return c
2366 }
2367
2368
2369
2370
2371 func (c *ProjectsLocationsInstancesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesListCall {
2372 c.ifNoneMatch_ = entityTag
2373 return c
2374 }
2375
2376
2377 func (c *ProjectsLocationsInstancesListCall) Context(ctx context.Context) *ProjectsLocationsInstancesListCall {
2378 c.ctx_ = ctx
2379 return c
2380 }
2381
2382
2383
2384 func (c *ProjectsLocationsInstancesListCall) Header() http.Header {
2385 if c.header_ == nil {
2386 c.header_ = make(http.Header)
2387 }
2388 return c.header_
2389 }
2390
2391 func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Response, error) {
2392 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2393 if c.ifNoneMatch_ != "" {
2394 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2395 }
2396 var body io.Reader = nil
2397 c.urlParams_.Set("alt", alt)
2398 c.urlParams_.Set("prettyPrint", "false")
2399 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances")
2400 urls += "?" + c.urlParams_.Encode()
2401 req, err := http.NewRequest("GET", urls, body)
2402 if err != nil {
2403 return nil, err
2404 }
2405 req.Header = reqHeaders
2406 googleapi.Expand(req.URL, map[string]string{
2407 "parent": c.parent,
2408 })
2409 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2410 }
2411
2412
2413
2414
2415
2416
2417
2418 func (c *ProjectsLocationsInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) {
2419 gensupport.SetOptions(c.urlParams_, opts...)
2420 res, err := c.doRequest("json")
2421 if res != nil && res.StatusCode == http.StatusNotModified {
2422 if res.Body != nil {
2423 res.Body.Close()
2424 }
2425 return nil, gensupport.WrapError(&googleapi.Error{
2426 Code: res.StatusCode,
2427 Header: res.Header,
2428 })
2429 }
2430 if err != nil {
2431 return nil, err
2432 }
2433 defer googleapi.CloseBody(res)
2434 if err := googleapi.CheckResponse(res); err != nil {
2435 return nil, gensupport.WrapError(err)
2436 }
2437 ret := &ListInstancesResponse{
2438 ServerResponse: googleapi.ServerResponse{
2439 Header: res.Header,
2440 HTTPStatusCode: res.StatusCode,
2441 },
2442 }
2443 target := &ret
2444 if err := gensupport.DecodeResponse(target, res); err != nil {
2445 return nil, err
2446 }
2447 return ret, nil
2448 }
2449
2450
2451
2452
2453 func (c *ProjectsLocationsInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error {
2454 c.ctx_ = ctx
2455 defer c.PageToken(c.urlParams_.Get("pageToken"))
2456 for {
2457 x, err := c.Do()
2458 if err != nil {
2459 return err
2460 }
2461 if err := f(x); err != nil {
2462 return err
2463 }
2464 if x.NextPageToken == "" {
2465 return nil
2466 }
2467 c.PageToken(x.NextPageToken)
2468 }
2469 }
2470
2471 type ProjectsLocationsInstancesPatchCall struct {
2472 s *Service
2473 name string
2474 instance *Instance
2475 urlParams_ gensupport.URLParams
2476 ctx_ context.Context
2477 header_ http.Header
2478 }
2479
2480
2481
2482
2483
2484 func (r *ProjectsLocationsInstancesService) Patch(name string, instance *Instance) *ProjectsLocationsInstancesPatchCall {
2485 c := &ProjectsLocationsInstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2486 c.name = name
2487 c.instance = instance
2488 return c
2489 }
2490
2491
2492
2493
2494
2495 func (c *ProjectsLocationsInstancesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsInstancesPatchCall {
2496 c.urlParams_.Set("updateMask", updateMask)
2497 return c
2498 }
2499
2500
2501
2502
2503 func (c *ProjectsLocationsInstancesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesPatchCall {
2504 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2505 return c
2506 }
2507
2508
2509 func (c *ProjectsLocationsInstancesPatchCall) Context(ctx context.Context) *ProjectsLocationsInstancesPatchCall {
2510 c.ctx_ = ctx
2511 return c
2512 }
2513
2514
2515
2516 func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header {
2517 if c.header_ == nil {
2518 c.header_ = make(http.Header)
2519 }
2520 return c.header_
2521 }
2522
2523 func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) {
2524 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2525 var body io.Reader = nil
2526 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
2527 if err != nil {
2528 return nil, err
2529 }
2530 c.urlParams_.Set("alt", alt)
2531 c.urlParams_.Set("prettyPrint", "false")
2532 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2533 urls += "?" + c.urlParams_.Encode()
2534 req, err := http.NewRequest("PATCH", urls, body)
2535 if err != nil {
2536 return nil, err
2537 }
2538 req.Header = reqHeaders
2539 googleapi.Expand(req.URL, map[string]string{
2540 "name": c.name,
2541 })
2542 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2543 }
2544
2545
2546
2547
2548
2549
2550 func (c *ProjectsLocationsInstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2551 gensupport.SetOptions(c.urlParams_, opts...)
2552 res, err := c.doRequest("json")
2553 if res != nil && res.StatusCode == http.StatusNotModified {
2554 if res.Body != nil {
2555 res.Body.Close()
2556 }
2557 return nil, gensupport.WrapError(&googleapi.Error{
2558 Code: res.StatusCode,
2559 Header: res.Header,
2560 })
2561 }
2562 if err != nil {
2563 return nil, err
2564 }
2565 defer googleapi.CloseBody(res)
2566 if err := googleapi.CheckResponse(res); err != nil {
2567 return nil, gensupport.WrapError(err)
2568 }
2569 ret := &Operation{
2570 ServerResponse: googleapi.ServerResponse{
2571 Header: res.Header,
2572 HTTPStatusCode: res.StatusCode,
2573 },
2574 }
2575 target := &ret
2576 if err := gensupport.DecodeResponse(target, res); err != nil {
2577 return nil, err
2578 }
2579 return ret, nil
2580 }
2581
2582 type ProjectsLocationsInstancesRestartCall struct {
2583 s *Service
2584 name string
2585 restartinstancerequest *RestartInstanceRequest
2586 urlParams_ gensupport.URLParams
2587 ctx_ context.Context
2588 header_ http.Header
2589 }
2590
2591
2592
2593
2594
2595 func (r *ProjectsLocationsInstancesService) Restart(name string, restartinstancerequest *RestartInstanceRequest) *ProjectsLocationsInstancesRestartCall {
2596 c := &ProjectsLocationsInstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2597 c.name = name
2598 c.restartinstancerequest = restartinstancerequest
2599 return c
2600 }
2601
2602
2603
2604
2605 func (c *ProjectsLocationsInstancesRestartCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesRestartCall {
2606 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2607 return c
2608 }
2609
2610
2611 func (c *ProjectsLocationsInstancesRestartCall) Context(ctx context.Context) *ProjectsLocationsInstancesRestartCall {
2612 c.ctx_ = ctx
2613 return c
2614 }
2615
2616
2617
2618 func (c *ProjectsLocationsInstancesRestartCall) Header() http.Header {
2619 if c.header_ == nil {
2620 c.header_ = make(http.Header)
2621 }
2622 return c.header_
2623 }
2624
2625 func (c *ProjectsLocationsInstancesRestartCall) doRequest(alt string) (*http.Response, error) {
2626 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2627 var body io.Reader = nil
2628 body, err := googleapi.WithoutDataWrapper.JSONReader(c.restartinstancerequest)
2629 if err != nil {
2630 return nil, err
2631 }
2632 c.urlParams_.Set("alt", alt)
2633 c.urlParams_.Set("prettyPrint", "false")
2634 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:restart")
2635 urls += "?" + c.urlParams_.Encode()
2636 req, err := http.NewRequest("POST", urls, body)
2637 if err != nil {
2638 return nil, err
2639 }
2640 req.Header = reqHeaders
2641 googleapi.Expand(req.URL, map[string]string{
2642 "name": c.name,
2643 })
2644 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2645 }
2646
2647
2648
2649
2650
2651
2652 func (c *ProjectsLocationsInstancesRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2653 gensupport.SetOptions(c.urlParams_, opts...)
2654 res, err := c.doRequest("json")
2655 if res != nil && res.StatusCode == http.StatusNotModified {
2656 if res.Body != nil {
2657 res.Body.Close()
2658 }
2659 return nil, gensupport.WrapError(&googleapi.Error{
2660 Code: res.StatusCode,
2661 Header: res.Header,
2662 })
2663 }
2664 if err != nil {
2665 return nil, err
2666 }
2667 defer googleapi.CloseBody(res)
2668 if err := googleapi.CheckResponse(res); err != nil {
2669 return nil, gensupport.WrapError(err)
2670 }
2671 ret := &Operation{
2672 ServerResponse: googleapi.ServerResponse{
2673 Header: res.Header,
2674 HTTPStatusCode: res.StatusCode,
2675 },
2676 }
2677 target := &ret
2678 if err := gensupport.DecodeResponse(target, res); err != nil {
2679 return nil, err
2680 }
2681 return ret, nil
2682 }
2683
2684 type ProjectsLocationsInstancesSetIamPolicyCall struct {
2685 s *Service
2686 resource string
2687 setiampolicyrequest *SetIamPolicyRequest
2688 urlParams_ gensupport.URLParams
2689 ctx_ context.Context
2690 header_ http.Header
2691 }
2692
2693
2694
2695
2696
2697
2698
2699
2700 func (r *ProjectsLocationsInstancesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsInstancesSetIamPolicyCall {
2701 c := &ProjectsLocationsInstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2702 c.resource = resource
2703 c.setiampolicyrequest = setiampolicyrequest
2704 return c
2705 }
2706
2707
2708
2709
2710 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSetIamPolicyCall {
2711 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2712 return c
2713 }
2714
2715
2716 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesSetIamPolicyCall {
2717 c.ctx_ = ctx
2718 return c
2719 }
2720
2721
2722
2723 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Header() http.Header {
2724 if c.header_ == nil {
2725 c.header_ = make(http.Header)
2726 }
2727 return c.header_
2728 }
2729
2730 func (c *ProjectsLocationsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2731 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2732 var body io.Reader = nil
2733 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
2734 if err != nil {
2735 return nil, err
2736 }
2737 c.urlParams_.Set("alt", alt)
2738 c.urlParams_.Set("prettyPrint", "false")
2739 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
2740 urls += "?" + c.urlParams_.Encode()
2741 req, err := http.NewRequest("POST", urls, body)
2742 if err != nil {
2743 return nil, err
2744 }
2745 req.Header = reqHeaders
2746 googleapi.Expand(req.URL, map[string]string{
2747 "resource": c.resource,
2748 })
2749 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2750 }
2751
2752
2753
2754
2755
2756
2757 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2758 gensupport.SetOptions(c.urlParams_, opts...)
2759 res, err := c.doRequest("json")
2760 if res != nil && res.StatusCode == http.StatusNotModified {
2761 if res.Body != nil {
2762 res.Body.Close()
2763 }
2764 return nil, gensupport.WrapError(&googleapi.Error{
2765 Code: res.StatusCode,
2766 Header: res.Header,
2767 })
2768 }
2769 if err != nil {
2770 return nil, err
2771 }
2772 defer googleapi.CloseBody(res)
2773 if err := googleapi.CheckResponse(res); err != nil {
2774 return nil, gensupport.WrapError(err)
2775 }
2776 ret := &Policy{
2777 ServerResponse: googleapi.ServerResponse{
2778 Header: res.Header,
2779 HTTPStatusCode: res.StatusCode,
2780 },
2781 }
2782 target := &ret
2783 if err := gensupport.DecodeResponse(target, res); err != nil {
2784 return nil, err
2785 }
2786 return ret, nil
2787 }
2788
2789 type ProjectsLocationsInstancesTestIamPermissionsCall struct {
2790 s *Service
2791 resource string
2792 testiampermissionsrequest *TestIamPermissionsRequest
2793 urlParams_ gensupport.URLParams
2794 ctx_ context.Context
2795 header_ http.Header
2796 }
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808 func (r *ProjectsLocationsInstancesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsInstancesTestIamPermissionsCall {
2809 c := &ProjectsLocationsInstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2810 c.resource = resource
2811 c.testiampermissionsrequest = testiampermissionsrequest
2812 return c
2813 }
2814
2815
2816
2817
2818 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesTestIamPermissionsCall {
2819 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2820 return c
2821 }
2822
2823
2824 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsInstancesTestIamPermissionsCall {
2825 c.ctx_ = ctx
2826 return c
2827 }
2828
2829
2830
2831 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Header() http.Header {
2832 if c.header_ == nil {
2833 c.header_ = make(http.Header)
2834 }
2835 return c.header_
2836 }
2837
2838 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
2839 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2840 var body io.Reader = nil
2841 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
2842 if err != nil {
2843 return nil, err
2844 }
2845 c.urlParams_.Set("alt", alt)
2846 c.urlParams_.Set("prettyPrint", "false")
2847 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
2848 urls += "?" + c.urlParams_.Encode()
2849 req, err := http.NewRequest("POST", urls, body)
2850 if err != nil {
2851 return nil, err
2852 }
2853 req.Header = reqHeaders
2854 googleapi.Expand(req.URL, map[string]string{
2855 "resource": c.resource,
2856 })
2857 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2858 }
2859
2860
2861
2862
2863
2864
2865
2866 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
2867 gensupport.SetOptions(c.urlParams_, opts...)
2868 res, err := c.doRequest("json")
2869 if res != nil && res.StatusCode == http.StatusNotModified {
2870 if res.Body != nil {
2871 res.Body.Close()
2872 }
2873 return nil, gensupport.WrapError(&googleapi.Error{
2874 Code: res.StatusCode,
2875 Header: res.Header,
2876 })
2877 }
2878 if err != nil {
2879 return nil, err
2880 }
2881 defer googleapi.CloseBody(res)
2882 if err := googleapi.CheckResponse(res); err != nil {
2883 return nil, gensupport.WrapError(err)
2884 }
2885 ret := &TestIamPermissionsResponse{
2886 ServerResponse: googleapi.ServerResponse{
2887 Header: res.Header,
2888 HTTPStatusCode: res.StatusCode,
2889 },
2890 }
2891 target := &ret
2892 if err := gensupport.DecodeResponse(target, res); err != nil {
2893 return nil, err
2894 }
2895 return ret, nil
2896 }
2897
2898 type ProjectsLocationsInstancesBackupsGetIamPolicyCall struct {
2899 s *Service
2900 resource string
2901 urlParams_ gensupport.URLParams
2902 ifNoneMatch_ string
2903 ctx_ context.Context
2904 header_ http.Header
2905 }
2906
2907
2908
2909
2910
2911
2912
2913 func (r *ProjectsLocationsInstancesBackupsService) GetIamPolicy(resource string) *ProjectsLocationsInstancesBackupsGetIamPolicyCall {
2914 c := &ProjectsLocationsInstancesBackupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2915 c.resource = resource
2916 return c
2917 }
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931 func (c *ProjectsLocationsInstancesBackupsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsInstancesBackupsGetIamPolicyCall {
2932 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
2933 return c
2934 }
2935
2936
2937
2938
2939 func (c *ProjectsLocationsInstancesBackupsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesBackupsGetIamPolicyCall {
2940 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2941 return c
2942 }
2943
2944
2945
2946
2947 func (c *ProjectsLocationsInstancesBackupsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesBackupsGetIamPolicyCall {
2948 c.ifNoneMatch_ = entityTag
2949 return c
2950 }
2951
2952
2953 func (c *ProjectsLocationsInstancesBackupsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesBackupsGetIamPolicyCall {
2954 c.ctx_ = ctx
2955 return c
2956 }
2957
2958
2959
2960 func (c *ProjectsLocationsInstancesBackupsGetIamPolicyCall) Header() http.Header {
2961 if c.header_ == nil {
2962 c.header_ = make(http.Header)
2963 }
2964 return c.header_
2965 }
2966
2967 func (c *ProjectsLocationsInstancesBackupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2968 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2969 if c.ifNoneMatch_ != "" {
2970 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2971 }
2972 var body io.Reader = nil
2973 c.urlParams_.Set("alt", alt)
2974 c.urlParams_.Set("prettyPrint", "false")
2975 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
2976 urls += "?" + c.urlParams_.Encode()
2977 req, err := http.NewRequest("GET", urls, body)
2978 if err != nil {
2979 return nil, err
2980 }
2981 req.Header = reqHeaders
2982 googleapi.Expand(req.URL, map[string]string{
2983 "resource": c.resource,
2984 })
2985 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2986 }
2987
2988
2989
2990
2991
2992
2993 func (c *ProjectsLocationsInstancesBackupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2994 gensupport.SetOptions(c.urlParams_, opts...)
2995 res, err := c.doRequest("json")
2996 if res != nil && res.StatusCode == http.StatusNotModified {
2997 if res.Body != nil {
2998 res.Body.Close()
2999 }
3000 return nil, gensupport.WrapError(&googleapi.Error{
3001 Code: res.StatusCode,
3002 Header: res.Header,
3003 })
3004 }
3005 if err != nil {
3006 return nil, err
3007 }
3008 defer googleapi.CloseBody(res)
3009 if err := googleapi.CheckResponse(res); err != nil {
3010 return nil, gensupport.WrapError(err)
3011 }
3012 ret := &Policy{
3013 ServerResponse: googleapi.ServerResponse{
3014 Header: res.Header,
3015 HTTPStatusCode: res.StatusCode,
3016 },
3017 }
3018 target := &ret
3019 if err := gensupport.DecodeResponse(target, res); err != nil {
3020 return nil, err
3021 }
3022 return ret, nil
3023 }
3024
3025 type ProjectsLocationsInstancesBackupsSetIamPolicyCall struct {
3026 s *Service
3027 resource string
3028 setiampolicyrequest *SetIamPolicyRequest
3029 urlParams_ gensupport.URLParams
3030 ctx_ context.Context
3031 header_ http.Header
3032 }
3033
3034
3035
3036
3037
3038
3039
3040
3041 func (r *ProjectsLocationsInstancesBackupsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsInstancesBackupsSetIamPolicyCall {
3042 c := &ProjectsLocationsInstancesBackupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3043 c.resource = resource
3044 c.setiampolicyrequest = setiampolicyrequest
3045 return c
3046 }
3047
3048
3049
3050
3051 func (c *ProjectsLocationsInstancesBackupsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesBackupsSetIamPolicyCall {
3052 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3053 return c
3054 }
3055
3056
3057 func (c *ProjectsLocationsInstancesBackupsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesBackupsSetIamPolicyCall {
3058 c.ctx_ = ctx
3059 return c
3060 }
3061
3062
3063
3064 func (c *ProjectsLocationsInstancesBackupsSetIamPolicyCall) Header() http.Header {
3065 if c.header_ == nil {
3066 c.header_ = make(http.Header)
3067 }
3068 return c.header_
3069 }
3070
3071 func (c *ProjectsLocationsInstancesBackupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3072 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3073 var body io.Reader = nil
3074 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
3075 if err != nil {
3076 return nil, err
3077 }
3078 c.urlParams_.Set("alt", alt)
3079 c.urlParams_.Set("prettyPrint", "false")
3080 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
3081 urls += "?" + c.urlParams_.Encode()
3082 req, err := http.NewRequest("POST", urls, body)
3083 if err != nil {
3084 return nil, err
3085 }
3086 req.Header = reqHeaders
3087 googleapi.Expand(req.URL, map[string]string{
3088 "resource": c.resource,
3089 })
3090 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3091 }
3092
3093
3094
3095
3096
3097
3098 func (c *ProjectsLocationsInstancesBackupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3099 gensupport.SetOptions(c.urlParams_, opts...)
3100 res, err := c.doRequest("json")
3101 if res != nil && res.StatusCode == http.StatusNotModified {
3102 if res.Body != nil {
3103 res.Body.Close()
3104 }
3105 return nil, gensupport.WrapError(&googleapi.Error{
3106 Code: res.StatusCode,
3107 Header: res.Header,
3108 })
3109 }
3110 if err != nil {
3111 return nil, err
3112 }
3113 defer googleapi.CloseBody(res)
3114 if err := googleapi.CheckResponse(res); err != nil {
3115 return nil, gensupport.WrapError(err)
3116 }
3117 ret := &Policy{
3118 ServerResponse: googleapi.ServerResponse{
3119 Header: res.Header,
3120 HTTPStatusCode: res.StatusCode,
3121 },
3122 }
3123 target := &ret
3124 if err := gensupport.DecodeResponse(target, res); err != nil {
3125 return nil, err
3126 }
3127 return ret, nil
3128 }
3129
3130 type ProjectsLocationsInstancesBackupsTestIamPermissionsCall struct {
3131 s *Service
3132 resource string
3133 testiampermissionsrequest *TestIamPermissionsRequest
3134 urlParams_ gensupport.URLParams
3135 ctx_ context.Context
3136 header_ http.Header
3137 }
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149 func (r *ProjectsLocationsInstancesBackupsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsInstancesBackupsTestIamPermissionsCall {
3150 c := &ProjectsLocationsInstancesBackupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3151 c.resource = resource
3152 c.testiampermissionsrequest = testiampermissionsrequest
3153 return c
3154 }
3155
3156
3157
3158
3159 func (c *ProjectsLocationsInstancesBackupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesBackupsTestIamPermissionsCall {
3160 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3161 return c
3162 }
3163
3164
3165 func (c *ProjectsLocationsInstancesBackupsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsInstancesBackupsTestIamPermissionsCall {
3166 c.ctx_ = ctx
3167 return c
3168 }
3169
3170
3171
3172 func (c *ProjectsLocationsInstancesBackupsTestIamPermissionsCall) Header() http.Header {
3173 if c.header_ == nil {
3174 c.header_ = make(http.Header)
3175 }
3176 return c.header_
3177 }
3178
3179 func (c *ProjectsLocationsInstancesBackupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
3180 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3181 var body io.Reader = nil
3182 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
3183 if err != nil {
3184 return nil, err
3185 }
3186 c.urlParams_.Set("alt", alt)
3187 c.urlParams_.Set("prettyPrint", "false")
3188 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
3189 urls += "?" + c.urlParams_.Encode()
3190 req, err := http.NewRequest("POST", urls, body)
3191 if err != nil {
3192 return nil, err
3193 }
3194 req.Header = reqHeaders
3195 googleapi.Expand(req.URL, map[string]string{
3196 "resource": c.resource,
3197 })
3198 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3199 }
3200
3201
3202
3203
3204
3205
3206
3207 func (c *ProjectsLocationsInstancesBackupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
3208 gensupport.SetOptions(c.urlParams_, opts...)
3209 res, err := c.doRequest("json")
3210 if res != nil && res.StatusCode == http.StatusNotModified {
3211 if res.Body != nil {
3212 res.Body.Close()
3213 }
3214 return nil, gensupport.WrapError(&googleapi.Error{
3215 Code: res.StatusCode,
3216 Header: res.Header,
3217 })
3218 }
3219 if err != nil {
3220 return nil, err
3221 }
3222 defer googleapi.CloseBody(res)
3223 if err := googleapi.CheckResponse(res); err != nil {
3224 return nil, gensupport.WrapError(err)
3225 }
3226 ret := &TestIamPermissionsResponse{
3227 ServerResponse: googleapi.ServerResponse{
3228 Header: res.Header,
3229 HTTPStatusCode: res.StatusCode,
3230 },
3231 }
3232 target := &ret
3233 if err := gensupport.DecodeResponse(target, res); err != nil {
3234 return nil, err
3235 }
3236 return ret, nil
3237 }
3238
3239 type ProjectsLocationsOperationsCancelCall struct {
3240 s *Service
3241 name string
3242 canceloperationrequest *CancelOperationRequest
3243 urlParams_ gensupport.URLParams
3244 ctx_ context.Context
3245 header_ http.Header
3246 }
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
3260 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3261 c.name = name
3262 c.canceloperationrequest = canceloperationrequest
3263 return c
3264 }
3265
3266
3267
3268
3269 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
3270 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3271 return c
3272 }
3273
3274
3275 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
3276 c.ctx_ = ctx
3277 return c
3278 }
3279
3280
3281
3282 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
3283 if c.header_ == nil {
3284 c.header_ = make(http.Header)
3285 }
3286 return c.header_
3287 }
3288
3289 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
3290 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3291 var body io.Reader = nil
3292 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
3293 if err != nil {
3294 return nil, err
3295 }
3296 c.urlParams_.Set("alt", alt)
3297 c.urlParams_.Set("prettyPrint", "false")
3298 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
3299 urls += "?" + c.urlParams_.Encode()
3300 req, err := http.NewRequest("POST", urls, body)
3301 if err != nil {
3302 return nil, err
3303 }
3304 req.Header = reqHeaders
3305 googleapi.Expand(req.URL, map[string]string{
3306 "name": c.name,
3307 })
3308 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3309 }
3310
3311
3312
3313
3314
3315
3316 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3317 gensupport.SetOptions(c.urlParams_, opts...)
3318 res, err := c.doRequest("json")
3319 if res != nil && res.StatusCode == http.StatusNotModified {
3320 if res.Body != nil {
3321 res.Body.Close()
3322 }
3323 return nil, gensupport.WrapError(&googleapi.Error{
3324 Code: res.StatusCode,
3325 Header: res.Header,
3326 })
3327 }
3328 if err != nil {
3329 return nil, err
3330 }
3331 defer googleapi.CloseBody(res)
3332 if err := googleapi.CheckResponse(res); err != nil {
3333 return nil, gensupport.WrapError(err)
3334 }
3335 ret := &Empty{
3336 ServerResponse: googleapi.ServerResponse{
3337 Header: res.Header,
3338 HTTPStatusCode: res.StatusCode,
3339 },
3340 }
3341 target := &ret
3342 if err := gensupport.DecodeResponse(target, res); err != nil {
3343 return nil, err
3344 }
3345 return ret, nil
3346 }
3347
3348 type ProjectsLocationsOperationsDeleteCall struct {
3349 s *Service
3350 name string
3351 urlParams_ gensupport.URLParams
3352 ctx_ context.Context
3353 header_ http.Header
3354 }
3355
3356
3357
3358
3359
3360
3361
3362 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
3363 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3364 c.name = name
3365 return c
3366 }
3367
3368
3369
3370
3371 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
3372 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3373 return c
3374 }
3375
3376
3377 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
3378 c.ctx_ = ctx
3379 return c
3380 }
3381
3382
3383
3384 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
3385 if c.header_ == nil {
3386 c.header_ = make(http.Header)
3387 }
3388 return c.header_
3389 }
3390
3391 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
3392 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3393 var body io.Reader = nil
3394 c.urlParams_.Set("alt", alt)
3395 c.urlParams_.Set("prettyPrint", "false")
3396 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3397 urls += "?" + c.urlParams_.Encode()
3398 req, err := http.NewRequest("DELETE", urls, body)
3399 if err != nil {
3400 return nil, err
3401 }
3402 req.Header = reqHeaders
3403 googleapi.Expand(req.URL, map[string]string{
3404 "name": c.name,
3405 })
3406 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3407 }
3408
3409
3410
3411
3412
3413
3414 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3415 gensupport.SetOptions(c.urlParams_, opts...)
3416 res, err := c.doRequest("json")
3417 if res != nil && res.StatusCode == http.StatusNotModified {
3418 if res.Body != nil {
3419 res.Body.Close()
3420 }
3421 return nil, gensupport.WrapError(&googleapi.Error{
3422 Code: res.StatusCode,
3423 Header: res.Header,
3424 })
3425 }
3426 if err != nil {
3427 return nil, err
3428 }
3429 defer googleapi.CloseBody(res)
3430 if err := googleapi.CheckResponse(res); err != nil {
3431 return nil, gensupport.WrapError(err)
3432 }
3433 ret := &Empty{
3434 ServerResponse: googleapi.ServerResponse{
3435 Header: res.Header,
3436 HTTPStatusCode: res.StatusCode,
3437 },
3438 }
3439 target := &ret
3440 if err := gensupport.DecodeResponse(target, res); err != nil {
3441 return nil, err
3442 }
3443 return ret, nil
3444 }
3445
3446 type ProjectsLocationsOperationsGetCall struct {
3447 s *Service
3448 name string
3449 urlParams_ gensupport.URLParams
3450 ifNoneMatch_ string
3451 ctx_ context.Context
3452 header_ http.Header
3453 }
3454
3455
3456
3457
3458
3459
3460 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
3461 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3462 c.name = name
3463 return c
3464 }
3465
3466
3467
3468
3469 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
3470 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3471 return c
3472 }
3473
3474
3475
3476
3477 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
3478 c.ifNoneMatch_ = entityTag
3479 return c
3480 }
3481
3482
3483 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
3484 c.ctx_ = ctx
3485 return c
3486 }
3487
3488
3489
3490 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
3491 if c.header_ == nil {
3492 c.header_ = make(http.Header)
3493 }
3494 return c.header_
3495 }
3496
3497 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
3498 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3499 if c.ifNoneMatch_ != "" {
3500 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3501 }
3502 var body io.Reader = nil
3503 c.urlParams_.Set("alt", alt)
3504 c.urlParams_.Set("prettyPrint", "false")
3505 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3506 urls += "?" + c.urlParams_.Encode()
3507 req, err := http.NewRequest("GET", urls, body)
3508 if err != nil {
3509 return nil, err
3510 }
3511 req.Header = reqHeaders
3512 googleapi.Expand(req.URL, map[string]string{
3513 "name": c.name,
3514 })
3515 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3516 }
3517
3518
3519
3520
3521
3522
3523 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3524 gensupport.SetOptions(c.urlParams_, opts...)
3525 res, err := c.doRequest("json")
3526 if res != nil && res.StatusCode == http.StatusNotModified {
3527 if res.Body != nil {
3528 res.Body.Close()
3529 }
3530 return nil, gensupport.WrapError(&googleapi.Error{
3531 Code: res.StatusCode,
3532 Header: res.Header,
3533 })
3534 }
3535 if err != nil {
3536 return nil, err
3537 }
3538 defer googleapi.CloseBody(res)
3539 if err := googleapi.CheckResponse(res); err != nil {
3540 return nil, gensupport.WrapError(err)
3541 }
3542 ret := &Operation{
3543 ServerResponse: googleapi.ServerResponse{
3544 Header: res.Header,
3545 HTTPStatusCode: res.StatusCode,
3546 },
3547 }
3548 target := &ret
3549 if err := gensupport.DecodeResponse(target, res); err != nil {
3550 return nil, err
3551 }
3552 return ret, nil
3553 }
3554
3555 type ProjectsLocationsOperationsListCall struct {
3556 s *Service
3557 name string
3558 urlParams_ gensupport.URLParams
3559 ifNoneMatch_ string
3560 ctx_ context.Context
3561 header_ http.Header
3562 }
3563
3564
3565
3566
3567
3568 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
3569 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3570 c.name = name
3571 return c
3572 }
3573
3574
3575 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
3576 c.urlParams_.Set("filter", filter)
3577 return c
3578 }
3579
3580
3581
3582 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
3583 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3584 return c
3585 }
3586
3587
3588
3589 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
3590 c.urlParams_.Set("pageToken", pageToken)
3591 return c
3592 }
3593
3594
3595
3596
3597 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
3598 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3599 return c
3600 }
3601
3602
3603
3604
3605 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
3606 c.ifNoneMatch_ = entityTag
3607 return c
3608 }
3609
3610
3611 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
3612 c.ctx_ = ctx
3613 return c
3614 }
3615
3616
3617
3618 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
3619 if c.header_ == nil {
3620 c.header_ = make(http.Header)
3621 }
3622 return c.header_
3623 }
3624
3625 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
3626 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3627 if c.ifNoneMatch_ != "" {
3628 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3629 }
3630 var body io.Reader = nil
3631 c.urlParams_.Set("alt", alt)
3632 c.urlParams_.Set("prettyPrint", "false")
3633 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
3634 urls += "?" + c.urlParams_.Encode()
3635 req, err := http.NewRequest("GET", urls, body)
3636 if err != nil {
3637 return nil, err
3638 }
3639 req.Header = reqHeaders
3640 googleapi.Expand(req.URL, map[string]string{
3641 "name": c.name,
3642 })
3643 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3644 }
3645
3646
3647
3648
3649
3650
3651
3652 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
3653 gensupport.SetOptions(c.urlParams_, opts...)
3654 res, err := c.doRequest("json")
3655 if res != nil && res.StatusCode == http.StatusNotModified {
3656 if res.Body != nil {
3657 res.Body.Close()
3658 }
3659 return nil, gensupport.WrapError(&googleapi.Error{
3660 Code: res.StatusCode,
3661 Header: res.Header,
3662 })
3663 }
3664 if err != nil {
3665 return nil, err
3666 }
3667 defer googleapi.CloseBody(res)
3668 if err := googleapi.CheckResponse(res); err != nil {
3669 return nil, gensupport.WrapError(err)
3670 }
3671 ret := &ListOperationsResponse{
3672 ServerResponse: googleapi.ServerResponse{
3673 Header: res.Header,
3674 HTTPStatusCode: res.StatusCode,
3675 },
3676 }
3677 target := &ret
3678 if err := gensupport.DecodeResponse(target, res); err != nil {
3679 return nil, err
3680 }
3681 return ret, nil
3682 }
3683
3684
3685
3686
3687 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
3688 c.ctx_ = ctx
3689 defer c.PageToken(c.urlParams_.Get("pageToken"))
3690 for {
3691 x, err := c.Do()
3692 if err != nil {
3693 return err
3694 }
3695 if err := f(x); err != nil {
3696 return err
3697 }
3698 if x.NextPageToken == "" {
3699 return nil
3700 }
3701 c.PageToken(x.NextPageToken)
3702 }
3703 }
3704
View as plain text