-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
sqladmin-gen.go
11179 lines (10120 loc) · 394 KB
/
sqladmin-gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
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
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
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
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2021 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package sqladmin provides access to the Cloud SQL Admin API.
//
// For product documentation, see: https://developers.google.com/cloud-sql/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/sqladmin/v1beta4"
// ...
// ctx := context.Background()
// sqladminService, err := sqladmin.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// sqladminService, err := sqladmin.NewService(ctx, option.WithScopes(sqladmin.SqlserviceAdminScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// sqladminService, err := sqladmin.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// sqladminService, err := sqladmin.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package sqladmin // import "google.golang.org/api/sqladmin/v1beta4"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
const apiId = "sqladmin:v1beta4"
const apiName = "sqladmin"
const apiVersion = "v1beta4"
const basePath = "https://sqladmin.googleapis.com/"
const mtlsBasePath = "https://sqladmin.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// See, edit, configure, and delete your Google Cloud Platform data
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
// Manage your Google SQL Service instances
SqlserviceAdminScope = "https://www.googleapis.com/auth/sqlservice.admin"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/sqlservice.admin",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.BackupRuns = NewBackupRunsService(s)
s.Databases = NewDatabasesService(s)
s.Flags = NewFlagsService(s)
s.Instances = NewInstancesService(s)
s.Operations = NewOperationsService(s)
s.Projects = NewProjectsService(s)
s.SslCerts = NewSslCertsService(s)
s.Tiers = NewTiersService(s)
s.Users = NewUsersService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
BackupRuns *BackupRunsService
Databases *DatabasesService
Flags *FlagsService
Instances *InstancesService
Operations *OperationsService
Projects *ProjectsService
SslCerts *SslCertsService
Tiers *TiersService
Users *UsersService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewBackupRunsService(s *Service) *BackupRunsService {
rs := &BackupRunsService{s: s}
return rs
}
type BackupRunsService struct {
s *Service
}
func NewDatabasesService(s *Service) *DatabasesService {
rs := &DatabasesService{s: s}
return rs
}
type DatabasesService struct {
s *Service
}
func NewFlagsService(s *Service) *FlagsService {
rs := &FlagsService{s: s}
return rs
}
type FlagsService struct {
s *Service
}
func NewInstancesService(s *Service) *InstancesService {
rs := &InstancesService{s: s}
return rs
}
type InstancesService struct {
s *Service
}
func NewOperationsService(s *Service) *OperationsService {
rs := &OperationsService{s: s}
return rs
}
type OperationsService struct {
s *Service
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.Instances = NewProjectsInstancesService(s)
return rs
}
type ProjectsService struct {
s *Service
Instances *ProjectsInstancesService
}
func NewProjectsInstancesService(s *Service) *ProjectsInstancesService {
rs := &ProjectsInstancesService{s: s}
return rs
}
type ProjectsInstancesService struct {
s *Service
}
func NewSslCertsService(s *Service) *SslCertsService {
rs := &SslCertsService{s: s}
return rs
}
type SslCertsService struct {
s *Service
}
func NewTiersService(s *Service) *TiersService {
rs := &TiersService{s: s}
return rs
}
type TiersService struct {
s *Service
}
func NewUsersService(s *Service) *UsersService {
rs := &UsersService{s: s}
return rs
}
type UsersService struct {
s *Service
}
// AclEntry: An entry for an Access Control list.
type AclEntry struct {
// ExpirationTime: The time when this access control entry expires in
// RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.
ExpirationTime string `json:"expirationTime,omitempty"`
// Kind: This is always *sql#aclEntry*.
Kind string `json:"kind,omitempty"`
// Name: Optional. A label to identify this entry.
Name string `json:"name,omitempty"`
// Value: The allowlisted value for the access control list.
Value string `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g. "ExpirationTime") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ExpirationTime") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *AclEntry) MarshalJSON() ([]byte, error) {
type NoMethod AclEntry
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ApiWarning: An Admin API warning message.
type ApiWarning struct {
// Code: Code to uniquely identify the warning type.
//
// Possible values:
// "SQL_API_WARNING_CODE_UNSPECIFIED" - An unknown or unset warning
// type from Cloud SQL API.
// "REGION_UNREACHABLE" - Warning when one or more regions are not
// reachable. The returned result set may be incomplete.
Code string `json:"code,omitempty"`
// Message: The warning message.
Message string `json:"message,omitempty"`
// Region: The region name for REGION_UNREACHABLE warning.
Region string `json:"region,omitempty"`
// ForceSendFields is a list of field names (e.g. "Code") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Code") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ApiWarning) MarshalJSON() ([]byte, error) {
type NoMethod ApiWarning
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BackupConfiguration: Database instance backup configuration.
type BackupConfiguration struct {
// BackupRetentionSettings: Backup retention settings.
BackupRetentionSettings *BackupRetentionSettings `json:"backupRetentionSettings,omitempty"`
// BinaryLogEnabled: (MySQL only) Whether binary log is enabled. If
// backup configuration is disabled, binarylog must be disabled as well.
BinaryLogEnabled bool `json:"binaryLogEnabled,omitempty"`
// Enabled: Whether this configuration is enabled.
Enabled bool `json:"enabled,omitempty"`
// Kind: This is always *sql#backupConfiguration*.
Kind string `json:"kind,omitempty"`
// Location: Location of the backup
Location string `json:"location,omitempty"`
// PointInTimeRecoveryEnabled: Reserved for future use.
PointInTimeRecoveryEnabled bool `json:"pointInTimeRecoveryEnabled,omitempty"`
// ReplicationLogArchivingEnabled: Reserved for future use.
ReplicationLogArchivingEnabled bool `json:"replicationLogArchivingEnabled,omitempty"`
// StartTime: Start time for the daily backup configuration in UTC
// timezone in the 24 hour format - *HH:MM*.
StartTime string `json:"startTime,omitempty"`
// TransactionLogRetentionDays: The number of days of transaction logs
// we retain for point in time restore, from 1-7.
TransactionLogRetentionDays int64 `json:"transactionLogRetentionDays,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "BackupRetentionSettings") to unconditionally include in API
// requests. By default, fields with empty values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BackupRetentionSettings")
// to include in API requests with the JSON null value. By default,
// fields with empty values are omitted from API requests. However, any
// field with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BackupConfiguration) MarshalJSON() ([]byte, error) {
type NoMethod BackupConfiguration
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BackupContext: Backup context.
type BackupContext struct {
// BackupId: The identifier of the backup.
BackupId int64 `json:"backupId,omitempty,string"`
// Kind: This is always *sql#backupContext*.
Kind string `json:"kind,omitempty"`
// ForceSendFields is a list of field names (e.g. "BackupId") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BackupId") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BackupContext) MarshalJSON() ([]byte, error) {
type NoMethod BackupContext
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BackupRetentionSettings: We currently only support backup retention
// by specifying the number of backups we will retain.
type BackupRetentionSettings struct {
// RetainedBackups: Depending on the value of retention_unit, this is
// used to determine if a backup needs to be deleted. If retention_unit
// is 'COUNT', we will retain this many backups.
RetainedBackups int64 `json:"retainedBackups,omitempty"`
// RetentionUnit: The unit that 'retained_backups' represents.
//
// Possible values:
// "RETENTION_UNIT_UNSPECIFIED" - Backup retention unit is
// unspecified, will be treated as COUNT.
// "COUNT" - Retention will be by count, eg. "retain the most recent 7
// backups".
RetentionUnit string `json:"retentionUnit,omitempty"`
// ForceSendFields is a list of field names (e.g. "RetainedBackups") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "RetainedBackups") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BackupRetentionSettings) MarshalJSON() ([]byte, error) {
type NoMethod BackupRetentionSettings
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BackupRun: A BackupRun resource.
type BackupRun struct {
// BackupKind: Specifies the kind of backup, PHYSICAL or
// DEFAULT_SNAPSHOT.
//
// Possible values:
// "SQL_BACKUP_KIND_UNSPECIFIED" - This is an unknown BackupKind.
// "SNAPSHOT" - The snapshot based backups
// "PHYSICAL" - Physical backups
BackupKind string `json:"backupKind,omitempty"`
// Description: The description of this run, only applicable to
// on-demand backups.
Description string `json:"description,omitempty"`
// DiskEncryptionConfiguration: Encryption configuration specific to a
// backup. Applies only to Second Generation instances.
DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"`
// DiskEncryptionStatus: Encryption status specific to a backup. Applies
// only to Second Generation instances.
DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"`
// EndTime: The time the backup operation completed in UTC timezone in
// RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.
EndTime string `json:"endTime,omitempty"`
// EnqueuedTime: The time the run was enqueued in UTC timezone in RFC
// 3339 format, for example *2012-11-15T16:19:00.094Z*.
EnqueuedTime string `json:"enqueuedTime,omitempty"`
// Error: Information about why the backup operation failed. This is
// only present if the run has the FAILED status.
Error *OperationError `json:"error,omitempty"`
// Id: The identifier for this backup run. Unique only for a specific
// Cloud SQL instance.
Id int64 `json:"id,omitempty,string"`
// Instance: Name of the database instance.
Instance string `json:"instance,omitempty"`
// Kind: This is always *sql#backupRun*.
Kind string `json:"kind,omitempty"`
// Location: Location of the backups.
Location string `json:"location,omitempty"`
// SelfLink: The URI of this resource.
SelfLink string `json:"selfLink,omitempty"`
// StartTime: The time the backup operation actually started in UTC
// timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*.
StartTime string `json:"startTime,omitempty"`
// Status: The status of this run.
//
// Possible values:
// "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" - The status of the run is
// unknown.
// "ENQUEUED" - The backup operation was enqueued.
// "OVERDUE" - The backup is overdue across a given backup window.
// Indicates a problem. Example: Long-running operation in progress
// during the whole window.
// "RUNNING" - The backup is in progress.
// "FAILED" - The backup failed.
// "SUCCESSFUL" - The backup was successful.
// "SKIPPED" - The backup was skipped (without problems) for a given
// backup window. Example: Instance was idle.
// "DELETION_PENDING" - The backup is about to be deleted.
// "DELETION_FAILED" - The backup deletion failed.
// "DELETED" - The backup has been deleted.
Status string `json:"status,omitempty"`
// Type: The type of this run; can be either "AUTOMATED" or "ON_DEMAND".
// This field defaults to "ON_DEMAND" and is ignored, when specified for
// insert requests.
//
// Possible values:
// "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" - This is an unknown BackupRun
// type.
// "AUTOMATED" - The backup schedule automatically triggers a backup.
// "ON_DEMAND" - The user manually triggers a backup.
Type string `json:"type,omitempty"`
// WindowStartTime: The start time of the backup window during which
// this the backup was attempted in RFC 3339 format, for example
// *2012-11-15T16:19:00.094Z*.
WindowStartTime string `json:"windowStartTime,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "BackupKind") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BackupKind") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BackupRun) MarshalJSON() ([]byte, error) {
type NoMethod BackupRun
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BackupRunsListResponse: Backup run list results.
type BackupRunsListResponse struct {
// Items: A list of backup runs in reverse chronological order of the
// enqueued time.
Items []*BackupRun `json:"items,omitempty"`
// Kind: This is always *sql#backupRunsList*.
Kind string `json:"kind,omitempty"`
// NextPageToken: The continuation token, used to page through large
// result sets. Provide this value in a subsequent request to return the
// next page of results.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Items") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Items") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) {
type NoMethod BackupRunsListResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BinLogCoordinates: Binary log coordinates.
type BinLogCoordinates struct {
// BinLogFileName: Name of the binary log file for a Cloud SQL instance.
BinLogFileName string `json:"binLogFileName,omitempty"`
// BinLogPosition: Position (offset) within the binary log file.
BinLogPosition int64 `json:"binLogPosition,omitempty,string"`
// Kind: This is always *sql#binLogCoordinates*.
Kind string `json:"kind,omitempty"`
// ForceSendFields is a list of field names (e.g. "BinLogFileName") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BinLogFileName") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) {
type NoMethod BinLogCoordinates
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CloneContext: Database instance clone context.
type CloneContext struct {
// BinLogCoordinates: Binary log coordinates, if specified, identify the
// position up to which the source instance is cloned. If not specified,
// the source instance is cloned up to the most recent binary log
// coordinates.
BinLogCoordinates *BinLogCoordinates `json:"binLogCoordinates,omitempty"`
// DestinationInstanceName: Name of the Cloud SQL instance to be created
// as a clone.
DestinationInstanceName string `json:"destinationInstanceName,omitempty"`
// Kind: This is always *sql#cloneContext*.
Kind string `json:"kind,omitempty"`
// PitrTimestampMs: Reserved for future use.
PitrTimestampMs int64 `json:"pitrTimestampMs,omitempty,string"`
// PointInTime: Reserved for future use.
PointInTime string `json:"pointInTime,omitempty"`
// ForceSendFields is a list of field names (e.g. "BinLogCoordinates")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BinLogCoordinates") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *CloneContext) MarshalJSON() ([]byte, error) {
type NoMethod CloneContext
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Database: Represents a SQL database on the Cloud SQL instance.
type Database struct {
// Charset: The Cloud SQL charset value.
Charset string `json:"charset,omitempty"`
// Collation: The Cloud SQL collation value.
Collation string `json:"collation,omitempty"`
// Etag: This field is deprecated and will be removed from a future
// version of the API.
Etag string `json:"etag,omitempty"`
// Instance: The name of the Cloud SQL instance. This does not include
// the project ID.
Instance string `json:"instance,omitempty"`
// Kind: This is always *sql#database*.
Kind string `json:"kind,omitempty"`
// Name: The name of the database in the Cloud SQL instance. This does
// not include the project ID or instance name.
Name string `json:"name,omitempty"`
// Project: The project ID of the project containing the Cloud SQL
// database. The Google apps domain is prefixed if applicable.
Project string `json:"project,omitempty"`
// SelfLink: The URI of this resource.
SelfLink string `json:"selfLink,omitempty"`
SqlserverDatabaseDetails *SqlServerDatabaseDetails `json:"sqlserverDatabaseDetails,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Charset") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Charset") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Database) MarshalJSON() ([]byte, error) {
type NoMethod Database
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DatabaseFlags: Database flags for Cloud SQL instances.
type DatabaseFlags struct {
// Name: The name of the flag. These flags are passed at instance
// startup, so include both server options and system variables for
// MySQL. Flags are specified with underscores, not hyphens. For more
// information, see Configuring Database Flags in the Cloud SQL
// documentation.
Name string `json:"name,omitempty"`
// Value: The value of the flag. Booleans are set to *on* for true and
// *off* for false. This field must be omitted if the flag doesn't take
// a value.
Value string `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *DatabaseFlags) MarshalJSON() ([]byte, error) {
type NoMethod DatabaseFlags
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DatabaseInstance: A Cloud SQL instance resource. Next field: 36
type DatabaseInstance struct {
// BackendType: *SECOND_GEN*: Cloud SQL database instance. *EXTERNAL*:
// A database server that is not managed by Google. This property is
// read-only; use the *tier* property in the *settings* object to
// determine the database type.
//
// Possible values:
// "SQL_BACKEND_TYPE_UNSPECIFIED" - This is an unknown backend type
// for instance.
// "FIRST_GEN" - V1 speckle instance.
// "SECOND_GEN" - V2 speckle instance.
// "EXTERNAL" - On premises instance.
BackendType string `json:"backendType,omitempty"`
// ConnectionName: Connection name of the Cloud SQL instance used in
// connection strings.
ConnectionName string `json:"connectionName,omitempty"`
// CurrentDiskSize: The current disk usage of the instance in bytes.
// This property has been deprecated. Use the
// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
// Monitoring API instead. Please see this announcement for details.
CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"`
// DatabaseVersion: The database engine type and version. The
// *databaseVersion* field cannot be changed after instance creation.
// MySQL instances: *MYSQL_8_0*, *MYSQL_5_7* (default), or *MYSQL_5_6*.
// PostgreSQL instances: *POSTGRES_9_6*, *POSTGRES_10*, *POSTGRES_11* or
// *POSTGRES_12* (default). SQL Server instances:
// *SQLSERVER_2017_STANDARD* (default), *SQLSERVER_2017_ENTERPRISE*,
// *SQLSERVER_2017_EXPRESS*, or *SQLSERVER_2017_WEB*.
//
// Possible values:
// "SQL_DATABASE_VERSION_UNSPECIFIED" - This is an unknown database
// version.
// "MYSQL_5_1" - The database version is MySQL 5.1.
// "MYSQL_5_5" - The database version is MySQL 5.5.
// "MYSQL_5_6" - The database version is MySQL 5.6.
// "MYSQL_5_7" - The database version is MySQL 5.7.
// "POSTGRES_9_6" - The database version is PostgreSQL 9.6.
// "POSTGRES_11" - The database version is PostgreSQL 11.
// "SQLSERVER_2017_STANDARD" - The database version is SQL Server 2017
// Standard.
// "SQLSERVER_2017_ENTERPRISE" - The database version is SQL Server
// 2017 Enterprise.
// "SQLSERVER_2017_EXPRESS" - The database version is SQL Server 2017
// Express.
// "SQLSERVER_2017_WEB" - The database version is SQL Server 2017 Web.
// "POSTGRES_10" - The database version is PostgreSQL 10.
// "POSTGRES_12" - The database version is PostgreSQL 12.
// "MYSQL_8_0" - The database version is MySQL 8.
// "POSTGRES_13" - The database version is PostgreSQL 13.
DatabaseVersion string `json:"databaseVersion,omitempty"`
// DiskEncryptionConfiguration: Disk encryption configuration specific
// to an instance. Applies only to Second Generation instances.
DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"`
// DiskEncryptionStatus: Disk encryption status specific to an instance.
// Applies only to Second Generation instances.
DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"`
// Etag: This field is deprecated and will be removed from a future
// version of the API. Use the *settings.settingsVersion* field instead.
Etag string `json:"etag,omitempty"`
// FailoverReplica: The name and status of the failover replica. This
// property is applicable only to Second Generation instances.
FailoverReplica *DatabaseInstanceFailoverReplica `json:"failoverReplica,omitempty"`
// GceZone: The Compute Engine zone that the instance is currently
// serving from. This value could be different from the zone that was
// specified when the instance was created if the instance has failed
// over to its secondary zone.
GceZone string `json:"gceZone,omitempty"`
// InstanceType: The instance type. This can be one of the following.
// *CLOUD_SQL_INSTANCE*: A Cloud SQL instance that is not replicating
// from a primary instance. *ON_PREMISES_INSTANCE*: An instance running
// on the customer's premises. *READ_REPLICA_INSTANCE*: A Cloud SQL
// instance configured as a read-replica.
//
// Possible values:
// "SQL_INSTANCE_TYPE_UNSPECIFIED" - This is an unknown Cloud SQL
// instance type.
// "CLOUD_SQL_INSTANCE" - A regular Cloud SQL instance.
// "ON_PREMISES_INSTANCE" - An instance running on the customer's
// premises that is not managed by Cloud SQL.
// "READ_REPLICA_INSTANCE" - A Cloud SQL instance acting as a
// read-replica.
InstanceType string `json:"instanceType,omitempty"`
// IpAddresses: The assigned IP addresses for the instance.
IpAddresses []*IpMapping `json:"ipAddresses,omitempty"`
// Ipv6Address: The IPv6 address assigned to the instance. (Deprecated)
// This property was applicable only to First Generation instances.
Ipv6Address string `json:"ipv6Address,omitempty"`
// Kind: This is always *sql#instance*.
Kind string `json:"kind,omitempty"`
// MasterInstanceName: The name of the instance which will act as
// primary in the replication setup.
MasterInstanceName string `json:"masterInstanceName,omitempty"`
// MaxDiskSize: The maximum disk size of the instance in bytes.
MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"`
// Name: Name of the Cloud SQL instance. This does not include the
// project ID.
Name string `json:"name,omitempty"`
// OnPremisesConfiguration: Configuration specific to on-premises
// instances.
OnPremisesConfiguration *OnPremisesConfiguration `json:"onPremisesConfiguration,omitempty"`
// Project: The project ID of the project containing the Cloud SQL
// instance. The Google apps domain is prefixed if applicable.
Project string `json:"project,omitempty"`
// Region: The geographical region. Can be *us-central* (*FIRST_GEN*
// instances only) *us-central1* (*SECOND_GEN* instances only)
// *asia-east1* or *europe-west1*. Defaults to *us-central* or
// *us-central1* depending on the instance type. The region cannot be
// changed after instance creation.
Region string `json:"region,omitempty"`
// ReplicaConfiguration: Configuration specific to failover replicas and
// read replicas.
ReplicaConfiguration *ReplicaConfiguration `json:"replicaConfiguration,omitempty"`
// ReplicaNames: The replicas of the instance.
ReplicaNames []string `json:"replicaNames,omitempty"`
// RootPassword: Initial root password. Use only on creation.
RootPassword string `json:"rootPassword,omitempty"`
// SatisfiesPzs: The status indicating if instance satisfies physical
// zone separation. Reserved for future use.
SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
// ScheduledMaintenance: The start time of any upcoming scheduled
// maintenance for this instance.
ScheduledMaintenance *SqlScheduledMaintenance `json:"scheduledMaintenance,omitempty"`
// SecondaryGceZone: The Compute Engine zone that the failover instance
// is currently serving from for a regional instance. This value could
// be different from the zone that was specified when the instance was
// created if the instance has failed over to its secondary/failover
// zone. Reserved for future use.
SecondaryGceZone string `json:"secondaryGceZone,omitempty"`
// SelfLink: The URI of this resource.
SelfLink string `json:"selfLink,omitempty"`
// ServerCaCert: SSL configuration.
ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
// ServiceAccountEmailAddress: The service account email address
// assigned to the instance. This property is applicable only to Second
// Generation instances.
ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,omitempty"`
// Settings: The user settings.
Settings *Settings `json:"settings,omitempty"`
// State: The current serving state of the Cloud SQL instance. This can
// be one of the following. *SQL_INSTANCE_STATE_UNSPECIFIED*: The state
// of the instance is unknown. *RUNNABLE*: The instance is running, or
// has been stopped by owner. *SUSPENDED*: The instance is not
// available, for example due to problems with billing. for example due
// to problems with billing. *PENDING_DELETE*: The instance is being
// deleted. *PENDING_CREATE*: The instance is being created.
// *MAINTENANCE*: The instance is down for maintenance. *FAILED*: The
// instance creation failed.
//
// Possible values:
// "SQL_INSTANCE_STATE_UNSPECIFIED" - The state of the instance is
// unknown.
// "RUNNABLE" - The instance is running, or has been stopped by owner.
// "SUSPENDED" - The instance is not available, for example due to
// problems with billing.
// "PENDING_DELETE" - The instance is being deleted.
// "PENDING_CREATE" - The instance is being created.
// "MAINTENANCE" - The instance is down for maintenance.
// "FAILED" - The creation of the instance failed or a fatal error
// occurred during maintenance.
State string `json:"state,omitempty"`
// SuspensionReason: If the instance state is SUSPENDED, the reason for
// the suspension.
//
// Possible values:
// "SQL_SUSPENSION_REASON_UNSPECIFIED" - This is an unknown suspension