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 package sql
47
48 import (
49 "bytes"
50 "context"
51 "encoding/json"
52 "errors"
53 "fmt"
54 "io"
55 "net/http"
56 "net/url"
57 "strconv"
58 "strings"
59
60 googleapi "google.golang.org/api/googleapi"
61 gensupport "google.golang.org/api/internal/gensupport"
62 option "google.golang.org/api/option"
63 internaloption "google.golang.org/api/option/internaloption"
64 htransport "google.golang.org/api/transport/http"
65 )
66
67
68
69 var _ = bytes.NewBuffer
70 var _ = strconv.Itoa
71 var _ = fmt.Sprintf
72 var _ = json.NewDecoder
73 var _ = io.Copy
74 var _ = url.Parse
75 var _ = gensupport.MarshalJSON
76 var _ = googleapi.Version
77 var _ = errors.New
78 var _ = strings.Replace
79 var _ = context.Canceled
80 var _ = internaloption.WithDefaultEndpoint
81
82 const apiId = "sql:v1beta4"
83 const apiName = "sql"
84 const apiVersion = "v1beta4"
85 const basePath = "https://sqladmin.googleapis.com/"
86
87
88 const (
89
90 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
91
92
93 SqlserviceAdminScope = "https://www.googleapis.com/auth/sqlservice.admin"
94 )
95
96
97 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
98 scopesOption := option.WithScopes(
99 "https://www.googleapis.com/auth/cloud-platform",
100 "https://www.googleapis.com/auth/sqlservice.admin",
101 )
102
103 opts = append([]option.ClientOption{scopesOption}, opts...)
104 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
105 client, endpoint, err := htransport.NewClient(ctx, opts...)
106 if err != nil {
107 return nil, err
108 }
109 s, err := New(client)
110 if err != nil {
111 return nil, err
112 }
113 if endpoint != "" {
114 s.BasePath = endpoint
115 }
116 return s, nil
117 }
118
119
120
121
122
123
124 func New(client *http.Client) (*Service, error) {
125 if client == nil {
126 return nil, errors.New("client is nil")
127 }
128 s := &Service{client: client, BasePath: basePath}
129 s.BackupRuns = NewBackupRunsService(s)
130 s.Databases = NewDatabasesService(s)
131 s.Flags = NewFlagsService(s)
132 s.Instances = NewInstancesService(s)
133 s.Operations = NewOperationsService(s)
134 s.Projects = NewProjectsService(s)
135 s.SslCerts = NewSslCertsService(s)
136 s.Tiers = NewTiersService(s)
137 s.Users = NewUsersService(s)
138 return s, nil
139 }
140
141 type Service struct {
142 client *http.Client
143 BasePath string
144 UserAgent string
145
146 BackupRuns *BackupRunsService
147
148 Databases *DatabasesService
149
150 Flags *FlagsService
151
152 Instances *InstancesService
153
154 Operations *OperationsService
155
156 Projects *ProjectsService
157
158 SslCerts *SslCertsService
159
160 Tiers *TiersService
161
162 Users *UsersService
163 }
164
165 func (s *Service) userAgent() string {
166 if s.UserAgent == "" {
167 return googleapi.UserAgent
168 }
169 return googleapi.UserAgent + " " + s.UserAgent
170 }
171
172 func NewBackupRunsService(s *Service) *BackupRunsService {
173 rs := &BackupRunsService{s: s}
174 return rs
175 }
176
177 type BackupRunsService struct {
178 s *Service
179 }
180
181 func NewDatabasesService(s *Service) *DatabasesService {
182 rs := &DatabasesService{s: s}
183 return rs
184 }
185
186 type DatabasesService struct {
187 s *Service
188 }
189
190 func NewFlagsService(s *Service) *FlagsService {
191 rs := &FlagsService{s: s}
192 return rs
193 }
194
195 type FlagsService struct {
196 s *Service
197 }
198
199 func NewInstancesService(s *Service) *InstancesService {
200 rs := &InstancesService{s: s}
201 return rs
202 }
203
204 type InstancesService struct {
205 s *Service
206 }
207
208 func NewOperationsService(s *Service) *OperationsService {
209 rs := &OperationsService{s: s}
210 return rs
211 }
212
213 type OperationsService struct {
214 s *Service
215 }
216
217 func NewProjectsService(s *Service) *ProjectsService {
218 rs := &ProjectsService{s: s}
219 rs.Instances = NewProjectsInstancesService(s)
220 return rs
221 }
222
223 type ProjectsService struct {
224 s *Service
225
226 Instances *ProjectsInstancesService
227 }
228
229 func NewProjectsInstancesService(s *Service) *ProjectsInstancesService {
230 rs := &ProjectsInstancesService{s: s}
231 return rs
232 }
233
234 type ProjectsInstancesService struct {
235 s *Service
236 }
237
238 func NewSslCertsService(s *Service) *SslCertsService {
239 rs := &SslCertsService{s: s}
240 return rs
241 }
242
243 type SslCertsService struct {
244 s *Service
245 }
246
247 func NewTiersService(s *Service) *TiersService {
248 rs := &TiersService{s: s}
249 return rs
250 }
251
252 type TiersService struct {
253 s *Service
254 }
255
256 func NewUsersService(s *Service) *UsersService {
257 rs := &UsersService{s: s}
258 return rs
259 }
260
261 type UsersService struct {
262 s *Service
263 }
264
265
266 type AclEntry struct {
267
268
269
270
271
272 ExpirationTime string `json:"expirationTime,omitempty"`
273
274
275 Kind string `json:"kind,omitempty"`
276
277
278 Name string `json:"name,omitempty"`
279
280
281 Value string `json:"value,omitempty"`
282
283
284
285
286
287
288
289 ForceSendFields []string `json:"-"`
290
291
292
293
294
295
296
297
298 NullFields []string `json:"-"`
299 }
300
301 func (s *AclEntry) MarshalJSON() ([]byte, error) {
302 type NoMethod AclEntry
303 raw := NoMethod(*s)
304 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
305 }
306
307
308 type ApiWarning struct {
309
310
311
312
313
314
315
316
317 Code string `json:"code,omitempty"`
318
319
320 Message string `json:"message,omitempty"`
321
322
323
324
325
326
327
328 ForceSendFields []string `json:"-"`
329
330
331
332
333
334
335
336 NullFields []string `json:"-"`
337 }
338
339 func (s *ApiWarning) MarshalJSON() ([]byte, error) {
340 type NoMethod ApiWarning
341 raw := NoMethod(*s)
342 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
343 }
344
345
346 type BackupConfiguration struct {
347
348
349
350 BinaryLogEnabled bool `json:"binaryLogEnabled,omitempty"`
351
352
353 Enabled bool `json:"enabled,omitempty"`
354
355
356 Kind string `json:"kind,omitempty"`
357
358
359 Location string `json:"location,omitempty"`
360
361
362 PointInTimeRecoveryEnabled bool `json:"pointInTimeRecoveryEnabled,omitempty"`
363
364
365 ReplicationLogArchivingEnabled bool `json:"replicationLogArchivingEnabled,omitempty"`
366
367
368
369
370 StartTime string `json:"startTime,omitempty"`
371
372
373
374
375
376
377
378 ForceSendFields []string `json:"-"`
379
380
381
382
383
384
385
386
387 NullFields []string `json:"-"`
388 }
389
390 func (s *BackupConfiguration) MarshalJSON() ([]byte, error) {
391 type NoMethod BackupConfiguration
392 raw := NoMethod(*s)
393 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
394 }
395
396
397 type BackupRun struct {
398
399
400 Description string `json:"description,omitempty"`
401
402
403
404
405 DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"`
406
407
408
409 DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"`
410
411
412
413
414
415
416 EndTime string `json:"endTime,omitempty"`
417
418
419
420
421
422
423 EnqueuedTime string `json:"enqueuedTime,omitempty"`
424
425
426
427
428 Error *OperationError `json:"error,omitempty"`
429
430
431
432
433 Id int64 `json:"id,omitempty,string"`
434
435
436 Instance string `json:"instance,omitempty"`
437
438
439 Kind string `json:"kind,omitempty"`
440
441
442 Location string `json:"location,omitempty"`
443
444
445 SelfLink string `json:"selfLink,omitempty"`
446
447
448
449
450
451
452 StartTime string `json:"startTime,omitempty"`
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473 Status string `json:"status,omitempty"`
474
475
476
477
478
479
480
481
482 Type string `json:"type,omitempty"`
483
484
485
486
487
488
489 WindowStartTime string `json:"windowStartTime,omitempty"`
490
491
492
493 googleapi.ServerResponse `json:"-"`
494
495
496
497
498
499
500
501 ForceSendFields []string `json:"-"`
502
503
504
505
506
507
508
509 NullFields []string `json:"-"`
510 }
511
512 func (s *BackupRun) MarshalJSON() ([]byte, error) {
513 type NoMethod BackupRun
514 raw := NoMethod(*s)
515 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
516 }
517
518
519 type BackupRunsListResponse struct {
520
521
522 Items []*BackupRun `json:"items,omitempty"`
523
524
525 Kind string `json:"kind,omitempty"`
526
527
528
529
530
531 NextPageToken string `json:"nextPageToken,omitempty"`
532
533
534
535 googleapi.ServerResponse `json:"-"`
536
537
538
539
540
541
542
543 ForceSendFields []string `json:"-"`
544
545
546
547
548
549
550
551 NullFields []string `json:"-"`
552 }
553
554 func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) {
555 type NoMethod BackupRunsListResponse
556 raw := NoMethod(*s)
557 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
558 }
559
560
561 type BinLogCoordinates struct {
562
563 BinLogFileName string `json:"binLogFileName,omitempty"`
564
565
566 BinLogPosition int64 `json:"binLogPosition,omitempty,string"`
567
568
569 Kind string `json:"kind,omitempty"`
570
571
572
573
574
575
576
577 ForceSendFields []string `json:"-"`
578
579
580
581
582
583
584
585
586 NullFields []string `json:"-"`
587 }
588
589 func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) {
590 type NoMethod BinLogCoordinates
591 raw := NoMethod(*s)
592 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
593 }
594
595
596 type CloneContext struct {
597
598
599
600
601
602 BinLogCoordinates *BinLogCoordinates `json:"binLogCoordinates,omitempty"`
603
604
605
606 DestinationInstanceName string `json:"destinationInstanceName,omitempty"`
607
608
609 Kind string `json:"kind,omitempty"`
610
611
612 PitrTimestampMs int64 `json:"pitrTimestampMs,omitempty,string"`
613
614
615 PointInTime string `json:"pointInTime,omitempty"`
616
617
618
619
620
621
622
623 ForceSendFields []string `json:"-"`
624
625
626
627
628
629
630
631
632 NullFields []string `json:"-"`
633 }
634
635 func (s *CloneContext) MarshalJSON() ([]byte, error) {
636 type NoMethod CloneContext
637 raw := NoMethod(*s)
638 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
639 }
640
641
642 type Database struct {
643
644 Charset string `json:"charset,omitempty"`
645
646
647 Collation string `json:"collation,omitempty"`
648
649
650
651
652 Etag string `json:"etag,omitempty"`
653
654
655
656 Instance string `json:"instance,omitempty"`
657
658
659 Kind string `json:"kind,omitempty"`
660
661
662
663
664 Name string `json:"name,omitempty"`
665
666
667
668
669 Project string `json:"project,omitempty"`
670
671
672 SelfLink string `json:"selfLink,omitempty"`
673
674 SqlserverDatabaseDetails *SqlServerDatabaseDetails `json:"sqlserverDatabaseDetails,omitempty"`
675
676
677
678 googleapi.ServerResponse `json:"-"`
679
680
681
682
683
684
685
686 ForceSendFields []string `json:"-"`
687
688
689
690
691
692
693
694 NullFields []string `json:"-"`
695 }
696
697 func (s *Database) MarshalJSON() ([]byte, error) {
698 type NoMethod Database
699 raw := NoMethod(*s)
700 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
701 }
702
703
704 type DatabaseFlags struct {
705
706
707
708
709
710
711
712
713
714 Name string `json:"name,omitempty"`
715
716
717
718
719
720
721 Value string `json:"value,omitempty"`
722
723
724
725
726
727
728
729 ForceSendFields []string `json:"-"`
730
731
732
733
734
735
736
737 NullFields []string `json:"-"`
738 }
739
740 func (s *DatabaseFlags) MarshalJSON() ([]byte, error) {
741 type NoMethod DatabaseFlags
742 raw := NoMethod(*s)
743 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
744 }
745
746
747 type DatabaseInstance struct {
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766 BackendType string `json:"backendType,omitempty"`
767
768
769
770 ConnectionName string `json:"connectionName,omitempty"`
771
772
773
774
775
776
777
778
779
780
781
782
783 CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"`
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814 DatabaseVersion string `json:"databaseVersion,omitempty"`
815
816
817
818
819 DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"`
820
821
822
823
824 DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"`
825
826
827
828
829 Etag string `json:"etag,omitempty"`
830
831
832
833
834 FailoverReplica *DatabaseInstanceFailoverReplica `json:"failoverReplica,omitempty"`
835
836
837
838
839
840
841 GceZone string `json:"gceZone,omitempty"`
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863 InstanceType string `json:"instanceType,omitempty"`
864
865
866 IpAddresses []*IpMapping `json:"ipAddresses,omitempty"`
867
868
869
870
871 Ipv6Address string `json:"ipv6Address,omitempty"`
872
873
874 Kind string `json:"kind,omitempty"`
875
876
877
878 MasterInstanceName string `json:"masterInstanceName,omitempty"`
879
880
881 MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"`
882
883
884
885 Name string `json:"name,omitempty"`
886
887
888
889 OnPremisesConfiguration *OnPremisesConfiguration `json:"onPremisesConfiguration,omitempty"`
890
891
892
893
894 Project string `json:"project,omitempty"`
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909 Region string `json:"region,omitempty"`
910
911
912
913 ReplicaConfiguration *ReplicaConfiguration `json:"replicaConfiguration,omitempty"`
914
915
916 ReplicaNames []string `json:"replicaNames,omitempty"`
917
918
919 RootPassword string `json:"rootPassword,omitempty"`
920
921
922
923 ScheduledMaintenance *SqlScheduledMaintenance `json:"scheduledMaintenance,omitempty"`
924
925
926 SelfLink string `json:"selfLink,omitempty"`
927
928
929 ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
930
931
932
933
934 ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,omitempty"`
935
936
937 Settings *Settings `json:"settings,omitempty"`
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965 State string `json:"state,omitempty"`
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983 SuspensionReason []string `json:"suspensionReason,omitempty"`
984
985
986
987 googleapi.ServerResponse `json:"-"`
988
989
990
991
992
993
994
995 ForceSendFields []string `json:"-"`
996
997
998
999
1000
1001
1002
1003 NullFields []string `json:"-"`
1004 }
1005
1006 func (s *DatabaseInstance) MarshalJSON() ([]byte, error) {
1007 type NoMethod DatabaseInstance
1008 raw := NoMethod(*s)
1009 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1010 }
1011
1012
1013
1014
1015 type DatabaseInstanceFailoverReplica struct {
1016
1017
1018
1019
1020
1021 Available bool `json:"available,omitempty"`
1022
1023
1024
1025
1026
1027
1028
1029 Name string `json:"name,omitempty"`
1030
1031
1032
1033
1034
1035
1036
1037 ForceSendFields []string `json:"-"`
1038
1039
1040
1041
1042
1043
1044
1045 NullFields []string `json:"-"`
1046 }
1047
1048 func (s *DatabaseInstanceFailoverReplica) MarshalJSON() ([]byte, error) {
1049 type NoMethod DatabaseInstanceFailoverReplica
1050 raw := NoMethod(*s)
1051 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1052 }
1053
1054
1055 type DatabasesListResponse struct {
1056
1057 Items []*Database `json:"items,omitempty"`
1058
1059
1060 Kind string `json:"kind,omitempty"`
1061
1062
1063
1064 googleapi.ServerResponse `json:"-"`
1065
1066
1067
1068
1069
1070
1071
1072 ForceSendFields []string `json:"-"`
1073
1074
1075
1076
1077
1078
1079
1080 NullFields []string `json:"-"`
1081 }
1082
1083 func (s *DatabasesListResponse) MarshalJSON() ([]byte, error) {
1084 type NoMethod DatabasesListResponse
1085 raw := NoMethod(*s)
1086 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1087 }
1088
1089
1090
1091 type DemoteMasterConfiguration struct {
1092
1093 Kind string `json:"kind,omitempty"`
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106 MysqlReplicaConfiguration *DemoteMasterMySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"`
1107
1108
1109
1110
1111
1112
1113
1114 ForceSendFields []string `json:"-"`
1115
1116
1117
1118
1119
1120
1121
1122 NullFields []string `json:"-"`
1123 }
1124
1125 func (s *DemoteMasterConfiguration) MarshalJSON() ([]byte, error) {
1126 type NoMethod DemoteMasterConfiguration
1127 raw := NoMethod(*s)
1128 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1129 }
1130
1131
1132 type DemoteMasterContext struct {
1133
1134 Kind string `json:"kind,omitempty"`
1135
1136
1137
1138
1139 MasterInstanceName string `json:"masterInstanceName,omitempty"`
1140
1141
1142
1143
1144 ReplicaConfiguration *DemoteMasterConfiguration `json:"replicaConfiguration,omitempty"`
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159 VerifyGtidConsistency bool `json:"verifyGtidConsistency,omitempty"`
1160
1161
1162
1163
1164
1165
1166
1167 ForceSendFields []string `json:"-"`
1168
1169
1170
1171
1172
1173
1174
1175 NullFields []string `json:"-"`
1176 }
1177
1178 func (s *DemoteMasterContext) MarshalJSON() ([]byte, error) {
1179 type NoMethod DemoteMasterContext
1180 raw := NoMethod(*s)
1181 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1182 }
1183
1184
1185
1186 type DemoteMasterMySqlReplicaConfiguration struct {
1187
1188
1189 CaCertificate string `json:"caCertificate,omitempty"`
1190
1191
1192
1193 ClientCertificate string `json:"clientCertificate,omitempty"`
1194
1195
1196
1197
1198
1199
1200 ClientKey string `json:"clientKey,omitempty"`
1201
1202
1203
1204 Kind string `json:"kind,omitempty"`
1205
1206
1207 Password string `json:"password,omitempty"`
1208
1209
1210 Username string `json:"username,omitempty"`
1211
1212
1213
1214
1215
1216
1217
1218 ForceSendFields []string `json:"-"`
1219
1220
1221
1222
1223
1224
1225
1226 NullFields []string `json:"-"`
1227 }
1228
1229 func (s *DemoteMasterMySqlReplicaConfiguration) MarshalJSON() ([]byte, error) {
1230 type NoMethod DemoteMasterMySqlReplicaConfiguration
1231 raw := NoMethod(*s)
1232 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1233 }
1234
1235
1236
1237 type DiskEncryptionConfiguration struct {
1238
1239 Kind string `json:"kind,omitempty"`
1240
1241
1242 KmsKeyName string `json:"kmsKeyName,omitempty"`
1243
1244
1245
1246
1247
1248
1249
1250 ForceSendFields []string `json:"-"`
1251
1252
1253
1254
1255
1256
1257
1258 NullFields []string `json:"-"`
1259 }
1260
1261 func (s *DiskEncryptionConfiguration) MarshalJSON() ([]byte, error) {
1262 type NoMethod DiskEncryptionConfiguration
1263 raw := NoMethod(*s)
1264 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1265 }
1266
1267
1268 type DiskEncryptionStatus struct {
1269
1270 Kind string `json:"kind,omitempty"`
1271
1272
1273
1274 KmsKeyVersionName string `json:"kmsKeyVersionName,omitempty"`
1275
1276
1277
1278
1279
1280
1281
1282 ForceSendFields []string `json:"-"`
1283
1284
1285
1286
1287
1288
1289
1290 NullFields []string `json:"-"`
1291 }
1292
1293 func (s *DiskEncryptionStatus) MarshalJSON() ([]byte, error) {
1294 type NoMethod DiskEncryptionStatus
1295 raw := NoMethod(*s)
1296 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1297 }
1298
1299
1300 type ExportContext struct {
1301
1302 CsvExportOptions *ExportContextCsvExportOptions `json:"csvExportOptions,omitempty"`
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323 Databases []string `json:"databases,omitempty"`
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335 FileType string `json:"fileType,omitempty"`
1336
1337
1338 Kind string `json:"kind,omitempty"`
1339
1340
1341 SqlExportOptions *ExportContextSqlExportOptions `json:"sqlExportOptions,omitempty"`
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353 Uri string `json:"uri,omitempty"`
1354
1355
1356
1357
1358
1359
1360
1361 ForceSendFields []string `json:"-"`
1362
1363
1364
1365
1366
1367
1368
1369
1370 NullFields []string `json:"-"`
1371 }
1372
1373 func (s *ExportContext) MarshalJSON() ([]byte, error) {
1374 type NoMethod ExportContext
1375 raw := NoMethod(*s)
1376 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1377 }
1378
1379
1380 type ExportContextCsvExportOptions struct {
1381
1382 SelectQuery string `json:"selectQuery,omitempty"`
1383
1384
1385
1386
1387
1388
1389
1390 ForceSendFields []string `json:"-"`
1391
1392
1393
1394
1395
1396
1397
1398 NullFields []string `json:"-"`
1399 }
1400
1401 func (s *ExportContextCsvExportOptions) MarshalJSON() ([]byte, error) {
1402 type NoMethod ExportContextCsvExportOptions
1403 raw := NoMethod(*s)
1404 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1405 }
1406
1407
1408
1409 type ExportContextSqlExportOptions struct {
1410
1411 MysqlExportOptions *ExportContextSqlExportOptionsMysqlExportOptions `json:"mysqlExportOptions,omitempty"`
1412
1413
1414 SchemaOnly bool `json:"schemaOnly,omitempty"`
1415
1416
1417
1418
1419
1420
1421 Tables []string `json:"tables,omitempty"`
1422
1423
1424
1425
1426
1427
1428
1429 ForceSendFields []string `json:"-"`
1430
1431
1432
1433
1434
1435
1436
1437
1438 NullFields []string `json:"-"`
1439 }
1440
1441 func (s *ExportContextSqlExportOptions) MarshalJSON() ([]byte, error) {
1442 type NoMethod ExportContextSqlExportOptions
1443 raw := NoMethod(*s)
1444 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1445 }
1446
1447
1448
1449 type ExportContextSqlExportOptionsMysqlExportOptions struct {
1450
1451
1452
1453
1454
1455
1456
1457
1458 MasterData int64 `json:"masterData,omitempty"`
1459
1460
1461
1462
1463
1464
1465
1466 ForceSendFields []string `json:"-"`
1467
1468
1469
1470
1471
1472
1473
1474 NullFields []string `json:"-"`
1475 }
1476
1477 func (s *ExportContextSqlExportOptionsMysqlExportOptions) MarshalJSON() ([]byte, error) {
1478 type NoMethod ExportContextSqlExportOptionsMysqlExportOptions
1479 raw := NoMethod(*s)
1480 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1481 }
1482
1483
1484 type FailoverContext struct {
1485
1486 Kind string `json:"kind,omitempty"`
1487
1488
1489
1490
1491 SettingsVersion int64 `json:"settingsVersion,omitempty,string"`
1492
1493
1494
1495
1496
1497
1498
1499 ForceSendFields []string `json:"-"`
1500
1501
1502
1503
1504
1505
1506
1507 NullFields []string `json:"-"`
1508 }
1509
1510 func (s *FailoverContext) MarshalJSON() ([]byte, error) {
1511 type NoMethod FailoverContext
1512 raw := NoMethod(*s)
1513 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1514 }
1515
1516
1517 type Flag struct {
1518
1519
1520
1521 AllowedIntValues googleapi.Int64s `json:"allowedIntValues,omitempty"`
1522
1523
1524
1525
1526 AllowedStringValues []string `json:"allowedStringValues,omitempty"`
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552 AppliesTo []string `json:"appliesTo,omitempty"`
1553
1554
1555 InBeta bool `json:"inBeta,omitempty"`
1556
1557
1558 Kind string `json:"kind,omitempty"`
1559
1560
1561 MaxValue int64 `json:"maxValue,omitempty,string"`
1562
1563
1564 MinValue int64 `json:"minValue,omitempty,string"`
1565
1566
1567
1568
1569 Name string `json:"name,omitempty"`
1570
1571
1572
1573
1574 RequiresRestart bool `json:"requiresRestart,omitempty"`
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596 Type string `json:"type,omitempty"`
1597
1598
1599
1600
1601
1602
1603
1604 ForceSendFields []string `json:"-"`
1605
1606
1607
1608
1609
1610
1611
1612
1613 NullFields []string `json:"-"`
1614 }
1615
1616 func (s *Flag) MarshalJSON() ([]byte, error) {
1617 type NoMethod Flag
1618 raw := NoMethod(*s)
1619 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1620 }
1621
1622
1623 type FlagsListResponse struct {
1624
1625 Items []*Flag `json:"items,omitempty"`
1626
1627
1628 Kind string `json:"kind,omitempty"`
1629
1630
1631
1632 googleapi.ServerResponse `json:"-"`
1633
1634
1635
1636
1637
1638
1639
1640 ForceSendFields []string `json:"-"`
1641
1642
1643
1644
1645
1646
1647
1648 NullFields []string `json:"-"`
1649 }
1650
1651 func (s *FlagsListResponse) MarshalJSON() ([]byte, error) {
1652 type NoMethod FlagsListResponse
1653 raw := NoMethod(*s)
1654 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1655 }
1656
1657
1658 type ImportContext struct {
1659
1660 BakImportOptions *ImportContextBakImportOptions `json:"bakImportOptions,omitempty"`
1661
1662
1663 CsvImportOptions *ImportContextCsvImportOptions `json:"csvImportOptions,omitempty"`
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674 Database string `json:"database,omitempty"`
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686 FileType string `json:"fileType,omitempty"`
1687
1688
1689
1690 ImportUser string `json:"importUser,omitempty"`
1691
1692
1693 Kind string `json:"kind,omitempty"`
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703 Uri string `json:"uri,omitempty"`
1704
1705
1706
1707
1708
1709
1710
1711 ForceSendFields []string `json:"-"`
1712
1713
1714
1715
1716
1717
1718
1719
1720 NullFields []string `json:"-"`
1721 }
1722
1723 func (s *ImportContext) MarshalJSON() ([]byte, error) {
1724 type NoMethod ImportContext
1725 raw := NoMethod(*s)
1726 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1727 }
1728
1729
1730
1731 type ImportContextBakImportOptions struct {
1732 EncryptionOptions *ImportContextBakImportOptionsEncryptionOptions `json:"encryptionOptions,omitempty"`
1733
1734
1735
1736
1737
1738
1739
1740 ForceSendFields []string `json:"-"`
1741
1742
1743
1744
1745
1746
1747
1748
1749 NullFields []string `json:"-"`
1750 }
1751
1752 func (s *ImportContextBakImportOptions) MarshalJSON() ([]byte, error) {
1753 type NoMethod ImportContextBakImportOptions
1754 raw := NoMethod(*s)
1755 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1756 }
1757
1758 type ImportContextBakImportOptionsEncryptionOptions struct {
1759
1760
1761
1762
1763 CertPath string `json:"certPath,omitempty"`
1764
1765
1766 PvkPassword string `json:"pvkPassword,omitempty"`
1767
1768
1769
1770
1771
1772
1773 PvkPath string `json:"pvkPath,omitempty"`
1774
1775
1776
1777
1778
1779
1780
1781 ForceSendFields []string `json:"-"`
1782
1783
1784
1785
1786
1787
1788
1789 NullFields []string `json:"-"`
1790 }
1791
1792 func (s *ImportContextBakImportOptionsEncryptionOptions) MarshalJSON() ([]byte, error) {
1793 type NoMethod ImportContextBakImportOptionsEncryptionOptions
1794 raw := NoMethod(*s)
1795 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1796 }
1797
1798
1799 type ImportContextCsvImportOptions struct {
1800
1801
1802
1803 Columns []string `json:"columns,omitempty"`
1804
1805
1806 Table string `json:"table,omitempty"`
1807
1808
1809
1810
1811
1812
1813
1814 ForceSendFields []string `json:"-"`
1815
1816
1817
1818
1819
1820
1821
1822 NullFields []string `json:"-"`
1823 }
1824
1825 func (s *ImportContextCsvImportOptions) MarshalJSON() ([]byte, error) {
1826 type NoMethod ImportContextCsvImportOptions
1827 raw := NoMethod(*s)
1828 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1829 }
1830
1831
1832 type InstancesCloneRequest struct {
1833
1834 CloneContext *CloneContext `json:"cloneContext,omitempty"`
1835
1836
1837
1838
1839
1840
1841
1842 ForceSendFields []string `json:"-"`
1843
1844
1845
1846
1847
1848
1849
1850 NullFields []string `json:"-"`
1851 }
1852
1853 func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error) {
1854 type NoMethod InstancesCloneRequest
1855 raw := NoMethod(*s)
1856 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1857 }
1858
1859
1860 type InstancesDemoteMasterRequest struct {
1861
1862
1863 DemoteMasterContext *DemoteMasterContext `json:"demoteMasterContext,omitempty"`
1864
1865
1866
1867
1868
1869
1870
1871 ForceSendFields []string `json:"-"`
1872
1873
1874
1875
1876
1877
1878
1879
1880 NullFields []string `json:"-"`
1881 }
1882
1883 func (s *InstancesDemoteMasterRequest) MarshalJSON() ([]byte, error) {
1884 type NoMethod InstancesDemoteMasterRequest
1885 raw := NoMethod(*s)
1886 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1887 }
1888
1889
1890 type InstancesExportRequest struct {
1891
1892 ExportContext *ExportContext `json:"exportContext,omitempty"`
1893
1894
1895
1896
1897
1898
1899
1900 ForceSendFields []string `json:"-"`
1901
1902
1903
1904
1905
1906
1907
1908 NullFields []string `json:"-"`
1909 }
1910
1911 func (s *InstancesExportRequest) MarshalJSON() ([]byte, error) {
1912 type NoMethod InstancesExportRequest
1913 raw := NoMethod(*s)
1914 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1915 }
1916
1917
1918 type InstancesFailoverRequest struct {
1919
1920 FailoverContext *FailoverContext `json:"failoverContext,omitempty"`
1921
1922
1923
1924
1925
1926
1927
1928 ForceSendFields []string `json:"-"`
1929
1930
1931
1932
1933
1934
1935
1936
1937 NullFields []string `json:"-"`
1938 }
1939
1940 func (s *InstancesFailoverRequest) MarshalJSON() ([]byte, error) {
1941 type NoMethod InstancesFailoverRequest
1942 raw := NoMethod(*s)
1943 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1944 }
1945
1946
1947 type InstancesImportRequest struct {
1948
1949 ImportContext *ImportContext `json:"importContext,omitempty"`
1950
1951
1952
1953
1954
1955
1956
1957 ForceSendFields []string `json:"-"`
1958
1959
1960
1961
1962
1963
1964
1965 NullFields []string `json:"-"`
1966 }
1967
1968 func (s *InstancesImportRequest) MarshalJSON() ([]byte, error) {
1969 type NoMethod InstancesImportRequest
1970 raw := NoMethod(*s)
1971 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1972 }
1973
1974
1975 type InstancesListResponse struct {
1976
1977 Items []*DatabaseInstance `json:"items,omitempty"`
1978
1979
1980 Kind string `json:"kind,omitempty"`
1981
1982
1983
1984
1985
1986 NextPageToken string `json:"nextPageToken,omitempty"`
1987
1988
1989 Warnings []*ApiWarning `json:"warnings,omitempty"`
1990
1991
1992
1993 googleapi.ServerResponse `json:"-"`
1994
1995
1996
1997
1998
1999
2000
2001 ForceSendFields []string `json:"-"`
2002
2003
2004
2005
2006
2007
2008
2009 NullFields []string `json:"-"`
2010 }
2011
2012 func (s *InstancesListResponse) MarshalJSON() ([]byte, error) {
2013 type NoMethod InstancesListResponse
2014 raw := NoMethod(*s)
2015 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2016 }
2017
2018
2019 type InstancesListServerCasResponse struct {
2020 ActiveVersion string `json:"activeVersion,omitempty"`
2021
2022
2023 Certs []*SslCert `json:"certs,omitempty"`
2024
2025
2026 Kind string `json:"kind,omitempty"`
2027
2028
2029
2030 googleapi.ServerResponse `json:"-"`
2031
2032
2033
2034
2035
2036
2037
2038 ForceSendFields []string `json:"-"`
2039
2040
2041
2042
2043
2044
2045
2046 NullFields []string `json:"-"`
2047 }
2048
2049 func (s *InstancesListServerCasResponse) MarshalJSON() ([]byte, error) {
2050 type NoMethod InstancesListServerCasResponse
2051 raw := NoMethod(*s)
2052 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2053 }
2054
2055
2056
2057 type InstancesRestoreBackupRequest struct {
2058
2059
2060 RestoreBackupContext *RestoreBackupContext `json:"restoreBackupContext,omitempty"`
2061
2062
2063
2064
2065
2066
2067
2068
2069 ForceSendFields []string `json:"-"`
2070
2071
2072
2073
2074
2075
2076
2077
2078 NullFields []string `json:"-"`
2079 }
2080
2081 func (s *InstancesRestoreBackupRequest) MarshalJSON() ([]byte, error) {
2082 type NoMethod InstancesRestoreBackupRequest
2083 raw := NoMethod(*s)
2084 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2085 }
2086
2087
2088 type InstancesRotateServerCaRequest struct {
2089
2090
2091 RotateServerCaContext *RotateServerCaContext `json:"rotateServerCaContext,omitempty"`
2092
2093
2094
2095
2096
2097
2098
2099
2100 ForceSendFields []string `json:"-"`
2101
2102
2103
2104
2105
2106
2107
2108
2109 NullFields []string `json:"-"`
2110 }
2111
2112 func (s *InstancesRotateServerCaRequest) MarshalJSON() ([]byte, error) {
2113 type NoMethod InstancesRotateServerCaRequest
2114 raw := NoMethod(*s)
2115 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2116 }
2117
2118
2119 type InstancesTruncateLogRequest struct {
2120
2121
2122 TruncateLogContext *TruncateLogContext `json:"truncateLogContext,omitempty"`
2123
2124
2125
2126
2127
2128
2129
2130 ForceSendFields []string `json:"-"`
2131
2132
2133
2134
2135
2136
2137
2138
2139 NullFields []string `json:"-"`
2140 }
2141
2142 func (s *InstancesTruncateLogRequest) MarshalJSON() ([]byte, error) {
2143 type NoMethod InstancesTruncateLogRequest
2144 raw := NoMethod(*s)
2145 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2146 }
2147
2148
2149 type IpConfiguration struct {
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159 AuthorizedNetworks []*AclEntry `json:"authorizedNetworks,omitempty"`
2160
2161
2162
2163 Ipv4Enabled bool `json:"ipv4Enabled,omitempty"`
2164
2165
2166
2167
2168
2169
2170
2171
2172 PrivateNetwork string `json:"privateNetwork,omitempty"`
2173
2174
2175
2176 RequireSsl bool `json:"requireSsl,omitempty"`
2177
2178
2179
2180
2181
2182
2183
2184 ForceSendFields []string `json:"-"`
2185
2186
2187
2188
2189
2190
2191
2192
2193 NullFields []string `json:"-"`
2194 }
2195
2196 func (s *IpConfiguration) MarshalJSON() ([]byte, error) {
2197 type NoMethod IpConfiguration
2198 raw := NoMethod(*s)
2199 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2200 }
2201
2202
2203 type IpMapping struct {
2204
2205 IpAddress string `json:"ipAddress,omitempty"`
2206
2207
2208
2209
2210
2211
2212
2213
2214 TimeToRetire string `json:"timeToRetire,omitempty"`
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244 Type string `json:"type,omitempty"`
2245
2246
2247
2248
2249
2250
2251
2252 ForceSendFields []string `json:"-"`
2253
2254
2255
2256
2257
2258
2259
2260 NullFields []string `json:"-"`
2261 }
2262
2263 func (s *IpMapping) MarshalJSON() ([]byte, error) {
2264 type NoMethod IpMapping
2265 raw := NoMethod(*s)
2266 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2267 }
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278 type LocationPreference struct {
2279
2280
2281
2282 FollowGaeApplication string `json:"followGaeApplication,omitempty"`
2283
2284
2285 Kind string `json:"kind,omitempty"`
2286
2287
2288
2289
2290 Zone string `json:"zone,omitempty"`
2291
2292
2293
2294
2295
2296
2297
2298
2299 ForceSendFields []string `json:"-"`
2300
2301
2302
2303
2304
2305
2306
2307
2308 NullFields []string `json:"-"`
2309 }
2310
2311 func (s *LocationPreference) MarshalJSON() ([]byte, error) {
2312 type NoMethod LocationPreference
2313 raw := NoMethod(*s)
2314 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2315 }
2316
2317
2318
2319
2320 type MaintenanceWindow struct {
2321
2322 Day int64 `json:"day,omitempty"`
2323
2324
2325 Hour int64 `json:"hour,omitempty"`
2326
2327
2328 Kind string `json:"kind,omitempty"`
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351 UpdateTrack string `json:"updateTrack,omitempty"`
2352
2353
2354
2355
2356
2357
2358
2359 ForceSendFields []string `json:"-"`
2360
2361
2362
2363
2364
2365
2366
2367 NullFields []string `json:"-"`
2368 }
2369
2370 func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
2371 type NoMethod MaintenanceWindow
2372 raw := NoMethod(*s)
2373 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2374 }
2375
2376
2377
2378 type MySqlReplicaConfiguration struct {
2379
2380
2381 CaCertificate string `json:"caCertificate,omitempty"`
2382
2383
2384
2385 ClientCertificate string `json:"clientCertificate,omitempty"`
2386
2387
2388
2389
2390 ClientKey string `json:"clientKey,omitempty"`
2391
2392
2393
2394 ConnectRetryInterval int64 `json:"connectRetryInterval,omitempty"`
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407 DumpFilePath string `json:"dumpFilePath,omitempty"`
2408
2409
2410 Kind string `json:"kind,omitempty"`
2411
2412
2413
2414 MasterHeartbeatPeriod int64 `json:"masterHeartbeatPeriod,omitempty,string"`
2415
2416
2417 Password string `json:"password,omitempty"`
2418
2419
2420 SslCipher string `json:"sslCipher,omitempty"`
2421
2422
2423 Username string `json:"username,omitempty"`
2424
2425
2426
2427
2428 VerifyServerCertificate bool `json:"verifyServerCertificate,omitempty"`
2429
2430
2431
2432
2433
2434
2435
2436 ForceSendFields []string `json:"-"`
2437
2438
2439
2440
2441
2442
2443
2444 NullFields []string `json:"-"`
2445 }
2446
2447 func (s *MySqlReplicaConfiguration) MarshalJSON() ([]byte, error) {
2448 type NoMethod MySqlReplicaConfiguration
2449 raw := NoMethod(*s)
2450 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2451 }
2452
2453
2454 type OnPremisesConfiguration struct {
2455
2456
2457 CaCertificate string `json:"caCertificate,omitempty"`
2458
2459
2460
2461 ClientCertificate string `json:"clientCertificate,omitempty"`
2462
2463
2464
2465
2466 ClientKey string `json:"clientKey,omitempty"`
2467
2468
2469 DumpFilePath string `json:"dumpFilePath,omitempty"`
2470
2471
2472
2473 HostPort string `json:"hostPort,omitempty"`
2474
2475
2476 Kind string `json:"kind,omitempty"`
2477
2478
2479 Password string `json:"password,omitempty"`
2480
2481
2482 Username string `json:"username,omitempty"`
2483
2484
2485
2486
2487
2488
2489
2490 ForceSendFields []string `json:"-"`
2491
2492
2493
2494
2495
2496
2497
2498 NullFields []string `json:"-"`
2499 }
2500
2501 func (s *OnPremisesConfiguration) MarshalJSON() ([]byte, error) {
2502 type NoMethod OnPremisesConfiguration
2503 raw := NoMethod(*s)
2504 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2505 }
2506
2507
2508
2509
2510
2511
2512 type Operation struct {
2513
2514
2515
2516
2517
2518 EndTime string `json:"endTime,omitempty"`
2519
2520
2521
2522
2523 Error *OperationErrors `json:"error,omitempty"`
2524
2525
2526 ExportContext *ExportContext `json:"exportContext,omitempty"`
2527
2528
2529 ImportContext *ImportContext `json:"importContext,omitempty"`
2530
2531
2532
2533
2534
2535
2536 InsertTime string `json:"insertTime,omitempty"`
2537
2538
2539 Kind string `json:"kind,omitempty"`
2540
2541
2542
2543
2544
2545
2546 Name string `json:"name,omitempty"`
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608 OperationType string `json:"operationType,omitempty"`
2609
2610
2611 SelfLink string `json:"selfLink,omitempty"`
2612
2613
2614
2615
2616
2617
2618 StartTime string `json:"startTime,omitempty"`
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632 Status string `json:"status,omitempty"`
2633
2634
2635 TargetId string `json:"targetId,omitempty"`
2636
2637 TargetLink string `json:"targetLink,omitempty"`
2638
2639
2640
2641 TargetProject string `json:"targetProject,omitempty"`
2642
2643
2644 User string `json:"user,omitempty"`
2645
2646
2647
2648 googleapi.ServerResponse `json:"-"`
2649
2650
2651
2652
2653
2654
2655
2656 ForceSendFields []string `json:"-"`
2657
2658
2659
2660
2661
2662
2663
2664 NullFields []string `json:"-"`
2665 }
2666
2667 func (s *Operation) MarshalJSON() ([]byte, error) {
2668 type NoMethod Operation
2669 raw := NoMethod(*s)
2670 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2671 }
2672
2673
2674 type OperationError struct {
2675
2676 Code string `json:"code,omitempty"`
2677
2678
2679 Kind string `json:"kind,omitempty"`
2680
2681
2682 Message string `json:"message,omitempty"`
2683
2684
2685
2686
2687
2688
2689
2690 ForceSendFields []string `json:"-"`
2691
2692
2693
2694
2695
2696
2697
2698 NullFields []string `json:"-"`
2699 }
2700
2701 func (s *OperationError) MarshalJSON() ([]byte, error) {
2702 type NoMethod OperationError
2703 raw := NoMethod(*s)
2704 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2705 }
2706
2707
2708 type OperationErrors struct {
2709
2710
2711 Errors []*OperationError `json:"errors,omitempty"`
2712
2713
2714 Kind string `json:"kind,omitempty"`
2715
2716
2717
2718
2719
2720
2721
2722 ForceSendFields []string `json:"-"`
2723
2724
2725
2726
2727
2728
2729
2730 NullFields []string `json:"-"`
2731 }
2732
2733 func (s *OperationErrors) MarshalJSON() ([]byte, error) {
2734 type NoMethod OperationErrors
2735 raw := NoMethod(*s)
2736 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2737 }
2738
2739
2740 type OperationsListResponse struct {
2741
2742 Items []*Operation `json:"items,omitempty"`
2743
2744
2745 Kind string `json:"kind,omitempty"`
2746
2747
2748
2749
2750
2751 NextPageToken string `json:"nextPageToken,omitempty"`
2752
2753
2754
2755 googleapi.ServerResponse `json:"-"`
2756
2757
2758
2759
2760
2761
2762
2763 ForceSendFields []string `json:"-"`
2764
2765
2766
2767
2768
2769
2770
2771 NullFields []string `json:"-"`
2772 }
2773
2774 func (s *OperationsListResponse) MarshalJSON() ([]byte, error) {
2775 type NoMethod OperationsListResponse
2776 raw := NoMethod(*s)
2777 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2778 }
2779
2780
2781
2782 type ReplicaConfiguration struct {
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794 FailoverTarget bool `json:"failoverTarget,omitempty"`
2795
2796
2797 Kind string `json:"kind,omitempty"`
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810 MysqlReplicaConfiguration *MySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"`
2811
2812
2813
2814
2815
2816
2817
2818 ForceSendFields []string `json:"-"`
2819
2820
2821
2822
2823
2824
2825
2826
2827 NullFields []string `json:"-"`
2828 }
2829
2830 func (s *ReplicaConfiguration) MarshalJSON() ([]byte, error) {
2831 type NoMethod ReplicaConfiguration
2832 raw := NoMethod(*s)
2833 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2834 }
2835
2836 type Reschedule struct {
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848 RescheduleType string `json:"rescheduleType,omitempty"`
2849
2850
2851
2852
2853
2854
2855
2856
2857 ScheduleTime string `json:"scheduleTime,omitempty"`
2858
2859
2860
2861
2862
2863
2864
2865 ForceSendFields []string `json:"-"`
2866
2867
2868
2869
2870
2871
2872
2873
2874 NullFields []string `json:"-"`
2875 }
2876
2877 func (s *Reschedule) MarshalJSON() ([]byte, error) {
2878 type NoMethod Reschedule
2879 raw := NoMethod(*s)
2880 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2881 }
2882
2883
2884
2885
2886 type RestoreBackupContext struct {
2887
2888 BackupRunId int64 `json:"backupRunId,omitempty,string"`
2889
2890
2891 InstanceId string `json:"instanceId,omitempty"`
2892
2893
2894 Kind string `json:"kind,omitempty"`
2895
2896
2897 Project string `json:"project,omitempty"`
2898
2899
2900
2901
2902
2903
2904
2905 ForceSendFields []string `json:"-"`
2906
2907
2908
2909
2910
2911
2912
2913 NullFields []string `json:"-"`
2914 }
2915
2916 func (s *RestoreBackupContext) MarshalJSON() ([]byte, error) {
2917 type NoMethod RestoreBackupContext
2918 raw := NoMethod(*s)
2919 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2920 }
2921
2922
2923 type RotateServerCaContext struct {
2924
2925 Kind string `json:"kind,omitempty"`
2926
2927
2928
2929
2930 NextVersion string `json:"nextVersion,omitempty"`
2931
2932
2933
2934
2935
2936
2937
2938 ForceSendFields []string `json:"-"`
2939
2940
2941
2942
2943
2944
2945
2946 NullFields []string `json:"-"`
2947 }
2948
2949 func (s *RotateServerCaContext) MarshalJSON() ([]byte, error) {
2950 type NoMethod RotateServerCaContext
2951 raw := NoMethod(*s)
2952 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2953 }
2954
2955
2956 type Settings struct {
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982 ActivationPolicy string `json:"activationPolicy,omitempty"`
2983
2984
2985
2986
2987 AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"`
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008 AvailabilityType string `json:"availabilityType,omitempty"`
3009
3010
3011 BackupConfiguration *BackupConfiguration `json:"backupConfiguration,omitempty"`
3012
3013
3014
3015
3016
3017
3018 CrashSafeReplicationEnabled bool `json:"crashSafeReplicationEnabled,omitempty"`
3019
3020
3021
3022
3023 DataDiskSizeGb int64 `json:"dataDiskSizeGb,omitempty,string"`
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037 DataDiskType string `json:"dataDiskType,omitempty"`
3038
3039
3040 DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"`
3041
3042
3043
3044
3045 DatabaseReplicationEnabled bool `json:"databaseReplicationEnabled,omitempty"`
3046
3047
3048
3049
3050
3051
3052 IpConfiguration *IpConfiguration `json:"ipConfiguration,omitempty"`
3053
3054
3055 Kind string `json:"kind,omitempty"`
3056
3057
3058
3059
3060
3061
3062
3063
3064 LocationPreference *LocationPreference `json:"locationPreference,omitempty"`
3065
3066
3067
3068
3069
3070
3071 MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084 PricingPlan string `json:"pricingPlan,omitempty"`
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105 ReplicationType string `json:"replicationType,omitempty"`
3106
3107
3108
3109
3110
3111
3112
3113
3114 SettingsVersion int64 `json:"settingsVersion,omitempty,string"`
3115
3116
3117
3118
3119 StorageAutoResize bool `json:"storageAutoResize,omitempty"`
3120
3121
3122
3123
3124
3125
3126 StorageAutoResizeLimit int64 `json:"storageAutoResizeLimit,omitempty,string"`
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139 Tier string `json:"tier,omitempty"`
3140
3141
3142
3143
3144 UserLabels map[string]string `json:"userLabels,omitempty"`
3145
3146
3147
3148
3149
3150
3151
3152 ForceSendFields []string `json:"-"`
3153
3154
3155
3156
3157
3158
3159
3160
3161 NullFields []string `json:"-"`
3162 }
3163
3164 func (s *Settings) MarshalJSON() ([]byte, error) {
3165 type NoMethod Settings
3166 raw := NoMethod(*s)
3167 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3168 }
3169
3170
3171 type SqlExternalSyncSettingError struct {
3172
3173 Detail string `json:"detail,omitempty"`
3174
3175
3176 Kind string `json:"kind,omitempty"`
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192 Type string `json:"type,omitempty"`
3193
3194
3195
3196
3197
3198
3199
3200 ForceSendFields []string `json:"-"`
3201
3202
3203
3204
3205
3206
3207
3208 NullFields []string `json:"-"`
3209 }
3210
3211 func (s *SqlExternalSyncSettingError) MarshalJSON() ([]byte, error) {
3212 type NoMethod SqlExternalSyncSettingError
3213 raw := NoMethod(*s)
3214 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3215 }
3216
3217
3218
3219 type SqlInstancesRescheduleMaintenanceRequestBody struct {
3220
3221 Reschedule *Reschedule `json:"reschedule,omitempty"`
3222
3223
3224
3225
3226
3227
3228
3229 ForceSendFields []string `json:"-"`
3230
3231
3232
3233
3234
3235
3236
3237 NullFields []string `json:"-"`
3238 }
3239
3240 func (s *SqlInstancesRescheduleMaintenanceRequestBody) MarshalJSON() ([]byte, error) {
3241 type NoMethod SqlInstancesRescheduleMaintenanceRequestBody
3242 raw := NoMethod(*s)
3243 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3244 }
3245
3246
3247
3248 type SqlInstancesVerifyExternalSyncSettingsResponse struct {
3249
3250 Errors []*SqlExternalSyncSettingError `json:"errors,omitempty"`
3251
3252
3253 Kind string `json:"kind,omitempty"`
3254
3255
3256
3257 googleapi.ServerResponse `json:"-"`
3258
3259
3260
3261
3262
3263
3264
3265 ForceSendFields []string `json:"-"`
3266
3267
3268
3269
3270
3271
3272
3273 NullFields []string `json:"-"`
3274 }
3275
3276 func (s *SqlInstancesVerifyExternalSyncSettingsResponse) MarshalJSON() ([]byte, error) {
3277 type NoMethod SqlInstancesVerifyExternalSyncSettingsResponse
3278 raw := NoMethod(*s)
3279 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3280 }
3281
3282
3283
3284 type SqlScheduledMaintenance struct {
3285 CanDefer bool `json:"canDefer,omitempty"`
3286
3287
3288 CanReschedule bool `json:"canReschedule,omitempty"`
3289
3290
3291
3292 StartTime string `json:"startTime,omitempty"`
3293
3294
3295
3296
3297
3298
3299
3300 ForceSendFields []string `json:"-"`
3301
3302
3303
3304
3305
3306
3307
3308 NullFields []string `json:"-"`
3309 }
3310
3311 func (s *SqlScheduledMaintenance) MarshalJSON() ([]byte, error) {
3312 type NoMethod SqlScheduledMaintenance
3313 raw := NoMethod(*s)
3314 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3315 }
3316
3317
3318
3319 type SqlServerDatabaseDetails struct {
3320
3321
3322 CompatibilityLevel int64 `json:"compatibilityLevel,omitempty"`
3323
3324
3325 RecoveryModel string `json:"recoveryModel,omitempty"`
3326
3327
3328
3329
3330
3331
3332
3333 ForceSendFields []string `json:"-"`
3334
3335
3336
3337
3338
3339
3340
3341
3342 NullFields []string `json:"-"`
3343 }
3344
3345 func (s *SqlServerDatabaseDetails) MarshalJSON() ([]byte, error) {
3346 type NoMethod SqlServerDatabaseDetails
3347 raw := NoMethod(*s)
3348 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3349 }
3350
3351
3352
3353 type SqlServerUserDetails struct {
3354
3355 Disabled bool `json:"disabled,omitempty"`
3356
3357
3358 ServerRoles []string `json:"serverRoles,omitempty"`
3359
3360
3361
3362
3363
3364
3365
3366 ForceSendFields []string `json:"-"`
3367
3368
3369
3370
3371
3372
3373
3374 NullFields []string `json:"-"`
3375 }
3376
3377 func (s *SqlServerUserDetails) MarshalJSON() ([]byte, error) {
3378 type NoMethod SqlServerUserDetails
3379 raw := NoMethod(*s)
3380 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3381 }
3382
3383
3384 type SslCert struct {
3385
3386 Cert string `json:"cert,omitempty"`
3387
3388
3389 CertSerialNumber string `json:"certSerialNumber,omitempty"`
3390
3391
3392 CommonName string `json:"commonName,omitempty"`
3393
3394
3395
3396
3397
3398
3399 CreateTime string `json:"createTime,omitempty"`
3400
3401
3402
3403
3404
3405
3406 ExpirationTime string `json:"expirationTime,omitempty"`
3407
3408
3409 Instance string `json:"instance,omitempty"`
3410
3411
3412 Kind string `json:"kind,omitempty"`
3413
3414
3415 SelfLink string `json:"selfLink,omitempty"`
3416
3417
3418 Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"`
3419
3420
3421
3422 googleapi.ServerResponse `json:"-"`
3423
3424
3425
3426
3427
3428
3429
3430 ForceSendFields []string `json:"-"`
3431
3432
3433
3434
3435
3436
3437
3438 NullFields []string `json:"-"`
3439 }
3440
3441 func (s *SslCert) MarshalJSON() ([]byte, error) {
3442 type NoMethod SslCert
3443 raw := NoMethod(*s)
3444 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3445 }
3446
3447
3448 type SslCertDetail struct {
3449
3450 CertInfo *SslCert `json:"certInfo,omitempty"`
3451
3452
3453
3454
3455 CertPrivateKey string `json:"certPrivateKey,omitempty"`
3456
3457
3458
3459
3460
3461
3462
3463 ForceSendFields []string `json:"-"`
3464
3465
3466
3467
3468
3469
3470
3471 NullFields []string `json:"-"`
3472 }
3473
3474 func (s *SslCertDetail) MarshalJSON() ([]byte, error) {
3475 type NoMethod SslCertDetail
3476 raw := NoMethod(*s)
3477 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3478 }
3479
3480
3481
3482 type SslCertsCreateEphemeralRequest struct {
3483
3484
3485 PublicKey string `json:"public_key,omitempty"`
3486
3487
3488
3489
3490
3491
3492
3493 ForceSendFields []string `json:"-"`
3494
3495
3496
3497
3498
3499
3500
3501 NullFields []string `json:"-"`
3502 }
3503
3504 func (s *SslCertsCreateEphemeralRequest) MarshalJSON() ([]byte, error) {
3505 type NoMethod SslCertsCreateEphemeralRequest
3506 raw := NoMethod(*s)
3507 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3508 }
3509
3510
3511 type SslCertsInsertRequest struct {
3512
3513
3514
3515 CommonName string `json:"commonName,omitempty"`
3516
3517
3518
3519
3520
3521
3522
3523 ForceSendFields []string `json:"-"`
3524
3525
3526
3527
3528
3529
3530
3531 NullFields []string `json:"-"`
3532 }
3533
3534 func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error) {
3535 type NoMethod SslCertsInsertRequest
3536 raw := NoMethod(*s)
3537 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3538 }
3539
3540
3541 type SslCertsInsertResponse struct {
3542
3543
3544
3545
3546
3547 ClientCert *SslCertDetail `json:"clientCert,omitempty"`
3548
3549
3550 Kind string `json:"kind,omitempty"`
3551
3552
3553 Operation *Operation `json:"operation,omitempty"`
3554
3555
3556
3557
3558
3559
3560 ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
3561
3562
3563
3564 googleapi.ServerResponse `json:"-"`
3565
3566
3567
3568
3569
3570
3571
3572 ForceSendFields []string `json:"-"`
3573
3574
3575
3576
3577
3578
3579
3580 NullFields []string `json:"-"`
3581 }
3582
3583 func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error) {
3584 type NoMethod SslCertsInsertResponse
3585 raw := NoMethod(*s)
3586 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3587 }
3588
3589
3590 type SslCertsListResponse struct {
3591
3592 Items []*SslCert `json:"items,omitempty"`
3593
3594
3595 Kind string `json:"kind,omitempty"`
3596
3597
3598
3599 googleapi.ServerResponse `json:"-"`
3600
3601
3602
3603
3604
3605
3606
3607 ForceSendFields []string `json:"-"`
3608
3609
3610
3611
3612
3613
3614
3615 NullFields []string `json:"-"`
3616 }
3617
3618 func (s *SslCertsListResponse) MarshalJSON() ([]byte, error) {
3619 type NoMethod SslCertsListResponse
3620 raw := NoMethod(*s)
3621 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3622 }
3623
3624
3625 type Tier struct {
3626
3627 DiskQuota int64 `json:"DiskQuota,omitempty,string"`
3628
3629
3630 RAM int64 `json:"RAM,omitempty,string"`
3631
3632
3633 Kind string `json:"kind,omitempty"`
3634
3635
3636 Region []string `json:"region,omitempty"`
3637
3638
3639
3640
3641 Tier string `json:"tier,omitempty"`
3642
3643
3644
3645
3646
3647
3648
3649 ForceSendFields []string `json:"-"`
3650
3651
3652
3653
3654
3655
3656
3657 NullFields []string `json:"-"`
3658 }
3659
3660 func (s *Tier) MarshalJSON() ([]byte, error) {
3661 type NoMethod Tier
3662 raw := NoMethod(*s)
3663 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3664 }
3665
3666
3667 type TiersListResponse struct {
3668
3669 Items []*Tier `json:"items,omitempty"`
3670
3671
3672 Kind string `json:"kind,omitempty"`
3673
3674
3675
3676 googleapi.ServerResponse `json:"-"`
3677
3678
3679
3680
3681
3682
3683
3684 ForceSendFields []string `json:"-"`
3685
3686
3687
3688
3689
3690
3691
3692 NullFields []string `json:"-"`
3693 }
3694
3695 func (s *TiersListResponse) MarshalJSON() ([]byte, error) {
3696 type NoMethod TiersListResponse
3697 raw := NoMethod(*s)
3698 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3699 }
3700
3701
3702 type TruncateLogContext struct {
3703
3704 Kind string `json:"kind,omitempty"`
3705
3706
3707
3708
3709 LogType string `json:"logType,omitempty"`
3710
3711
3712
3713
3714
3715
3716
3717 ForceSendFields []string `json:"-"`
3718
3719
3720
3721
3722
3723
3724
3725 NullFields []string `json:"-"`
3726 }
3727
3728 func (s *TruncateLogContext) MarshalJSON() ([]byte, error) {
3729 type NoMethod TruncateLogContext
3730 raw := NoMethod(*s)
3731 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3732 }
3733
3734
3735 type User struct {
3736
3737
3738
3739 Etag string `json:"etag,omitempty"`
3740
3741
3742
3743
3744
3745
3746
3747
3748 Host string `json:"host,omitempty"`
3749
3750
3751
3752
3753
3754
3755 Instance string `json:"instance,omitempty"`
3756
3757
3758 Kind string `json:"kind,omitempty"`
3759
3760
3761
3762
3763 Name string `json:"name,omitempty"`
3764
3765
3766 Password string `json:"password,omitempty"`
3767
3768
3769
3770
3771
3772
3773 Project string `json:"project,omitempty"`
3774
3775 SqlserverUserDetails *SqlServerUserDetails `json:"sqlserverUserDetails,omitempty"`
3776
3777
3778
3779
3780
3781
3782
3783 ForceSendFields []string `json:"-"`
3784
3785
3786
3787
3788
3789
3790
3791 NullFields []string `json:"-"`
3792 }
3793
3794 func (s *User) MarshalJSON() ([]byte, error) {
3795 type NoMethod User
3796 raw := NoMethod(*s)
3797 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3798 }
3799
3800
3801 type UsersListResponse struct {
3802
3803 Items []*User `json:"items,omitempty"`
3804
3805
3806 Kind string `json:"kind,omitempty"`
3807
3808
3809
3810
3811
3812
3813 NextPageToken string `json:"nextPageToken,omitempty"`
3814
3815
3816
3817 googleapi.ServerResponse `json:"-"`
3818
3819
3820
3821
3822
3823
3824
3825 ForceSendFields []string `json:"-"`
3826
3827
3828
3829
3830
3831
3832
3833 NullFields []string `json:"-"`
3834 }
3835
3836 func (s *UsersListResponse) MarshalJSON() ([]byte, error) {
3837 type NoMethod UsersListResponse
3838 raw := NoMethod(*s)
3839 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3840 }
3841
3842
3843
3844 type BackupRunsDeleteCall struct {
3845 s *Service
3846 project string
3847 instance string
3848 id int64
3849 urlParams_ gensupport.URLParams
3850 ctx_ context.Context
3851 header_ http.Header
3852 }
3853
3854
3855 func (r *BackupRunsService) Delete(project string, instance string, id int64) *BackupRunsDeleteCall {
3856 c := &BackupRunsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3857 c.project = project
3858 c.instance = instance
3859 c.id = id
3860 return c
3861 }
3862
3863
3864
3865
3866 func (c *BackupRunsDeleteCall) Fields(s ...googleapi.Field) *BackupRunsDeleteCall {
3867 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3868 return c
3869 }
3870
3871
3872
3873
3874 func (c *BackupRunsDeleteCall) Context(ctx context.Context) *BackupRunsDeleteCall {
3875 c.ctx_ = ctx
3876 return c
3877 }
3878
3879
3880
3881 func (c *BackupRunsDeleteCall) Header() http.Header {
3882 if c.header_ == nil {
3883 c.header_ = make(http.Header)
3884 }
3885 return c.header_
3886 }
3887
3888 func (c *BackupRunsDeleteCall) doRequest(alt string) (*http.Response, error) {
3889 reqHeaders := make(http.Header)
3890 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
3891 for k, v := range c.header_ {
3892 reqHeaders[k] = v
3893 }
3894 reqHeaders.Set("User-Agent", c.s.userAgent())
3895 var body io.Reader = nil
3896 c.urlParams_.Set("alt", alt)
3897 c.urlParams_.Set("prettyPrint", "false")
3898 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}")
3899 urls += "?" + c.urlParams_.Encode()
3900 req, err := http.NewRequest("DELETE", urls, body)
3901 if err != nil {
3902 return nil, err
3903 }
3904 req.Header = reqHeaders
3905 googleapi.Expand(req.URL, map[string]string{
3906 "project": c.project,
3907 "instance": c.instance,
3908 "id": strconv.FormatInt(c.id, 10),
3909 })
3910 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3911 }
3912
3913
3914
3915
3916
3917
3918
3919
3920 func (c *BackupRunsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3921 gensupport.SetOptions(c.urlParams_, opts...)
3922 res, err := c.doRequest("json")
3923 if res != nil && res.StatusCode == http.StatusNotModified {
3924 if res.Body != nil {
3925 res.Body.Close()
3926 }
3927 return nil, &googleapi.Error{
3928 Code: res.StatusCode,
3929 Header: res.Header,
3930 }
3931 }
3932 if err != nil {
3933 return nil, err
3934 }
3935 defer googleapi.CloseBody(res)
3936 if err := googleapi.CheckResponse(res); err != nil {
3937 return nil, err
3938 }
3939 ret := &Operation{
3940 ServerResponse: googleapi.ServerResponse{
3941 Header: res.Header,
3942 HTTPStatusCode: res.StatusCode,
3943 },
3944 }
3945 target := &ret
3946 if err := gensupport.DecodeResponse(target, res); err != nil {
3947 return nil, err
3948 }
3949 return ret, nil
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991 }
3992
3993
3994
3995 type BackupRunsGetCall struct {
3996 s *Service
3997 project string
3998 instance string
3999 id int64
4000 urlParams_ gensupport.URLParams
4001 ifNoneMatch_ string
4002 ctx_ context.Context
4003 header_ http.Header
4004 }
4005
4006
4007 func (r *BackupRunsService) Get(project string, instance string, id int64) *BackupRunsGetCall {
4008 c := &BackupRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4009 c.project = project
4010 c.instance = instance
4011 c.id = id
4012 return c
4013 }
4014
4015
4016
4017
4018 func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall {
4019 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4020 return c
4021 }
4022
4023
4024
4025
4026
4027
4028 func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall {
4029 c.ifNoneMatch_ = entityTag
4030 return c
4031 }
4032
4033
4034
4035
4036 func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall {
4037 c.ctx_ = ctx
4038 return c
4039 }
4040
4041
4042
4043 func (c *BackupRunsGetCall) Header() http.Header {
4044 if c.header_ == nil {
4045 c.header_ = make(http.Header)
4046 }
4047 return c.header_
4048 }
4049
4050 func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) {
4051 reqHeaders := make(http.Header)
4052 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
4053 for k, v := range c.header_ {
4054 reqHeaders[k] = v
4055 }
4056 reqHeaders.Set("User-Agent", c.s.userAgent())
4057 if c.ifNoneMatch_ != "" {
4058 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4059 }
4060 var body io.Reader = nil
4061 c.urlParams_.Set("alt", alt)
4062 c.urlParams_.Set("prettyPrint", "false")
4063 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}")
4064 urls += "?" + c.urlParams_.Encode()
4065 req, err := http.NewRequest("GET", urls, body)
4066 if err != nil {
4067 return nil, err
4068 }
4069 req.Header = reqHeaders
4070 googleapi.Expand(req.URL, map[string]string{
4071 "project": c.project,
4072 "instance": c.instance,
4073 "id": strconv.FormatInt(c.id, 10),
4074 })
4075 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4076 }
4077
4078
4079
4080
4081
4082
4083
4084
4085 func (c *BackupRunsGetCall) Do(opts ...googleapi.CallOption) (*BackupRun, error) {
4086 gensupport.SetOptions(c.urlParams_, opts...)
4087 res, err := c.doRequest("json")
4088 if res != nil && res.StatusCode == http.StatusNotModified {
4089 if res.Body != nil {
4090 res.Body.Close()
4091 }
4092 return nil, &googleapi.Error{
4093 Code: res.StatusCode,
4094 Header: res.Header,
4095 }
4096 }
4097 if err != nil {
4098 return nil, err
4099 }
4100 defer googleapi.CloseBody(res)
4101 if err := googleapi.CheckResponse(res); err != nil {
4102 return nil, err
4103 }
4104 ret := &BackupRun{
4105 ServerResponse: googleapi.ServerResponse{
4106 Header: res.Header,
4107 HTTPStatusCode: res.StatusCode,
4108 },
4109 }
4110 target := &ret
4111 if err := gensupport.DecodeResponse(target, res); err != nil {
4112 return nil, err
4113 }
4114 return ret, nil
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156 }
4157
4158
4159
4160 type BackupRunsInsertCall struct {
4161 s *Service
4162 project string
4163 instance string
4164 backuprun *BackupRun
4165 urlParams_ gensupport.URLParams
4166 ctx_ context.Context
4167 header_ http.Header
4168 }
4169
4170
4171
4172
4173 func (r *BackupRunsService) Insert(project string, instance string, backuprun *BackupRun) *BackupRunsInsertCall {
4174 c := &BackupRunsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4175 c.project = project
4176 c.instance = instance
4177 c.backuprun = backuprun
4178 return c
4179 }
4180
4181
4182
4183
4184 func (c *BackupRunsInsertCall) Fields(s ...googleapi.Field) *BackupRunsInsertCall {
4185 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4186 return c
4187 }
4188
4189
4190
4191
4192 func (c *BackupRunsInsertCall) Context(ctx context.Context) *BackupRunsInsertCall {
4193 c.ctx_ = ctx
4194 return c
4195 }
4196
4197
4198
4199 func (c *BackupRunsInsertCall) Header() http.Header {
4200 if c.header_ == nil {
4201 c.header_ = make(http.Header)
4202 }
4203 return c.header_
4204 }
4205
4206 func (c *BackupRunsInsertCall) doRequest(alt string) (*http.Response, error) {
4207 reqHeaders := make(http.Header)
4208 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
4209 for k, v := range c.header_ {
4210 reqHeaders[k] = v
4211 }
4212 reqHeaders.Set("User-Agent", c.s.userAgent())
4213 var body io.Reader = nil
4214 body, err := googleapi.WithoutDataWrapper.JSONReader(c.backuprun)
4215 if err != nil {
4216 return nil, err
4217 }
4218 reqHeaders.Set("Content-Type", "application/json")
4219 c.urlParams_.Set("alt", alt)
4220 c.urlParams_.Set("prettyPrint", "false")
4221 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns")
4222 urls += "?" + c.urlParams_.Encode()
4223 req, err := http.NewRequest("POST", urls, body)
4224 if err != nil {
4225 return nil, err
4226 }
4227 req.Header = reqHeaders
4228 googleapi.Expand(req.URL, map[string]string{
4229 "project": c.project,
4230 "instance": c.instance,
4231 })
4232 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4233 }
4234
4235
4236
4237
4238
4239
4240
4241
4242 func (c *BackupRunsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4243 gensupport.SetOptions(c.urlParams_, opts...)
4244 res, err := c.doRequest("json")
4245 if res != nil && res.StatusCode == http.StatusNotModified {
4246 if res.Body != nil {
4247 res.Body.Close()
4248 }
4249 return nil, &googleapi.Error{
4250 Code: res.StatusCode,
4251 Header: res.Header,
4252 }
4253 }
4254 if err != nil {
4255 return nil, err
4256 }
4257 defer googleapi.CloseBody(res)
4258 if err := googleapi.CheckResponse(res); err != nil {
4259 return nil, err
4260 }
4261 ret := &Operation{
4262 ServerResponse: googleapi.ServerResponse{
4263 Header: res.Header,
4264 HTTPStatusCode: res.StatusCode,
4265 },
4266 }
4267 target := &ret
4268 if err := gensupport.DecodeResponse(target, res); err != nil {
4269 return nil, err
4270 }
4271 return ret, nil
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308 }
4309
4310
4311
4312 type BackupRunsListCall struct {
4313 s *Service
4314 project string
4315 instance string
4316 urlParams_ gensupport.URLParams
4317 ifNoneMatch_ string
4318 ctx_ context.Context
4319 header_ http.Header
4320 }
4321
4322
4323
4324
4325 func (r *BackupRunsService) List(project string, instance string) *BackupRunsListCall {
4326 c := &BackupRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4327 c.project = project
4328 c.instance = instance
4329 return c
4330 }
4331
4332
4333
4334 func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall {
4335 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4336 return c
4337 }
4338
4339
4340
4341
4342
4343 func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall {
4344 c.urlParams_.Set("pageToken", pageToken)
4345 return c
4346 }
4347
4348
4349
4350
4351 func (c *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall {
4352 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4353 return c
4354 }
4355
4356
4357
4358
4359
4360
4361 func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall {
4362 c.ifNoneMatch_ = entityTag
4363 return c
4364 }
4365
4366
4367
4368
4369 func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall {
4370 c.ctx_ = ctx
4371 return c
4372 }
4373
4374
4375
4376 func (c *BackupRunsListCall) Header() http.Header {
4377 if c.header_ == nil {
4378 c.header_ = make(http.Header)
4379 }
4380 return c.header_
4381 }
4382
4383 func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) {
4384 reqHeaders := make(http.Header)
4385 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
4386 for k, v := range c.header_ {
4387 reqHeaders[k] = v
4388 }
4389 reqHeaders.Set("User-Agent", c.s.userAgent())
4390 if c.ifNoneMatch_ != "" {
4391 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4392 }
4393 var body io.Reader = nil
4394 c.urlParams_.Set("alt", alt)
4395 c.urlParams_.Set("prettyPrint", "false")
4396 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns")
4397 urls += "?" + c.urlParams_.Encode()
4398 req, err := http.NewRequest("GET", urls, body)
4399 if err != nil {
4400 return nil, err
4401 }
4402 req.Header = reqHeaders
4403 googleapi.Expand(req.URL, map[string]string{
4404 "project": c.project,
4405 "instance": c.instance,
4406 })
4407 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4408 }
4409
4410
4411
4412
4413
4414
4415
4416
4417 func (c *BackupRunsListCall) Do(opts ...googleapi.CallOption) (*BackupRunsListResponse, error) {
4418 gensupport.SetOptions(c.urlParams_, opts...)
4419 res, err := c.doRequest("json")
4420 if res != nil && res.StatusCode == http.StatusNotModified {
4421 if res.Body != nil {
4422 res.Body.Close()
4423 }
4424 return nil, &googleapi.Error{
4425 Code: res.StatusCode,
4426 Header: res.Header,
4427 }
4428 }
4429 if err != nil {
4430 return nil, err
4431 }
4432 defer googleapi.CloseBody(res)
4433 if err := googleapi.CheckResponse(res); err != nil {
4434 return nil, err
4435 }
4436 ret := &BackupRunsListResponse{
4437 ServerResponse: googleapi.ServerResponse{
4438 Header: res.Header,
4439 HTTPStatusCode: res.StatusCode,
4440 },
4441 }
4442 target := &ret
4443 if err := gensupport.DecodeResponse(target, res); err != nil {
4444 return nil, err
4445 }
4446 return ret, nil
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491 }
4492
4493
4494
4495
4496 func (c *BackupRunsListCall) Pages(ctx context.Context, f func(*BackupRunsListResponse) error) error {
4497 c.ctx_ = ctx
4498 defer c.PageToken(c.urlParams_.Get("pageToken"))
4499 for {
4500 x, err := c.Do()
4501 if err != nil {
4502 return err
4503 }
4504 if err := f(x); err != nil {
4505 return err
4506 }
4507 if x.NextPageToken == "" {
4508 return nil
4509 }
4510 c.PageToken(x.NextPageToken)
4511 }
4512 }
4513
4514
4515
4516 type DatabasesDeleteCall struct {
4517 s *Service
4518 project string
4519 instance string
4520 database string
4521 urlParams_ gensupport.URLParams
4522 ctx_ context.Context
4523 header_ http.Header
4524 }
4525
4526
4527 func (r *DatabasesService) Delete(project string, instance string, database string) *DatabasesDeleteCall {
4528 c := &DatabasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4529 c.project = project
4530 c.instance = instance
4531 c.database = database
4532 return c
4533 }
4534
4535
4536
4537
4538 func (c *DatabasesDeleteCall) Fields(s ...googleapi.Field) *DatabasesDeleteCall {
4539 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4540 return c
4541 }
4542
4543
4544
4545
4546 func (c *DatabasesDeleteCall) Context(ctx context.Context) *DatabasesDeleteCall {
4547 c.ctx_ = ctx
4548 return c
4549 }
4550
4551
4552
4553 func (c *DatabasesDeleteCall) Header() http.Header {
4554 if c.header_ == nil {
4555 c.header_ = make(http.Header)
4556 }
4557 return c.header_
4558 }
4559
4560 func (c *DatabasesDeleteCall) doRequest(alt string) (*http.Response, error) {
4561 reqHeaders := make(http.Header)
4562 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
4563 for k, v := range c.header_ {
4564 reqHeaders[k] = v
4565 }
4566 reqHeaders.Set("User-Agent", c.s.userAgent())
4567 var body io.Reader = nil
4568 c.urlParams_.Set("alt", alt)
4569 c.urlParams_.Set("prettyPrint", "false")
4570 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}")
4571 urls += "?" + c.urlParams_.Encode()
4572 req, err := http.NewRequest("DELETE", urls, body)
4573 if err != nil {
4574 return nil, err
4575 }
4576 req.Header = reqHeaders
4577 googleapi.Expand(req.URL, map[string]string{
4578 "project": c.project,
4579 "instance": c.instance,
4580 "database": c.database,
4581 })
4582 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4583 }
4584
4585
4586
4587
4588
4589
4590
4591
4592 func (c *DatabasesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4593 gensupport.SetOptions(c.urlParams_, opts...)
4594 res, err := c.doRequest("json")
4595 if res != nil && res.StatusCode == http.StatusNotModified {
4596 if res.Body != nil {
4597 res.Body.Close()
4598 }
4599 return nil, &googleapi.Error{
4600 Code: res.StatusCode,
4601 Header: res.Header,
4602 }
4603 }
4604 if err != nil {
4605 return nil, err
4606 }
4607 defer googleapi.CloseBody(res)
4608 if err := googleapi.CheckResponse(res); err != nil {
4609 return nil, err
4610 }
4611 ret := &Operation{
4612 ServerResponse: googleapi.ServerResponse{
4613 Header: res.Header,
4614 HTTPStatusCode: res.StatusCode,
4615 },
4616 }
4617 target := &ret
4618 if err := gensupport.DecodeResponse(target, res); err != nil {
4619 return nil, err
4620 }
4621 return ret, nil
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662 }
4663
4664
4665
4666 type DatabasesGetCall struct {
4667 s *Service
4668 project string
4669 instance string
4670 database string
4671 urlParams_ gensupport.URLParams
4672 ifNoneMatch_ string
4673 ctx_ context.Context
4674 header_ http.Header
4675 }
4676
4677
4678
4679
4680 func (r *DatabasesService) Get(project string, instance string, database string) *DatabasesGetCall {
4681 c := &DatabasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4682 c.project = project
4683 c.instance = instance
4684 c.database = database
4685 return c
4686 }
4687
4688
4689
4690
4691 func (c *DatabasesGetCall) Fields(s ...googleapi.Field) *DatabasesGetCall {
4692 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4693 return c
4694 }
4695
4696
4697
4698
4699
4700
4701 func (c *DatabasesGetCall) IfNoneMatch(entityTag string) *DatabasesGetCall {
4702 c.ifNoneMatch_ = entityTag
4703 return c
4704 }
4705
4706
4707
4708
4709 func (c *DatabasesGetCall) Context(ctx context.Context) *DatabasesGetCall {
4710 c.ctx_ = ctx
4711 return c
4712 }
4713
4714
4715
4716 func (c *DatabasesGetCall) Header() http.Header {
4717 if c.header_ == nil {
4718 c.header_ = make(http.Header)
4719 }
4720 return c.header_
4721 }
4722
4723 func (c *DatabasesGetCall) doRequest(alt string) (*http.Response, error) {
4724 reqHeaders := make(http.Header)
4725 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
4726 for k, v := range c.header_ {
4727 reqHeaders[k] = v
4728 }
4729 reqHeaders.Set("User-Agent", c.s.userAgent())
4730 if c.ifNoneMatch_ != "" {
4731 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4732 }
4733 var body io.Reader = nil
4734 c.urlParams_.Set("alt", alt)
4735 c.urlParams_.Set("prettyPrint", "false")
4736 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}")
4737 urls += "?" + c.urlParams_.Encode()
4738 req, err := http.NewRequest("GET", urls, body)
4739 if err != nil {
4740 return nil, err
4741 }
4742 req.Header = reqHeaders
4743 googleapi.Expand(req.URL, map[string]string{
4744 "project": c.project,
4745 "instance": c.instance,
4746 "database": c.database,
4747 })
4748 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4749 }
4750
4751
4752
4753
4754
4755
4756
4757
4758 func (c *DatabasesGetCall) Do(opts ...googleapi.CallOption) (*Database, error) {
4759 gensupport.SetOptions(c.urlParams_, opts...)
4760 res, err := c.doRequest("json")
4761 if res != nil && res.StatusCode == http.StatusNotModified {
4762 if res.Body != nil {
4763 res.Body.Close()
4764 }
4765 return nil, &googleapi.Error{
4766 Code: res.StatusCode,
4767 Header: res.Header,
4768 }
4769 }
4770 if err != nil {
4771 return nil, err
4772 }
4773 defer googleapi.CloseBody(res)
4774 if err := googleapi.CheckResponse(res); err != nil {
4775 return nil, err
4776 }
4777 ret := &Database{
4778 ServerResponse: googleapi.ServerResponse{
4779 Header: res.Header,
4780 HTTPStatusCode: res.StatusCode,
4781 },
4782 }
4783 target := &ret
4784 if err := gensupport.DecodeResponse(target, res); err != nil {
4785 return nil, err
4786 }
4787 return ret, nil
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828 }
4829
4830
4831
4832 type DatabasesInsertCall struct {
4833 s *Service
4834 project string
4835 instance string
4836 database *Database
4837 urlParams_ gensupport.URLParams
4838 ctx_ context.Context
4839 header_ http.Header
4840 }
4841
4842
4843
4844
4845 func (r *DatabasesService) Insert(project string, instance string, database *Database) *DatabasesInsertCall {
4846 c := &DatabasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4847 c.project = project
4848 c.instance = instance
4849 c.database = database
4850 return c
4851 }
4852
4853
4854
4855
4856 func (c *DatabasesInsertCall) Fields(s ...googleapi.Field) *DatabasesInsertCall {
4857 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4858 return c
4859 }
4860
4861
4862
4863
4864 func (c *DatabasesInsertCall) Context(ctx context.Context) *DatabasesInsertCall {
4865 c.ctx_ = ctx
4866 return c
4867 }
4868
4869
4870
4871 func (c *DatabasesInsertCall) Header() http.Header {
4872 if c.header_ == nil {
4873 c.header_ = make(http.Header)
4874 }
4875 return c.header_
4876 }
4877
4878 func (c *DatabasesInsertCall) doRequest(alt string) (*http.Response, error) {
4879 reqHeaders := make(http.Header)
4880 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
4881 for k, v := range c.header_ {
4882 reqHeaders[k] = v
4883 }
4884 reqHeaders.Set("User-Agent", c.s.userAgent())
4885 var body io.Reader = nil
4886 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database)
4887 if err != nil {
4888 return nil, err
4889 }
4890 reqHeaders.Set("Content-Type", "application/json")
4891 c.urlParams_.Set("alt", alt)
4892 c.urlParams_.Set("prettyPrint", "false")
4893 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases")
4894 urls += "?" + c.urlParams_.Encode()
4895 req, err := http.NewRequest("POST", urls, body)
4896 if err != nil {
4897 return nil, err
4898 }
4899 req.Header = reqHeaders
4900 googleapi.Expand(req.URL, map[string]string{
4901 "project": c.project,
4902 "instance": c.instance,
4903 })
4904 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4905 }
4906
4907
4908
4909
4910
4911
4912
4913
4914 func (c *DatabasesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4915 gensupport.SetOptions(c.urlParams_, opts...)
4916 res, err := c.doRequest("json")
4917 if res != nil && res.StatusCode == http.StatusNotModified {
4918 if res.Body != nil {
4919 res.Body.Close()
4920 }
4921 return nil, &googleapi.Error{
4922 Code: res.StatusCode,
4923 Header: res.Header,
4924 }
4925 }
4926 if err != nil {
4927 return nil, err
4928 }
4929 defer googleapi.CloseBody(res)
4930 if err := googleapi.CheckResponse(res); err != nil {
4931 return nil, err
4932 }
4933 ret := &Operation{
4934 ServerResponse: googleapi.ServerResponse{
4935 Header: res.Header,
4936 HTTPStatusCode: res.StatusCode,
4937 },
4938 }
4939 target := &ret
4940 if err := gensupport.DecodeResponse(target, res); err != nil {
4941 return nil, err
4942 }
4943 return ret, nil
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980 }
4981
4982
4983
4984 type DatabasesListCall struct {
4985 s *Service
4986 project string
4987 instance string
4988 urlParams_ gensupport.URLParams
4989 ifNoneMatch_ string
4990 ctx_ context.Context
4991 header_ http.Header
4992 }
4993
4994
4995 func (r *DatabasesService) List(project string, instance string) *DatabasesListCall {
4996 c := &DatabasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4997 c.project = project
4998 c.instance = instance
4999 return c
5000 }
5001
5002
5003
5004
5005 func (c *DatabasesListCall) Fields(s ...googleapi.Field) *DatabasesListCall {
5006 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5007 return c
5008 }
5009
5010
5011
5012
5013
5014
5015 func (c *DatabasesListCall) IfNoneMatch(entityTag string) *DatabasesListCall {
5016 c.ifNoneMatch_ = entityTag
5017 return c
5018 }
5019
5020
5021
5022
5023 func (c *DatabasesListCall) Context(ctx context.Context) *DatabasesListCall {
5024 c.ctx_ = ctx
5025 return c
5026 }
5027
5028
5029
5030 func (c *DatabasesListCall) Header() http.Header {
5031 if c.header_ == nil {
5032 c.header_ = make(http.Header)
5033 }
5034 return c.header_
5035 }
5036
5037 func (c *DatabasesListCall) doRequest(alt string) (*http.Response, error) {
5038 reqHeaders := make(http.Header)
5039 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
5040 for k, v := range c.header_ {
5041 reqHeaders[k] = v
5042 }
5043 reqHeaders.Set("User-Agent", c.s.userAgent())
5044 if c.ifNoneMatch_ != "" {
5045 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5046 }
5047 var body io.Reader = nil
5048 c.urlParams_.Set("alt", alt)
5049 c.urlParams_.Set("prettyPrint", "false")
5050 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases")
5051 urls += "?" + c.urlParams_.Encode()
5052 req, err := http.NewRequest("GET", urls, body)
5053 if err != nil {
5054 return nil, err
5055 }
5056 req.Header = reqHeaders
5057 googleapi.Expand(req.URL, map[string]string{
5058 "project": c.project,
5059 "instance": c.instance,
5060 })
5061 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5062 }
5063
5064
5065
5066
5067
5068
5069
5070
5071 func (c *DatabasesListCall) Do(opts ...googleapi.CallOption) (*DatabasesListResponse, error) {
5072 gensupport.SetOptions(c.urlParams_, opts...)
5073 res, err := c.doRequest("json")
5074 if res != nil && res.StatusCode == http.StatusNotModified {
5075 if res.Body != nil {
5076 res.Body.Close()
5077 }
5078 return nil, &googleapi.Error{
5079 Code: res.StatusCode,
5080 Header: res.Header,
5081 }
5082 }
5083 if err != nil {
5084 return nil, err
5085 }
5086 defer googleapi.CloseBody(res)
5087 if err := googleapi.CheckResponse(res); err != nil {
5088 return nil, err
5089 }
5090 ret := &DatabasesListResponse{
5091 ServerResponse: googleapi.ServerResponse{
5092 Header: res.Header,
5093 HTTPStatusCode: res.StatusCode,
5094 },
5095 }
5096 target := &ret
5097 if err := gensupport.DecodeResponse(target, res); err != nil {
5098 return nil, err
5099 }
5100 return ret, nil
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134 }
5135
5136
5137
5138 type DatabasesPatchCall struct {
5139 s *Service
5140 project string
5141 instance string
5142 database string
5143 database2 *Database
5144 urlParams_ gensupport.URLParams
5145 ctx_ context.Context
5146 header_ http.Header
5147 }
5148
5149
5150
5151
5152 func (r *DatabasesService) Patch(project string, instance string, database string, database2 *Database) *DatabasesPatchCall {
5153 c := &DatabasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5154 c.project = project
5155 c.instance = instance
5156 c.database = database
5157 c.database2 = database2
5158 return c
5159 }
5160
5161
5162
5163
5164 func (c *DatabasesPatchCall) Fields(s ...googleapi.Field) *DatabasesPatchCall {
5165 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5166 return c
5167 }
5168
5169
5170
5171
5172 func (c *DatabasesPatchCall) Context(ctx context.Context) *DatabasesPatchCall {
5173 c.ctx_ = ctx
5174 return c
5175 }
5176
5177
5178
5179 func (c *DatabasesPatchCall) Header() http.Header {
5180 if c.header_ == nil {
5181 c.header_ = make(http.Header)
5182 }
5183 return c.header_
5184 }
5185
5186 func (c *DatabasesPatchCall) doRequest(alt string) (*http.Response, error) {
5187 reqHeaders := make(http.Header)
5188 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
5189 for k, v := range c.header_ {
5190 reqHeaders[k] = v
5191 }
5192 reqHeaders.Set("User-Agent", c.s.userAgent())
5193 var body io.Reader = nil
5194 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2)
5195 if err != nil {
5196 return nil, err
5197 }
5198 reqHeaders.Set("Content-Type", "application/json")
5199 c.urlParams_.Set("alt", alt)
5200 c.urlParams_.Set("prettyPrint", "false")
5201 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}")
5202 urls += "?" + c.urlParams_.Encode()
5203 req, err := http.NewRequest("PATCH", urls, body)
5204 if err != nil {
5205 return nil, err
5206 }
5207 req.Header = reqHeaders
5208 googleapi.Expand(req.URL, map[string]string{
5209 "project": c.project,
5210 "instance": c.instance,
5211 "database": c.database,
5212 })
5213 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5214 }
5215
5216
5217
5218
5219
5220
5221
5222
5223 func (c *DatabasesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5224 gensupport.SetOptions(c.urlParams_, opts...)
5225 res, err := c.doRequest("json")
5226 if res != nil && res.StatusCode == http.StatusNotModified {
5227 if res.Body != nil {
5228 res.Body.Close()
5229 }
5230 return nil, &googleapi.Error{
5231 Code: res.StatusCode,
5232 Header: res.Header,
5233 }
5234 }
5235 if err != nil {
5236 return nil, err
5237 }
5238 defer googleapi.CloseBody(res)
5239 if err := googleapi.CheckResponse(res); err != nil {
5240 return nil, err
5241 }
5242 ret := &Operation{
5243 ServerResponse: googleapi.ServerResponse{
5244 Header: res.Header,
5245 HTTPStatusCode: res.StatusCode,
5246 },
5247 }
5248 target := &ret
5249 if err := gensupport.DecodeResponse(target, res); err != nil {
5250 return nil, err
5251 }
5252 return ret, nil
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296 }
5297
5298
5299
5300 type DatabasesUpdateCall struct {
5301 s *Service
5302 project string
5303 instance string
5304 database string
5305 database2 *Database
5306 urlParams_ gensupport.URLParams
5307 ctx_ context.Context
5308 header_ http.Header
5309 }
5310
5311
5312
5313
5314 func (r *DatabasesService) Update(project string, instance string, database string, database2 *Database) *DatabasesUpdateCall {
5315 c := &DatabasesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5316 c.project = project
5317 c.instance = instance
5318 c.database = database
5319 c.database2 = database2
5320 return c
5321 }
5322
5323
5324
5325
5326 func (c *DatabasesUpdateCall) Fields(s ...googleapi.Field) *DatabasesUpdateCall {
5327 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5328 return c
5329 }
5330
5331
5332
5333
5334 func (c *DatabasesUpdateCall) Context(ctx context.Context) *DatabasesUpdateCall {
5335 c.ctx_ = ctx
5336 return c
5337 }
5338
5339
5340
5341 func (c *DatabasesUpdateCall) Header() http.Header {
5342 if c.header_ == nil {
5343 c.header_ = make(http.Header)
5344 }
5345 return c.header_
5346 }
5347
5348 func (c *DatabasesUpdateCall) doRequest(alt string) (*http.Response, error) {
5349 reqHeaders := make(http.Header)
5350 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
5351 for k, v := range c.header_ {
5352 reqHeaders[k] = v
5353 }
5354 reqHeaders.Set("User-Agent", c.s.userAgent())
5355 var body io.Reader = nil
5356 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2)
5357 if err != nil {
5358 return nil, err
5359 }
5360 reqHeaders.Set("Content-Type", "application/json")
5361 c.urlParams_.Set("alt", alt)
5362 c.urlParams_.Set("prettyPrint", "false")
5363 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}")
5364 urls += "?" + c.urlParams_.Encode()
5365 req, err := http.NewRequest("PUT", urls, body)
5366 if err != nil {
5367 return nil, err
5368 }
5369 req.Header = reqHeaders
5370 googleapi.Expand(req.URL, map[string]string{
5371 "project": c.project,
5372 "instance": c.instance,
5373 "database": c.database,
5374 })
5375 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5376 }
5377
5378
5379
5380
5381
5382
5383
5384
5385 func (c *DatabasesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5386 gensupport.SetOptions(c.urlParams_, opts...)
5387 res, err := c.doRequest("json")
5388 if res != nil && res.StatusCode == http.StatusNotModified {
5389 if res.Body != nil {
5390 res.Body.Close()
5391 }
5392 return nil, &googleapi.Error{
5393 Code: res.StatusCode,
5394 Header: res.Header,
5395 }
5396 }
5397 if err != nil {
5398 return nil, err
5399 }
5400 defer googleapi.CloseBody(res)
5401 if err := googleapi.CheckResponse(res); err != nil {
5402 return nil, err
5403 }
5404 ret := &Operation{
5405 ServerResponse: googleapi.ServerResponse{
5406 Header: res.Header,
5407 HTTPStatusCode: res.StatusCode,
5408 },
5409 }
5410 target := &ret
5411 if err := gensupport.DecodeResponse(target, res); err != nil {
5412 return nil, err
5413 }
5414 return ret, nil
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458 }
5459
5460
5461
5462 type FlagsListCall struct {
5463 s *Service
5464 urlParams_ gensupport.URLParams
5465 ifNoneMatch_ string
5466 ctx_ context.Context
5467 header_ http.Header
5468 }
5469
5470
5471 func (r *FlagsService) List() *FlagsListCall {
5472 c := &FlagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5473 return c
5474 }
5475
5476
5477
5478
5479
5480 func (c *FlagsListCall) DatabaseVersion(databaseVersion string) *FlagsListCall {
5481 c.urlParams_.Set("databaseVersion", databaseVersion)
5482 return c
5483 }
5484
5485
5486
5487
5488 func (c *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall {
5489 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5490 return c
5491 }
5492
5493
5494
5495
5496
5497
5498 func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall {
5499 c.ifNoneMatch_ = entityTag
5500 return c
5501 }
5502
5503
5504
5505
5506 func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall {
5507 c.ctx_ = ctx
5508 return c
5509 }
5510
5511
5512
5513 func (c *FlagsListCall) Header() http.Header {
5514 if c.header_ == nil {
5515 c.header_ = make(http.Header)
5516 }
5517 return c.header_
5518 }
5519
5520 func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) {
5521 reqHeaders := make(http.Header)
5522 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
5523 for k, v := range c.header_ {
5524 reqHeaders[k] = v
5525 }
5526 reqHeaders.Set("User-Agent", c.s.userAgent())
5527 if c.ifNoneMatch_ != "" {
5528 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5529 }
5530 var body io.Reader = nil
5531 c.urlParams_.Set("alt", alt)
5532 c.urlParams_.Set("prettyPrint", "false")
5533 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/flags")
5534 urls += "?" + c.urlParams_.Encode()
5535 req, err := http.NewRequest("GET", urls, body)
5536 if err != nil {
5537 return nil, err
5538 }
5539 req.Header = reqHeaders
5540 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5541 }
5542
5543
5544
5545
5546
5547
5548
5549
5550 func (c *FlagsListCall) Do(opts ...googleapi.CallOption) (*FlagsListResponse, error) {
5551 gensupport.SetOptions(c.urlParams_, opts...)
5552 res, err := c.doRequest("json")
5553 if res != nil && res.StatusCode == http.StatusNotModified {
5554 if res.Body != nil {
5555 res.Body.Close()
5556 }
5557 return nil, &googleapi.Error{
5558 Code: res.StatusCode,
5559 Header: res.Header,
5560 }
5561 }
5562 if err != nil {
5563 return nil, err
5564 }
5565 defer googleapi.CloseBody(res)
5566 if err := googleapi.CheckResponse(res); err != nil {
5567 return nil, err
5568 }
5569 ret := &FlagsListResponse{
5570 ServerResponse: googleapi.ServerResponse{
5571 Header: res.Header,
5572 HTTPStatusCode: res.StatusCode,
5573 },
5574 }
5575 target := &ret
5576 if err := gensupport.DecodeResponse(target, res); err != nil {
5577 return nil, err
5578 }
5579 return ret, nil
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603 }
5604
5605
5606
5607 type InstancesAddServerCaCall struct {
5608 s *Service
5609 project string
5610 instance string
5611 urlParams_ gensupport.URLParams
5612 ctx_ context.Context
5613 header_ http.Header
5614 }
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625 func (r *InstancesService) AddServerCa(project string, instance string) *InstancesAddServerCaCall {
5626 c := &InstancesAddServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5627 c.project = project
5628 c.instance = instance
5629 return c
5630 }
5631
5632
5633
5634
5635 func (c *InstancesAddServerCaCall) Fields(s ...googleapi.Field) *InstancesAddServerCaCall {
5636 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5637 return c
5638 }
5639
5640
5641
5642
5643 func (c *InstancesAddServerCaCall) Context(ctx context.Context) *InstancesAddServerCaCall {
5644 c.ctx_ = ctx
5645 return c
5646 }
5647
5648
5649
5650 func (c *InstancesAddServerCaCall) Header() http.Header {
5651 if c.header_ == nil {
5652 c.header_ = make(http.Header)
5653 }
5654 return c.header_
5655 }
5656
5657 func (c *InstancesAddServerCaCall) doRequest(alt string) (*http.Response, error) {
5658 reqHeaders := make(http.Header)
5659 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
5660 for k, v := range c.header_ {
5661 reqHeaders[k] = v
5662 }
5663 reqHeaders.Set("User-Agent", c.s.userAgent())
5664 var body io.Reader = nil
5665 c.urlParams_.Set("alt", alt)
5666 c.urlParams_.Set("prettyPrint", "false")
5667 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa")
5668 urls += "?" + c.urlParams_.Encode()
5669 req, err := http.NewRequest("POST", urls, body)
5670 if err != nil {
5671 return nil, err
5672 }
5673 req.Header = reqHeaders
5674 googleapi.Expand(req.URL, map[string]string{
5675 "project": c.project,
5676 "instance": c.instance,
5677 })
5678 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5679 }
5680
5681
5682
5683
5684
5685
5686
5687
5688 func (c *InstancesAddServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5689 gensupport.SetOptions(c.urlParams_, opts...)
5690 res, err := c.doRequest("json")
5691 if res != nil && res.StatusCode == http.StatusNotModified {
5692 if res.Body != nil {
5693 res.Body.Close()
5694 }
5695 return nil, &googleapi.Error{
5696 Code: res.StatusCode,
5697 Header: res.Header,
5698 }
5699 }
5700 if err != nil {
5701 return nil, err
5702 }
5703 defer googleapi.CloseBody(res)
5704 if err := googleapi.CheckResponse(res); err != nil {
5705 return nil, err
5706 }
5707 ret := &Operation{
5708 ServerResponse: googleapi.ServerResponse{
5709 Header: res.Header,
5710 HTTPStatusCode: res.StatusCode,
5711 },
5712 }
5713 target := &ret
5714 if err := gensupport.DecodeResponse(target, res); err != nil {
5715 return nil, err
5716 }
5717 return ret, nil
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751 }
5752
5753
5754
5755 type InstancesCloneCall struct {
5756 s *Service
5757 project string
5758 instance string
5759 instancesclonerequest *InstancesCloneRequest
5760 urlParams_ gensupport.URLParams
5761 ctx_ context.Context
5762 header_ http.Header
5763 }
5764
5765
5766
5767
5768 func (r *InstancesService) Clone(project string, instance string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall {
5769 c := &InstancesCloneCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5770 c.project = project
5771 c.instance = instance
5772 c.instancesclonerequest = instancesclonerequest
5773 return c
5774 }
5775
5776
5777
5778
5779 func (c *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall {
5780 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5781 return c
5782 }
5783
5784
5785
5786
5787 func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall {
5788 c.ctx_ = ctx
5789 return c
5790 }
5791
5792
5793
5794 func (c *InstancesCloneCall) Header() http.Header {
5795 if c.header_ == nil {
5796 c.header_ = make(http.Header)
5797 }
5798 return c.header_
5799 }
5800
5801 func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, error) {
5802 reqHeaders := make(http.Header)
5803 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
5804 for k, v := range c.header_ {
5805 reqHeaders[k] = v
5806 }
5807 reqHeaders.Set("User-Agent", c.s.userAgent())
5808 var body io.Reader = nil
5809 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest)
5810 if err != nil {
5811 return nil, err
5812 }
5813 reqHeaders.Set("Content-Type", "application/json")
5814 c.urlParams_.Set("alt", alt)
5815 c.urlParams_.Set("prettyPrint", "false")
5816 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/clone")
5817 urls += "?" + c.urlParams_.Encode()
5818 req, err := http.NewRequest("POST", urls, body)
5819 if err != nil {
5820 return nil, err
5821 }
5822 req.Header = reqHeaders
5823 googleapi.Expand(req.URL, map[string]string{
5824 "project": c.project,
5825 "instance": c.instance,
5826 })
5827 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5828 }
5829
5830
5831
5832
5833
5834
5835
5836
5837 func (c *InstancesCloneCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5838 gensupport.SetOptions(c.urlParams_, opts...)
5839 res, err := c.doRequest("json")
5840 if res != nil && res.StatusCode == http.StatusNotModified {
5841 if res.Body != nil {
5842 res.Body.Close()
5843 }
5844 return nil, &googleapi.Error{
5845 Code: res.StatusCode,
5846 Header: res.Header,
5847 }
5848 }
5849 if err != nil {
5850 return nil, err
5851 }
5852 defer googleapi.CloseBody(res)
5853 if err := googleapi.CheckResponse(res); err != nil {
5854 return nil, err
5855 }
5856 ret := &Operation{
5857 ServerResponse: googleapi.ServerResponse{
5858 Header: res.Header,
5859 HTTPStatusCode: res.StatusCode,
5860 },
5861 }
5862 target := &ret
5863 if err := gensupport.DecodeResponse(target, res); err != nil {
5864 return nil, err
5865 }
5866 return ret, nil
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903 }
5904
5905
5906
5907 type InstancesDeleteCall struct {
5908 s *Service
5909 project string
5910 instance string
5911 urlParams_ gensupport.URLParams
5912 ctx_ context.Context
5913 header_ http.Header
5914 }
5915
5916
5917 func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall {
5918 c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5919 c.project = project
5920 c.instance = instance
5921 return c
5922 }
5923
5924
5925
5926
5927 func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
5928 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5929 return c
5930 }
5931
5932
5933
5934
5935 func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
5936 c.ctx_ = ctx
5937 return c
5938 }
5939
5940
5941
5942 func (c *InstancesDeleteCall) Header() http.Header {
5943 if c.header_ == nil {
5944 c.header_ = make(http.Header)
5945 }
5946 return c.header_
5947 }
5948
5949 func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
5950 reqHeaders := make(http.Header)
5951 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
5952 for k, v := range c.header_ {
5953 reqHeaders[k] = v
5954 }
5955 reqHeaders.Set("User-Agent", c.s.userAgent())
5956 var body io.Reader = nil
5957 c.urlParams_.Set("alt", alt)
5958 c.urlParams_.Set("prettyPrint", "false")
5959 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}")
5960 urls += "?" + c.urlParams_.Encode()
5961 req, err := http.NewRequest("DELETE", urls, body)
5962 if err != nil {
5963 return nil, err
5964 }
5965 req.Header = reqHeaders
5966 googleapi.Expand(req.URL, map[string]string{
5967 "project": c.project,
5968 "instance": c.instance,
5969 })
5970 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5971 }
5972
5973
5974
5975
5976
5977
5978
5979
5980 func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5981 gensupport.SetOptions(c.urlParams_, opts...)
5982 res, err := c.doRequest("json")
5983 if res != nil && res.StatusCode == http.StatusNotModified {
5984 if res.Body != nil {
5985 res.Body.Close()
5986 }
5987 return nil, &googleapi.Error{
5988 Code: res.StatusCode,
5989 Header: res.Header,
5990 }
5991 }
5992 if err != nil {
5993 return nil, err
5994 }
5995 defer googleapi.CloseBody(res)
5996 if err := googleapi.CheckResponse(res); err != nil {
5997 return nil, err
5998 }
5999 ret := &Operation{
6000 ServerResponse: googleapi.ServerResponse{
6001 Header: res.Header,
6002 HTTPStatusCode: res.StatusCode,
6003 },
6004 }
6005 target := &ret
6006 if err := gensupport.DecodeResponse(target, res); err != nil {
6007 return nil, err
6008 }
6009 return ret, nil
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043 }
6044
6045
6046
6047 type InstancesDemoteMasterCall struct {
6048 s *Service
6049 project string
6050 instance string
6051 instancesdemotemasterrequest *InstancesDemoteMasterRequest
6052 urlParams_ gensupport.URLParams
6053 ctx_ context.Context
6054 header_ http.Header
6055 }
6056
6057
6058
6059
6060 func (r *InstancesService) DemoteMaster(project string, instance string, instancesdemotemasterrequest *InstancesDemoteMasterRequest) *InstancesDemoteMasterCall {
6061 c := &InstancesDemoteMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6062 c.project = project
6063 c.instance = instance
6064 c.instancesdemotemasterrequest = instancesdemotemasterrequest
6065 return c
6066 }
6067
6068
6069
6070
6071 func (c *InstancesDemoteMasterCall) Fields(s ...googleapi.Field) *InstancesDemoteMasterCall {
6072 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6073 return c
6074 }
6075
6076
6077
6078
6079 func (c *InstancesDemoteMasterCall) Context(ctx context.Context) *InstancesDemoteMasterCall {
6080 c.ctx_ = ctx
6081 return c
6082 }
6083
6084
6085
6086 func (c *InstancesDemoteMasterCall) Header() http.Header {
6087 if c.header_ == nil {
6088 c.header_ = make(http.Header)
6089 }
6090 return c.header_
6091 }
6092
6093 func (c *InstancesDemoteMasterCall) doRequest(alt string) (*http.Response, error) {
6094 reqHeaders := make(http.Header)
6095 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
6096 for k, v := range c.header_ {
6097 reqHeaders[k] = v
6098 }
6099 reqHeaders.Set("User-Agent", c.s.userAgent())
6100 var body io.Reader = nil
6101 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesdemotemasterrequest)
6102 if err != nil {
6103 return nil, err
6104 }
6105 reqHeaders.Set("Content-Type", "application/json")
6106 c.urlParams_.Set("alt", alt)
6107 c.urlParams_.Set("prettyPrint", "false")
6108 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster")
6109 urls += "?" + c.urlParams_.Encode()
6110 req, err := http.NewRequest("POST", urls, body)
6111 if err != nil {
6112 return nil, err
6113 }
6114 req.Header = reqHeaders
6115 googleapi.Expand(req.URL, map[string]string{
6116 "project": c.project,
6117 "instance": c.instance,
6118 })
6119 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6120 }
6121
6122
6123
6124
6125
6126
6127
6128
6129 func (c *InstancesDemoteMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6130 gensupport.SetOptions(c.urlParams_, opts...)
6131 res, err := c.doRequest("json")
6132 if res != nil && res.StatusCode == http.StatusNotModified {
6133 if res.Body != nil {
6134 res.Body.Close()
6135 }
6136 return nil, &googleapi.Error{
6137 Code: res.StatusCode,
6138 Header: res.Header,
6139 }
6140 }
6141 if err != nil {
6142 return nil, err
6143 }
6144 defer googleapi.CloseBody(res)
6145 if err := googleapi.CheckResponse(res); err != nil {
6146 return nil, err
6147 }
6148 ret := &Operation{
6149 ServerResponse: googleapi.ServerResponse{
6150 Header: res.Header,
6151 HTTPStatusCode: res.StatusCode,
6152 },
6153 }
6154 target := &ret
6155 if err := gensupport.DecodeResponse(target, res); err != nil {
6156 return nil, err
6157 }
6158 return ret, nil
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195 }
6196
6197
6198
6199 type InstancesExportCall struct {
6200 s *Service
6201 project string
6202 instance string
6203 instancesexportrequest *InstancesExportRequest
6204 urlParams_ gensupport.URLParams
6205 ctx_ context.Context
6206 header_ http.Header
6207 }
6208
6209
6210
6211
6212 func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall {
6213 c := &InstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6214 c.project = project
6215 c.instance = instance
6216 c.instancesexportrequest = instancesexportrequest
6217 return c
6218 }
6219
6220
6221
6222
6223 func (c *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall {
6224 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6225 return c
6226 }
6227
6228
6229
6230
6231 func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall {
6232 c.ctx_ = ctx
6233 return c
6234 }
6235
6236
6237
6238 func (c *InstancesExportCall) Header() http.Header {
6239 if c.header_ == nil {
6240 c.header_ = make(http.Header)
6241 }
6242 return c.header_
6243 }
6244
6245 func (c *InstancesExportCall) doRequest(alt string) (*http.Response, error) {
6246 reqHeaders := make(http.Header)
6247 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
6248 for k, v := range c.header_ {
6249 reqHeaders[k] = v
6250 }
6251 reqHeaders.Set("User-Agent", c.s.userAgent())
6252 var body io.Reader = nil
6253 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest)
6254 if err != nil {
6255 return nil, err
6256 }
6257 reqHeaders.Set("Content-Type", "application/json")
6258 c.urlParams_.Set("alt", alt)
6259 c.urlParams_.Set("prettyPrint", "false")
6260 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/export")
6261 urls += "?" + c.urlParams_.Encode()
6262 req, err := http.NewRequest("POST", urls, body)
6263 if err != nil {
6264 return nil, err
6265 }
6266 req.Header = reqHeaders
6267 googleapi.Expand(req.URL, map[string]string{
6268 "project": c.project,
6269 "instance": c.instance,
6270 })
6271 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6272 }
6273
6274
6275
6276
6277
6278
6279
6280
6281 func (c *InstancesExportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6282 gensupport.SetOptions(c.urlParams_, opts...)
6283 res, err := c.doRequest("json")
6284 if res != nil && res.StatusCode == http.StatusNotModified {
6285 if res.Body != nil {
6286 res.Body.Close()
6287 }
6288 return nil, &googleapi.Error{
6289 Code: res.StatusCode,
6290 Header: res.Header,
6291 }
6292 }
6293 if err != nil {
6294 return nil, err
6295 }
6296 defer googleapi.CloseBody(res)
6297 if err := googleapi.CheckResponse(res); err != nil {
6298 return nil, err
6299 }
6300 ret := &Operation{
6301 ServerResponse: googleapi.ServerResponse{
6302 Header: res.Header,
6303 HTTPStatusCode: res.StatusCode,
6304 },
6305 }
6306 target := &ret
6307 if err := gensupport.DecodeResponse(target, res); err != nil {
6308 return nil, err
6309 }
6310 return ret, nil
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346 }
6347
6348
6349
6350 type InstancesFailoverCall struct {
6351 s *Service
6352 project string
6353 instance string
6354 instancesfailoverrequest *InstancesFailoverRequest
6355 urlParams_ gensupport.URLParams
6356 ctx_ context.Context
6357 header_ http.Header
6358 }
6359
6360
6361
6362
6363 func (r *InstancesService) Failover(project string, instance string, instancesfailoverrequest *InstancesFailoverRequest) *InstancesFailoverCall {
6364 c := &InstancesFailoverCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6365 c.project = project
6366 c.instance = instance
6367 c.instancesfailoverrequest = instancesfailoverrequest
6368 return c
6369 }
6370
6371
6372
6373
6374 func (c *InstancesFailoverCall) Fields(s ...googleapi.Field) *InstancesFailoverCall {
6375 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6376 return c
6377 }
6378
6379
6380
6381
6382 func (c *InstancesFailoverCall) Context(ctx context.Context) *InstancesFailoverCall {
6383 c.ctx_ = ctx
6384 return c
6385 }
6386
6387
6388
6389 func (c *InstancesFailoverCall) Header() http.Header {
6390 if c.header_ == nil {
6391 c.header_ = make(http.Header)
6392 }
6393 return c.header_
6394 }
6395
6396 func (c *InstancesFailoverCall) doRequest(alt string) (*http.Response, error) {
6397 reqHeaders := make(http.Header)
6398 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
6399 for k, v := range c.header_ {
6400 reqHeaders[k] = v
6401 }
6402 reqHeaders.Set("User-Agent", c.s.userAgent())
6403 var body io.Reader = nil
6404 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesfailoverrequest)
6405 if err != nil {
6406 return nil, err
6407 }
6408 reqHeaders.Set("Content-Type", "application/json")
6409 c.urlParams_.Set("alt", alt)
6410 c.urlParams_.Set("prettyPrint", "false")
6411 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/failover")
6412 urls += "?" + c.urlParams_.Encode()
6413 req, err := http.NewRequest("POST", urls, body)
6414 if err != nil {
6415 return nil, err
6416 }
6417 req.Header = reqHeaders
6418 googleapi.Expand(req.URL, map[string]string{
6419 "project": c.project,
6420 "instance": c.instance,
6421 })
6422 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6423 }
6424
6425
6426
6427
6428
6429
6430
6431
6432 func (c *InstancesFailoverCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6433 gensupport.SetOptions(c.urlParams_, opts...)
6434 res, err := c.doRequest("json")
6435 if res != nil && res.StatusCode == http.StatusNotModified {
6436 if res.Body != nil {
6437 res.Body.Close()
6438 }
6439 return nil, &googleapi.Error{
6440 Code: res.StatusCode,
6441 Header: res.Header,
6442 }
6443 }
6444 if err != nil {
6445 return nil, err
6446 }
6447 defer googleapi.CloseBody(res)
6448 if err := googleapi.CheckResponse(res); err != nil {
6449 return nil, err
6450 }
6451 ret := &Operation{
6452 ServerResponse: googleapi.ServerResponse{
6453 Header: res.Header,
6454 HTTPStatusCode: res.StatusCode,
6455 },
6456 }
6457 target := &ret
6458 if err := gensupport.DecodeResponse(target, res); err != nil {
6459 return nil, err
6460 }
6461 return ret, nil
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498 }
6499
6500
6501
6502 type InstancesGetCall struct {
6503 s *Service
6504 project string
6505 instance string
6506 urlParams_ gensupport.URLParams
6507 ifNoneMatch_ string
6508 ctx_ context.Context
6509 header_ http.Header
6510 }
6511
6512
6513
6514 func (r *InstancesService) Get(project string, instance string) *InstancesGetCall {
6515 c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6516 c.project = project
6517 c.instance = instance
6518 return c
6519 }
6520
6521
6522
6523
6524 func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
6525 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6526 return c
6527 }
6528
6529
6530
6531
6532
6533
6534 func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
6535 c.ifNoneMatch_ = entityTag
6536 return c
6537 }
6538
6539
6540
6541
6542 func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
6543 c.ctx_ = ctx
6544 return c
6545 }
6546
6547
6548
6549 func (c *InstancesGetCall) Header() http.Header {
6550 if c.header_ == nil {
6551 c.header_ = make(http.Header)
6552 }
6553 return c.header_
6554 }
6555
6556 func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
6557 reqHeaders := make(http.Header)
6558 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
6559 for k, v := range c.header_ {
6560 reqHeaders[k] = v
6561 }
6562 reqHeaders.Set("User-Agent", c.s.userAgent())
6563 if c.ifNoneMatch_ != "" {
6564 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6565 }
6566 var body io.Reader = nil
6567 c.urlParams_.Set("alt", alt)
6568 c.urlParams_.Set("prettyPrint", "false")
6569 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}")
6570 urls += "?" + c.urlParams_.Encode()
6571 req, err := http.NewRequest("GET", urls, body)
6572 if err != nil {
6573 return nil, err
6574 }
6575 req.Header = reqHeaders
6576 googleapi.Expand(req.URL, map[string]string{
6577 "project": c.project,
6578 "instance": c.instance,
6579 })
6580 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6581 }
6582
6583
6584
6585
6586
6587
6588
6589
6590 func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*DatabaseInstance, error) {
6591 gensupport.SetOptions(c.urlParams_, opts...)
6592 res, err := c.doRequest("json")
6593 if res != nil && res.StatusCode == http.StatusNotModified {
6594 if res.Body != nil {
6595 res.Body.Close()
6596 }
6597 return nil, &googleapi.Error{
6598 Code: res.StatusCode,
6599 Header: res.Header,
6600 }
6601 }
6602 if err != nil {
6603 return nil, err
6604 }
6605 defer googleapi.CloseBody(res)
6606 if err := googleapi.CheckResponse(res); err != nil {
6607 return nil, err
6608 }
6609 ret := &DatabaseInstance{
6610 ServerResponse: googleapi.ServerResponse{
6611 Header: res.Header,
6612 HTTPStatusCode: res.StatusCode,
6613 },
6614 }
6615 target := &ret
6616 if err := gensupport.DecodeResponse(target, res); err != nil {
6617 return nil, err
6618 }
6619 return ret, nil
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653 }
6654
6655
6656
6657 type InstancesImportCall struct {
6658 s *Service
6659 project string
6660 instance string
6661 instancesimportrequest *InstancesImportRequest
6662 urlParams_ gensupport.URLParams
6663 ctx_ context.Context
6664 header_ http.Header
6665 }
6666
6667
6668
6669
6670 func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall {
6671 c := &InstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6672 c.project = project
6673 c.instance = instance
6674 c.instancesimportrequest = instancesimportrequest
6675 return c
6676 }
6677
6678
6679
6680
6681 func (c *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall {
6682 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6683 return c
6684 }
6685
6686
6687
6688
6689 func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall {
6690 c.ctx_ = ctx
6691 return c
6692 }
6693
6694
6695
6696 func (c *InstancesImportCall) Header() http.Header {
6697 if c.header_ == nil {
6698 c.header_ = make(http.Header)
6699 }
6700 return c.header_
6701 }
6702
6703 func (c *InstancesImportCall) doRequest(alt string) (*http.Response, error) {
6704 reqHeaders := make(http.Header)
6705 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
6706 for k, v := range c.header_ {
6707 reqHeaders[k] = v
6708 }
6709 reqHeaders.Set("User-Agent", c.s.userAgent())
6710 var body io.Reader = nil
6711 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest)
6712 if err != nil {
6713 return nil, err
6714 }
6715 reqHeaders.Set("Content-Type", "application/json")
6716 c.urlParams_.Set("alt", alt)
6717 c.urlParams_.Set("prettyPrint", "false")
6718 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/import")
6719 urls += "?" + c.urlParams_.Encode()
6720 req, err := http.NewRequest("POST", urls, body)
6721 if err != nil {
6722 return nil, err
6723 }
6724 req.Header = reqHeaders
6725 googleapi.Expand(req.URL, map[string]string{
6726 "project": c.project,
6727 "instance": c.instance,
6728 })
6729 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6730 }
6731
6732
6733
6734
6735
6736
6737
6738
6739 func (c *InstancesImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6740 gensupport.SetOptions(c.urlParams_, opts...)
6741 res, err := c.doRequest("json")
6742 if res != nil && res.StatusCode == http.StatusNotModified {
6743 if res.Body != nil {
6744 res.Body.Close()
6745 }
6746 return nil, &googleapi.Error{
6747 Code: res.StatusCode,
6748 Header: res.Header,
6749 }
6750 }
6751 if err != nil {
6752 return nil, err
6753 }
6754 defer googleapi.CloseBody(res)
6755 if err := googleapi.CheckResponse(res); err != nil {
6756 return nil, err
6757 }
6758 ret := &Operation{
6759 ServerResponse: googleapi.ServerResponse{
6760 Header: res.Header,
6761 HTTPStatusCode: res.StatusCode,
6762 },
6763 }
6764 target := &ret
6765 if err := gensupport.DecodeResponse(target, res); err != nil {
6766 return nil, err
6767 }
6768 return ret, nil
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804 }
6805
6806
6807
6808 type InstancesInsertCall struct {
6809 s *Service
6810 project string
6811 databaseinstance *DatabaseInstance
6812 urlParams_ gensupport.URLParams
6813 ctx_ context.Context
6814 header_ http.Header
6815 }
6816
6817
6818 func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall {
6819 c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6820 c.project = project
6821 c.databaseinstance = databaseinstance
6822 return c
6823 }
6824
6825
6826
6827
6828 func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
6829 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6830 return c
6831 }
6832
6833
6834
6835
6836 func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
6837 c.ctx_ = ctx
6838 return c
6839 }
6840
6841
6842
6843 func (c *InstancesInsertCall) Header() http.Header {
6844 if c.header_ == nil {
6845 c.header_ = make(http.Header)
6846 }
6847 return c.header_
6848 }
6849
6850 func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
6851 reqHeaders := make(http.Header)
6852 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
6853 for k, v := range c.header_ {
6854 reqHeaders[k] = v
6855 }
6856 reqHeaders.Set("User-Agent", c.s.userAgent())
6857 var body io.Reader = nil
6858 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
6859 if err != nil {
6860 return nil, err
6861 }
6862 reqHeaders.Set("Content-Type", "application/json")
6863 c.urlParams_.Set("alt", alt)
6864 c.urlParams_.Set("prettyPrint", "false")
6865 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances")
6866 urls += "?" + c.urlParams_.Encode()
6867 req, err := http.NewRequest("POST", urls, body)
6868 if err != nil {
6869 return nil, err
6870 }
6871 req.Header = reqHeaders
6872 googleapi.Expand(req.URL, map[string]string{
6873 "project": c.project,
6874 })
6875 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6876 }
6877
6878
6879
6880
6881
6882
6883
6884
6885 func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
6886 gensupport.SetOptions(c.urlParams_, opts...)
6887 res, err := c.doRequest("json")
6888 if res != nil && res.StatusCode == http.StatusNotModified {
6889 if res.Body != nil {
6890 res.Body.Close()
6891 }
6892 return nil, &googleapi.Error{
6893 Code: res.StatusCode,
6894 Header: res.Header,
6895 }
6896 }
6897 if err != nil {
6898 return nil, err
6899 }
6900 defer googleapi.CloseBody(res)
6901 if err := googleapi.CheckResponse(res); err != nil {
6902 return nil, err
6903 }
6904 ret := &Operation{
6905 ServerResponse: googleapi.ServerResponse{
6906 Header: res.Header,
6907 HTTPStatusCode: res.StatusCode,
6908 },
6909 }
6910 target := &ret
6911 if err := gensupport.DecodeResponse(target, res); err != nil {
6912 return nil, err
6913 }
6914 return ret, nil
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944 }
6945
6946
6947
6948 type InstancesListCall struct {
6949 s *Service
6950 project string
6951 urlParams_ gensupport.URLParams
6952 ifNoneMatch_ string
6953 ctx_ context.Context
6954 header_ http.Header
6955 }
6956
6957
6958 func (r *InstancesService) List(project string) *InstancesListCall {
6959 c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6960 c.project = project
6961 return c
6962 }
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980 func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
6981 c.urlParams_.Set("filter", filter)
6982 return c
6983 }
6984
6985
6986
6987 func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
6988 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
6989 return c
6990 }
6991
6992
6993
6994
6995
6996 func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
6997 c.urlParams_.Set("pageToken", pageToken)
6998 return c
6999 }
7000
7001
7002
7003
7004 func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
7005 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7006 return c
7007 }
7008
7009
7010
7011
7012
7013
7014 func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
7015 c.ifNoneMatch_ = entityTag
7016 return c
7017 }
7018
7019
7020
7021
7022 func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
7023 c.ctx_ = ctx
7024 return c
7025 }
7026
7027
7028
7029 func (c *InstancesListCall) Header() http.Header {
7030 if c.header_ == nil {
7031 c.header_ = make(http.Header)
7032 }
7033 return c.header_
7034 }
7035
7036 func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
7037 reqHeaders := make(http.Header)
7038 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
7039 for k, v := range c.header_ {
7040 reqHeaders[k] = v
7041 }
7042 reqHeaders.Set("User-Agent", c.s.userAgent())
7043 if c.ifNoneMatch_ != "" {
7044 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7045 }
7046 var body io.Reader = nil
7047 c.urlParams_.Set("alt", alt)
7048 c.urlParams_.Set("prettyPrint", "false")
7049 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances")
7050 urls += "?" + c.urlParams_.Encode()
7051 req, err := http.NewRequest("GET", urls, body)
7052 if err != nil {
7053 return nil, err
7054 }
7055 req.Header = reqHeaders
7056 googleapi.Expand(req.URL, map[string]string{
7057 "project": c.project,
7058 })
7059 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7060 }
7061
7062
7063
7064
7065
7066
7067
7068
7069 func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstancesListResponse, error) {
7070 gensupport.SetOptions(c.urlParams_, opts...)
7071 res, err := c.doRequest("json")
7072 if res != nil && res.StatusCode == http.StatusNotModified {
7073 if res.Body != nil {
7074 res.Body.Close()
7075 }
7076 return nil, &googleapi.Error{
7077 Code: res.StatusCode,
7078 Header: res.Header,
7079 }
7080 }
7081 if err != nil {
7082 return nil, err
7083 }
7084 defer googleapi.CloseBody(res)
7085 if err := googleapi.CheckResponse(res); err != nil {
7086 return nil, err
7087 }
7088 ret := &InstancesListResponse{
7089 ServerResponse: googleapi.ServerResponse{
7090 Header: res.Header,
7091 HTTPStatusCode: res.StatusCode,
7092 },
7093 }
7094 target := &ret
7095 if err := gensupport.DecodeResponse(target, res); err != nil {
7096 return nil, err
7097 }
7098 return ret, nil
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141 }
7142
7143
7144
7145
7146 func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstancesListResponse) error) error {
7147 c.ctx_ = ctx
7148 defer c.PageToken(c.urlParams_.Get("pageToken"))
7149 for {
7150 x, err := c.Do()
7151 if err != nil {
7152 return err
7153 }
7154 if err := f(x); err != nil {
7155 return err
7156 }
7157 if x.NextPageToken == "" {
7158 return nil
7159 }
7160 c.PageToken(x.NextPageToken)
7161 }
7162 }
7163
7164
7165
7166 type InstancesListServerCasCall struct {
7167 s *Service
7168 project string
7169 instance string
7170 urlParams_ gensupport.URLParams
7171 ifNoneMatch_ string
7172 ctx_ context.Context
7173 header_ http.Header
7174 }
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185 func (r *InstancesService) ListServerCas(project string, instance string) *InstancesListServerCasCall {
7186 c := &InstancesListServerCasCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7187 c.project = project
7188 c.instance = instance
7189 return c
7190 }
7191
7192
7193
7194
7195 func (c *InstancesListServerCasCall) Fields(s ...googleapi.Field) *InstancesListServerCasCall {
7196 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7197 return c
7198 }
7199
7200
7201
7202
7203
7204
7205 func (c *InstancesListServerCasCall) IfNoneMatch(entityTag string) *InstancesListServerCasCall {
7206 c.ifNoneMatch_ = entityTag
7207 return c
7208 }
7209
7210
7211
7212
7213 func (c *InstancesListServerCasCall) Context(ctx context.Context) *InstancesListServerCasCall {
7214 c.ctx_ = ctx
7215 return c
7216 }
7217
7218
7219
7220 func (c *InstancesListServerCasCall) Header() http.Header {
7221 if c.header_ == nil {
7222 c.header_ = make(http.Header)
7223 }
7224 return c.header_
7225 }
7226
7227 func (c *InstancesListServerCasCall) doRequest(alt string) (*http.Response, error) {
7228 reqHeaders := make(http.Header)
7229 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
7230 for k, v := range c.header_ {
7231 reqHeaders[k] = v
7232 }
7233 reqHeaders.Set("User-Agent", c.s.userAgent())
7234 if c.ifNoneMatch_ != "" {
7235 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7236 }
7237 var body io.Reader = nil
7238 c.urlParams_.Set("alt", alt)
7239 c.urlParams_.Set("prettyPrint", "false")
7240 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas")
7241 urls += "?" + c.urlParams_.Encode()
7242 req, err := http.NewRequest("GET", urls, body)
7243 if err != nil {
7244 return nil, err
7245 }
7246 req.Header = reqHeaders
7247 googleapi.Expand(req.URL, map[string]string{
7248 "project": c.project,
7249 "instance": c.instance,
7250 })
7251 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7252 }
7253
7254
7255
7256
7257
7258
7259
7260
7261 func (c *InstancesListServerCasCall) Do(opts ...googleapi.CallOption) (*InstancesListServerCasResponse, error) {
7262 gensupport.SetOptions(c.urlParams_, opts...)
7263 res, err := c.doRequest("json")
7264 if res != nil && res.StatusCode == http.StatusNotModified {
7265 if res.Body != nil {
7266 res.Body.Close()
7267 }
7268 return nil, &googleapi.Error{
7269 Code: res.StatusCode,
7270 Header: res.Header,
7271 }
7272 }
7273 if err != nil {
7274 return nil, err
7275 }
7276 defer googleapi.CloseBody(res)
7277 if err := googleapi.CheckResponse(res); err != nil {
7278 return nil, err
7279 }
7280 ret := &InstancesListServerCasResponse{
7281 ServerResponse: googleapi.ServerResponse{
7282 Header: res.Header,
7283 HTTPStatusCode: res.StatusCode,
7284 },
7285 }
7286 target := &ret
7287 if err := gensupport.DecodeResponse(target, res); err != nil {
7288 return nil, err
7289 }
7290 return ret, nil
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324 }
7325
7326
7327
7328 type InstancesPatchCall struct {
7329 s *Service
7330 project string
7331 instance string
7332 databaseinstance *DatabaseInstance
7333 urlParams_ gensupport.URLParams
7334 ctx_ context.Context
7335 header_ http.Header
7336 }
7337
7338
7339
7340 func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall {
7341 c := &InstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7342 c.project = project
7343 c.instance = instance
7344 c.databaseinstance = databaseinstance
7345 return c
7346 }
7347
7348
7349
7350
7351 func (c *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall {
7352 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7353 return c
7354 }
7355
7356
7357
7358
7359 func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall {
7360 c.ctx_ = ctx
7361 return c
7362 }
7363
7364
7365
7366 func (c *InstancesPatchCall) Header() http.Header {
7367 if c.header_ == nil {
7368 c.header_ = make(http.Header)
7369 }
7370 return c.header_
7371 }
7372
7373 func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, error) {
7374 reqHeaders := make(http.Header)
7375 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
7376 for k, v := range c.header_ {
7377 reqHeaders[k] = v
7378 }
7379 reqHeaders.Set("User-Agent", c.s.userAgent())
7380 var body io.Reader = nil
7381 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
7382 if err != nil {
7383 return nil, err
7384 }
7385 reqHeaders.Set("Content-Type", "application/json")
7386 c.urlParams_.Set("alt", alt)
7387 c.urlParams_.Set("prettyPrint", "false")
7388 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}")
7389 urls += "?" + c.urlParams_.Encode()
7390 req, err := http.NewRequest("PATCH", urls, body)
7391 if err != nil {
7392 return nil, err
7393 }
7394 req.Header = reqHeaders
7395 googleapi.Expand(req.URL, map[string]string{
7396 "project": c.project,
7397 "instance": c.instance,
7398 })
7399 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7400 }
7401
7402
7403
7404
7405
7406
7407
7408
7409 func (c *InstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7410 gensupport.SetOptions(c.urlParams_, opts...)
7411 res, err := c.doRequest("json")
7412 if res != nil && res.StatusCode == http.StatusNotModified {
7413 if res.Body != nil {
7414 res.Body.Close()
7415 }
7416 return nil, &googleapi.Error{
7417 Code: res.StatusCode,
7418 Header: res.Header,
7419 }
7420 }
7421 if err != nil {
7422 return nil, err
7423 }
7424 defer googleapi.CloseBody(res)
7425 if err := googleapi.CheckResponse(res); err != nil {
7426 return nil, err
7427 }
7428 ret := &Operation{
7429 ServerResponse: googleapi.ServerResponse{
7430 Header: res.Header,
7431 HTTPStatusCode: res.StatusCode,
7432 },
7433 }
7434 target := &ret
7435 if err := gensupport.DecodeResponse(target, res); err != nil {
7436 return nil, err
7437 }
7438 return ret, nil
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475 }
7476
7477
7478
7479 type InstancesPromoteReplicaCall struct {
7480 s *Service
7481 project string
7482 instance string
7483 urlParams_ gensupport.URLParams
7484 ctx_ context.Context
7485 header_ http.Header
7486 }
7487
7488
7489
7490
7491 func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall {
7492 c := &InstancesPromoteReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7493 c.project = project
7494 c.instance = instance
7495 return c
7496 }
7497
7498
7499
7500
7501 func (c *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall {
7502 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7503 return c
7504 }
7505
7506
7507
7508
7509 func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall {
7510 c.ctx_ = ctx
7511 return c
7512 }
7513
7514
7515
7516 func (c *InstancesPromoteReplicaCall) Header() http.Header {
7517 if c.header_ == nil {
7518 c.header_ = make(http.Header)
7519 }
7520 return c.header_
7521 }
7522
7523 func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) {
7524 reqHeaders := make(http.Header)
7525 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
7526 for k, v := range c.header_ {
7527 reqHeaders[k] = v
7528 }
7529 reqHeaders.Set("User-Agent", c.s.userAgent())
7530 var body io.Reader = nil
7531 c.urlParams_.Set("alt", alt)
7532 c.urlParams_.Set("prettyPrint", "false")
7533 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica")
7534 urls += "?" + c.urlParams_.Encode()
7535 req, err := http.NewRequest("POST", urls, body)
7536 if err != nil {
7537 return nil, err
7538 }
7539 req.Header = reqHeaders
7540 googleapi.Expand(req.URL, map[string]string{
7541 "project": c.project,
7542 "instance": c.instance,
7543 })
7544 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7545 }
7546
7547
7548
7549
7550
7551
7552
7553
7554 func (c *InstancesPromoteReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7555 gensupport.SetOptions(c.urlParams_, opts...)
7556 res, err := c.doRequest("json")
7557 if res != nil && res.StatusCode == http.StatusNotModified {
7558 if res.Body != nil {
7559 res.Body.Close()
7560 }
7561 return nil, &googleapi.Error{
7562 Code: res.StatusCode,
7563 Header: res.Header,
7564 }
7565 }
7566 if err != nil {
7567 return nil, err
7568 }
7569 defer googleapi.CloseBody(res)
7570 if err := googleapi.CheckResponse(res); err != nil {
7571 return nil, err
7572 }
7573 ret := &Operation{
7574 ServerResponse: googleapi.ServerResponse{
7575 Header: res.Header,
7576 HTTPStatusCode: res.StatusCode,
7577 },
7578 }
7579 target := &ret
7580 if err := gensupport.DecodeResponse(target, res); err != nil {
7581 return nil, err
7582 }
7583 return ret, nil
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617 }
7618
7619
7620
7621 type InstancesResetSslConfigCall struct {
7622 s *Service
7623 project string
7624 instance string
7625 urlParams_ gensupport.URLParams
7626 ctx_ context.Context
7627 header_ http.Header
7628 }
7629
7630
7631
7632
7633 func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall {
7634 c := &InstancesResetSslConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7635 c.project = project
7636 c.instance = instance
7637 return c
7638 }
7639
7640
7641
7642
7643 func (c *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall {
7644 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7645 return c
7646 }
7647
7648
7649
7650
7651 func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall {
7652 c.ctx_ = ctx
7653 return c
7654 }
7655
7656
7657
7658 func (c *InstancesResetSslConfigCall) Header() http.Header {
7659 if c.header_ == nil {
7660 c.header_ = make(http.Header)
7661 }
7662 return c.header_
7663 }
7664
7665 func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) {
7666 reqHeaders := make(http.Header)
7667 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
7668 for k, v := range c.header_ {
7669 reqHeaders[k] = v
7670 }
7671 reqHeaders.Set("User-Agent", c.s.userAgent())
7672 var body io.Reader = nil
7673 c.urlParams_.Set("alt", alt)
7674 c.urlParams_.Set("prettyPrint", "false")
7675 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig")
7676 urls += "?" + c.urlParams_.Encode()
7677 req, err := http.NewRequest("POST", urls, body)
7678 if err != nil {
7679 return nil, err
7680 }
7681 req.Header = reqHeaders
7682 googleapi.Expand(req.URL, map[string]string{
7683 "project": c.project,
7684 "instance": c.instance,
7685 })
7686 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7687 }
7688
7689
7690
7691
7692
7693
7694
7695
7696 func (c *InstancesResetSslConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7697 gensupport.SetOptions(c.urlParams_, opts...)
7698 res, err := c.doRequest("json")
7699 if res != nil && res.StatusCode == http.StatusNotModified {
7700 if res.Body != nil {
7701 res.Body.Close()
7702 }
7703 return nil, &googleapi.Error{
7704 Code: res.StatusCode,
7705 Header: res.Header,
7706 }
7707 }
7708 if err != nil {
7709 return nil, err
7710 }
7711 defer googleapi.CloseBody(res)
7712 if err := googleapi.CheckResponse(res); err != nil {
7713 return nil, err
7714 }
7715 ret := &Operation{
7716 ServerResponse: googleapi.ServerResponse{
7717 Header: res.Header,
7718 HTTPStatusCode: res.StatusCode,
7719 },
7720 }
7721 target := &ret
7722 if err := gensupport.DecodeResponse(target, res); err != nil {
7723 return nil, err
7724 }
7725 return ret, nil
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759 }
7760
7761
7762
7763 type InstancesRestartCall struct {
7764 s *Service
7765 project string
7766 instance string
7767 urlParams_ gensupport.URLParams
7768 ctx_ context.Context
7769 header_ http.Header
7770 }
7771
7772
7773 func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall {
7774 c := &InstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7775 c.project = project
7776 c.instance = instance
7777 return c
7778 }
7779
7780
7781
7782
7783 func (c *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall {
7784 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7785 return c
7786 }
7787
7788
7789
7790
7791 func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall {
7792 c.ctx_ = ctx
7793 return c
7794 }
7795
7796
7797
7798 func (c *InstancesRestartCall) Header() http.Header {
7799 if c.header_ == nil {
7800 c.header_ = make(http.Header)
7801 }
7802 return c.header_
7803 }
7804
7805 func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) {
7806 reqHeaders := make(http.Header)
7807 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
7808 for k, v := range c.header_ {
7809 reqHeaders[k] = v
7810 }
7811 reqHeaders.Set("User-Agent", c.s.userAgent())
7812 var body io.Reader = nil
7813 c.urlParams_.Set("alt", alt)
7814 c.urlParams_.Set("prettyPrint", "false")
7815 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/restart")
7816 urls += "?" + c.urlParams_.Encode()
7817 req, err := http.NewRequest("POST", urls, body)
7818 if err != nil {
7819 return nil, err
7820 }
7821 req.Header = reqHeaders
7822 googleapi.Expand(req.URL, map[string]string{
7823 "project": c.project,
7824 "instance": c.instance,
7825 })
7826 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7827 }
7828
7829
7830
7831
7832
7833
7834
7835
7836 func (c *InstancesRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7837 gensupport.SetOptions(c.urlParams_, opts...)
7838 res, err := c.doRequest("json")
7839 if res != nil && res.StatusCode == http.StatusNotModified {
7840 if res.Body != nil {
7841 res.Body.Close()
7842 }
7843 return nil, &googleapi.Error{
7844 Code: res.StatusCode,
7845 Header: res.Header,
7846 }
7847 }
7848 if err != nil {
7849 return nil, err
7850 }
7851 defer googleapi.CloseBody(res)
7852 if err := googleapi.CheckResponse(res); err != nil {
7853 return nil, err
7854 }
7855 ret := &Operation{
7856 ServerResponse: googleapi.ServerResponse{
7857 Header: res.Header,
7858 HTTPStatusCode: res.StatusCode,
7859 },
7860 }
7861 target := &ret
7862 if err := gensupport.DecodeResponse(target, res); err != nil {
7863 return nil, err
7864 }
7865 return ret, nil
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899 }
7900
7901
7902
7903 type InstancesRestoreBackupCall struct {
7904 s *Service
7905 project string
7906 instance string
7907 instancesrestorebackuprequest *InstancesRestoreBackupRequest
7908 urlParams_ gensupport.URLParams
7909 ctx_ context.Context
7910 header_ http.Header
7911 }
7912
7913
7914
7915
7916 func (r *InstancesService) RestoreBackup(project string, instance string, instancesrestorebackuprequest *InstancesRestoreBackupRequest) *InstancesRestoreBackupCall {
7917 c := &InstancesRestoreBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7918 c.project = project
7919 c.instance = instance
7920 c.instancesrestorebackuprequest = instancesrestorebackuprequest
7921 return c
7922 }
7923
7924
7925
7926
7927 func (c *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall {
7928 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7929 return c
7930 }
7931
7932
7933
7934
7935 func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall {
7936 c.ctx_ = ctx
7937 return c
7938 }
7939
7940
7941
7942 func (c *InstancesRestoreBackupCall) Header() http.Header {
7943 if c.header_ == nil {
7944 c.header_ = make(http.Header)
7945 }
7946 return c.header_
7947 }
7948
7949 func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) {
7950 reqHeaders := make(http.Header)
7951 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
7952 for k, v := range c.header_ {
7953 reqHeaders[k] = v
7954 }
7955 reqHeaders.Set("User-Agent", c.s.userAgent())
7956 var body io.Reader = nil
7957 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrestorebackuprequest)
7958 if err != nil {
7959 return nil, err
7960 }
7961 reqHeaders.Set("Content-Type", "application/json")
7962 c.urlParams_.Set("alt", alt)
7963 c.urlParams_.Set("prettyPrint", "false")
7964 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup")
7965 urls += "?" + c.urlParams_.Encode()
7966 req, err := http.NewRequest("POST", urls, body)
7967 if err != nil {
7968 return nil, err
7969 }
7970 req.Header = reqHeaders
7971 googleapi.Expand(req.URL, map[string]string{
7972 "project": c.project,
7973 "instance": c.instance,
7974 })
7975 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7976 }
7977
7978
7979
7980
7981
7982
7983
7984
7985 func (c *InstancesRestoreBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7986 gensupport.SetOptions(c.urlParams_, opts...)
7987 res, err := c.doRequest("json")
7988 if res != nil && res.StatusCode == http.StatusNotModified {
7989 if res.Body != nil {
7990 res.Body.Close()
7991 }
7992 return nil, &googleapi.Error{
7993 Code: res.StatusCode,
7994 Header: res.Header,
7995 }
7996 }
7997 if err != nil {
7998 return nil, err
7999 }
8000 defer googleapi.CloseBody(res)
8001 if err := googleapi.CheckResponse(res); err != nil {
8002 return nil, err
8003 }
8004 ret := &Operation{
8005 ServerResponse: googleapi.ServerResponse{
8006 Header: res.Header,
8007 HTTPStatusCode: res.StatusCode,
8008 },
8009 }
8010 target := &ret
8011 if err := gensupport.DecodeResponse(target, res); err != nil {
8012 return nil, err
8013 }
8014 return ret, nil
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051 }
8052
8053
8054
8055 type InstancesRotateServerCaCall struct {
8056 s *Service
8057 project string
8058 instance string
8059 instancesrotateservercarequest *InstancesRotateServerCaRequest
8060 urlParams_ gensupport.URLParams
8061 ctx_ context.Context
8062 header_ http.Header
8063 }
8064
8065
8066
8067
8068 func (r *InstancesService) RotateServerCa(project string, instance string, instancesrotateservercarequest *InstancesRotateServerCaRequest) *InstancesRotateServerCaCall {
8069 c := &InstancesRotateServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8070 c.project = project
8071 c.instance = instance
8072 c.instancesrotateservercarequest = instancesrotateservercarequest
8073 return c
8074 }
8075
8076
8077
8078
8079 func (c *InstancesRotateServerCaCall) Fields(s ...googleapi.Field) *InstancesRotateServerCaCall {
8080 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8081 return c
8082 }
8083
8084
8085
8086
8087 func (c *InstancesRotateServerCaCall) Context(ctx context.Context) *InstancesRotateServerCaCall {
8088 c.ctx_ = ctx
8089 return c
8090 }
8091
8092
8093
8094 func (c *InstancesRotateServerCaCall) Header() http.Header {
8095 if c.header_ == nil {
8096 c.header_ = make(http.Header)
8097 }
8098 return c.header_
8099 }
8100
8101 func (c *InstancesRotateServerCaCall) doRequest(alt string) (*http.Response, error) {
8102 reqHeaders := make(http.Header)
8103 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
8104 for k, v := range c.header_ {
8105 reqHeaders[k] = v
8106 }
8107 reqHeaders.Set("User-Agent", c.s.userAgent())
8108 var body io.Reader = nil
8109 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrotateservercarequest)
8110 if err != nil {
8111 return nil, err
8112 }
8113 reqHeaders.Set("Content-Type", "application/json")
8114 c.urlParams_.Set("alt", alt)
8115 c.urlParams_.Set("prettyPrint", "false")
8116 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa")
8117 urls += "?" + c.urlParams_.Encode()
8118 req, err := http.NewRequest("POST", urls, body)
8119 if err != nil {
8120 return nil, err
8121 }
8122 req.Header = reqHeaders
8123 googleapi.Expand(req.URL, map[string]string{
8124 "project": c.project,
8125 "instance": c.instance,
8126 })
8127 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8128 }
8129
8130
8131
8132
8133
8134
8135
8136
8137 func (c *InstancesRotateServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8138 gensupport.SetOptions(c.urlParams_, opts...)
8139 res, err := c.doRequest("json")
8140 if res != nil && res.StatusCode == http.StatusNotModified {
8141 if res.Body != nil {
8142 res.Body.Close()
8143 }
8144 return nil, &googleapi.Error{
8145 Code: res.StatusCode,
8146 Header: res.Header,
8147 }
8148 }
8149 if err != nil {
8150 return nil, err
8151 }
8152 defer googleapi.CloseBody(res)
8153 if err := googleapi.CheckResponse(res); err != nil {
8154 return nil, err
8155 }
8156 ret := &Operation{
8157 ServerResponse: googleapi.ServerResponse{
8158 Header: res.Header,
8159 HTTPStatusCode: res.StatusCode,
8160 },
8161 }
8162 target := &ret
8163 if err := gensupport.DecodeResponse(target, res); err != nil {
8164 return nil, err
8165 }
8166 return ret, nil
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203 }
8204
8205
8206
8207 type InstancesStartReplicaCall struct {
8208 s *Service
8209 project string
8210 instance string
8211 urlParams_ gensupport.URLParams
8212 ctx_ context.Context
8213 header_ http.Header
8214 }
8215
8216
8217 func (r *InstancesService) StartReplica(project string, instance string) *InstancesStartReplicaCall {
8218 c := &InstancesStartReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8219 c.project = project
8220 c.instance = instance
8221 return c
8222 }
8223
8224
8225
8226
8227 func (c *InstancesStartReplicaCall) Fields(s ...googleapi.Field) *InstancesStartReplicaCall {
8228 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8229 return c
8230 }
8231
8232
8233
8234
8235 func (c *InstancesStartReplicaCall) Context(ctx context.Context) *InstancesStartReplicaCall {
8236 c.ctx_ = ctx
8237 return c
8238 }
8239
8240
8241
8242 func (c *InstancesStartReplicaCall) Header() http.Header {
8243 if c.header_ == nil {
8244 c.header_ = make(http.Header)
8245 }
8246 return c.header_
8247 }
8248
8249 func (c *InstancesStartReplicaCall) doRequest(alt string) (*http.Response, error) {
8250 reqHeaders := make(http.Header)
8251 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
8252 for k, v := range c.header_ {
8253 reqHeaders[k] = v
8254 }
8255 reqHeaders.Set("User-Agent", c.s.userAgent())
8256 var body io.Reader = nil
8257 c.urlParams_.Set("alt", alt)
8258 c.urlParams_.Set("prettyPrint", "false")
8259 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/startReplica")
8260 urls += "?" + c.urlParams_.Encode()
8261 req, err := http.NewRequest("POST", urls, body)
8262 if err != nil {
8263 return nil, err
8264 }
8265 req.Header = reqHeaders
8266 googleapi.Expand(req.URL, map[string]string{
8267 "project": c.project,
8268 "instance": c.instance,
8269 })
8270 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8271 }
8272
8273
8274
8275
8276
8277
8278
8279
8280 func (c *InstancesStartReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8281 gensupport.SetOptions(c.urlParams_, opts...)
8282 res, err := c.doRequest("json")
8283 if res != nil && res.StatusCode == http.StatusNotModified {
8284 if res.Body != nil {
8285 res.Body.Close()
8286 }
8287 return nil, &googleapi.Error{
8288 Code: res.StatusCode,
8289 Header: res.Header,
8290 }
8291 }
8292 if err != nil {
8293 return nil, err
8294 }
8295 defer googleapi.CloseBody(res)
8296 if err := googleapi.CheckResponse(res); err != nil {
8297 return nil, err
8298 }
8299 ret := &Operation{
8300 ServerResponse: googleapi.ServerResponse{
8301 Header: res.Header,
8302 HTTPStatusCode: res.StatusCode,
8303 },
8304 }
8305 target := &ret
8306 if err := gensupport.DecodeResponse(target, res); err != nil {
8307 return nil, err
8308 }
8309 return ret, nil
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343 }
8344
8345
8346
8347 type InstancesStopReplicaCall struct {
8348 s *Service
8349 project string
8350 instance string
8351 urlParams_ gensupport.URLParams
8352 ctx_ context.Context
8353 header_ http.Header
8354 }
8355
8356
8357 func (r *InstancesService) StopReplica(project string, instance string) *InstancesStopReplicaCall {
8358 c := &InstancesStopReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8359 c.project = project
8360 c.instance = instance
8361 return c
8362 }
8363
8364
8365
8366
8367 func (c *InstancesStopReplicaCall) Fields(s ...googleapi.Field) *InstancesStopReplicaCall {
8368 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8369 return c
8370 }
8371
8372
8373
8374
8375 func (c *InstancesStopReplicaCall) Context(ctx context.Context) *InstancesStopReplicaCall {
8376 c.ctx_ = ctx
8377 return c
8378 }
8379
8380
8381
8382 func (c *InstancesStopReplicaCall) Header() http.Header {
8383 if c.header_ == nil {
8384 c.header_ = make(http.Header)
8385 }
8386 return c.header_
8387 }
8388
8389 func (c *InstancesStopReplicaCall) doRequest(alt string) (*http.Response, error) {
8390 reqHeaders := make(http.Header)
8391 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
8392 for k, v := range c.header_ {
8393 reqHeaders[k] = v
8394 }
8395 reqHeaders.Set("User-Agent", c.s.userAgent())
8396 var body io.Reader = nil
8397 c.urlParams_.Set("alt", alt)
8398 c.urlParams_.Set("prettyPrint", "false")
8399 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica")
8400 urls += "?" + c.urlParams_.Encode()
8401 req, err := http.NewRequest("POST", urls, body)
8402 if err != nil {
8403 return nil, err
8404 }
8405 req.Header = reqHeaders
8406 googleapi.Expand(req.URL, map[string]string{
8407 "project": c.project,
8408 "instance": c.instance,
8409 })
8410 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8411 }
8412
8413
8414
8415
8416
8417
8418
8419
8420 func (c *InstancesStopReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8421 gensupport.SetOptions(c.urlParams_, opts...)
8422 res, err := c.doRequest("json")
8423 if res != nil && res.StatusCode == http.StatusNotModified {
8424 if res.Body != nil {
8425 res.Body.Close()
8426 }
8427 return nil, &googleapi.Error{
8428 Code: res.StatusCode,
8429 Header: res.Header,
8430 }
8431 }
8432 if err != nil {
8433 return nil, err
8434 }
8435 defer googleapi.CloseBody(res)
8436 if err := googleapi.CheckResponse(res); err != nil {
8437 return nil, err
8438 }
8439 ret := &Operation{
8440 ServerResponse: googleapi.ServerResponse{
8441 Header: res.Header,
8442 HTTPStatusCode: res.StatusCode,
8443 },
8444 }
8445 target := &ret
8446 if err := gensupport.DecodeResponse(target, res); err != nil {
8447 return nil, err
8448 }
8449 return ret, nil
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483 }
8484
8485
8486
8487 type InstancesTruncateLogCall struct {
8488 s *Service
8489 project string
8490 instance string
8491 instancestruncatelogrequest *InstancesTruncateLogRequest
8492 urlParams_ gensupport.URLParams
8493 ctx_ context.Context
8494 header_ http.Header
8495 }
8496
8497
8498 func (r *InstancesService) TruncateLog(project string, instance string, instancestruncatelogrequest *InstancesTruncateLogRequest) *InstancesTruncateLogCall {
8499 c := &InstancesTruncateLogCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8500 c.project = project
8501 c.instance = instance
8502 c.instancestruncatelogrequest = instancestruncatelogrequest
8503 return c
8504 }
8505
8506
8507
8508
8509 func (c *InstancesTruncateLogCall) Fields(s ...googleapi.Field) *InstancesTruncateLogCall {
8510 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8511 return c
8512 }
8513
8514
8515
8516
8517 func (c *InstancesTruncateLogCall) Context(ctx context.Context) *InstancesTruncateLogCall {
8518 c.ctx_ = ctx
8519 return c
8520 }
8521
8522
8523
8524 func (c *InstancesTruncateLogCall) Header() http.Header {
8525 if c.header_ == nil {
8526 c.header_ = make(http.Header)
8527 }
8528 return c.header_
8529 }
8530
8531 func (c *InstancesTruncateLogCall) doRequest(alt string) (*http.Response, error) {
8532 reqHeaders := make(http.Header)
8533 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
8534 for k, v := range c.header_ {
8535 reqHeaders[k] = v
8536 }
8537 reqHeaders.Set("User-Agent", c.s.userAgent())
8538 var body io.Reader = nil
8539 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancestruncatelogrequest)
8540 if err != nil {
8541 return nil, err
8542 }
8543 reqHeaders.Set("Content-Type", "application/json")
8544 c.urlParams_.Set("alt", alt)
8545 c.urlParams_.Set("prettyPrint", "false")
8546 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/truncateLog")
8547 urls += "?" + c.urlParams_.Encode()
8548 req, err := http.NewRequest("POST", urls, body)
8549 if err != nil {
8550 return nil, err
8551 }
8552 req.Header = reqHeaders
8553 googleapi.Expand(req.URL, map[string]string{
8554 "project": c.project,
8555 "instance": c.instance,
8556 })
8557 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8558 }
8559
8560
8561
8562
8563
8564
8565
8566
8567 func (c *InstancesTruncateLogCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8568 gensupport.SetOptions(c.urlParams_, opts...)
8569 res, err := c.doRequest("json")
8570 if res != nil && res.StatusCode == http.StatusNotModified {
8571 if res.Body != nil {
8572 res.Body.Close()
8573 }
8574 return nil, &googleapi.Error{
8575 Code: res.StatusCode,
8576 Header: res.Header,
8577 }
8578 }
8579 if err != nil {
8580 return nil, err
8581 }
8582 defer googleapi.CloseBody(res)
8583 if err := googleapi.CheckResponse(res); err != nil {
8584 return nil, err
8585 }
8586 ret := &Operation{
8587 ServerResponse: googleapi.ServerResponse{
8588 Header: res.Header,
8589 HTTPStatusCode: res.StatusCode,
8590 },
8591 }
8592 target := &ret
8593 if err := gensupport.DecodeResponse(target, res); err != nil {
8594 return nil, err
8595 }
8596 return ret, nil
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633 }
8634
8635
8636
8637 type InstancesUpdateCall struct {
8638 s *Service
8639 project string
8640 instance string
8641 databaseinstance *DatabaseInstance
8642 urlParams_ gensupport.URLParams
8643 ctx_ context.Context
8644 header_ http.Header
8645 }
8646
8647
8648
8649
8650 func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall {
8651 c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8652 c.project = project
8653 c.instance = instance
8654 c.databaseinstance = databaseinstance
8655 return c
8656 }
8657
8658
8659
8660
8661 func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall {
8662 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8663 return c
8664 }
8665
8666
8667
8668
8669 func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall {
8670 c.ctx_ = ctx
8671 return c
8672 }
8673
8674
8675
8676 func (c *InstancesUpdateCall) Header() http.Header {
8677 if c.header_ == nil {
8678 c.header_ = make(http.Header)
8679 }
8680 return c.header_
8681 }
8682
8683 func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) {
8684 reqHeaders := make(http.Header)
8685 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
8686 for k, v := range c.header_ {
8687 reqHeaders[k] = v
8688 }
8689 reqHeaders.Set("User-Agent", c.s.userAgent())
8690 var body io.Reader = nil
8691 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance)
8692 if err != nil {
8693 return nil, err
8694 }
8695 reqHeaders.Set("Content-Type", "application/json")
8696 c.urlParams_.Set("alt", alt)
8697 c.urlParams_.Set("prettyPrint", "false")
8698 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}")
8699 urls += "?" + c.urlParams_.Encode()
8700 req, err := http.NewRequest("PUT", urls, body)
8701 if err != nil {
8702 return nil, err
8703 }
8704 req.Header = reqHeaders
8705 googleapi.Expand(req.URL, map[string]string{
8706 "project": c.project,
8707 "instance": c.instance,
8708 })
8709 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8710 }
8711
8712
8713
8714
8715
8716
8717
8718
8719 func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8720 gensupport.SetOptions(c.urlParams_, opts...)
8721 res, err := c.doRequest("json")
8722 if res != nil && res.StatusCode == http.StatusNotModified {
8723 if res.Body != nil {
8724 res.Body.Close()
8725 }
8726 return nil, &googleapi.Error{
8727 Code: res.StatusCode,
8728 Header: res.Header,
8729 }
8730 }
8731 if err != nil {
8732 return nil, err
8733 }
8734 defer googleapi.CloseBody(res)
8735 if err := googleapi.CheckResponse(res); err != nil {
8736 return nil, err
8737 }
8738 ret := &Operation{
8739 ServerResponse: googleapi.ServerResponse{
8740 Header: res.Header,
8741 HTTPStatusCode: res.StatusCode,
8742 },
8743 }
8744 target := &ret
8745 if err := gensupport.DecodeResponse(target, res); err != nil {
8746 return nil, err
8747 }
8748 return ret, nil
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785 }
8786
8787
8788
8789 type OperationsGetCall struct {
8790 s *Service
8791 project string
8792 operation string
8793 urlParams_ gensupport.URLParams
8794 ifNoneMatch_ string
8795 ctx_ context.Context
8796 header_ http.Header
8797 }
8798
8799
8800
8801 func (r *OperationsService) Get(project string, operation string) *OperationsGetCall {
8802 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8803 c.project = project
8804 c.operation = operation
8805 return c
8806 }
8807
8808
8809
8810
8811 func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
8812 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8813 return c
8814 }
8815
8816
8817
8818
8819
8820
8821 func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
8822 c.ifNoneMatch_ = entityTag
8823 return c
8824 }
8825
8826
8827
8828
8829 func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
8830 c.ctx_ = ctx
8831 return c
8832 }
8833
8834
8835
8836 func (c *OperationsGetCall) Header() http.Header {
8837 if c.header_ == nil {
8838 c.header_ = make(http.Header)
8839 }
8840 return c.header_
8841 }
8842
8843 func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
8844 reqHeaders := make(http.Header)
8845 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
8846 for k, v := range c.header_ {
8847 reqHeaders[k] = v
8848 }
8849 reqHeaders.Set("User-Agent", c.s.userAgent())
8850 if c.ifNoneMatch_ != "" {
8851 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8852 }
8853 var body io.Reader = nil
8854 c.urlParams_.Set("alt", alt)
8855 c.urlParams_.Set("prettyPrint", "false")
8856 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/operations/{operation}")
8857 urls += "?" + c.urlParams_.Encode()
8858 req, err := http.NewRequest("GET", urls, body)
8859 if err != nil {
8860 return nil, err
8861 }
8862 req.Header = reqHeaders
8863 googleapi.Expand(req.URL, map[string]string{
8864 "project": c.project,
8865 "operation": c.operation,
8866 })
8867 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8868 }
8869
8870
8871
8872
8873
8874
8875
8876
8877 func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8878 gensupport.SetOptions(c.urlParams_, opts...)
8879 res, err := c.doRequest("json")
8880 if res != nil && res.StatusCode == http.StatusNotModified {
8881 if res.Body != nil {
8882 res.Body.Close()
8883 }
8884 return nil, &googleapi.Error{
8885 Code: res.StatusCode,
8886 Header: res.Header,
8887 }
8888 }
8889 if err != nil {
8890 return nil, err
8891 }
8892 defer googleapi.CloseBody(res)
8893 if err := googleapi.CheckResponse(res); err != nil {
8894 return nil, err
8895 }
8896 ret := &Operation{
8897 ServerResponse: googleapi.ServerResponse{
8898 Header: res.Header,
8899 HTTPStatusCode: res.StatusCode,
8900 },
8901 }
8902 target := &ret
8903 if err := gensupport.DecodeResponse(target, res); err != nil {
8904 return nil, err
8905 }
8906 return ret, nil
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940 }
8941
8942
8943
8944 type OperationsListCall struct {
8945 s *Service
8946 project string
8947 urlParams_ gensupport.URLParams
8948 ifNoneMatch_ string
8949 ctx_ context.Context
8950 header_ http.Header
8951 }
8952
8953
8954
8955
8956 func (r *OperationsService) List(project string) *OperationsListCall {
8957 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8958 c.project = project
8959 return c
8960 }
8961
8962
8963
8964 func (c *OperationsListCall) Instance(instance string) *OperationsListCall {
8965 c.urlParams_.Set("instance", instance)
8966 return c
8967 }
8968
8969
8970
8971 func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall {
8972 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
8973 return c
8974 }
8975
8976
8977
8978
8979
8980 func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
8981 c.urlParams_.Set("pageToken", pageToken)
8982 return c
8983 }
8984
8985
8986
8987
8988 func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
8989 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8990 return c
8991 }
8992
8993
8994
8995
8996
8997
8998 func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
8999 c.ifNoneMatch_ = entityTag
9000 return c
9001 }
9002
9003
9004
9005
9006 func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
9007 c.ctx_ = ctx
9008 return c
9009 }
9010
9011
9012
9013 func (c *OperationsListCall) Header() http.Header {
9014 if c.header_ == nil {
9015 c.header_ = make(http.Header)
9016 }
9017 return c.header_
9018 }
9019
9020 func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
9021 reqHeaders := make(http.Header)
9022 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
9023 for k, v := range c.header_ {
9024 reqHeaders[k] = v
9025 }
9026 reqHeaders.Set("User-Agent", c.s.userAgent())
9027 if c.ifNoneMatch_ != "" {
9028 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9029 }
9030 var body io.Reader = nil
9031 c.urlParams_.Set("alt", alt)
9032 c.urlParams_.Set("prettyPrint", "false")
9033 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/operations")
9034 urls += "?" + c.urlParams_.Encode()
9035 req, err := http.NewRequest("GET", urls, body)
9036 if err != nil {
9037 return nil, err
9038 }
9039 req.Header = reqHeaders
9040 googleapi.Expand(req.URL, map[string]string{
9041 "project": c.project,
9042 })
9043 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9044 }
9045
9046
9047
9048
9049
9050
9051
9052
9053 func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) {
9054 gensupport.SetOptions(c.urlParams_, opts...)
9055 res, err := c.doRequest("json")
9056 if res != nil && res.StatusCode == http.StatusNotModified {
9057 if res.Body != nil {
9058 res.Body.Close()
9059 }
9060 return nil, &googleapi.Error{
9061 Code: res.StatusCode,
9062 Header: res.Header,
9063 }
9064 }
9065 if err != nil {
9066 return nil, err
9067 }
9068 defer googleapi.CloseBody(res)
9069 if err := googleapi.CheckResponse(res); err != nil {
9070 return nil, err
9071 }
9072 ret := &OperationsListResponse{
9073 ServerResponse: googleapi.ServerResponse{
9074 Header: res.Header,
9075 HTTPStatusCode: res.StatusCode,
9076 },
9077 }
9078 target := &ret
9079 if err := gensupport.DecodeResponse(target, res); err != nil {
9080 return nil, err
9081 }
9082 return ret, nil
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125 }
9126
9127
9128
9129
9130 func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error {
9131 c.ctx_ = ctx
9132 defer c.PageToken(c.urlParams_.Get("pageToken"))
9133 for {
9134 x, err := c.Do()
9135 if err != nil {
9136 return err
9137 }
9138 if err := f(x); err != nil {
9139 return err
9140 }
9141 if x.NextPageToken == "" {
9142 return nil
9143 }
9144 c.PageToken(x.NextPageToken)
9145 }
9146 }
9147
9148
9149
9150 type ProjectsInstancesRescheduleMaintenanceCall struct {
9151 s *Service
9152 project string
9153 instance string
9154 sqlinstancesreschedulemaintenancerequestbody *SqlInstancesRescheduleMaintenanceRequestBody
9155 urlParams_ gensupport.URLParams
9156 ctx_ context.Context
9157 header_ http.Header
9158 }
9159
9160
9161
9162 func (r *ProjectsInstancesService) RescheduleMaintenance(project string, instance string, sqlinstancesreschedulemaintenancerequestbody *SqlInstancesRescheduleMaintenanceRequestBody) *ProjectsInstancesRescheduleMaintenanceCall {
9163 c := &ProjectsInstancesRescheduleMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9164 c.project = project
9165 c.instance = instance
9166 c.sqlinstancesreschedulemaintenancerequestbody = sqlinstancesreschedulemaintenancerequestbody
9167 return c
9168 }
9169
9170
9171
9172
9173 func (c *ProjectsInstancesRescheduleMaintenanceCall) Fields(s ...googleapi.Field) *ProjectsInstancesRescheduleMaintenanceCall {
9174 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9175 return c
9176 }
9177
9178
9179
9180
9181 func (c *ProjectsInstancesRescheduleMaintenanceCall) Context(ctx context.Context) *ProjectsInstancesRescheduleMaintenanceCall {
9182 c.ctx_ = ctx
9183 return c
9184 }
9185
9186
9187
9188 func (c *ProjectsInstancesRescheduleMaintenanceCall) Header() http.Header {
9189 if c.header_ == nil {
9190 c.header_ = make(http.Header)
9191 }
9192 return c.header_
9193 }
9194
9195 func (c *ProjectsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) {
9196 reqHeaders := make(http.Header)
9197 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
9198 for k, v := range c.header_ {
9199 reqHeaders[k] = v
9200 }
9201 reqHeaders.Set("User-Agent", c.s.userAgent())
9202 var body io.Reader = nil
9203 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesreschedulemaintenancerequestbody)
9204 if err != nil {
9205 return nil, err
9206 }
9207 reqHeaders.Set("Content-Type", "application/json")
9208 c.urlParams_.Set("alt", alt)
9209 c.urlParams_.Set("prettyPrint", "false")
9210 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance")
9211 urls += "?" + c.urlParams_.Encode()
9212 req, err := http.NewRequest("POST", urls, body)
9213 if err != nil {
9214 return nil, err
9215 }
9216 req.Header = reqHeaders
9217 googleapi.Expand(req.URL, map[string]string{
9218 "project": c.project,
9219 "instance": c.instance,
9220 })
9221 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9222 }
9223
9224
9225
9226
9227
9228
9229
9230
9231 func (c *ProjectsInstancesRescheduleMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9232 gensupport.SetOptions(c.urlParams_, opts...)
9233 res, err := c.doRequest("json")
9234 if res != nil && res.StatusCode == http.StatusNotModified {
9235 if res.Body != nil {
9236 res.Body.Close()
9237 }
9238 return nil, &googleapi.Error{
9239 Code: res.StatusCode,
9240 Header: res.Header,
9241 }
9242 }
9243 if err != nil {
9244 return nil, err
9245 }
9246 defer googleapi.CloseBody(res)
9247 if err := googleapi.CheckResponse(res); err != nil {
9248 return nil, err
9249 }
9250 ret := &Operation{
9251 ServerResponse: googleapi.ServerResponse{
9252 Header: res.Header,
9253 HTTPStatusCode: res.StatusCode,
9254 },
9255 }
9256 target := &ret
9257 if err := gensupport.DecodeResponse(target, res); err != nil {
9258 return nil, err
9259 }
9260 return ret, nil
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297 }
9298
9299
9300
9301 type ProjectsInstancesStartExternalSyncCall struct {
9302 s *Service
9303 project string
9304 instance string
9305 urlParams_ gensupport.URLParams
9306 ctx_ context.Context
9307 header_ http.Header
9308 }
9309
9310
9311 func (r *ProjectsInstancesService) StartExternalSync(project string, instance string) *ProjectsInstancesStartExternalSyncCall {
9312 c := &ProjectsInstancesStartExternalSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9313 c.project = project
9314 c.instance = instance
9315 return c
9316 }
9317
9318
9319
9320
9321
9322
9323
9324
9325 func (c *ProjectsInstancesStartExternalSyncCall) SyncMode(syncMode string) *ProjectsInstancesStartExternalSyncCall {
9326 c.urlParams_.Set("syncMode", syncMode)
9327 return c
9328 }
9329
9330
9331
9332
9333 func (c *ProjectsInstancesStartExternalSyncCall) Fields(s ...googleapi.Field) *ProjectsInstancesStartExternalSyncCall {
9334 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9335 return c
9336 }
9337
9338
9339
9340
9341 func (c *ProjectsInstancesStartExternalSyncCall) Context(ctx context.Context) *ProjectsInstancesStartExternalSyncCall {
9342 c.ctx_ = ctx
9343 return c
9344 }
9345
9346
9347
9348 func (c *ProjectsInstancesStartExternalSyncCall) Header() http.Header {
9349 if c.header_ == nil {
9350 c.header_ = make(http.Header)
9351 }
9352 return c.header_
9353 }
9354
9355 func (c *ProjectsInstancesStartExternalSyncCall) doRequest(alt string) (*http.Response, error) {
9356 reqHeaders := make(http.Header)
9357 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
9358 for k, v := range c.header_ {
9359 reqHeaders[k] = v
9360 }
9361 reqHeaders.Set("User-Agent", c.s.userAgent())
9362 var body io.Reader = nil
9363 c.urlParams_.Set("alt", alt)
9364 c.urlParams_.Set("prettyPrint", "false")
9365 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync")
9366 urls += "?" + c.urlParams_.Encode()
9367 req, err := http.NewRequest("POST", urls, body)
9368 if err != nil {
9369 return nil, err
9370 }
9371 req.Header = reqHeaders
9372 googleapi.Expand(req.URL, map[string]string{
9373 "project": c.project,
9374 "instance": c.instance,
9375 })
9376 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9377 }
9378
9379
9380
9381
9382
9383
9384
9385
9386 func (c *ProjectsInstancesStartExternalSyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9387 gensupport.SetOptions(c.urlParams_, opts...)
9388 res, err := c.doRequest("json")
9389 if res != nil && res.StatusCode == http.StatusNotModified {
9390 if res.Body != nil {
9391 res.Body.Close()
9392 }
9393 return nil, &googleapi.Error{
9394 Code: res.StatusCode,
9395 Header: res.Header,
9396 }
9397 }
9398 if err != nil {
9399 return nil, err
9400 }
9401 defer googleapi.CloseBody(res)
9402 if err := googleapi.CheckResponse(res); err != nil {
9403 return nil, err
9404 }
9405 ret := &Operation{
9406 ServerResponse: googleapi.ServerResponse{
9407 Header: res.Header,
9408 HTTPStatusCode: res.StatusCode,
9409 },
9410 }
9411 target := &ret
9412 if err := gensupport.DecodeResponse(target, res); err != nil {
9413 return nil, err
9414 }
9415 return ret, nil
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459 }
9460
9461
9462
9463 type ProjectsInstancesVerifyExternalSyncSettingsCall struct {
9464 s *Service
9465 project string
9466 instance string
9467 urlParams_ gensupport.URLParams
9468 ctx_ context.Context
9469 header_ http.Header
9470 }
9471
9472
9473
9474 func (r *ProjectsInstancesService) VerifyExternalSyncSettings(project string, instance string) *ProjectsInstancesVerifyExternalSyncSettingsCall {
9475 c := &ProjectsInstancesVerifyExternalSyncSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9476 c.project = project
9477 c.instance = instance
9478 return c
9479 }
9480
9481
9482
9483
9484
9485
9486
9487
9488 func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) SyncMode(syncMode string) *ProjectsInstancesVerifyExternalSyncSettingsCall {
9489 c.urlParams_.Set("syncMode", syncMode)
9490 return c
9491 }
9492
9493
9494
9495 func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) VerifyConnectionOnly(verifyConnectionOnly bool) *ProjectsInstancesVerifyExternalSyncSettingsCall {
9496 c.urlParams_.Set("verifyConnectionOnly", fmt.Sprint(verifyConnectionOnly))
9497 return c
9498 }
9499
9500
9501
9502
9503 func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Fields(s ...googleapi.Field) *ProjectsInstancesVerifyExternalSyncSettingsCall {
9504 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9505 return c
9506 }
9507
9508
9509
9510
9511 func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Context(ctx context.Context) *ProjectsInstancesVerifyExternalSyncSettingsCall {
9512 c.ctx_ = ctx
9513 return c
9514 }
9515
9516
9517
9518 func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Header() http.Header {
9519 if c.header_ == nil {
9520 c.header_ = make(http.Header)
9521 }
9522 return c.header_
9523 }
9524
9525 func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) doRequest(alt string) (*http.Response, error) {
9526 reqHeaders := make(http.Header)
9527 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
9528 for k, v := range c.header_ {
9529 reqHeaders[k] = v
9530 }
9531 reqHeaders.Set("User-Agent", c.s.userAgent())
9532 var body io.Reader = nil
9533 c.urlParams_.Set("alt", alt)
9534 c.urlParams_.Set("prettyPrint", "false")
9535 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings")
9536 urls += "?" + c.urlParams_.Encode()
9537 req, err := http.NewRequest("POST", urls, body)
9538 if err != nil {
9539 return nil, err
9540 }
9541 req.Header = reqHeaders
9542 googleapi.Expand(req.URL, map[string]string{
9543 "project": c.project,
9544 "instance": c.instance,
9545 })
9546 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9547 }
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558 func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Do(opts ...googleapi.CallOption) (*SqlInstancesVerifyExternalSyncSettingsResponse, error) {
9559 gensupport.SetOptions(c.urlParams_, opts...)
9560 res, err := c.doRequest("json")
9561 if res != nil && res.StatusCode == http.StatusNotModified {
9562 if res.Body != nil {
9563 res.Body.Close()
9564 }
9565 return nil, &googleapi.Error{
9566 Code: res.StatusCode,
9567 Header: res.Header,
9568 }
9569 }
9570 if err != nil {
9571 return nil, err
9572 }
9573 defer googleapi.CloseBody(res)
9574 if err := googleapi.CheckResponse(res); err != nil {
9575 return nil, err
9576 }
9577 ret := &SqlInstancesVerifyExternalSyncSettingsResponse{
9578 ServerResponse: googleapi.ServerResponse{
9579 Header: res.Header,
9580 HTTPStatusCode: res.StatusCode,
9581 },
9582 }
9583 target := &ret
9584 if err := gensupport.DecodeResponse(target, res); err != nil {
9585 return nil, err
9586 }
9587 return ret, nil
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636 }
9637
9638
9639
9640 type SslCertsCreateEphemeralCall struct {
9641 s *Service
9642 project string
9643 instance string
9644 sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest
9645 urlParams_ gensupport.URLParams
9646 ctx_ context.Context
9647 header_ http.Header
9648 }
9649
9650
9651
9652
9653
9654
9655
9656
9657 func (r *SslCertsService) CreateEphemeral(project string, instance string, sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest) *SslCertsCreateEphemeralCall {
9658 c := &SslCertsCreateEphemeralCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9659 c.project = project
9660 c.instance = instance
9661 c.sslcertscreateephemeralrequest = sslcertscreateephemeralrequest
9662 return c
9663 }
9664
9665
9666
9667
9668 func (c *SslCertsCreateEphemeralCall) Fields(s ...googleapi.Field) *SslCertsCreateEphemeralCall {
9669 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9670 return c
9671 }
9672
9673
9674
9675
9676 func (c *SslCertsCreateEphemeralCall) Context(ctx context.Context) *SslCertsCreateEphemeralCall {
9677 c.ctx_ = ctx
9678 return c
9679 }
9680
9681
9682
9683 func (c *SslCertsCreateEphemeralCall) Header() http.Header {
9684 if c.header_ == nil {
9685 c.header_ = make(http.Header)
9686 }
9687 return c.header_
9688 }
9689
9690 func (c *SslCertsCreateEphemeralCall) doRequest(alt string) (*http.Response, error) {
9691 reqHeaders := make(http.Header)
9692 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
9693 for k, v := range c.header_ {
9694 reqHeaders[k] = v
9695 }
9696 reqHeaders.Set("User-Agent", c.s.userAgent())
9697 var body io.Reader = nil
9698 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertscreateephemeralrequest)
9699 if err != nil {
9700 return nil, err
9701 }
9702 reqHeaders.Set("Content-Type", "application/json")
9703 c.urlParams_.Set("alt", alt)
9704 c.urlParams_.Set("prettyPrint", "false")
9705 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral")
9706 urls += "?" + c.urlParams_.Encode()
9707 req, err := http.NewRequest("POST", urls, body)
9708 if err != nil {
9709 return nil, err
9710 }
9711 req.Header = reqHeaders
9712 googleapi.Expand(req.URL, map[string]string{
9713 "project": c.project,
9714 "instance": c.instance,
9715 })
9716 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9717 }
9718
9719
9720
9721
9722
9723
9724
9725
9726 func (c *SslCertsCreateEphemeralCall) Do(opts ...googleapi.CallOption) (*SslCert, error) {
9727 gensupport.SetOptions(c.urlParams_, opts...)
9728 res, err := c.doRequest("json")
9729 if res != nil && res.StatusCode == http.StatusNotModified {
9730 if res.Body != nil {
9731 res.Body.Close()
9732 }
9733 return nil, &googleapi.Error{
9734 Code: res.StatusCode,
9735 Header: res.Header,
9736 }
9737 }
9738 if err != nil {
9739 return nil, err
9740 }
9741 defer googleapi.CloseBody(res)
9742 if err := googleapi.CheckResponse(res); err != nil {
9743 return nil, err
9744 }
9745 ret := &SslCert{
9746 ServerResponse: googleapi.ServerResponse{
9747 Header: res.Header,
9748 HTTPStatusCode: res.StatusCode,
9749 },
9750 }
9751 target := &ret
9752 if err := gensupport.DecodeResponse(target, res); err != nil {
9753 return nil, err
9754 }
9755 return ret, nil
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792 }
9793
9794
9795
9796 type SslCertsDeleteCall struct {
9797 s *Service
9798 project string
9799 instance string
9800 sha1Fingerprint string
9801 urlParams_ gensupport.URLParams
9802 ctx_ context.Context
9803 header_ http.Header
9804 }
9805
9806
9807
9808
9809 func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall {
9810 c := &SslCertsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9811 c.project = project
9812 c.instance = instance
9813 c.sha1Fingerprint = sha1Fingerprint
9814 return c
9815 }
9816
9817
9818
9819
9820 func (c *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall {
9821 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9822 return c
9823 }
9824
9825
9826
9827
9828 func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall {
9829 c.ctx_ = ctx
9830 return c
9831 }
9832
9833
9834
9835 func (c *SslCertsDeleteCall) Header() http.Header {
9836 if c.header_ == nil {
9837 c.header_ = make(http.Header)
9838 }
9839 return c.header_
9840 }
9841
9842 func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) {
9843 reqHeaders := make(http.Header)
9844 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
9845 for k, v := range c.header_ {
9846 reqHeaders[k] = v
9847 }
9848 reqHeaders.Set("User-Agent", c.s.userAgent())
9849 var body io.Reader = nil
9850 c.urlParams_.Set("alt", alt)
9851 c.urlParams_.Set("prettyPrint", "false")
9852 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
9853 urls += "?" + c.urlParams_.Encode()
9854 req, err := http.NewRequest("DELETE", urls, body)
9855 if err != nil {
9856 return nil, err
9857 }
9858 req.Header = reqHeaders
9859 googleapi.Expand(req.URL, map[string]string{
9860 "project": c.project,
9861 "instance": c.instance,
9862 "sha1Fingerprint": c.sha1Fingerprint,
9863 })
9864 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9865 }
9866
9867
9868
9869
9870
9871
9872
9873
9874 func (c *SslCertsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
9875 gensupport.SetOptions(c.urlParams_, opts...)
9876 res, err := c.doRequest("json")
9877 if res != nil && res.StatusCode == http.StatusNotModified {
9878 if res.Body != nil {
9879 res.Body.Close()
9880 }
9881 return nil, &googleapi.Error{
9882 Code: res.StatusCode,
9883 Header: res.Header,
9884 }
9885 }
9886 if err != nil {
9887 return nil, err
9888 }
9889 defer googleapi.CloseBody(res)
9890 if err := googleapi.CheckResponse(res); err != nil {
9891 return nil, err
9892 }
9893 ret := &Operation{
9894 ServerResponse: googleapi.ServerResponse{
9895 Header: res.Header,
9896 HTTPStatusCode: res.StatusCode,
9897 },
9898 }
9899 target := &ret
9900 if err := gensupport.DecodeResponse(target, res); err != nil {
9901 return nil, err
9902 }
9903 return ret, nil
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944 }
9945
9946
9947
9948 type SslCertsGetCall struct {
9949 s *Service
9950 project string
9951 instance string
9952 sha1Fingerprint string
9953 urlParams_ gensupport.URLParams
9954 ifNoneMatch_ string
9955 ctx_ context.Context
9956 header_ http.Header
9957 }
9958
9959
9960
9961
9962
9963
9964 func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall {
9965 c := &SslCertsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9966 c.project = project
9967 c.instance = instance
9968 c.sha1Fingerprint = sha1Fingerprint
9969 return c
9970 }
9971
9972
9973
9974
9975 func (c *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall {
9976 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9977 return c
9978 }
9979
9980
9981
9982
9983
9984
9985 func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall {
9986 c.ifNoneMatch_ = entityTag
9987 return c
9988 }
9989
9990
9991
9992
9993 func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall {
9994 c.ctx_ = ctx
9995 return c
9996 }
9997
9998
9999
10000 func (c *SslCertsGetCall) Header() http.Header {
10001 if c.header_ == nil {
10002 c.header_ = make(http.Header)
10003 }
10004 return c.header_
10005 }
10006
10007 func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) {
10008 reqHeaders := make(http.Header)
10009 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
10010 for k, v := range c.header_ {
10011 reqHeaders[k] = v
10012 }
10013 reqHeaders.Set("User-Agent", c.s.userAgent())
10014 if c.ifNoneMatch_ != "" {
10015 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10016 }
10017 var body io.Reader = nil
10018 c.urlParams_.Set("alt", alt)
10019 c.urlParams_.Set("prettyPrint", "false")
10020 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}")
10021 urls += "?" + c.urlParams_.Encode()
10022 req, err := http.NewRequest("GET", urls, body)
10023 if err != nil {
10024 return nil, err
10025 }
10026 req.Header = reqHeaders
10027 googleapi.Expand(req.URL, map[string]string{
10028 "project": c.project,
10029 "instance": c.instance,
10030 "sha1Fingerprint": c.sha1Fingerprint,
10031 })
10032 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10033 }
10034
10035
10036
10037
10038
10039
10040
10041
10042 func (c *SslCertsGetCall) Do(opts ...googleapi.CallOption) (*SslCert, error) {
10043 gensupport.SetOptions(c.urlParams_, opts...)
10044 res, err := c.doRequest("json")
10045 if res != nil && res.StatusCode == http.StatusNotModified {
10046 if res.Body != nil {
10047 res.Body.Close()
10048 }
10049 return nil, &googleapi.Error{
10050 Code: res.StatusCode,
10051 Header: res.Header,
10052 }
10053 }
10054 if err != nil {
10055 return nil, err
10056 }
10057 defer googleapi.CloseBody(res)
10058 if err := googleapi.CheckResponse(res); err != nil {
10059 return nil, err
10060 }
10061 ret := &SslCert{
10062 ServerResponse: googleapi.ServerResponse{
10063 Header: res.Header,
10064 HTTPStatusCode: res.StatusCode,
10065 },
10066 }
10067 target := &ret
10068 if err := gensupport.DecodeResponse(target, res); err != nil {
10069 return nil, err
10070 }
10071 return ret, nil
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112 }
10113
10114
10115
10116 type SslCertsInsertCall struct {
10117 s *Service
10118 project string
10119 instance string
10120 sslcertsinsertrequest *SslCertsInsertRequest
10121 urlParams_ gensupport.URLParams
10122 ctx_ context.Context
10123 header_ http.Header
10124 }
10125
10126
10127
10128
10129
10130
10131 func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall {
10132 c := &SslCertsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10133 c.project = project
10134 c.instance = instance
10135 c.sslcertsinsertrequest = sslcertsinsertrequest
10136 return c
10137 }
10138
10139
10140
10141
10142 func (c *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall {
10143 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10144 return c
10145 }
10146
10147
10148
10149
10150 func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall {
10151 c.ctx_ = ctx
10152 return c
10153 }
10154
10155
10156
10157 func (c *SslCertsInsertCall) Header() http.Header {
10158 if c.header_ == nil {
10159 c.header_ = make(http.Header)
10160 }
10161 return c.header_
10162 }
10163
10164 func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, error) {
10165 reqHeaders := make(http.Header)
10166 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
10167 for k, v := range c.header_ {
10168 reqHeaders[k] = v
10169 }
10170 reqHeaders.Set("User-Agent", c.s.userAgent())
10171 var body io.Reader = nil
10172 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest)
10173 if err != nil {
10174 return nil, err
10175 }
10176 reqHeaders.Set("Content-Type", "application/json")
10177 c.urlParams_.Set("alt", alt)
10178 c.urlParams_.Set("prettyPrint", "false")
10179 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts")
10180 urls += "?" + c.urlParams_.Encode()
10181 req, err := http.NewRequest("POST", urls, body)
10182 if err != nil {
10183 return nil, err
10184 }
10185 req.Header = reqHeaders
10186 googleapi.Expand(req.URL, map[string]string{
10187 "project": c.project,
10188 "instance": c.instance,
10189 })
10190 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10191 }
10192
10193
10194
10195
10196
10197
10198
10199
10200 func (c *SslCertsInsertCall) Do(opts ...googleapi.CallOption) (*SslCertsInsertResponse, error) {
10201 gensupport.SetOptions(c.urlParams_, opts...)
10202 res, err := c.doRequest("json")
10203 if res != nil && res.StatusCode == http.StatusNotModified {
10204 if res.Body != nil {
10205 res.Body.Close()
10206 }
10207 return nil, &googleapi.Error{
10208 Code: res.StatusCode,
10209 Header: res.Header,
10210 }
10211 }
10212 if err != nil {
10213 return nil, err
10214 }
10215 defer googleapi.CloseBody(res)
10216 if err := googleapi.CheckResponse(res); err != nil {
10217 return nil, err
10218 }
10219 ret := &SslCertsInsertResponse{
10220 ServerResponse: googleapi.ServerResponse{
10221 Header: res.Header,
10222 HTTPStatusCode: res.StatusCode,
10223 },
10224 }
10225 target := &ret
10226 if err := gensupport.DecodeResponse(target, res); err != nil {
10227 return nil, err
10228 }
10229 return ret, nil
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266 }
10267
10268
10269
10270 type SslCertsListCall struct {
10271 s *Service
10272 project string
10273 instance string
10274 urlParams_ gensupport.URLParams
10275 ifNoneMatch_ string
10276 ctx_ context.Context
10277 header_ http.Header
10278 }
10279
10280
10281 func (r *SslCertsService) List(project string, instance string) *SslCertsListCall {
10282 c := &SslCertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10283 c.project = project
10284 c.instance = instance
10285 return c
10286 }
10287
10288
10289
10290
10291 func (c *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall {
10292 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10293 return c
10294 }
10295
10296
10297
10298
10299
10300
10301 func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall {
10302 c.ifNoneMatch_ = entityTag
10303 return c
10304 }
10305
10306
10307
10308
10309 func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall {
10310 c.ctx_ = ctx
10311 return c
10312 }
10313
10314
10315
10316 func (c *SslCertsListCall) Header() http.Header {
10317 if c.header_ == nil {
10318 c.header_ = make(http.Header)
10319 }
10320 return c.header_
10321 }
10322
10323 func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) {
10324 reqHeaders := make(http.Header)
10325 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
10326 for k, v := range c.header_ {
10327 reqHeaders[k] = v
10328 }
10329 reqHeaders.Set("User-Agent", c.s.userAgent())
10330 if c.ifNoneMatch_ != "" {
10331 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10332 }
10333 var body io.Reader = nil
10334 c.urlParams_.Set("alt", alt)
10335 c.urlParams_.Set("prettyPrint", "false")
10336 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts")
10337 urls += "?" + c.urlParams_.Encode()
10338 req, err := http.NewRequest("GET", urls, body)
10339 if err != nil {
10340 return nil, err
10341 }
10342 req.Header = reqHeaders
10343 googleapi.Expand(req.URL, map[string]string{
10344 "project": c.project,
10345 "instance": c.instance,
10346 })
10347 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10348 }
10349
10350
10351
10352
10353
10354
10355
10356
10357 func (c *SslCertsListCall) Do(opts ...googleapi.CallOption) (*SslCertsListResponse, error) {
10358 gensupport.SetOptions(c.urlParams_, opts...)
10359 res, err := c.doRequest("json")
10360 if res != nil && res.StatusCode == http.StatusNotModified {
10361 if res.Body != nil {
10362 res.Body.Close()
10363 }
10364 return nil, &googleapi.Error{
10365 Code: res.StatusCode,
10366 Header: res.Header,
10367 }
10368 }
10369 if err != nil {
10370 return nil, err
10371 }
10372 defer googleapi.CloseBody(res)
10373 if err := googleapi.CheckResponse(res); err != nil {
10374 return nil, err
10375 }
10376 ret := &SslCertsListResponse{
10377 ServerResponse: googleapi.ServerResponse{
10378 Header: res.Header,
10379 HTTPStatusCode: res.StatusCode,
10380 },
10381 }
10382 target := &ret
10383 if err := gensupport.DecodeResponse(target, res); err != nil {
10384 return nil, err
10385 }
10386 return ret, nil
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420 }
10421
10422
10423
10424 type TiersListCall struct {
10425 s *Service
10426 project string
10427 urlParams_ gensupport.URLParams
10428 ifNoneMatch_ string
10429 ctx_ context.Context
10430 header_ http.Header
10431 }
10432
10433
10434
10435
10436
10437
10438 func (r *TiersService) List(project string) *TiersListCall {
10439 c := &TiersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10440 c.project = project
10441 return c
10442 }
10443
10444
10445
10446
10447 func (c *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall {
10448 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10449 return c
10450 }
10451
10452
10453
10454
10455
10456
10457 func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall {
10458 c.ifNoneMatch_ = entityTag
10459 return c
10460 }
10461
10462
10463
10464
10465 func (c *TiersListCall) Context(ctx context.Context) *TiersListCall {
10466 c.ctx_ = ctx
10467 return c
10468 }
10469
10470
10471
10472 func (c *TiersListCall) Header() http.Header {
10473 if c.header_ == nil {
10474 c.header_ = make(http.Header)
10475 }
10476 return c.header_
10477 }
10478
10479 func (c *TiersListCall) doRequest(alt string) (*http.Response, error) {
10480 reqHeaders := make(http.Header)
10481 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
10482 for k, v := range c.header_ {
10483 reqHeaders[k] = v
10484 }
10485 reqHeaders.Set("User-Agent", c.s.userAgent())
10486 if c.ifNoneMatch_ != "" {
10487 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10488 }
10489 var body io.Reader = nil
10490 c.urlParams_.Set("alt", alt)
10491 c.urlParams_.Set("prettyPrint", "false")
10492 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/tiers")
10493 urls += "?" + c.urlParams_.Encode()
10494 req, err := http.NewRequest("GET", urls, body)
10495 if err != nil {
10496 return nil, err
10497 }
10498 req.Header = reqHeaders
10499 googleapi.Expand(req.URL, map[string]string{
10500 "project": c.project,
10501 })
10502 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10503 }
10504
10505
10506
10507
10508
10509
10510
10511
10512 func (c *TiersListCall) Do(opts ...googleapi.CallOption) (*TiersListResponse, error) {
10513 gensupport.SetOptions(c.urlParams_, opts...)
10514 res, err := c.doRequest("json")
10515 if res != nil && res.StatusCode == http.StatusNotModified {
10516 if res.Body != nil {
10517 res.Body.Close()
10518 }
10519 return nil, &googleapi.Error{
10520 Code: res.StatusCode,
10521 Header: res.Header,
10522 }
10523 }
10524 if err != nil {
10525 return nil, err
10526 }
10527 defer googleapi.CloseBody(res)
10528 if err := googleapi.CheckResponse(res); err != nil {
10529 return nil, err
10530 }
10531 ret := &TiersListResponse{
10532 ServerResponse: googleapi.ServerResponse{
10533 Header: res.Header,
10534 HTTPStatusCode: res.StatusCode,
10535 },
10536 }
10537 target := &ret
10538 if err := gensupport.DecodeResponse(target, res); err != nil {
10539 return nil, err
10540 }
10541 return ret, nil
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568 }
10569
10570
10571
10572 type UsersDeleteCall struct {
10573 s *Service
10574 project string
10575 instance string
10576 urlParams_ gensupport.URLParams
10577 ctx_ context.Context
10578 header_ http.Header
10579 }
10580
10581
10582 func (r *UsersService) Delete(project string, instance string) *UsersDeleteCall {
10583 c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10584 c.project = project
10585 c.instance = instance
10586 return c
10587 }
10588
10589
10590
10591 func (c *UsersDeleteCall) Host(host string) *UsersDeleteCall {
10592 c.urlParams_.Set("host", host)
10593 return c
10594 }
10595
10596
10597
10598 func (c *UsersDeleteCall) Name(name string) *UsersDeleteCall {
10599 c.urlParams_.Set("name", name)
10600 return c
10601 }
10602
10603
10604
10605
10606 func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall {
10607 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10608 return c
10609 }
10610
10611
10612
10613
10614 func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall {
10615 c.ctx_ = ctx
10616 return c
10617 }
10618
10619
10620
10621 func (c *UsersDeleteCall) Header() http.Header {
10622 if c.header_ == nil {
10623 c.header_ = make(http.Header)
10624 }
10625 return c.header_
10626 }
10627
10628 func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) {
10629 reqHeaders := make(http.Header)
10630 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
10631 for k, v := range c.header_ {
10632 reqHeaders[k] = v
10633 }
10634 reqHeaders.Set("User-Agent", c.s.userAgent())
10635 var body io.Reader = nil
10636 c.urlParams_.Set("alt", alt)
10637 c.urlParams_.Set("prettyPrint", "false")
10638 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users")
10639 urls += "?" + c.urlParams_.Encode()
10640 req, err := http.NewRequest("DELETE", urls, body)
10641 if err != nil {
10642 return nil, err
10643 }
10644 req.Header = reqHeaders
10645 googleapi.Expand(req.URL, map[string]string{
10646 "project": c.project,
10647 "instance": c.instance,
10648 })
10649 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10650 }
10651
10652
10653
10654
10655
10656
10657
10658
10659 func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10660 gensupport.SetOptions(c.urlParams_, opts...)
10661 res, err := c.doRequest("json")
10662 if res != nil && res.StatusCode == http.StatusNotModified {
10663 if res.Body != nil {
10664 res.Body.Close()
10665 }
10666 return nil, &googleapi.Error{
10667 Code: res.StatusCode,
10668 Header: res.Header,
10669 }
10670 }
10671 if err != nil {
10672 return nil, err
10673 }
10674 defer googleapi.CloseBody(res)
10675 if err := googleapi.CheckResponse(res); err != nil {
10676 return nil, err
10677 }
10678 ret := &Operation{
10679 ServerResponse: googleapi.ServerResponse{
10680 Header: res.Header,
10681 HTTPStatusCode: res.StatusCode,
10682 },
10683 }
10684 target := &ret
10685 if err := gensupport.DecodeResponse(target, res); err != nil {
10686 return nil, err
10687 }
10688 return ret, nil
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732 }
10733
10734
10735
10736 type UsersInsertCall struct {
10737 s *Service
10738 project string
10739 instance string
10740 user *User
10741 urlParams_ gensupport.URLParams
10742 ctx_ context.Context
10743 header_ http.Header
10744 }
10745
10746
10747 func (r *UsersService) Insert(project string, instance string, user *User) *UsersInsertCall {
10748 c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10749 c.project = project
10750 c.instance = instance
10751 c.user = user
10752 return c
10753 }
10754
10755
10756
10757
10758 func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall {
10759 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10760 return c
10761 }
10762
10763
10764
10765
10766 func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall {
10767 c.ctx_ = ctx
10768 return c
10769 }
10770
10771
10772
10773 func (c *UsersInsertCall) Header() http.Header {
10774 if c.header_ == nil {
10775 c.header_ = make(http.Header)
10776 }
10777 return c.header_
10778 }
10779
10780 func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) {
10781 reqHeaders := make(http.Header)
10782 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
10783 for k, v := range c.header_ {
10784 reqHeaders[k] = v
10785 }
10786 reqHeaders.Set("User-Agent", c.s.userAgent())
10787 var body io.Reader = nil
10788 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
10789 if err != nil {
10790 return nil, err
10791 }
10792 reqHeaders.Set("Content-Type", "application/json")
10793 c.urlParams_.Set("alt", alt)
10794 c.urlParams_.Set("prettyPrint", "false")
10795 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users")
10796 urls += "?" + c.urlParams_.Encode()
10797 req, err := http.NewRequest("POST", urls, body)
10798 if err != nil {
10799 return nil, err
10800 }
10801 req.Header = reqHeaders
10802 googleapi.Expand(req.URL, map[string]string{
10803 "project": c.project,
10804 "instance": c.instance,
10805 })
10806 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10807 }
10808
10809
10810
10811
10812
10813
10814
10815
10816 func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
10817 gensupport.SetOptions(c.urlParams_, opts...)
10818 res, err := c.doRequest("json")
10819 if res != nil && res.StatusCode == http.StatusNotModified {
10820 if res.Body != nil {
10821 res.Body.Close()
10822 }
10823 return nil, &googleapi.Error{
10824 Code: res.StatusCode,
10825 Header: res.Header,
10826 }
10827 }
10828 if err != nil {
10829 return nil, err
10830 }
10831 defer googleapi.CloseBody(res)
10832 if err := googleapi.CheckResponse(res); err != nil {
10833 return nil, err
10834 }
10835 ret := &Operation{
10836 ServerResponse: googleapi.ServerResponse{
10837 Header: res.Header,
10838 HTTPStatusCode: res.StatusCode,
10839 },
10840 }
10841 target := &ret
10842 if err := gensupport.DecodeResponse(target, res); err != nil {
10843 return nil, err
10844 }
10845 return ret, nil
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882 }
10883
10884
10885
10886 type UsersListCall struct {
10887 s *Service
10888 project string
10889 instance string
10890 urlParams_ gensupport.URLParams
10891 ifNoneMatch_ string
10892 ctx_ context.Context
10893 header_ http.Header
10894 }
10895
10896
10897 func (r *UsersService) List(project string, instance string) *UsersListCall {
10898 c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10899 c.project = project
10900 c.instance = instance
10901 return c
10902 }
10903
10904
10905
10906
10907 func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall {
10908 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10909 return c
10910 }
10911
10912
10913
10914
10915
10916
10917 func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall {
10918 c.ifNoneMatch_ = entityTag
10919 return c
10920 }
10921
10922
10923
10924
10925 func (c *UsersListCall) Context(ctx context.Context) *UsersListCall {
10926 c.ctx_ = ctx
10927 return c
10928 }
10929
10930
10931
10932 func (c *UsersListCall) Header() http.Header {
10933 if c.header_ == nil {
10934 c.header_ = make(http.Header)
10935 }
10936 return c.header_
10937 }
10938
10939 func (c *UsersListCall) doRequest(alt string) (*http.Response, error) {
10940 reqHeaders := make(http.Header)
10941 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
10942 for k, v := range c.header_ {
10943 reqHeaders[k] = v
10944 }
10945 reqHeaders.Set("User-Agent", c.s.userAgent())
10946 if c.ifNoneMatch_ != "" {
10947 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10948 }
10949 var body io.Reader = nil
10950 c.urlParams_.Set("alt", alt)
10951 c.urlParams_.Set("prettyPrint", "false")
10952 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users")
10953 urls += "?" + c.urlParams_.Encode()
10954 req, err := http.NewRequest("GET", urls, body)
10955 if err != nil {
10956 return nil, err
10957 }
10958 req.Header = reqHeaders
10959 googleapi.Expand(req.URL, map[string]string{
10960 "project": c.project,
10961 "instance": c.instance,
10962 })
10963 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10964 }
10965
10966
10967
10968
10969
10970
10971
10972
10973 func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) {
10974 gensupport.SetOptions(c.urlParams_, opts...)
10975 res, err := c.doRequest("json")
10976 if res != nil && res.StatusCode == http.StatusNotModified {
10977 if res.Body != nil {
10978 res.Body.Close()
10979 }
10980 return nil, &googleapi.Error{
10981 Code: res.StatusCode,
10982 Header: res.Header,
10983 }
10984 }
10985 if err != nil {
10986 return nil, err
10987 }
10988 defer googleapi.CloseBody(res)
10989 if err := googleapi.CheckResponse(res); err != nil {
10990 return nil, err
10991 }
10992 ret := &UsersListResponse{
10993 ServerResponse: googleapi.ServerResponse{
10994 Header: res.Header,
10995 HTTPStatusCode: res.StatusCode,
10996 },
10997 }
10998 target := &ret
10999 if err := gensupport.DecodeResponse(target, res); err != nil {
11000 return nil, err
11001 }
11002 return ret, nil
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036 }
11037
11038
11039
11040 type UsersUpdateCall struct {
11041 s *Service
11042 project string
11043 instance string
11044 user *User
11045 urlParams_ gensupport.URLParams
11046 ctx_ context.Context
11047 header_ http.Header
11048 }
11049
11050
11051 func (r *UsersService) Update(project string, instance string, user *User) *UsersUpdateCall {
11052 c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11053 c.project = project
11054 c.instance = instance
11055 c.user = user
11056 return c
11057 }
11058
11059
11060
11061 func (c *UsersUpdateCall) Host(host string) *UsersUpdateCall {
11062 c.urlParams_.Set("host", host)
11063 return c
11064 }
11065
11066
11067
11068 func (c *UsersUpdateCall) Name(name string) *UsersUpdateCall {
11069 c.urlParams_.Set("name", name)
11070 return c
11071 }
11072
11073
11074
11075
11076 func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall {
11077 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11078 return c
11079 }
11080
11081
11082
11083
11084 func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall {
11085 c.ctx_ = ctx
11086 return c
11087 }
11088
11089
11090
11091 func (c *UsersUpdateCall) Header() http.Header {
11092 if c.header_ == nil {
11093 c.header_ = make(http.Header)
11094 }
11095 return c.header_
11096 }
11097
11098 func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) {
11099 reqHeaders := make(http.Header)
11100 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200503")
11101 for k, v := range c.header_ {
11102 reqHeaders[k] = v
11103 }
11104 reqHeaders.Set("User-Agent", c.s.userAgent())
11105 var body io.Reader = nil
11106 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
11107 if err != nil {
11108 return nil, err
11109 }
11110 reqHeaders.Set("Content-Type", "application/json")
11111 c.urlParams_.Set("alt", alt)
11112 c.urlParams_.Set("prettyPrint", "false")
11113 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users")
11114 urls += "?" + c.urlParams_.Encode()
11115 req, err := http.NewRequest("PUT", urls, body)
11116 if err != nil {
11117 return nil, err
11118 }
11119 req.Header = reqHeaders
11120 googleapi.Expand(req.URL, map[string]string{
11121 "project": c.project,
11122 "instance": c.instance,
11123 })
11124 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11125 }
11126
11127
11128
11129
11130
11131
11132
11133
11134 func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
11135 gensupport.SetOptions(c.urlParams_, opts...)
11136 res, err := c.doRequest("json")
11137 if res != nil && res.StatusCode == http.StatusNotModified {
11138 if res.Body != nil {
11139 res.Body.Close()
11140 }
11141 return nil, &googleapi.Error{
11142 Code: res.StatusCode,
11143 Header: res.Header,
11144 }
11145 }
11146 if err != nil {
11147 return nil, err
11148 }
11149 defer googleapi.CloseBody(res)
11150 if err := googleapi.CheckResponse(res); err != nil {
11151 return nil, err
11152 }
11153 ret := &Operation{
11154 ServerResponse: googleapi.ServerResponse{
11155 Header: res.Header,
11156 HTTPStatusCode: res.StatusCode,
11157 },
11158 }
11159 target := &ret
11160 if err := gensupport.DecodeResponse(target, res); err != nil {
11161 return nil, err
11162 }
11163 return ret, nil
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210 }
11211
View as plain text