1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package sqladmin provides access to the Cloud SQL Admin API. 8// 9// For product documentation, see: https://developers.google.com/cloud-sql/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/sqladmin/v1beta4" 16// ... 17// ctx := context.Background() 18// sqladminService, err := sqladmin.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 27// 28// sqladminService, err := sqladmin.NewService(ctx, option.WithScopes(sqladmin.SqlserviceAdminScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// sqladminService, err := sqladmin.NewService(ctx, option.WithAPIKey("AIza...")) 33// 34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 35// 36// config := &oauth2.Config{...} 37// // ... 38// token, err := config.Exchange(ctx, ...) 39// sqladminService, err := sqladmin.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package sqladmin // import "google.golang.org/api/sqladmin/v1beta4" 43 44import ( 45 "bytes" 46 "context" 47 "encoding/json" 48 "errors" 49 "fmt" 50 "io" 51 "net/http" 52 "net/url" 53 "strconv" 54 "strings" 55 56 googleapi "google.golang.org/api/googleapi" 57 gensupport "google.golang.org/api/internal/gensupport" 58 option "google.golang.org/api/option" 59 internaloption "google.golang.org/api/option/internaloption" 60 htransport "google.golang.org/api/transport/http" 61) 62 63// Always reference these packages, just in case the auto-generated code 64// below doesn't. 65var _ = bytes.NewBuffer 66var _ = strconv.Itoa 67var _ = fmt.Sprintf 68var _ = json.NewDecoder 69var _ = io.Copy 70var _ = url.Parse 71var _ = gensupport.MarshalJSON 72var _ = googleapi.Version 73var _ = errors.New 74var _ = strings.Replace 75var _ = context.Canceled 76var _ = internaloption.WithDefaultEndpoint 77 78const apiId = "sqladmin:v1beta4" 79const apiName = "sqladmin" 80const apiVersion = "v1beta4" 81const basePath = "https://sqladmin.googleapis.com/" 82const mtlsBasePath = "https://sqladmin.mtls.googleapis.com/" 83 84// OAuth2 scopes used by this API. 85const ( 86 // See, edit, configure, and delete your Google Cloud data and see the 87 // email address for your Google Account. 88 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 89 90 // Manage your Google SQL Service instances 91 SqlserviceAdminScope = "https://www.googleapis.com/auth/sqlservice.admin" 92) 93 94// NewService creates a new Service. 95func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 96 scopesOption := option.WithScopes( 97 "https://www.googleapis.com/auth/cloud-platform", 98 "https://www.googleapis.com/auth/sqlservice.admin", 99 ) 100 // NOTE: prepend, so we don't override user-specified scopes. 101 opts = append([]option.ClientOption{scopesOption}, opts...) 102 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 103 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 104 client, endpoint, err := htransport.NewClient(ctx, opts...) 105 if err != nil { 106 return nil, err 107 } 108 s, err := New(client) 109 if err != nil { 110 return nil, err 111 } 112 if endpoint != "" { 113 s.BasePath = endpoint 114 } 115 return s, nil 116} 117 118// New creates a new Service. It uses the provided http.Client for requests. 119// 120// Deprecated: please use NewService instead. 121// To provide a custom HTTP client, use option.WithHTTPClient. 122// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 123func New(client *http.Client) (*Service, error) { 124 if client == nil { 125 return nil, errors.New("client is nil") 126 } 127 s := &Service{client: client, BasePath: basePath} 128 s.BackupRuns = NewBackupRunsService(s) 129 s.Connect = NewConnectService(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 141type Service struct { 142 client *http.Client 143 BasePath string // API endpoint base URL 144 UserAgent string // optional additional User-Agent fragment 145 146 BackupRuns *BackupRunsService 147 148 Connect *ConnectService 149 150 Databases *DatabasesService 151 152 Flags *FlagsService 153 154 Instances *InstancesService 155 156 Operations *OperationsService 157 158 Projects *ProjectsService 159 160 SslCerts *SslCertsService 161 162 Tiers *TiersService 163 164 Users *UsersService 165} 166 167func (s *Service) userAgent() string { 168 if s.UserAgent == "" { 169 return googleapi.UserAgent 170 } 171 return googleapi.UserAgent + " " + s.UserAgent 172} 173 174func NewBackupRunsService(s *Service) *BackupRunsService { 175 rs := &BackupRunsService{s: s} 176 return rs 177} 178 179type BackupRunsService struct { 180 s *Service 181} 182 183func NewConnectService(s *Service) *ConnectService { 184 rs := &ConnectService{s: s} 185 return rs 186} 187 188type ConnectService struct { 189 s *Service 190} 191 192func NewDatabasesService(s *Service) *DatabasesService { 193 rs := &DatabasesService{s: s} 194 return rs 195} 196 197type DatabasesService struct { 198 s *Service 199} 200 201func NewFlagsService(s *Service) *FlagsService { 202 rs := &FlagsService{s: s} 203 return rs 204} 205 206type FlagsService struct { 207 s *Service 208} 209 210func NewInstancesService(s *Service) *InstancesService { 211 rs := &InstancesService{s: s} 212 return rs 213} 214 215type InstancesService struct { 216 s *Service 217} 218 219func NewOperationsService(s *Service) *OperationsService { 220 rs := &OperationsService{s: s} 221 return rs 222} 223 224type OperationsService struct { 225 s *Service 226} 227 228func NewProjectsService(s *Service) *ProjectsService { 229 rs := &ProjectsService{s: s} 230 rs.Instances = NewProjectsInstancesService(s) 231 return rs 232} 233 234type ProjectsService struct { 235 s *Service 236 237 Instances *ProjectsInstancesService 238} 239 240func NewProjectsInstancesService(s *Service) *ProjectsInstancesService { 241 rs := &ProjectsInstancesService{s: s} 242 return rs 243} 244 245type ProjectsInstancesService struct { 246 s *Service 247} 248 249func NewSslCertsService(s *Service) *SslCertsService { 250 rs := &SslCertsService{s: s} 251 return rs 252} 253 254type SslCertsService struct { 255 s *Service 256} 257 258func NewTiersService(s *Service) *TiersService { 259 rs := &TiersService{s: s} 260 return rs 261} 262 263type TiersService struct { 264 s *Service 265} 266 267func NewUsersService(s *Service) *UsersService { 268 rs := &UsersService{s: s} 269 return rs 270} 271 272type UsersService struct { 273 s *Service 274} 275 276// AclEntry: An entry for an Access Control list. 277type AclEntry struct { 278 // ExpirationTime: The time when this access control entry expires in 279 // RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example 280 // **2012-11-15T16:19:00.094Z**. 281 ExpirationTime string `json:"expirationTime,omitempty"` 282 283 // Kind: This is always **sql#aclEntry**. 284 Kind string `json:"kind,omitempty"` 285 286 // Name: Optional. A label to identify this entry. 287 Name string `json:"name,omitempty"` 288 289 // Value: The allowlisted value for the access control list. 290 Value string `json:"value,omitempty"` 291 292 // ForceSendFields is a list of field names (e.g. "ExpirationTime") to 293 // unconditionally include in API requests. By default, fields with 294 // empty or default values are omitted from API requests. However, any 295 // non-pointer, non-interface field appearing in ForceSendFields will be 296 // sent to the server regardless of whether the field is empty or not. 297 // This may be used to include empty fields in Patch requests. 298 ForceSendFields []string `json:"-"` 299 300 // NullFields is a list of field names (e.g. "ExpirationTime") to 301 // include in API requests with the JSON null value. By default, fields 302 // with empty values are omitted from API requests. However, any field 303 // with an empty value appearing in NullFields will be sent to the 304 // server as null. It is an error if a field in this list has a 305 // non-empty value. This may be used to include null fields in Patch 306 // requests. 307 NullFields []string `json:"-"` 308} 309 310func (s *AclEntry) MarshalJSON() ([]byte, error) { 311 type NoMethod AclEntry 312 raw := NoMethod(*s) 313 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 314} 315 316// ApiWarning: An Admin API warning message. 317type ApiWarning struct { 318 // Code: Code to uniquely identify the warning type. 319 // 320 // Possible values: 321 // "SQL_API_WARNING_CODE_UNSPECIFIED" - An unknown or unset warning 322 // type from Cloud SQL API. 323 // "REGION_UNREACHABLE" - Warning when one or more regions are not 324 // reachable. The returned result set may be incomplete. 325 Code string `json:"code,omitempty"` 326 327 // Message: The warning message. 328 Message string `json:"message,omitempty"` 329 330 // Region: The region name for REGION_UNREACHABLE warning. 331 Region string `json:"region,omitempty"` 332 333 // ForceSendFields is a list of field names (e.g. "Code") to 334 // unconditionally include in API requests. By default, fields with 335 // empty or default values are omitted from API requests. However, any 336 // non-pointer, non-interface field appearing in ForceSendFields will be 337 // sent to the server regardless of whether the field is empty or not. 338 // This may be used to include empty fields in Patch requests. 339 ForceSendFields []string `json:"-"` 340 341 // NullFields is a list of field names (e.g. "Code") to include in API 342 // requests with the JSON null value. By default, fields with empty 343 // values are omitted from API requests. However, any field with an 344 // empty value appearing in NullFields will be sent to the server as 345 // null. It is an error if a field in this list has a non-empty value. 346 // This may be used to include null fields in Patch requests. 347 NullFields []string `json:"-"` 348} 349 350func (s *ApiWarning) MarshalJSON() ([]byte, error) { 351 type NoMethod ApiWarning 352 raw := NoMethod(*s) 353 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 354} 355 356// BackupConfiguration: Database instance backup configuration. 357type BackupConfiguration struct { 358 // BackupRetentionSettings: Backup retention settings. 359 BackupRetentionSettings *BackupRetentionSettings `json:"backupRetentionSettings,omitempty"` 360 361 // BinaryLogEnabled: (MySQL only) Whether binary log is enabled. If 362 // backup configuration is disabled, binarylog must be disabled as well. 363 BinaryLogEnabled bool `json:"binaryLogEnabled,omitempty"` 364 365 // Enabled: Whether this configuration is enabled. 366 Enabled bool `json:"enabled,omitempty"` 367 368 // Kind: This is always **sql#backupConfiguration**. 369 Kind string `json:"kind,omitempty"` 370 371 // Location: Location of the backup 372 Location string `json:"location,omitempty"` 373 374 // PointInTimeRecoveryEnabled: (Postgres only) Whether point in time 375 // recovery is enabled. 376 PointInTimeRecoveryEnabled bool `json:"pointInTimeRecoveryEnabled,omitempty"` 377 378 // ReplicationLogArchivingEnabled: Reserved for future use. 379 ReplicationLogArchivingEnabled bool `json:"replicationLogArchivingEnabled,omitempty"` 380 381 // StartTime: Start time for the daily backup configuration in UTC 382 // timezone in the 24 hour format - **HH:MM**. 383 StartTime string `json:"startTime,omitempty"` 384 385 // TransactionLogRetentionDays: The number of days of transaction logs 386 // we retain for point in time restore, from 1-7. 387 TransactionLogRetentionDays int64 `json:"transactionLogRetentionDays,omitempty"` 388 389 // ForceSendFields is a list of field names (e.g. 390 // "BackupRetentionSettings") to unconditionally include in API 391 // requests. By default, fields with empty or default values are omitted 392 // from API requests. However, any non-pointer, non-interface field 393 // appearing in ForceSendFields will be sent to the server regardless of 394 // whether the field is empty or not. This may be used to include empty 395 // fields in Patch requests. 396 ForceSendFields []string `json:"-"` 397 398 // NullFields is a list of field names (e.g. "BackupRetentionSettings") 399 // to include in API requests with the JSON null value. By default, 400 // fields with empty values are omitted from API requests. However, any 401 // field with an empty value appearing in NullFields will be sent to the 402 // server as null. It is an error if a field in this list has a 403 // non-empty value. This may be used to include null fields in Patch 404 // requests. 405 NullFields []string `json:"-"` 406} 407 408func (s *BackupConfiguration) MarshalJSON() ([]byte, error) { 409 type NoMethod BackupConfiguration 410 raw := NoMethod(*s) 411 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 412} 413 414// BackupContext: Backup context. 415type BackupContext struct { 416 // BackupId: The identifier of the backup. 417 BackupId int64 `json:"backupId,omitempty,string"` 418 419 // Kind: This is always **sql#backupContext**. 420 Kind string `json:"kind,omitempty"` 421 422 // ForceSendFields is a list of field names (e.g. "BackupId") to 423 // unconditionally include in API requests. By default, fields with 424 // empty or default values are omitted from API requests. However, any 425 // non-pointer, non-interface field appearing in ForceSendFields will be 426 // sent to the server regardless of whether the field is empty or not. 427 // This may be used to include empty fields in Patch requests. 428 ForceSendFields []string `json:"-"` 429 430 // NullFields is a list of field names (e.g. "BackupId") to include in 431 // API requests with the JSON null value. By default, fields with empty 432 // values are omitted from API requests. However, any field with an 433 // empty value appearing in NullFields will be sent to the server as 434 // null. It is an error if a field in this list has a non-empty value. 435 // This may be used to include null fields in Patch requests. 436 NullFields []string `json:"-"` 437} 438 439func (s *BackupContext) MarshalJSON() ([]byte, error) { 440 type NoMethod BackupContext 441 raw := NoMethod(*s) 442 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 443} 444 445// BackupRetentionSettings: We currently only support backup retention 446// by specifying the number of backups we will retain. 447type BackupRetentionSettings struct { 448 // RetainedBackups: Depending on the value of retention_unit, this is 449 // used to determine if a backup needs to be deleted. If retention_unit 450 // is 'COUNT', we will retain this many backups. 451 RetainedBackups int64 `json:"retainedBackups,omitempty"` 452 453 // RetentionUnit: The unit that 'retained_backups' represents. 454 // 455 // Possible values: 456 // "RETENTION_UNIT_UNSPECIFIED" - Backup retention unit is 457 // unspecified, will be treated as COUNT. 458 // "COUNT" - Retention will be by count, eg. "retain the most recent 7 459 // backups". 460 RetentionUnit string `json:"retentionUnit,omitempty"` 461 462 // ForceSendFields is a list of field names (e.g. "RetainedBackups") to 463 // unconditionally include in API requests. By default, fields with 464 // empty or default values are omitted from API requests. However, any 465 // non-pointer, non-interface field appearing in ForceSendFields will be 466 // sent to the server regardless of whether the field is empty or not. 467 // This may be used to include empty fields in Patch requests. 468 ForceSendFields []string `json:"-"` 469 470 // NullFields is a list of field names (e.g. "RetainedBackups") to 471 // include in API requests with the JSON null value. By default, fields 472 // with empty values are omitted from API requests. However, any field 473 // with an empty value appearing in NullFields will be sent to the 474 // server as null. It is an error if a field in this list has a 475 // non-empty value. This may be used to include null fields in Patch 476 // requests. 477 NullFields []string `json:"-"` 478} 479 480func (s *BackupRetentionSettings) MarshalJSON() ([]byte, error) { 481 type NoMethod BackupRetentionSettings 482 raw := NoMethod(*s) 483 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 484} 485 486// BackupRun: A BackupRun resource. 487type BackupRun struct { 488 // BackupKind: Specifies the kind of backup, PHYSICAL or 489 // DEFAULT_SNAPSHOT. 490 // 491 // Possible values: 492 // "SQL_BACKUP_KIND_UNSPECIFIED" - This is an unknown BackupKind. 493 // "SNAPSHOT" - The snapshot based backups 494 // "PHYSICAL" - Physical backups 495 BackupKind string `json:"backupKind,omitempty"` 496 497 // Description: The description of this run, only applicable to 498 // on-demand backups. 499 Description string `json:"description,omitempty"` 500 501 // DiskEncryptionConfiguration: Encryption configuration specific to a 502 // backup. 503 DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"` 504 505 // DiskEncryptionStatus: Encryption status specific to a backup. 506 DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"` 507 508 // EndTime: The time the backup operation completed in UTC timezone in 509 // RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example 510 // **2012-11-15T16:19:00.094Z**. 511 EndTime string `json:"endTime,omitempty"` 512 513 // EnqueuedTime: The time the run was enqueued in UTC timezone in RFC 514 // 3339 (https://tools.ietf.org/html/rfc3339) format, for example 515 // **2012-11-15T16:19:00.094Z**. 516 EnqueuedTime string `json:"enqueuedTime,omitempty"` 517 518 // Error: Information about why the backup operation failed. This is 519 // only present if the run has the FAILED status. 520 Error *OperationError `json:"error,omitempty"` 521 522 // Id: The identifier for this backup run. Unique only for a specific 523 // Cloud SQL instance. 524 Id int64 `json:"id,omitempty,string"` 525 526 // Instance: Name of the database instance. 527 Instance string `json:"instance,omitempty"` 528 529 // Kind: This is always **sql#backupRun**. 530 Kind string `json:"kind,omitempty"` 531 532 // Location: Location of the backups. 533 Location string `json:"location,omitempty"` 534 535 // SelfLink: The URI of this resource. 536 SelfLink string `json:"selfLink,omitempty"` 537 538 // StartTime: The time the backup operation actually started in UTC 539 // timezone in RFC 3339 (https://tools.ietf.org/html/rfc3339) format, 540 // for example **2012-11-15T16:19:00.094Z**. 541 StartTime string `json:"startTime,omitempty"` 542 543 // Status: The status of this run. 544 // 545 // Possible values: 546 // "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" - The status of the run is 547 // unknown. 548 // "ENQUEUED" - The backup operation was enqueued. 549 // "OVERDUE" - The backup is overdue across a given backup window. 550 // Indicates a problem. Example: Long-running operation in progress 551 // during the whole window. 552 // "RUNNING" - The backup is in progress. 553 // "FAILED" - The backup failed. 554 // "SUCCESSFUL" - The backup was successful. 555 // "SKIPPED" - The backup was skipped (without problems) for a given 556 // backup window. Example: Instance was idle. 557 // "DELETION_PENDING" - The backup is about to be deleted. 558 // "DELETION_FAILED" - The backup deletion failed. 559 // "DELETED" - The backup has been deleted. 560 Status string `json:"status,omitempty"` 561 562 // Type: The type of this run; can be either "AUTOMATED" or "ON_DEMAND". 563 // This field defaults to "ON_DEMAND" and is ignored, when specified for 564 // insert requests. 565 // 566 // Possible values: 567 // "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" - This is an unknown BackupRun 568 // type. 569 // "AUTOMATED" - The backup schedule automatically triggers a backup. 570 // "ON_DEMAND" - The user manually triggers a backup. 571 Type string `json:"type,omitempty"` 572 573 // WindowStartTime: The start time of the backup window during which 574 // this the backup was attempted in RFC 3339 575 // (https://tools.ietf.org/html/rfc3339) format, for example 576 // **2012-11-15T16:19:00.094Z**. 577 WindowStartTime string `json:"windowStartTime,omitempty"` 578 579 // ServerResponse contains the HTTP response code and headers from the 580 // server. 581 googleapi.ServerResponse `json:"-"` 582 583 // ForceSendFields is a list of field names (e.g. "BackupKind") to 584 // unconditionally include in API requests. By default, fields with 585 // empty or default values are omitted from API requests. However, any 586 // non-pointer, non-interface field appearing in ForceSendFields will be 587 // sent to the server regardless of whether the field is empty or not. 588 // This may be used to include empty fields in Patch requests. 589 ForceSendFields []string `json:"-"` 590 591 // NullFields is a list of field names (e.g. "BackupKind") to include in 592 // API requests with the JSON null value. By default, fields with empty 593 // values are omitted from API requests. However, any field with an 594 // empty value appearing in NullFields will be sent to the server as 595 // null. It is an error if a field in this list has a non-empty value. 596 // This may be used to include null fields in Patch requests. 597 NullFields []string `json:"-"` 598} 599 600func (s *BackupRun) MarshalJSON() ([]byte, error) { 601 type NoMethod BackupRun 602 raw := NoMethod(*s) 603 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 604} 605 606// BackupRunsListResponse: Backup run list results. 607type BackupRunsListResponse struct { 608 // Items: A list of backup runs in reverse chronological order of the 609 // enqueued time. 610 Items []*BackupRun `json:"items,omitempty"` 611 612 // Kind: This is always **sql#backupRunsList**. 613 Kind string `json:"kind,omitempty"` 614 615 // NextPageToken: The continuation token, used to page through large 616 // result sets. Provide this value in a subsequent request to return the 617 // next page of results. 618 NextPageToken string `json:"nextPageToken,omitempty"` 619 620 // ServerResponse contains the HTTP response code and headers from the 621 // server. 622 googleapi.ServerResponse `json:"-"` 623 624 // ForceSendFields is a list of field names (e.g. "Items") to 625 // unconditionally include in API requests. By default, fields with 626 // empty or default values are omitted from API requests. However, any 627 // non-pointer, non-interface field appearing in ForceSendFields will be 628 // sent to the server regardless of whether the field is empty or not. 629 // This may be used to include empty fields in Patch requests. 630 ForceSendFields []string `json:"-"` 631 632 // NullFields is a list of field names (e.g. "Items") to include in API 633 // requests with the JSON null value. By default, fields with empty 634 // values are omitted from API requests. However, any field with an 635 // empty value appearing in NullFields will be sent to the server as 636 // null. It is an error if a field in this list has a non-empty value. 637 // This may be used to include null fields in Patch requests. 638 NullFields []string `json:"-"` 639} 640 641func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) { 642 type NoMethod BackupRunsListResponse 643 raw := NoMethod(*s) 644 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 645} 646 647// BinLogCoordinates: Binary log coordinates. 648type BinLogCoordinates struct { 649 // BinLogFileName: Name of the binary log file for a Cloud SQL instance. 650 BinLogFileName string `json:"binLogFileName,omitempty"` 651 652 // BinLogPosition: Position (offset) within the binary log file. 653 BinLogPosition int64 `json:"binLogPosition,omitempty,string"` 654 655 // Kind: This is always **sql#binLogCoordinates**. 656 Kind string `json:"kind,omitempty"` 657 658 // ForceSendFields is a list of field names (e.g. "BinLogFileName") to 659 // unconditionally include in API requests. By default, fields with 660 // empty or default values are omitted from API requests. However, any 661 // non-pointer, non-interface field appearing in ForceSendFields will be 662 // sent to the server regardless of whether the field is empty or not. 663 // This may be used to include empty fields in Patch requests. 664 ForceSendFields []string `json:"-"` 665 666 // NullFields is a list of field names (e.g. "BinLogFileName") to 667 // include in API requests with the JSON null value. By default, fields 668 // with empty values are omitted from API requests. However, any field 669 // with an empty value appearing in NullFields will be sent to the 670 // server as null. It is an error if a field in this list has a 671 // non-empty value. This may be used to include null fields in Patch 672 // requests. 673 NullFields []string `json:"-"` 674} 675 676func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) { 677 type NoMethod BinLogCoordinates 678 raw := NoMethod(*s) 679 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 680} 681 682// CloneContext: Database instance clone context. 683type CloneContext struct { 684 // BinLogCoordinates: Binary log coordinates, if specified, identify the 685 // position up to which the source instance is cloned. If not specified, 686 // the source instance is cloned up to the most recent binary log 687 // coordinates. 688 BinLogCoordinates *BinLogCoordinates `json:"binLogCoordinates,omitempty"` 689 690 // DestinationInstanceName: Name of the Cloud SQL instance to be created 691 // as a clone. 692 DestinationInstanceName string `json:"destinationInstanceName,omitempty"` 693 694 // Kind: This is always **sql#cloneContext**. 695 Kind string `json:"kind,omitempty"` 696 697 // PitrTimestampMs: Reserved for future use. 698 PitrTimestampMs int64 `json:"pitrTimestampMs,omitempty,string"` 699 700 // PointInTime: Timestamp, if specified, identifies the time to which 701 // the source instance is cloned. 702 PointInTime string `json:"pointInTime,omitempty"` 703 704 // ForceSendFields is a list of field names (e.g. "BinLogCoordinates") 705 // to unconditionally include in API requests. By default, fields with 706 // empty or default values are omitted from API requests. However, any 707 // non-pointer, non-interface field appearing in ForceSendFields will be 708 // sent to the server regardless of whether the field is empty or not. 709 // This may be used to include empty fields in Patch requests. 710 ForceSendFields []string `json:"-"` 711 712 // NullFields is a list of field names (e.g. "BinLogCoordinates") to 713 // include in API requests with the JSON null value. By default, fields 714 // with empty values are omitted from API requests. However, any field 715 // with an empty value appearing in NullFields will be sent to the 716 // server as null. It is an error if a field in this list has a 717 // non-empty value. This may be used to include null fields in Patch 718 // requests. 719 NullFields []string `json:"-"` 720} 721 722func (s *CloneContext) MarshalJSON() ([]byte, error) { 723 type NoMethod CloneContext 724 raw := NoMethod(*s) 725 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 726} 727 728// ConnectSettings: Connect settings retrieval response. 729type ConnectSettings struct { 730 // BackendType: **SECOND_GEN**: Cloud SQL database instance. 731 // **EXTERNAL**: A database server that is not managed by Google. This 732 // property is read-only; use the **tier** property in the **settings** 733 // object to determine the database type. 734 // 735 // Possible values: 736 // "SQL_BACKEND_TYPE_UNSPECIFIED" - This is an unknown backend type 737 // for instance. 738 // "FIRST_GEN" - V1 speckle instance. 739 // "SECOND_GEN" - V2 speckle instance. 740 // "EXTERNAL" - On premises instance. 741 BackendType string `json:"backendType,omitempty"` 742 743 // DatabaseVersion: The database engine type and version. The 744 // **databaseVersion** field cannot be changed after instance creation. 745 // MySQL instances: **MYSQL_8_0**, **MYSQL_5_7** (default), or 746 // **MYSQL_5_6**. PostgreSQL instances: **POSTGRES_9_6**, 747 // **POSTGRES_10**, **POSTGRES_11** or **POSTGRES_12** (default). SQL 748 // Server instances: **SQLSERVER_2017_STANDARD** (default), 749 // **SQLSERVER_2017_ENTERPRISE**, **SQLSERVER_2017_EXPRESS**, or 750 // **SQLSERVER_2017_WEB**. 751 // 752 // Possible values: 753 // "SQL_DATABASE_VERSION_UNSPECIFIED" - This is an unknown database 754 // version. 755 // "MYSQL_5_1" - The database version is MySQL 5.1. 756 // "MYSQL_5_5" - The database version is MySQL 5.5. 757 // "MYSQL_5_6" - The database version is MySQL 5.6. 758 // "MYSQL_5_7" - The database version is MySQL 5.7. 759 // "POSTGRES_9_6" - The database version is PostgreSQL 9.6. 760 // "POSTGRES_11" - The database version is PostgreSQL 11. 761 // "SQLSERVER_2017_STANDARD" - The database version is SQL Server 2017 762 // Standard. 763 // "SQLSERVER_2017_ENTERPRISE" - The database version is SQL Server 764 // 2017 Enterprise. 765 // "SQLSERVER_2017_EXPRESS" - The database version is SQL Server 2017 766 // Express. 767 // "SQLSERVER_2017_WEB" - The database version is SQL Server 2017 Web. 768 // "POSTGRES_10" - The database version is PostgreSQL 10. 769 // "POSTGRES_12" - The database version is PostgreSQL 12. 770 // "MYSQL_8_0" - The database version is MySQL 8. 771 // "MYSQL_8_0_18" - The database major version is MySQL 8.0 and the 772 // minor version is 18. 773 // "MYSQL_8_0_26" - The database major version is MySQL 8.0 and the 774 // minor version is 26. 775 // "POSTGRES_13" - The database version is PostgreSQL 13. 776 // "POSTGRES_14" - The database version is PostgreSQL 14. 777 // "SQLSERVER_2019_STANDARD" - The database version is SQL Server 2019 778 // Standard. 779 // "SQLSERVER_2019_ENTERPRISE" - The database version is SQL Server 780 // 2019 Enterprise. 781 // "SQLSERVER_2019_EXPRESS" - The database version is SQL Server 2019 782 // Express. 783 // "SQLSERVER_2019_WEB" - The database version is SQL Server 2019 Web. 784 DatabaseVersion string `json:"databaseVersion,omitempty"` 785 786 // IpAddresses: The assigned IP addresses for the instance. 787 IpAddresses []*IpMapping `json:"ipAddresses,omitempty"` 788 789 // Kind: This is always `sql#connectSettings`. 790 Kind string `json:"kind,omitempty"` 791 792 // Region: The cloud region for the instance. e.g. **us-central1**, 793 // **europe-west1**. The region cannot be changed after instance 794 // creation. 795 Region string `json:"region,omitempty"` 796 797 // ServerCaCert: SSL configuration. 798 ServerCaCert *SslCert `json:"serverCaCert,omitempty"` 799 800 // ServerResponse contains the HTTP response code and headers from the 801 // server. 802 googleapi.ServerResponse `json:"-"` 803 804 // ForceSendFields is a list of field names (e.g. "BackendType") to 805 // unconditionally include in API requests. By default, fields with 806 // empty or default values are omitted from API requests. However, any 807 // non-pointer, non-interface field appearing in ForceSendFields will be 808 // sent to the server regardless of whether the field is empty or not. 809 // This may be used to include empty fields in Patch requests. 810 ForceSendFields []string `json:"-"` 811 812 // NullFields is a list of field names (e.g. "BackendType") to include 813 // in API requests with the JSON null value. By default, fields with 814 // empty values are omitted from API requests. However, any field with 815 // an empty value appearing in NullFields will be sent to the server as 816 // null. It is an error if a field in this list has a non-empty value. 817 // This may be used to include null fields in Patch requests. 818 NullFields []string `json:"-"` 819} 820 821func (s *ConnectSettings) MarshalJSON() ([]byte, error) { 822 type NoMethod ConnectSettings 823 raw := NoMethod(*s) 824 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 825} 826 827// Database: Represents a SQL database on the Cloud SQL instance. 828type Database struct { 829 // Charset: The Cloud SQL charset value. 830 Charset string `json:"charset,omitempty"` 831 832 // Collation: The Cloud SQL collation value. 833 Collation string `json:"collation,omitempty"` 834 835 // Etag: This field is deprecated and will be removed from a future 836 // version of the API. 837 Etag string `json:"etag,omitempty"` 838 839 // Instance: The name of the Cloud SQL instance. This does not include 840 // the project ID. 841 Instance string `json:"instance,omitempty"` 842 843 // Kind: This is always **sql#database**. 844 Kind string `json:"kind,omitempty"` 845 846 // Name: The name of the database in the Cloud SQL instance. This does 847 // not include the project ID or instance name. 848 Name string `json:"name,omitempty"` 849 850 // Project: The project ID of the project containing the Cloud SQL 851 // database. The Google apps domain is prefixed if applicable. 852 Project string `json:"project,omitempty"` 853 854 // SelfLink: The URI of this resource. 855 SelfLink string `json:"selfLink,omitempty"` 856 857 SqlserverDatabaseDetails *SqlServerDatabaseDetails `json:"sqlserverDatabaseDetails,omitempty"` 858 859 // ServerResponse contains the HTTP response code and headers from the 860 // server. 861 googleapi.ServerResponse `json:"-"` 862 863 // ForceSendFields is a list of field names (e.g. "Charset") to 864 // unconditionally include in API requests. By default, fields with 865 // empty or default values are omitted from API requests. However, any 866 // non-pointer, non-interface field appearing in ForceSendFields will be 867 // sent to the server regardless of whether the field is empty or not. 868 // This may be used to include empty fields in Patch requests. 869 ForceSendFields []string `json:"-"` 870 871 // NullFields is a list of field names (e.g. "Charset") to include in 872 // API requests with the JSON null value. By default, fields with empty 873 // values are omitted from API requests. However, any field with an 874 // empty value appearing in NullFields will be sent to the server as 875 // null. It is an error if a field in this list has a non-empty value. 876 // This may be used to include null fields in Patch requests. 877 NullFields []string `json:"-"` 878} 879 880func (s *Database) MarshalJSON() ([]byte, error) { 881 type NoMethod Database 882 raw := NoMethod(*s) 883 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 884} 885 886// DatabaseFlags: Database flags for Cloud SQL instances. 887type DatabaseFlags struct { 888 // Name: The name of the flag. These flags are passed at instance 889 // startup, so include both server options and system variables. Flags 890 // are specified with underscores, not hyphens. For more information, 891 // see Configuring Database Flags 892 // (https://cloud.google.com/sql/docs/mysql/flags) in the Cloud SQL 893 // documentation. 894 Name string `json:"name,omitempty"` 895 896 // Value: The value of the flag. Booleans are set to **on** for true and 897 // **off** for false. This field must be omitted if the flag doesn't 898 // take a value. 899 Value string `json:"value,omitempty"` 900 901 // ForceSendFields is a list of field names (e.g. "Name") to 902 // unconditionally include in API requests. By default, fields with 903 // empty or default values are omitted from API requests. However, any 904 // non-pointer, non-interface field appearing in ForceSendFields will be 905 // sent to the server regardless of whether the field is empty or not. 906 // This may be used to include empty fields in Patch requests. 907 ForceSendFields []string `json:"-"` 908 909 // NullFields is a list of field names (e.g. "Name") to include in API 910 // requests with the JSON null value. By default, fields with empty 911 // values are omitted from API requests. However, any field with an 912 // empty value appearing in NullFields will be sent to the server as 913 // null. It is an error if a field in this list has a non-empty value. 914 // This may be used to include null fields in Patch requests. 915 NullFields []string `json:"-"` 916} 917 918func (s *DatabaseFlags) MarshalJSON() ([]byte, error) { 919 type NoMethod DatabaseFlags 920 raw := NoMethod(*s) 921 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 922} 923 924// DatabaseInstance: A Cloud SQL instance resource. 925type DatabaseInstance struct { 926 // BackendType: The backend type. **SECOND_GEN**: Cloud SQL database 927 // instance. **EXTERNAL**: A database server that is not managed by 928 // Google. This property is read-only; use the **tier** property in the 929 // **settings** object to determine the database type. 930 // 931 // Possible values: 932 // "SQL_BACKEND_TYPE_UNSPECIFIED" - This is an unknown backend type 933 // for instance. 934 // "FIRST_GEN" - V1 speckle instance. 935 // "SECOND_GEN" - V2 speckle instance. 936 // "EXTERNAL" - On premises instance. 937 BackendType string `json:"backendType,omitempty"` 938 939 // ConnectionName: Connection name of the Cloud SQL instance used in 940 // connection strings. 941 ConnectionName string `json:"connectionName,omitempty"` 942 943 // CreateTime: Output only. The time when the instance was created in 944 // RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example 945 // **2012-11-15T16:19:00.094Z**. 946 CreateTime string `json:"createTime,omitempty"` 947 948 // CurrentDiskSize: The current disk usage of the instance in bytes. 949 // This property has been deprecated. Use the 950 // "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud 951 // Monitoring API instead. Please see this announcement 952 // (https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ) 953 // for details. 954 CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"` 955 956 // DatabaseInstalledVersion: Output only. The databaseInstalledVersion 957 // stores the current fully resolved database version running on the 958 // instance including minor version such as MYSQL_5_6_50 959 DatabaseInstalledVersion string `json:"databaseInstalledVersion,omitempty"` 960 961 // DatabaseVersion: The database engine type and version. The 962 // **databaseVersion** field cannot be changed after instance creation. 963 // 964 // Possible values: 965 // "SQL_DATABASE_VERSION_UNSPECIFIED" - This is an unknown database 966 // version. 967 // "MYSQL_5_1" - The database version is MySQL 5.1. 968 // "MYSQL_5_5" - The database version is MySQL 5.5. 969 // "MYSQL_5_6" - The database version is MySQL 5.6. 970 // "MYSQL_5_7" - The database version is MySQL 5.7. 971 // "POSTGRES_9_6" - The database version is PostgreSQL 9.6. 972 // "POSTGRES_11" - The database version is PostgreSQL 11. 973 // "SQLSERVER_2017_STANDARD" - The database version is SQL Server 2017 974 // Standard. 975 // "SQLSERVER_2017_ENTERPRISE" - The database version is SQL Server 976 // 2017 Enterprise. 977 // "SQLSERVER_2017_EXPRESS" - The database version is SQL Server 2017 978 // Express. 979 // "SQLSERVER_2017_WEB" - The database version is SQL Server 2017 Web. 980 // "POSTGRES_10" - The database version is PostgreSQL 10. 981 // "POSTGRES_12" - The database version is PostgreSQL 12. 982 // "MYSQL_8_0" - The database version is MySQL 8. 983 // "MYSQL_8_0_18" - The database major version is MySQL 8.0 and the 984 // minor version is 18. 985 // "MYSQL_8_0_26" - The database major version is MySQL 8.0 and the 986 // minor version is 26. 987 // "POSTGRES_13" - The database version is PostgreSQL 13. 988 // "POSTGRES_14" - The database version is PostgreSQL 14. 989 // "SQLSERVER_2019_STANDARD" - The database version is SQL Server 2019 990 // Standard. 991 // "SQLSERVER_2019_ENTERPRISE" - The database version is SQL Server 992 // 2019 Enterprise. 993 // "SQLSERVER_2019_EXPRESS" - The database version is SQL Server 2019 994 // Express. 995 // "SQLSERVER_2019_WEB" - The database version is SQL Server 2019 Web. 996 DatabaseVersion string `json:"databaseVersion,omitempty"` 997 998 // DiskEncryptionConfiguration: Disk encryption configuration specific 999 // to an instance. 1000 DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"` 1001 1002 // DiskEncryptionStatus: Disk encryption status specific to an instance. 1003 DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"` 1004 1005 // Etag: This field is deprecated and will be removed from a future 1006 // version of the API. Use the **settings.settingsVersion** field 1007 // instead. 1008 Etag string `json:"etag,omitempty"` 1009 1010 // FailoverReplica: The name and status of the failover replica. 1011 FailoverReplica *DatabaseInstanceFailoverReplica `json:"failoverReplica,omitempty"` 1012 1013 // GceZone: The Compute Engine zone that the instance is currently 1014 // serving from. This value could be different from the zone that was 1015 // specified when the instance was created if the instance has failed 1016 // over to its secondary zone. 1017 GceZone string `json:"gceZone,omitempty"` 1018 1019 // InstanceType: The instance type. 1020 // 1021 // Possible values: 1022 // "SQL_INSTANCE_TYPE_UNSPECIFIED" - This is an unknown Cloud SQL 1023 // instance type. 1024 // "CLOUD_SQL_INSTANCE" - A regular Cloud SQL instance that is not 1025 // replicating from a primary instance. 1026 // "ON_PREMISES_INSTANCE" - An instance running on the customer's 1027 // premises that is not managed by Cloud SQL. 1028 // "READ_REPLICA_INSTANCE" - A Cloud SQL instance acting as a 1029 // read-replica. 1030 InstanceType string `json:"instanceType,omitempty"` 1031 1032 // IpAddresses: The assigned IP addresses for the instance. 1033 IpAddresses []*IpMapping `json:"ipAddresses,omitempty"` 1034 1035 // Ipv6Address: The IPv6 address assigned to the instance. (Deprecated) 1036 // This property was applicable only to First Generation instances. 1037 Ipv6Address string `json:"ipv6Address,omitempty"` 1038 1039 // Kind: This is always **sql#instance**. 1040 Kind string `json:"kind,omitempty"` 1041 1042 // MasterInstanceName: The name of the instance which will act as 1043 // primary in the replication setup. 1044 MasterInstanceName string `json:"masterInstanceName,omitempty"` 1045 1046 // MaxDiskSize: The maximum disk size of the instance in bytes. 1047 MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"` 1048 1049 // Name: Name of the Cloud SQL instance. This does not include the 1050 // project ID. 1051 Name string `json:"name,omitempty"` 1052 1053 // OnPremisesConfiguration: Configuration specific to on-premises 1054 // instances. 1055 OnPremisesConfiguration *OnPremisesConfiguration `json:"onPremisesConfiguration,omitempty"` 1056 1057 // OutOfDiskReport: This field represents the report generated by the 1058 // proactive database wellness job for OutOfDisk issues. * Writers: * 1059 // the proactive database wellness job for OOD. * Readers: * the 1060 // proactive database wellness job 1061 OutOfDiskReport *SqlOutOfDiskReport `json:"outOfDiskReport,omitempty"` 1062 1063 // Project: The project ID of the project containing the Cloud SQL 1064 // instance. The Google apps domain is prefixed if applicable. 1065 Project string `json:"project,omitempty"` 1066 1067 // Region: The geographical region. Can be: * **us-central** 1068 // (**FIRST_GEN** instances only) * **us-central1** (**SECOND_GEN** 1069 // instances only) * **asia-east1** or **europe-west1**. Defaults to 1070 // **us-central** or **us-central1** depending on the instance type. The 1071 // region cannot be changed after instance creation. 1072 Region string `json:"region,omitempty"` 1073 1074 // ReplicaConfiguration: Configuration specific to failover replicas and 1075 // read replicas. 1076 ReplicaConfiguration *ReplicaConfiguration `json:"replicaConfiguration,omitempty"` 1077 1078 // ReplicaNames: The replicas of the instance. 1079 ReplicaNames []string `json:"replicaNames,omitempty"` 1080 1081 // RootPassword: Initial root password. Use only on creation. 1082 RootPassword string `json:"rootPassword,omitempty"` 1083 1084 // SatisfiesPzs: The status indicating if instance satisfiesPzs. 1085 // Reserved for future use. 1086 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"` 1087 1088 // ScheduledMaintenance: The start time of any upcoming scheduled 1089 // maintenance for this instance. 1090 ScheduledMaintenance *SqlScheduledMaintenance `json:"scheduledMaintenance,omitempty"` 1091 1092 // SecondaryGceZone: The Compute Engine zone that the failover instance 1093 // is currently serving from for a regional instance. This value could 1094 // be different from the zone that was specified when the instance was 1095 // created if the instance has failed over to its secondary/failover 1096 // zone. Reserved for future use. 1097 SecondaryGceZone string `json:"secondaryGceZone,omitempty"` 1098 1099 // SelfLink: The URI of this resource. 1100 SelfLink string `json:"selfLink,omitempty"` 1101 1102 // ServerCaCert: SSL configuration. 1103 ServerCaCert *SslCert `json:"serverCaCert,omitempty"` 1104 1105 // ServiceAccountEmailAddress: The service account email address 1106 // assigned to the instance. This property is read-only. 1107 ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,omitempty"` 1108 1109 // Settings: The user settings. 1110 Settings *Settings `json:"settings,omitempty"` 1111 1112 // State: The current serving state of the Cloud SQL instance. 1113 // 1114 // Possible values: 1115 // "SQL_INSTANCE_STATE_UNSPECIFIED" - The state of the instance is 1116 // unknown. 1117 // "RUNNABLE" - The instance is running, or has been stopped by owner. 1118 // "SUSPENDED" - The instance is not available, for example due to 1119 // problems with billing. 1120 // "PENDING_DELETE" - The instance is being deleted. 1121 // "PENDING_CREATE" - The instance is being created. 1122 // "MAINTENANCE" - The instance is down for maintenance. 1123 // "FAILED" - The creation of the instance failed or a fatal error 1124 // occurred during maintenance. 1125 // "ONLINE_MAINTENANCE" - Deprecated 1126 State string `json:"state,omitempty"` 1127 1128 // SuspensionReason: If the instance state is SUSPENDED, the reason for 1129 // the suspension. 1130 // 1131 // Possible values: 1132 // "SQL_SUSPENSION_REASON_UNSPECIFIED" - This is an unknown suspension 1133 // reason. 1134 // "BILLING_ISSUE" - The instance is suspended due to billing issues 1135 // (for example:, GCP account issue) 1136 // "LEGAL_ISSUE" - The instance is suspended due to illegal content 1137 // (for example:, child pornography, copyrighted material, etc.). 1138 // "OPERATIONAL_ISSUE" - The instance is causing operational issues 1139 // (for example:, causing the database to crash). 1140 // "KMS_KEY_ISSUE" - The KMS key used by the instance is either 1141 // revoked or denied access to 1142 SuspensionReason []string `json:"suspensionReason,omitempty"` 1143 1144 // ServerResponse contains the HTTP response code and headers from the 1145 // server. 1146 googleapi.ServerResponse `json:"-"` 1147 1148 // ForceSendFields is a list of field names (e.g. "BackendType") to 1149 // unconditionally include in API requests. By default, fields with 1150 // empty or default values are omitted from API requests. However, any 1151 // non-pointer, non-interface field appearing in ForceSendFields will be 1152 // sent to the server regardless of whether the field is empty or not. 1153 // This may be used to include empty fields in Patch requests. 1154 ForceSendFields []string `json:"-"` 1155 1156 // NullFields is a list of field names (e.g. "BackendType") to include 1157 // in API requests with the JSON null value. By default, fields with 1158 // empty values are omitted from API requests. However, any field with 1159 // an empty value appearing in NullFields will be sent to the server as 1160 // null. It is an error if a field in this list has a non-empty value. 1161 // This may be used to include null fields in Patch requests. 1162 NullFields []string `json:"-"` 1163} 1164 1165func (s *DatabaseInstance) MarshalJSON() ([]byte, error) { 1166 type NoMethod DatabaseInstance 1167 raw := NoMethod(*s) 1168 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1169} 1170 1171// DatabaseInstanceFailoverReplica: The name and status of the failover 1172// replica. 1173type DatabaseInstanceFailoverReplica struct { 1174 // Available: The availability status of the failover replica. A false 1175 // status indicates that the failover replica is out of sync. The 1176 // primary instance can only failover to the failover replica when the 1177 // status is true. 1178 Available bool `json:"available,omitempty"` 1179 1180 // Name: The name of the failover replica. If specified at instance 1181 // creation, a failover replica is created for the instance. The name 1182 // doesn't include the project ID. 1183 Name string `json:"name,omitempty"` 1184 1185 // ForceSendFields is a list of field names (e.g. "Available") to 1186 // unconditionally include in API requests. By default, fields with 1187 // empty or default values are omitted from API requests. However, any 1188 // non-pointer, non-interface field appearing in ForceSendFields will be 1189 // sent to the server regardless of whether the field is empty or not. 1190 // This may be used to include empty fields in Patch requests. 1191 ForceSendFields []string `json:"-"` 1192 1193 // NullFields is a list of field names (e.g. "Available") to include in 1194 // API requests with the JSON null value. By default, fields with empty 1195 // values are omitted from API requests. However, any field with an 1196 // empty value appearing in NullFields will be sent to the server as 1197 // null. It is an error if a field in this list has a non-empty value. 1198 // This may be used to include null fields in Patch requests. 1199 NullFields []string `json:"-"` 1200} 1201 1202func (s *DatabaseInstanceFailoverReplica) MarshalJSON() ([]byte, error) { 1203 type NoMethod DatabaseInstanceFailoverReplica 1204 raw := NoMethod(*s) 1205 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1206} 1207 1208// DatabasesListResponse: Database list response. 1209type DatabasesListResponse struct { 1210 // Items: List of database resources in the instance. 1211 Items []*Database `json:"items,omitempty"` 1212 1213 // Kind: This is always **sql#databasesList**. 1214 Kind string `json:"kind,omitempty"` 1215 1216 // ServerResponse contains the HTTP response code and headers from the 1217 // server. 1218 googleapi.ServerResponse `json:"-"` 1219 1220 // ForceSendFields is a list of field names (e.g. "Items") to 1221 // unconditionally include in API requests. By default, fields with 1222 // empty or default values are omitted from API requests. However, any 1223 // non-pointer, non-interface field appearing in ForceSendFields will be 1224 // sent to the server regardless of whether the field is empty or not. 1225 // This may be used to include empty fields in Patch requests. 1226 ForceSendFields []string `json:"-"` 1227 1228 // NullFields is a list of field names (e.g. "Items") to include in API 1229 // requests with the JSON null value. By default, fields with empty 1230 // values are omitted from API requests. However, any field with an 1231 // empty value appearing in NullFields will be sent to the server as 1232 // null. It is an error if a field in this list has a non-empty value. 1233 // This may be used to include null fields in Patch requests. 1234 NullFields []string `json:"-"` 1235} 1236 1237func (s *DatabasesListResponse) MarshalJSON() ([]byte, error) { 1238 type NoMethod DatabasesListResponse 1239 raw := NoMethod(*s) 1240 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1241} 1242 1243// DemoteMasterConfiguration: Read-replica configuration for connecting 1244// to the on-premises primary instance. 1245type DemoteMasterConfiguration struct { 1246 // Kind: This is always **sql#demoteMasterConfiguration**. 1247 Kind string `json:"kind,omitempty"` 1248 1249 // MysqlReplicaConfiguration: MySQL specific configuration when 1250 // replicating from a MySQL on-premises primary instance. Replication 1251 // configuration information such as the username, password, 1252 // certificates, and keys are not stored in the instance metadata. The 1253 // configuration information is used only to set up the replication 1254 // connection and is stored by MySQL in a file named **master.info** in 1255 // the data directory. 1256 MysqlReplicaConfiguration *DemoteMasterMySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"` 1257 1258 // ForceSendFields is a list of field names (e.g. "Kind") to 1259 // unconditionally include in API requests. By default, fields with 1260 // empty or default values are omitted from API requests. However, any 1261 // non-pointer, non-interface field appearing in ForceSendFields will be 1262 // sent to the server regardless of whether the field is empty or not. 1263 // This may be used to include empty fields in Patch requests. 1264 ForceSendFields []string `json:"-"` 1265 1266 // NullFields is a list of field names (e.g. "Kind") to include in API 1267 // requests with the JSON null value. By default, fields with empty 1268 // values are omitted from API requests. However, any field with an 1269 // empty value appearing in NullFields will be sent to the server as 1270 // null. It is an error if a field in this list has a non-empty value. 1271 // This may be used to include null fields in Patch requests. 1272 NullFields []string `json:"-"` 1273} 1274 1275func (s *DemoteMasterConfiguration) MarshalJSON() ([]byte, error) { 1276 type NoMethod DemoteMasterConfiguration 1277 raw := NoMethod(*s) 1278 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1279} 1280 1281// DemoteMasterContext: Database instance demote primary instance 1282// context. 1283type DemoteMasterContext struct { 1284 // Kind: This is always **sql#demoteMasterContext**. 1285 Kind string `json:"kind,omitempty"` 1286 1287 // MasterInstanceName: The name of the instance which will act as 1288 // on-premises primary instance in the replication setup. 1289 MasterInstanceName string `json:"masterInstanceName,omitempty"` 1290 1291 // ReplicaConfiguration: Configuration specific to read-replicas 1292 // replicating from the on-premises primary instance. 1293 ReplicaConfiguration *DemoteMasterConfiguration `json:"replicaConfiguration,omitempty"` 1294 1295 // SkipReplicationSetup: Flag to skip replication setup on the instance. 1296 SkipReplicationSetup bool `json:"skipReplicationSetup,omitempty"` 1297 1298 // VerifyGtidConsistency: Verify GTID consistency for demote operation. 1299 // Default value: **True**. Setting this flag to false enables you to 1300 // bypass GTID consistency check between on-premises primary instance 1301 // and Cloud SQL instance during the demotion operation but also exposes 1302 // you to the risk of future replication failures. Change the value only 1303 // if you know the reason for the GTID divergence and are confident that 1304 // doing so will not cause any replication issues. 1305 VerifyGtidConsistency bool `json:"verifyGtidConsistency,omitempty"` 1306 1307 // ForceSendFields is a list of field names (e.g. "Kind") to 1308 // unconditionally include in API requests. By default, fields with 1309 // empty or default values are omitted from API requests. However, any 1310 // non-pointer, non-interface field appearing in ForceSendFields will be 1311 // sent to the server regardless of whether the field is empty or not. 1312 // This may be used to include empty fields in Patch requests. 1313 ForceSendFields []string `json:"-"` 1314 1315 // NullFields is a list of field names (e.g. "Kind") to include in API 1316 // requests with the JSON null value. By default, fields with empty 1317 // values are omitted from API requests. However, any field with an 1318 // empty value appearing in NullFields will be sent to the server as 1319 // null. It is an error if a field in this list has a non-empty value. 1320 // This may be used to include null fields in Patch requests. 1321 NullFields []string `json:"-"` 1322} 1323 1324func (s *DemoteMasterContext) MarshalJSON() ([]byte, error) { 1325 type NoMethod DemoteMasterContext 1326 raw := NoMethod(*s) 1327 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1328} 1329 1330// DemoteMasterMySqlReplicaConfiguration: Read-replica configuration 1331// specific to MySQL databases. 1332type DemoteMasterMySqlReplicaConfiguration struct { 1333 // CaCertificate: PEM representation of the trusted CA's x509 1334 // certificate. 1335 CaCertificate string `json:"caCertificate,omitempty"` 1336 1337 // ClientCertificate: PEM representation of the replica's x509 1338 // certificate. 1339 ClientCertificate string `json:"clientCertificate,omitempty"` 1340 1341 // ClientKey: PEM representation of the replica's private key. The 1342 // corresponsing public key is encoded in the client's certificate. The 1343 // format of the replica's private key can be either PKCS #1 or PKCS #8. 1344 ClientKey string `json:"clientKey,omitempty"` 1345 1346 // Kind: This is always **sql#demoteMasterMysqlReplicaConfiguration**. 1347 Kind string `json:"kind,omitempty"` 1348 1349 // Password: The password for the replication connection. 1350 Password string `json:"password,omitempty"` 1351 1352 // Username: The username for the replication connection. 1353 Username string `json:"username,omitempty"` 1354 1355 // ForceSendFields is a list of field names (e.g. "CaCertificate") to 1356 // unconditionally include in API requests. By default, fields with 1357 // empty or default values are omitted from API requests. However, any 1358 // non-pointer, non-interface field appearing in ForceSendFields will be 1359 // sent to the server regardless of whether the field is empty or not. 1360 // This may be used to include empty fields in Patch requests. 1361 ForceSendFields []string `json:"-"` 1362 1363 // NullFields is a list of field names (e.g. "CaCertificate") to include 1364 // in API requests with the JSON null value. By default, fields with 1365 // empty values are omitted from API requests. However, any field with 1366 // an empty value appearing in NullFields will be sent to the server as 1367 // null. It is an error if a field in this list has a non-empty value. 1368 // This may be used to include null fields in Patch requests. 1369 NullFields []string `json:"-"` 1370} 1371 1372func (s *DemoteMasterMySqlReplicaConfiguration) MarshalJSON() ([]byte, error) { 1373 type NoMethod DemoteMasterMySqlReplicaConfiguration 1374 raw := NoMethod(*s) 1375 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1376} 1377 1378// DenyMaintenancePeriod: Deny Maintenance Periods. This specifies a 1379// date range during when all CSA rollout will be denied. 1380type DenyMaintenancePeriod struct { 1381 // EndDate: "deny maintenance period" end date. If the year of the end 1382 // date is empty, the year of the start date also must be empty. In this 1383 // case, it means the deny maintenance period recurs every year. The 1384 // date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01 1385 EndDate string `json:"endDate,omitempty"` 1386 1387 // StartDate: "deny maintenance period" start date. If the year of the 1388 // start date is empty, the year of the end date also must be empty. In 1389 // this case, it means the deny maintenance period recurs every year. 1390 // The date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 1391 // 11-01 1392 StartDate string `json:"startDate,omitempty"` 1393 1394 // Time: Time in UTC when the "deny maintenance period" starts on 1395 // start_date and ends on end_date. The time is in format: HH:mm:SS, 1396 // i.e., 00:00:00 1397 Time string `json:"time,omitempty"` 1398 1399 // ForceSendFields is a list of field names (e.g. "EndDate") to 1400 // unconditionally include in API requests. By default, fields with 1401 // empty or default values are omitted from API requests. However, any 1402 // non-pointer, non-interface field appearing in ForceSendFields will be 1403 // sent to the server regardless of whether the field is empty or not. 1404 // This may be used to include empty fields in Patch requests. 1405 ForceSendFields []string `json:"-"` 1406 1407 // NullFields is a list of field names (e.g. "EndDate") to include in 1408 // API requests with the JSON null value. By default, fields with empty 1409 // values are omitted from API requests. However, any field with an 1410 // empty value appearing in NullFields will be sent to the server as 1411 // null. It is an error if a field in this list has a non-empty value. 1412 // This may be used to include null fields in Patch requests. 1413 NullFields []string `json:"-"` 1414} 1415 1416func (s *DenyMaintenancePeriod) MarshalJSON() ([]byte, error) { 1417 type NoMethod DenyMaintenancePeriod 1418 raw := NoMethod(*s) 1419 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1420} 1421 1422// DiskEncryptionConfiguration: Disk encryption configuration for an 1423// instance. 1424type DiskEncryptionConfiguration struct { 1425 // Kind: This is always **sql#diskEncryptionConfiguration**. 1426 Kind string `json:"kind,omitempty"` 1427 1428 // KmsKeyName: Resource name of KMS key for disk encryption 1429 KmsKeyName string `json:"kmsKeyName,omitempty"` 1430 1431 // ForceSendFields is a list of field names (e.g. "Kind") to 1432 // unconditionally include in API requests. By default, fields with 1433 // empty or default values are omitted from API requests. However, any 1434 // non-pointer, non-interface field appearing in ForceSendFields will be 1435 // sent to the server regardless of whether the field is empty or not. 1436 // This may be used to include empty fields in Patch requests. 1437 ForceSendFields []string `json:"-"` 1438 1439 // NullFields is a list of field names (e.g. "Kind") to include in API 1440 // requests with the JSON null value. By default, fields with empty 1441 // values are omitted from API requests. However, any field with an 1442 // empty value appearing in NullFields will be sent to the server as 1443 // null. It is an error if a field in this list has a non-empty value. 1444 // This may be used to include null fields in Patch requests. 1445 NullFields []string `json:"-"` 1446} 1447 1448func (s *DiskEncryptionConfiguration) MarshalJSON() ([]byte, error) { 1449 type NoMethod DiskEncryptionConfiguration 1450 raw := NoMethod(*s) 1451 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1452} 1453 1454// DiskEncryptionStatus: Disk encryption status for an instance. 1455type DiskEncryptionStatus struct { 1456 // Kind: This is always **sql#diskEncryptionStatus**. 1457 Kind string `json:"kind,omitempty"` 1458 1459 // KmsKeyVersionName: KMS key version used to encrypt the Cloud SQL 1460 // instance resource 1461 KmsKeyVersionName string `json:"kmsKeyVersionName,omitempty"` 1462 1463 // ForceSendFields is a list of field names (e.g. "Kind") to 1464 // unconditionally include in API requests. By default, fields with 1465 // empty or default values are omitted from API requests. However, any 1466 // non-pointer, non-interface field appearing in ForceSendFields will be 1467 // sent to the server regardless of whether the field is empty or not. 1468 // This may be used to include empty fields in Patch requests. 1469 ForceSendFields []string `json:"-"` 1470 1471 // NullFields is a list of field names (e.g. "Kind") to include in API 1472 // requests with the JSON null value. By default, fields with empty 1473 // values are omitted from API requests. However, any field with an 1474 // empty value appearing in NullFields will be sent to the server as 1475 // null. It is an error if a field in this list has a non-empty value. 1476 // This may be used to include null fields in Patch requests. 1477 NullFields []string `json:"-"` 1478} 1479 1480func (s *DiskEncryptionStatus) MarshalJSON() ([]byte, error) { 1481 type NoMethod DiskEncryptionStatus 1482 raw := NoMethod(*s) 1483 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1484} 1485 1486// ExportContext: Database instance export context. 1487type ExportContext struct { 1488 // CsvExportOptions: Options for exporting data as CSV. **MySQL** and 1489 // **PostgreSQL** instances only. 1490 CsvExportOptions *ExportContextCsvExportOptions `json:"csvExportOptions,omitempty"` 1491 1492 // Databases: Databases to be exported. **MySQL instances:** If 1493 // **fileType** is **SQL** and no database is specified, all databases 1494 // are exported, except for the **mysql** system database. If 1495 // **fileType** is **CSV**, you can specify one database, either by 1496 // using this property or by using the **csvExportOptions.selectQuery** 1497 // property, which takes precedence over this property. **PostgreSQL 1498 // instances:** You must specify one database to be exported. If 1499 // **fileType** is **CSV**, this database must match the one specified 1500 // in the **csvExportOptions.selectQuery** property. **SQL Server 1501 // instances:** You must specify one database to be exported, and the 1502 // **fileType** must be **BAK**. 1503 Databases []string `json:"databases,omitempty"` 1504 1505 // FileType: The file type for the specified uri. 1506 // 1507 // Possible values: 1508 // "SQL_FILE_TYPE_UNSPECIFIED" - Unknown file type. 1509 // "SQL" - File containing SQL statements. 1510 // "CSV" - File in CSV format. 1511 // "BAK" 1512 FileType string `json:"fileType,omitempty"` 1513 1514 // Kind: This is always **sql#exportContext**. 1515 Kind string `json:"kind,omitempty"` 1516 1517 // Offload: Option for export offload. 1518 Offload bool `json:"offload,omitempty"` 1519 1520 // SqlExportOptions: Options for exporting data as SQL statements. 1521 SqlExportOptions *ExportContextSqlExportOptions `json:"sqlExportOptions,omitempty"` 1522 1523 // Uri: The path to the file in Google Cloud Storage where the export 1524 // will be stored. The URI is in the form **gs://bucketName/fileName**. 1525 // If the file already exists, the request succeeds, but the operation 1526 // fails. If **fileType** is **SQL** and the filename ends with .gz, the 1527 // contents are compressed. 1528 Uri string `json:"uri,omitempty"` 1529 1530 // ForceSendFields is a list of field names (e.g. "CsvExportOptions") to 1531 // unconditionally include in API requests. By default, fields with 1532 // empty or default values are omitted from API requests. However, any 1533 // non-pointer, non-interface field appearing in ForceSendFields will be 1534 // sent to the server regardless of whether the field is empty or not. 1535 // This may be used to include empty fields in Patch requests. 1536 ForceSendFields []string `json:"-"` 1537 1538 // NullFields is a list of field names (e.g. "CsvExportOptions") to 1539 // include in API requests with the JSON null value. By default, fields 1540 // with empty values are omitted from API requests. However, any field 1541 // with an empty value appearing in NullFields will be sent to the 1542 // server as null. It is an error if a field in this list has a 1543 // non-empty value. This may be used to include null fields in Patch 1544 // requests. 1545 NullFields []string `json:"-"` 1546} 1547 1548func (s *ExportContext) MarshalJSON() ([]byte, error) { 1549 type NoMethod ExportContext 1550 raw := NoMethod(*s) 1551 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1552} 1553 1554// ExportContextCsvExportOptions: Options for exporting data as CSV. 1555// **MySQL** and **PostgreSQL** instances only. 1556type ExportContextCsvExportOptions struct { 1557 // EscapeCharacter: Specifies the character that should appear before a 1558 // data character that needs to be escaped. 1559 EscapeCharacter string `json:"escapeCharacter,omitempty"` 1560 1561 // FieldsTerminatedBy: Specifies the character that separates columns 1562 // within each row (line) of the file. 1563 FieldsTerminatedBy string `json:"fieldsTerminatedBy,omitempty"` 1564 1565 // LinesTerminatedBy: This is used to separate lines. If a line does not 1566 // contain all fields, the rest of the columns are set to their default 1567 // values. 1568 LinesTerminatedBy string `json:"linesTerminatedBy,omitempty"` 1569 1570 // QuoteCharacter: Specifies the quoting character to be used when a 1571 // data value is quoted. 1572 QuoteCharacter string `json:"quoteCharacter,omitempty"` 1573 1574 // SelectQuery: The select query used to extract the data. 1575 SelectQuery string `json:"selectQuery,omitempty"` 1576 1577 // ForceSendFields is a list of field names (e.g. "EscapeCharacter") to 1578 // unconditionally include in API requests. By default, fields with 1579 // empty or default values are omitted from API requests. However, any 1580 // non-pointer, non-interface field appearing in ForceSendFields will be 1581 // sent to the server regardless of whether the field is empty or not. 1582 // This may be used to include empty fields in Patch requests. 1583 ForceSendFields []string `json:"-"` 1584 1585 // NullFields is a list of field names (e.g. "EscapeCharacter") to 1586 // include in API requests with the JSON null value. By default, fields 1587 // with empty values are omitted from API requests. However, any field 1588 // with an empty value appearing in NullFields will be sent to the 1589 // server as null. It is an error if a field in this list has a 1590 // non-empty value. This may be used to include null fields in Patch 1591 // requests. 1592 NullFields []string `json:"-"` 1593} 1594 1595func (s *ExportContextCsvExportOptions) MarshalJSON() ([]byte, error) { 1596 type NoMethod ExportContextCsvExportOptions 1597 raw := NoMethod(*s) 1598 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1599} 1600 1601// ExportContextSqlExportOptions: Options for exporting data as SQL 1602// statements. 1603type ExportContextSqlExportOptions struct { 1604 // MysqlExportOptions: Options for exporting from MySQL. 1605 MysqlExportOptions *ExportContextSqlExportOptionsMysqlExportOptions `json:"mysqlExportOptions,omitempty"` 1606 1607 // SchemaOnly: Export only schemas. 1608 SchemaOnly bool `json:"schemaOnly,omitempty"` 1609 1610 // Tables: Tables to export, or that were exported, from the specified 1611 // database. If you specify tables, specify one and only one database. 1612 // For PostgreSQL instances, you can specify only one table. 1613 Tables []string `json:"tables,omitempty"` 1614 1615 // ForceSendFields is a list of field names (e.g. "MysqlExportOptions") 1616 // to unconditionally include in API requests. By default, fields with 1617 // empty or default values are omitted from API requests. However, any 1618 // non-pointer, non-interface field appearing in ForceSendFields will be 1619 // sent to the server regardless of whether the field is empty or not. 1620 // This may be used to include empty fields in Patch requests. 1621 ForceSendFields []string `json:"-"` 1622 1623 // NullFields is a list of field names (e.g. "MysqlExportOptions") to 1624 // include in API requests with the JSON null value. By default, fields 1625 // with empty values are omitted from API requests. However, any field 1626 // with an empty value appearing in NullFields will be sent to the 1627 // server as null. It is an error if a field in this list has a 1628 // non-empty value. This may be used to include null fields in Patch 1629 // requests. 1630 NullFields []string `json:"-"` 1631} 1632 1633func (s *ExportContextSqlExportOptions) MarshalJSON() ([]byte, error) { 1634 type NoMethod ExportContextSqlExportOptions 1635 raw := NoMethod(*s) 1636 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1637} 1638 1639// ExportContextSqlExportOptionsMysqlExportOptions: Options for 1640// exporting from MySQL. 1641type ExportContextSqlExportOptionsMysqlExportOptions struct { 1642 // MasterData: Option to include SQL statement required to set up 1643 // replication. If set to **1**, the dump file includes a CHANGE MASTER 1644 // TO statement with the binary log coordinates, and --set-gtid-purged 1645 // is set to ON. If set to **2**, the CHANGE MASTER TO statement is 1646 // written as a SQL comment and has no effect. If set to any value other 1647 // than **1**, --set-gtid-purged is set to OFF. 1648 MasterData int64 `json:"masterData,omitempty"` 1649 1650 // ForceSendFields is a list of field names (e.g. "MasterData") to 1651 // unconditionally include in API requests. By default, fields with 1652 // empty or default values are omitted from API requests. However, any 1653 // non-pointer, non-interface field appearing in ForceSendFields will be 1654 // sent to the server regardless of whether the field is empty or not. 1655 // This may be used to include empty fields in Patch requests. 1656 ForceSendFields []string `json:"-"` 1657 1658 // NullFields is a list of field names (e.g. "MasterData") to include in 1659 // API requests with the JSON null value. By default, fields with empty 1660 // values are omitted from API requests. However, any field with an 1661 // empty value appearing in NullFields will be sent to the server as 1662 // null. It is an error if a field in this list has a non-empty value. 1663 // This may be used to include null fields in Patch requests. 1664 NullFields []string `json:"-"` 1665} 1666 1667func (s *ExportContextSqlExportOptionsMysqlExportOptions) MarshalJSON() ([]byte, error) { 1668 type NoMethod ExportContextSqlExportOptionsMysqlExportOptions 1669 raw := NoMethod(*s) 1670 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1671} 1672 1673// FailoverContext: Database instance failover context. 1674type FailoverContext struct { 1675 // Kind: This is always **sql#failoverContext**. 1676 Kind string `json:"kind,omitempty"` 1677 1678 // SettingsVersion: The current settings version of this instance. 1679 // Request will be rejected if this version doesn't match the current 1680 // settings version. 1681 SettingsVersion int64 `json:"settingsVersion,omitempty,string"` 1682 1683 // ForceSendFields is a list of field names (e.g. "Kind") to 1684 // unconditionally include in API requests. By default, fields with 1685 // empty or default values are omitted from API requests. However, any 1686 // non-pointer, non-interface field appearing in ForceSendFields will be 1687 // sent to the server regardless of whether the field is empty or not. 1688 // This may be used to include empty fields in Patch requests. 1689 ForceSendFields []string `json:"-"` 1690 1691 // NullFields is a list of field names (e.g. "Kind") to include in API 1692 // requests with the JSON null value. By default, fields with empty 1693 // values are omitted from API requests. However, any field with an 1694 // empty value appearing in NullFields will be sent to the server as 1695 // null. It is an error if a field in this list has a non-empty value. 1696 // This may be used to include null fields in Patch requests. 1697 NullFields []string `json:"-"` 1698} 1699 1700func (s *FailoverContext) MarshalJSON() ([]byte, error) { 1701 type NoMethod FailoverContext 1702 raw := NoMethod(*s) 1703 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1704} 1705 1706// Flag: A flag resource. 1707type Flag struct { 1708 // AllowedIntValues: Use this field if only certain integers are 1709 // accepted. Can be combined with min_value and max_value to add 1710 // additional values. 1711 AllowedIntValues googleapi.Int64s `json:"allowedIntValues,omitempty"` 1712 1713 // AllowedStringValues: For **STRING** flags, a list of strings that the 1714 // value can be set to. 1715 AllowedStringValues []string `json:"allowedStringValues,omitempty"` 1716 1717 // AppliesTo: The database version this flag applies to. Can be 1718 // **MYSQL_8_0**, **MYSQL_5_6**, or **MYSQL_5_7**. 1719 // 1720 // Possible values: 1721 // "SQL_DATABASE_VERSION_UNSPECIFIED" - This is an unknown database 1722 // version. 1723 // "MYSQL_5_1" - The database version is MySQL 5.1. 1724 // "MYSQL_5_5" - The database version is MySQL 5.5. 1725 // "MYSQL_5_6" - The database version is MySQL 5.6. 1726 // "MYSQL_5_7" - The database version is MySQL 5.7. 1727 // "POSTGRES_9_6" - The database version is PostgreSQL 9.6. 1728 // "POSTGRES_11" - The database version is PostgreSQL 11. 1729 // "SQLSERVER_2017_STANDARD" - The database version is SQL Server 2017 1730 // Standard. 1731 // "SQLSERVER_2017_ENTERPRISE" - The database version is SQL Server 1732 // 2017 Enterprise. 1733 // "SQLSERVER_2017_EXPRESS" - The database version is SQL Server 2017 1734 // Express. 1735 // "SQLSERVER_2017_WEB" - The database version is SQL Server 2017 Web. 1736 // "POSTGRES_10" - The database version is PostgreSQL 10. 1737 // "POSTGRES_12" - The database version is PostgreSQL 12. 1738 // "MYSQL_8_0" - The database version is MySQL 8. 1739 // "MYSQL_8_0_18" - The database major version is MySQL 8.0 and the 1740 // minor version is 18. 1741 // "MYSQL_8_0_26" - The database major version is MySQL 8.0 and the 1742 // minor version is 26. 1743 // "POSTGRES_13" - The database version is PostgreSQL 13. 1744 // "POSTGRES_14" - The database version is PostgreSQL 14. 1745 // "SQLSERVER_2019_STANDARD" - The database version is SQL Server 2019 1746 // Standard. 1747 // "SQLSERVER_2019_ENTERPRISE" - The database version is SQL Server 1748 // 2019 Enterprise. 1749 // "SQLSERVER_2019_EXPRESS" - The database version is SQL Server 2019 1750 // Express. 1751 // "SQLSERVER_2019_WEB" - The database version is SQL Server 2019 Web. 1752 AppliesTo []string `json:"appliesTo,omitempty"` 1753 1754 // InBeta: Whether or not the flag is considered in beta. 1755 InBeta bool `json:"inBeta,omitempty"` 1756 1757 // Kind: This is always **sql#flag**. 1758 Kind string `json:"kind,omitempty"` 1759 1760 // MaxValue: For **INTEGER** flags, the maximum allowed value. 1761 MaxValue int64 `json:"maxValue,omitempty,string"` 1762 1763 // MinValue: For **INTEGER** flags, the minimum allowed value. 1764 MinValue int64 `json:"minValue,omitempty,string"` 1765 1766 // Name: This is the name of the flag. Flag names always use 1767 // underscores, not hyphens, for example: **max_allowed_packet** 1768 Name string `json:"name,omitempty"` 1769 1770 // RequiresRestart: Indicates whether changing this flag will trigger a 1771 // database restart. Only applicable to Second Generation instances. 1772 RequiresRestart bool `json:"requiresRestart,omitempty"` 1773 1774 // Type: The type of the flag. Flags are typed to being **BOOLEAN**, 1775 // **STRING**, **INTEGER** or **NONE**. **NONE** is used for flags which 1776 // do not take a value, such as **skip_grant_tables**. 1777 // 1778 // Possible values: 1779 // "SQL_FLAG_TYPE_UNSPECIFIED" - This is an unknown flag type. 1780 // "BOOLEAN" - Boolean type flag. 1781 // "STRING" - String type flag. 1782 // "INTEGER" - Integer type flag. 1783 // "NONE" - Flag type used for a server startup option. 1784 // "MYSQL_TIMEZONE_OFFSET" - Type introduced specially for MySQL 1785 // TimeZone offset. Accept a string value with the format [-12:59, 1786 // 13:00]. 1787 // "FLOAT" - Float type flag. 1788 // "REPEATED_STRING" - Comma-separated list of the strings in a 1789 // SqlFlagType enum. 1790 Type string `json:"type,omitempty"` 1791 1792 // ForceSendFields is a list of field names (e.g. "AllowedIntValues") to 1793 // unconditionally include in API requests. By default, fields with 1794 // empty or default values are omitted from API requests. However, any 1795 // non-pointer, non-interface field appearing in ForceSendFields will be 1796 // sent to the server regardless of whether the field is empty or not. 1797 // This may be used to include empty fields in Patch requests. 1798 ForceSendFields []string `json:"-"` 1799 1800 // NullFields is a list of field names (e.g. "AllowedIntValues") to 1801 // include in API requests with the JSON null value. By default, fields 1802 // with empty values are omitted from API requests. However, any field 1803 // with an empty value appearing in NullFields will be sent to the 1804 // server as null. It is an error if a field in this list has a 1805 // non-empty value. This may be used to include null fields in Patch 1806 // requests. 1807 NullFields []string `json:"-"` 1808} 1809 1810func (s *Flag) MarshalJSON() ([]byte, error) { 1811 type NoMethod Flag 1812 raw := NoMethod(*s) 1813 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1814} 1815 1816// FlagsListResponse: Flags list response. 1817type FlagsListResponse struct { 1818 // Items: List of flags. 1819 Items []*Flag `json:"items,omitempty"` 1820 1821 // Kind: This is always **sql#flagsList**. 1822 Kind string `json:"kind,omitempty"` 1823 1824 // ServerResponse contains the HTTP response code and headers from the 1825 // server. 1826 googleapi.ServerResponse `json:"-"` 1827 1828 // ForceSendFields is a list of field names (e.g. "Items") to 1829 // unconditionally include in API requests. By default, fields with 1830 // empty or default values are omitted from API requests. However, any 1831 // non-pointer, non-interface field appearing in ForceSendFields will be 1832 // sent to the server regardless of whether the field is empty or not. 1833 // This may be used to include empty fields in Patch requests. 1834 ForceSendFields []string `json:"-"` 1835 1836 // NullFields is a list of field names (e.g. "Items") to include in API 1837 // requests with the JSON null value. By default, fields with empty 1838 // values are omitted from API requests. However, any field with an 1839 // empty value appearing in NullFields will be sent to the server as 1840 // null. It is an error if a field in this list has a non-empty value. 1841 // This may be used to include null fields in Patch requests. 1842 NullFields []string `json:"-"` 1843} 1844 1845func (s *FlagsListResponse) MarshalJSON() ([]byte, error) { 1846 type NoMethod FlagsListResponse 1847 raw := NoMethod(*s) 1848 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1849} 1850 1851// GenerateEphemeralCertRequest: Ephemeral certificate creation request. 1852type GenerateEphemeralCertRequest struct { 1853 // AccessToken: Optional. Access token to include in the signed 1854 // certificate. 1855 AccessToken string `json:"access_token,omitempty"` 1856 1857 // PublicKey: PEM encoded public key to include in the signed 1858 // certificate. 1859 PublicKey string `json:"public_key,omitempty"` 1860 1861 // ReadTime: Optional. Optional snapshot read timestamp to trade 1862 // freshness for performance. 1863 ReadTime string `json:"readTime,omitempty"` 1864 1865 // ValidDuration: Optional. If set, it will contain the cert valid 1866 // duration. 1867 ValidDuration string `json:"validDuration,omitempty"` 1868 1869 // ForceSendFields is a list of field names (e.g. "AccessToken") to 1870 // unconditionally include in API requests. By default, fields with 1871 // empty or default values are omitted from API requests. However, any 1872 // non-pointer, non-interface field appearing in ForceSendFields will be 1873 // sent to the server regardless of whether the field is empty or not. 1874 // This may be used to include empty fields in Patch requests. 1875 ForceSendFields []string `json:"-"` 1876 1877 // NullFields is a list of field names (e.g. "AccessToken") to include 1878 // in API requests with the JSON null value. By default, fields with 1879 // empty values are omitted from API requests. However, any field with 1880 // an empty value appearing in NullFields will be sent to the server as 1881 // null. It is an error if a field in this list has a non-empty value. 1882 // This may be used to include null fields in Patch requests. 1883 NullFields []string `json:"-"` 1884} 1885 1886func (s *GenerateEphemeralCertRequest) MarshalJSON() ([]byte, error) { 1887 type NoMethod GenerateEphemeralCertRequest 1888 raw := NoMethod(*s) 1889 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1890} 1891 1892// GenerateEphemeralCertResponse: Ephemeral certificate creation 1893// request. 1894type GenerateEphemeralCertResponse struct { 1895 // EphemeralCert: Generated cert 1896 EphemeralCert *SslCert `json:"ephemeralCert,omitempty"` 1897 1898 // ServerResponse contains the HTTP response code and headers from the 1899 // server. 1900 googleapi.ServerResponse `json:"-"` 1901 1902 // ForceSendFields is a list of field names (e.g. "EphemeralCert") to 1903 // unconditionally include in API requests. By default, fields with 1904 // empty or default values are omitted from API requests. However, any 1905 // non-pointer, non-interface field appearing in ForceSendFields will be 1906 // sent to the server regardless of whether the field is empty or not. 1907 // This may be used to include empty fields in Patch requests. 1908 ForceSendFields []string `json:"-"` 1909 1910 // NullFields is a list of field names (e.g. "EphemeralCert") to include 1911 // in API requests with the JSON null value. By default, fields with 1912 // empty values are omitted from API requests. However, any field with 1913 // an empty value appearing in NullFields will be sent to the server as 1914 // null. It is an error if a field in this list has a non-empty value. 1915 // This may be used to include null fields in Patch requests. 1916 NullFields []string `json:"-"` 1917} 1918 1919func (s *GenerateEphemeralCertResponse) MarshalJSON() ([]byte, error) { 1920 type NoMethod GenerateEphemeralCertResponse 1921 raw := NoMethod(*s) 1922 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1923} 1924 1925// ImportContext: Database instance import context. 1926type ImportContext struct { 1927 // BakImportOptions: Import parameters specific to SQL Server .BAK files 1928 BakImportOptions *ImportContextBakImportOptions `json:"bakImportOptions,omitempty"` 1929 1930 // CsvImportOptions: Options for importing data as CSV. 1931 CsvImportOptions *ImportContextCsvImportOptions `json:"csvImportOptions,omitempty"` 1932 1933 // Database: The target database for the import. If **fileType** is 1934 // **SQL**, this field is required only if the import file does not 1935 // specify a database, and is overridden by any database specification 1936 // in the import file. If **fileType** is **CSV**, one database must be 1937 // specified. 1938 Database string `json:"database,omitempty"` 1939 1940 // FileType: The file type for the specified uri. * **SQL**: The file 1941 // contains SQL statements. * **CSV**: The file contains CSV data. * 1942 // **BAK**: The file contains backup data for a SQL Server instance. 1943 // 1944 // Possible values: 1945 // "SQL_FILE_TYPE_UNSPECIFIED" - Unknown file type. 1946 // "SQL" - File containing SQL statements. 1947 // "CSV" - File in CSV format. 1948 // "BAK" 1949 FileType string `json:"fileType,omitempty"` 1950 1951 // ImportUser: The PostgreSQL user for this import operation. PostgreSQL 1952 // instances only. 1953 ImportUser string `json:"importUser,omitempty"` 1954 1955 // Kind: This is always **sql#importContext**. 1956 Kind string `json:"kind,omitempty"` 1957 1958 // Uri: Path to the import file in Cloud Storage, in the form 1959 // **gs://bucketName/fileName**. Compressed gzip files (.gz) are 1960 // supported when **fileType** is **SQL**. The instance must have write 1961 // permissions to the bucket and read access to the file. 1962 Uri string `json:"uri,omitempty"` 1963 1964 // ForceSendFields is a list of field names (e.g. "BakImportOptions") to 1965 // unconditionally include in API requests. By default, fields with 1966 // empty or default values are omitted from API requests. However, any 1967 // non-pointer, non-interface field appearing in ForceSendFields will be 1968 // sent to the server regardless of whether the field is empty or not. 1969 // This may be used to include empty fields in Patch requests. 1970 ForceSendFields []string `json:"-"` 1971 1972 // NullFields is a list of field names (e.g. "BakImportOptions") to 1973 // include in API requests with the JSON null value. By default, fields 1974 // with empty values are omitted from API requests. However, any field 1975 // with an empty value appearing in NullFields will be sent to the 1976 // server as null. It is an error if a field in this list has a 1977 // non-empty value. This may be used to include null fields in Patch 1978 // requests. 1979 NullFields []string `json:"-"` 1980} 1981 1982func (s *ImportContext) MarshalJSON() ([]byte, error) { 1983 type NoMethod ImportContext 1984 raw := NoMethod(*s) 1985 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1986} 1987 1988// ImportContextBakImportOptions: Import parameters specific to SQL 1989// Server .BAK files 1990type ImportContextBakImportOptions struct { 1991 EncryptionOptions *ImportContextBakImportOptionsEncryptionOptions `json:"encryptionOptions,omitempty"` 1992 1993 // ForceSendFields is a list of field names (e.g. "EncryptionOptions") 1994 // to unconditionally include in API requests. By default, fields with 1995 // empty or default values are omitted from API requests. However, any 1996 // non-pointer, non-interface field appearing in ForceSendFields will be 1997 // sent to the server regardless of whether the field is empty or not. 1998 // This may be used to include empty fields in Patch requests. 1999 ForceSendFields []string `json:"-"` 2000 2001 // NullFields is a list of field names (e.g. "EncryptionOptions") to 2002 // include in API requests with the JSON null value. By default, fields 2003 // with empty values are omitted from API requests. However, any field 2004 // with an empty value appearing in NullFields will be sent to the 2005 // server as null. It is an error if a field in this list has a 2006 // non-empty value. This may be used to include null fields in Patch 2007 // requests. 2008 NullFields []string `json:"-"` 2009} 2010 2011func (s *ImportContextBakImportOptions) MarshalJSON() ([]byte, error) { 2012 type NoMethod ImportContextBakImportOptions 2013 raw := NoMethod(*s) 2014 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2015} 2016 2017type ImportContextBakImportOptionsEncryptionOptions struct { 2018 // CertPath: Path to the Certificate (.cer) in Cloud Storage, in the 2019 // form **gs://bucketName/fileName**. The instance must have write 2020 // permissions to the bucket and read access to the file. 2021 CertPath string `json:"certPath,omitempty"` 2022 2023 // PvkPassword: Password that encrypts the private key 2024 PvkPassword string `json:"pvkPassword,omitempty"` 2025 2026 // PvkPath: Path to the Certificate Private Key (.pvk) in Cloud Storage, 2027 // in the form **gs://bucketName/fileName**. The instance must have 2028 // write permissions to the bucket and read access to the file. 2029 PvkPath string `json:"pvkPath,omitempty"` 2030 2031 // ForceSendFields is a list of field names (e.g. "CertPath") to 2032 // unconditionally include in API requests. By default, fields with 2033 // empty or default values are omitted from API requests. However, any 2034 // non-pointer, non-interface field appearing in ForceSendFields will be 2035 // sent to the server regardless of whether the field is empty or not. 2036 // This may be used to include empty fields in Patch requests. 2037 ForceSendFields []string `json:"-"` 2038 2039 // NullFields is a list of field names (e.g. "CertPath") to include in 2040 // API requests with the JSON null value. By default, fields with empty 2041 // values are omitted from API requests. However, any field with an 2042 // empty value appearing in NullFields will be sent to the server as 2043 // null. It is an error if a field in this list has a non-empty value. 2044 // This may be used to include null fields in Patch requests. 2045 NullFields []string `json:"-"` 2046} 2047 2048func (s *ImportContextBakImportOptionsEncryptionOptions) MarshalJSON() ([]byte, error) { 2049 type NoMethod ImportContextBakImportOptionsEncryptionOptions 2050 raw := NoMethod(*s) 2051 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2052} 2053 2054// ImportContextCsvImportOptions: Options for importing data as CSV. 2055type ImportContextCsvImportOptions struct { 2056 // Columns: The columns to which CSV data is imported. If not specified, 2057 // all columns of the database table are loaded with CSV data. 2058 Columns []string `json:"columns,omitempty"` 2059 2060 // EscapeCharacter: Specifies the character that should appear before a 2061 // data character that needs to be escaped. 2062 EscapeCharacter string `json:"escapeCharacter,omitempty"` 2063 2064 // FieldsTerminatedBy: Specifies the character that separates columns 2065 // within each row (line) of the file. 2066 FieldsTerminatedBy string `json:"fieldsTerminatedBy,omitempty"` 2067 2068 // LinesTerminatedBy: This is used to separate lines. If a line does not 2069 // contain all fields, the rest of the columns are set to their default 2070 // values. 2071 LinesTerminatedBy string `json:"linesTerminatedBy,omitempty"` 2072 2073 // QuoteCharacter: Specifies the quoting character to be used when a 2074 // data value is quoted. 2075 QuoteCharacter string `json:"quoteCharacter,omitempty"` 2076 2077 // Table: The table to which CSV data is imported. 2078 Table string `json:"table,omitempty"` 2079 2080 // ForceSendFields is a list of field names (e.g. "Columns") to 2081 // unconditionally include in API requests. By default, fields with 2082 // empty or default values are omitted from API requests. However, any 2083 // non-pointer, non-interface field appearing in ForceSendFields will be 2084 // sent to the server regardless of whether the field is empty or not. 2085 // This may be used to include empty fields in Patch requests. 2086 ForceSendFields []string `json:"-"` 2087 2088 // NullFields is a list of field names (e.g. "Columns") to include in 2089 // API requests with the JSON null value. By default, fields with empty 2090 // values are omitted from API requests. However, any field with an 2091 // empty value appearing in NullFields will be sent to the server as 2092 // null. It is an error if a field in this list has a non-empty value. 2093 // This may be used to include null fields in Patch requests. 2094 NullFields []string `json:"-"` 2095} 2096 2097func (s *ImportContextCsvImportOptions) MarshalJSON() ([]byte, error) { 2098 type NoMethod ImportContextCsvImportOptions 2099 raw := NoMethod(*s) 2100 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2101} 2102 2103// InsightsConfig: Insights configuration. This specifies when Cloud SQL 2104// Insights feature is enabled and optional configuration. 2105type InsightsConfig struct { 2106 // QueryInsightsEnabled: Whether Query Insights feature is enabled. 2107 QueryInsightsEnabled bool `json:"queryInsightsEnabled,omitempty"` 2108 2109 // QueryPlansPerMinute: Number of query execution plans captured by 2110 // Insights per minute for all queries combined. Default is 5. 2111 QueryPlansPerMinute int64 `json:"queryPlansPerMinute,omitempty"` 2112 2113 // QueryStringLength: Maximum query length stored in bytes. Default 2114 // value: 1024 bytes. Range: 256-4500 bytes. Query length more than this 2115 // field value will be truncated to this value. When unset, query length 2116 // will be the default value. Changing query length will restart the 2117 // database. 2118 QueryStringLength int64 `json:"queryStringLength,omitempty"` 2119 2120 // RecordApplicationTags: Whether Query Insights will record application 2121 // tags from query when enabled. 2122 RecordApplicationTags bool `json:"recordApplicationTags,omitempty"` 2123 2124 // RecordClientAddress: Whether Query Insights will record client 2125 // address when enabled. 2126 RecordClientAddress bool `json:"recordClientAddress,omitempty"` 2127 2128 // ForceSendFields is a list of field names (e.g. 2129 // "QueryInsightsEnabled") to unconditionally include in API requests. 2130 // By default, fields with empty or default values are omitted from API 2131 // requests. However, any non-pointer, non-interface field appearing in 2132 // ForceSendFields will be sent to the server regardless of whether the 2133 // field is empty or not. This may be used to include empty fields in 2134 // Patch requests. 2135 ForceSendFields []string `json:"-"` 2136 2137 // NullFields is a list of field names (e.g. "QueryInsightsEnabled") to 2138 // include in API requests with the JSON null value. By default, fields 2139 // with empty values are omitted from API requests. However, any field 2140 // with an empty value appearing in NullFields will be sent to the 2141 // server as null. It is an error if a field in this list has a 2142 // non-empty value. This may be used to include null fields in Patch 2143 // requests. 2144 NullFields []string `json:"-"` 2145} 2146 2147func (s *InsightsConfig) MarshalJSON() ([]byte, error) { 2148 type NoMethod InsightsConfig 2149 raw := NoMethod(*s) 2150 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2151} 2152 2153// InstanceReference: Reference to another Cloud SQL instance. 2154type InstanceReference struct { 2155 // Name: The name of the Cloud SQL instance being referenced. This does 2156 // not include the project ID. 2157 Name string `json:"name,omitempty"` 2158 2159 // Project: The project ID of the Cloud SQL instance being referenced. 2160 // The default is the same project ID as the instance references it. 2161 Project string `json:"project,omitempty"` 2162 2163 // Region: The region of the Cloud SQL instance being referenced. 2164 Region string `json:"region,omitempty"` 2165 2166 // ForceSendFields is a list of field names (e.g. "Name") to 2167 // unconditionally include in API requests. By default, fields with 2168 // empty or default values are omitted from API requests. However, any 2169 // non-pointer, non-interface field appearing in ForceSendFields will be 2170 // sent to the server regardless of whether the field is empty or not. 2171 // This may be used to include empty fields in Patch requests. 2172 ForceSendFields []string `json:"-"` 2173 2174 // NullFields is a list of field names (e.g. "Name") to include in API 2175 // requests with the JSON null value. By default, fields with empty 2176 // values are omitted from API requests. However, any field with an 2177 // empty value appearing in NullFields will be sent to the server as 2178 // null. It is an error if a field in this list has a non-empty value. 2179 // This may be used to include null fields in Patch requests. 2180 NullFields []string `json:"-"` 2181} 2182 2183func (s *InstanceReference) MarshalJSON() ([]byte, error) { 2184 type NoMethod InstanceReference 2185 raw := NoMethod(*s) 2186 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2187} 2188 2189// InstancesCloneRequest: Database instance clone request. 2190type InstancesCloneRequest struct { 2191 // CloneContext: Contains details about the clone operation. 2192 CloneContext *CloneContext `json:"cloneContext,omitempty"` 2193 2194 // ForceSendFields is a list of field names (e.g. "CloneContext") to 2195 // unconditionally include in API requests. By default, fields with 2196 // empty or default values are omitted from API requests. However, any 2197 // non-pointer, non-interface field appearing in ForceSendFields will be 2198 // sent to the server regardless of whether the field is empty or not. 2199 // This may be used to include empty fields in Patch requests. 2200 ForceSendFields []string `json:"-"` 2201 2202 // NullFields is a list of field names (e.g. "CloneContext") to include 2203 // in API requests with the JSON null value. By default, fields with 2204 // empty values are omitted from API requests. However, any field with 2205 // an empty value appearing in NullFields will be sent to the server as 2206 // null. It is an error if a field in this list has a non-empty value. 2207 // This may be used to include null fields in Patch requests. 2208 NullFields []string `json:"-"` 2209} 2210 2211func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error) { 2212 type NoMethod InstancesCloneRequest 2213 raw := NoMethod(*s) 2214 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2215} 2216 2217// InstancesDemoteMasterRequest: Database demote primary instance 2218// request. 2219type InstancesDemoteMasterRequest struct { 2220 // DemoteMasterContext: Contains details about the demoteMaster 2221 // operation. 2222 DemoteMasterContext *DemoteMasterContext `json:"demoteMasterContext,omitempty"` 2223 2224 // ForceSendFields is a list of field names (e.g. "DemoteMasterContext") 2225 // to unconditionally include in API requests. By default, fields with 2226 // empty or default values are omitted from API requests. However, any 2227 // non-pointer, non-interface field appearing in ForceSendFields will be 2228 // sent to the server regardless of whether the field is empty or not. 2229 // This may be used to include empty fields in Patch requests. 2230 ForceSendFields []string `json:"-"` 2231 2232 // NullFields is a list of field names (e.g. "DemoteMasterContext") to 2233 // include in API requests with the JSON null value. By default, fields 2234 // with empty values are omitted from API requests. However, any field 2235 // with an empty value appearing in NullFields will be sent to the 2236 // server as null. It is an error if a field in this list has a 2237 // non-empty value. This may be used to include null fields in Patch 2238 // requests. 2239 NullFields []string `json:"-"` 2240} 2241 2242func (s *InstancesDemoteMasterRequest) MarshalJSON() ([]byte, error) { 2243 type NoMethod InstancesDemoteMasterRequest 2244 raw := NoMethod(*s) 2245 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2246} 2247 2248// InstancesExportRequest: Database instance export request. 2249type InstancesExportRequest struct { 2250 // ExportContext: Contains details about the export operation. 2251 ExportContext *ExportContext `json:"exportContext,omitempty"` 2252 2253 // ForceSendFields is a list of field names (e.g. "ExportContext") to 2254 // unconditionally include in API requests. By default, fields with 2255 // empty or default values are omitted from API requests. However, any 2256 // non-pointer, non-interface field appearing in ForceSendFields will be 2257 // sent to the server regardless of whether the field is empty or not. 2258 // This may be used to include empty fields in Patch requests. 2259 ForceSendFields []string `json:"-"` 2260 2261 // NullFields is a list of field names (e.g. "ExportContext") to include 2262 // in API requests with the JSON null value. By default, fields with 2263 // empty values are omitted from API requests. However, any field with 2264 // an empty value appearing in NullFields will be sent to the server as 2265 // null. It is an error if a field in this list has a non-empty value. 2266 // This may be used to include null fields in Patch requests. 2267 NullFields []string `json:"-"` 2268} 2269 2270func (s *InstancesExportRequest) MarshalJSON() ([]byte, error) { 2271 type NoMethod InstancesExportRequest 2272 raw := NoMethod(*s) 2273 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2274} 2275 2276// InstancesFailoverRequest: Instance failover request. 2277type InstancesFailoverRequest struct { 2278 // FailoverContext: Failover Context. 2279 FailoverContext *FailoverContext `json:"failoverContext,omitempty"` 2280 2281 // ForceSendFields is a list of field names (e.g. "FailoverContext") to 2282 // unconditionally include in API requests. By default, fields with 2283 // empty or default values are omitted from API requests. However, any 2284 // non-pointer, non-interface field appearing in ForceSendFields will be 2285 // sent to the server regardless of whether the field is empty or not. 2286 // This may be used to include empty fields in Patch requests. 2287 ForceSendFields []string `json:"-"` 2288 2289 // NullFields is a list of field names (e.g. "FailoverContext") to 2290 // include in API requests with the JSON null value. By default, fields 2291 // with empty values are omitted from API requests. However, any field 2292 // with an empty value appearing in NullFields will be sent to the 2293 // server as null. It is an error if a field in this list has a 2294 // non-empty value. This may be used to include null fields in Patch 2295 // requests. 2296 NullFields []string `json:"-"` 2297} 2298 2299func (s *InstancesFailoverRequest) MarshalJSON() ([]byte, error) { 2300 type NoMethod InstancesFailoverRequest 2301 raw := NoMethod(*s) 2302 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2303} 2304 2305// InstancesImportRequest: Database instance import request. 2306type InstancesImportRequest struct { 2307 // ImportContext: Contains details about the import operation. 2308 ImportContext *ImportContext `json:"importContext,omitempty"` 2309 2310 // ForceSendFields is a list of field names (e.g. "ImportContext") to 2311 // unconditionally include in API requests. By default, fields with 2312 // empty or default values are omitted from API requests. However, any 2313 // non-pointer, non-interface field appearing in ForceSendFields will be 2314 // sent to the server regardless of whether the field is empty or not. 2315 // This may be used to include empty fields in Patch requests. 2316 ForceSendFields []string `json:"-"` 2317 2318 // NullFields is a list of field names (e.g. "ImportContext") to include 2319 // in API requests with the JSON null value. By default, fields with 2320 // empty values are omitted from API requests. However, any field with 2321 // an empty value appearing in NullFields will be sent to the server as 2322 // null. It is an error if a field in this list has a non-empty value. 2323 // This may be used to include null fields in Patch requests. 2324 NullFields []string `json:"-"` 2325} 2326 2327func (s *InstancesImportRequest) MarshalJSON() ([]byte, error) { 2328 type NoMethod InstancesImportRequest 2329 raw := NoMethod(*s) 2330 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2331} 2332 2333// InstancesListResponse: Database instances list response. 2334type InstancesListResponse struct { 2335 // Items: List of database instance resources. 2336 Items []*DatabaseInstance `json:"items,omitempty"` 2337 2338 // Kind: This is always **sql#instancesList**. 2339 Kind string `json:"kind,omitempty"` 2340 2341 // NextPageToken: The continuation token, used to page through large 2342 // result sets. Provide this value in a subsequent request to return the 2343 // next page of results. 2344 NextPageToken string `json:"nextPageToken,omitempty"` 2345 2346 // Warnings: List of warnings that occurred while handling the request. 2347 Warnings []*ApiWarning `json:"warnings,omitempty"` 2348 2349 // ServerResponse contains the HTTP response code and headers from the 2350 // server. 2351 googleapi.ServerResponse `json:"-"` 2352 2353 // ForceSendFields is a list of field names (e.g. "Items") to 2354 // unconditionally include in API requests. By default, fields with 2355 // empty or default values are omitted from API requests. However, any 2356 // non-pointer, non-interface field appearing in ForceSendFields will be 2357 // sent to the server regardless of whether the field is empty or not. 2358 // This may be used to include empty fields in Patch requests. 2359 ForceSendFields []string `json:"-"` 2360 2361 // NullFields is a list of field names (e.g. "Items") to include in API 2362 // requests with the JSON null value. By default, fields with empty 2363 // values are omitted from API requests. However, any field with an 2364 // empty value appearing in NullFields will be sent to the server as 2365 // null. It is an error if a field in this list has a non-empty value. 2366 // This may be used to include null fields in Patch requests. 2367 NullFields []string `json:"-"` 2368} 2369 2370func (s *InstancesListResponse) MarshalJSON() ([]byte, error) { 2371 type NoMethod InstancesListResponse 2372 raw := NoMethod(*s) 2373 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2374} 2375 2376// InstancesListServerCasResponse: Instances ListServerCas response. 2377type InstancesListServerCasResponse struct { 2378 ActiveVersion string `json:"activeVersion,omitempty"` 2379 2380 // Certs: List of server CA certificates for the instance. 2381 Certs []*SslCert `json:"certs,omitempty"` 2382 2383 // Kind: This is always **sql#instancesListServerCas**. 2384 Kind string `json:"kind,omitempty"` 2385 2386 // ServerResponse contains the HTTP response code and headers from the 2387 // server. 2388 googleapi.ServerResponse `json:"-"` 2389 2390 // ForceSendFields is a list of field names (e.g. "ActiveVersion") to 2391 // unconditionally include in API requests. By default, fields with 2392 // empty or default values are omitted from API requests. However, any 2393 // non-pointer, non-interface field appearing in ForceSendFields will be 2394 // sent to the server regardless of whether the field is empty or not. 2395 // This may be used to include empty fields in Patch requests. 2396 ForceSendFields []string `json:"-"` 2397 2398 // NullFields is a list of field names (e.g. "ActiveVersion") to include 2399 // in API requests with the JSON null value. By default, fields with 2400 // empty values are omitted from API requests. However, any field with 2401 // an empty value appearing in NullFields will be sent to the server as 2402 // null. It is an error if a field in this list has a non-empty value. 2403 // This may be used to include null fields in Patch requests. 2404 NullFields []string `json:"-"` 2405} 2406 2407func (s *InstancesListServerCasResponse) MarshalJSON() ([]byte, error) { 2408 type NoMethod InstancesListServerCasResponse 2409 raw := NoMethod(*s) 2410 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2411} 2412 2413// InstancesRestoreBackupRequest: Database instance restore backup 2414// request. 2415type InstancesRestoreBackupRequest struct { 2416 // RestoreBackupContext: Parameters required to perform the restore 2417 // backup operation. 2418 RestoreBackupContext *RestoreBackupContext `json:"restoreBackupContext,omitempty"` 2419 2420 // ForceSendFields is a list of field names (e.g. 2421 // "RestoreBackupContext") to unconditionally include in API requests. 2422 // By default, fields with empty or default values are omitted from API 2423 // requests. However, any non-pointer, non-interface field appearing in 2424 // ForceSendFields will be sent to the server regardless of whether the 2425 // field is empty or not. This may be used to include empty fields in 2426 // Patch requests. 2427 ForceSendFields []string `json:"-"` 2428 2429 // NullFields is a list of field names (e.g. "RestoreBackupContext") to 2430 // include in API requests with the JSON null value. By default, fields 2431 // with empty values are omitted from API requests. However, any field 2432 // with an empty value appearing in NullFields will be sent to the 2433 // server as null. It is an error if a field in this list has a 2434 // non-empty value. This may be used to include null fields in Patch 2435 // requests. 2436 NullFields []string `json:"-"` 2437} 2438 2439func (s *InstancesRestoreBackupRequest) MarshalJSON() ([]byte, error) { 2440 type NoMethod InstancesRestoreBackupRequest 2441 raw := NoMethod(*s) 2442 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2443} 2444 2445// InstancesRotateServerCaRequest: Rotate Server CA request. 2446type InstancesRotateServerCaRequest struct { 2447 // RotateServerCaContext: Contains details about the rotate server CA 2448 // operation. 2449 RotateServerCaContext *RotateServerCaContext `json:"rotateServerCaContext,omitempty"` 2450 2451 // ForceSendFields is a list of field names (e.g. 2452 // "RotateServerCaContext") to unconditionally include in API requests. 2453 // By default, fields with empty or default values are omitted from API 2454 // requests. However, any non-pointer, non-interface field appearing in 2455 // ForceSendFields will be sent to the server regardless of whether the 2456 // field is empty or not. This may be used to include empty fields in 2457 // Patch requests. 2458 ForceSendFields []string `json:"-"` 2459 2460 // NullFields is a list of field names (e.g. "RotateServerCaContext") to 2461 // include in API requests with the JSON null value. By default, fields 2462 // with empty values are omitted from API requests. However, any field 2463 // with an empty value appearing in NullFields will be sent to the 2464 // server as null. It is an error if a field in this list has a 2465 // non-empty value. This may be used to include null fields in Patch 2466 // requests. 2467 NullFields []string `json:"-"` 2468} 2469 2470func (s *InstancesRotateServerCaRequest) MarshalJSON() ([]byte, error) { 2471 type NoMethod InstancesRotateServerCaRequest 2472 raw := NoMethod(*s) 2473 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2474} 2475 2476// InstancesTruncateLogRequest: Instance truncate log request. 2477type InstancesTruncateLogRequest struct { 2478 // TruncateLogContext: Contains details about the truncate log 2479 // operation. 2480 TruncateLogContext *TruncateLogContext `json:"truncateLogContext,omitempty"` 2481 2482 // ForceSendFields is a list of field names (e.g. "TruncateLogContext") 2483 // to unconditionally include in API requests. By default, fields with 2484 // empty or default values are omitted from API requests. However, any 2485 // non-pointer, non-interface field appearing in ForceSendFields will be 2486 // sent to the server regardless of whether the field is empty or not. 2487 // This may be used to include empty fields in Patch requests. 2488 ForceSendFields []string `json:"-"` 2489 2490 // NullFields is a list of field names (e.g. "TruncateLogContext") to 2491 // include in API requests with the JSON null value. By default, fields 2492 // with empty values are omitted from API requests. However, any field 2493 // with an empty value appearing in NullFields will be sent to the 2494 // server as null. It is an error if a field in this list has a 2495 // non-empty value. This may be used to include null fields in Patch 2496 // requests. 2497 NullFields []string `json:"-"` 2498} 2499 2500func (s *InstancesTruncateLogRequest) MarshalJSON() ([]byte, error) { 2501 type NoMethod InstancesTruncateLogRequest 2502 raw := NoMethod(*s) 2503 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2504} 2505 2506// IpConfiguration: IP Management configuration. 2507type IpConfiguration struct { 2508 // AllocatedIpRange: The name of the allocated ip range for the private 2509 // ip CloudSQL instance. For example: "google-managed-services-default". 2510 // If set, the instance ip will be created in the allocated range. The 2511 // range name must comply with RFC 1035 2512 // (https://tools.ietf.org/html/rfc1035). Specifically, the name must be 2513 // 1-63 characters long and match the regular expression 2514 // `[a-z]([-a-z0-9]*[a-z0-9])?.` 2515 AllocatedIpRange string `json:"allocatedIpRange,omitempty"` 2516 2517 // AuthorizedNetworks: The list of external networks that are allowed to 2518 // connect to the instance using the IP. In 'CIDR' notation, also known 2519 // as 'slash' notation (for example: **192.168.100.0/24**). 2520 AuthorizedNetworks []*AclEntry `json:"authorizedNetworks,omitempty"` 2521 2522 // Ipv4Enabled: Whether the instance is assigned a public IP address or 2523 // not. 2524 Ipv4Enabled bool `json:"ipv4Enabled,omitempty"` 2525 2526 // PrivateNetwork: The resource link for the VPC network from which the 2527 // Cloud SQL instance is accessible for private IP. For example, 2528 // **/projects/myProject/global/networks/default**. This setting can be 2529 // updated, but it cannot be removed after it is set. 2530 PrivateNetwork string `json:"privateNetwork,omitempty"` 2531 2532 // RequireSsl: Whether SSL connections over IP are enforced or not. 2533 RequireSsl bool `json:"requireSsl,omitempty"` 2534 2535 // ForceSendFields is a list of field names (e.g. "AllocatedIpRange") to 2536 // unconditionally include in API requests. By default, fields with 2537 // empty or default values are omitted from API requests. However, any 2538 // non-pointer, non-interface field appearing in ForceSendFields will be 2539 // sent to the server regardless of whether the field is empty or not. 2540 // This may be used to include empty fields in Patch requests. 2541 ForceSendFields []string `json:"-"` 2542 2543 // NullFields is a list of field names (e.g. "AllocatedIpRange") to 2544 // include in API requests with the JSON null value. By default, fields 2545 // with empty values are omitted from API requests. However, any field 2546 // with an empty value appearing in NullFields will be sent to the 2547 // server as null. It is an error if a field in this list has a 2548 // non-empty value. This may be used to include null fields in Patch 2549 // requests. 2550 NullFields []string `json:"-"` 2551} 2552 2553func (s *IpConfiguration) MarshalJSON() ([]byte, error) { 2554 type NoMethod IpConfiguration 2555 raw := NoMethod(*s) 2556 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2557} 2558 2559// IpMapping: Database instance IP Mapping. 2560type IpMapping struct { 2561 // IpAddress: The IP address assigned. 2562 IpAddress string `json:"ipAddress,omitempty"` 2563 2564 // TimeToRetire: The due time for this IP to be retired in RFC 3339 2565 // (https://tools.ietf.org/html/rfc3339) format, for example 2566 // **2012-11-15T16:19:00.094Z**. This field is only available when the 2567 // IP is scheduled to be retired. 2568 TimeToRetire string `json:"timeToRetire,omitempty"` 2569 2570 // Type: The type of this IP address. A **PRIMARY** address is a public 2571 // address that can accept incoming connections. A **PRIVATE** address 2572 // is a private address that can accept incoming connections. An 2573 // **OUTGOING** address is the source address of connections originating 2574 // from the instance, if supported. 2575 // 2576 // Possible values: 2577 // "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" - This is an unknown IP address 2578 // type. 2579 // "PRIMARY" - IP address the customer is supposed to connect to. 2580 // Usually this is the load balancer's IP address 2581 // "OUTGOING" - Source IP address of the connection a read replica 2582 // establishes to its external primary instance. This IP address can be 2583 // allowlisted by the customer in case it has a firewall that filters 2584 // incoming connection to its on premises primary instance. 2585 // "PRIVATE" - Private IP used when using private IPs and network 2586 // peering. 2587 // "MIGRATED_1ST_GEN" - V1 IP of a migrated instance. We want the user 2588 // to decommission this IP as soon as the migration is complete. Note: 2589 // V1 instances with V1 ip addresses will be counted as PRIMARY. 2590 Type string `json:"type,omitempty"` 2591 2592 // ForceSendFields is a list of field names (e.g. "IpAddress") to 2593 // unconditionally include in API requests. By default, fields with 2594 // empty or default values are omitted from API requests. However, any 2595 // non-pointer, non-interface field appearing in ForceSendFields will be 2596 // sent to the server regardless of whether the field is empty or not. 2597 // This may be used to include empty fields in Patch requests. 2598 ForceSendFields []string `json:"-"` 2599 2600 // NullFields is a list of field names (e.g. "IpAddress") to include in 2601 // API requests with the JSON null value. By default, fields with empty 2602 // values are omitted from API requests. However, any field with an 2603 // empty value appearing in NullFields will be sent to the server as 2604 // null. It is an error if a field in this list has a non-empty value. 2605 // This may be used to include null fields in Patch requests. 2606 NullFields []string `json:"-"` 2607} 2608 2609func (s *IpMapping) MarshalJSON() ([]byte, error) { 2610 type NoMethod IpMapping 2611 raw := NoMethod(*s) 2612 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2613} 2614 2615// LocationPreference: Preferred location. This specifies where a Cloud 2616// SQL instance is located. Note that if the preferred location is not 2617// available, the instance will be located as close as possible within 2618// the region. Only one location may be specified. 2619type LocationPreference struct { 2620 // FollowGaeApplication: The App Engine application to follow, it must 2621 // be in the same region as the Cloud SQL instance. 2622 FollowGaeApplication string `json:"followGaeApplication,omitempty"` 2623 2624 // Kind: This is always **sql#locationPreference**. 2625 Kind string `json:"kind,omitempty"` 2626 2627 // SecondaryZone: The preferred Compute Engine zone for the 2628 // secondary/failover (for example: us-central1-a, us-central1-b, etc.). 2629 // Reserved for future use. 2630 SecondaryZone string `json:"secondaryZone,omitempty"` 2631 2632 // Zone: The preferred Compute Engine zone (for example: us-central1-a, 2633 // us-central1-b, etc.). 2634 Zone string `json:"zone,omitempty"` 2635 2636 // ForceSendFields is a list of field names (e.g. 2637 // "FollowGaeApplication") to unconditionally include in API requests. 2638 // By default, fields with empty or default values are omitted from API 2639 // requests. However, any non-pointer, non-interface field appearing in 2640 // ForceSendFields will be sent to the server regardless of whether the 2641 // field is empty or not. This may be used to include empty fields in 2642 // Patch requests. 2643 ForceSendFields []string `json:"-"` 2644 2645 // NullFields is a list of field names (e.g. "FollowGaeApplication") to 2646 // include in API requests with the JSON null value. By default, fields 2647 // with empty values are omitted from API requests. However, any field 2648 // with an empty value appearing in NullFields will be sent to the 2649 // server as null. It is an error if a field in this list has a 2650 // non-empty value. This may be used to include null fields in Patch 2651 // requests. 2652 NullFields []string `json:"-"` 2653} 2654 2655func (s *LocationPreference) MarshalJSON() ([]byte, error) { 2656 type NoMethod LocationPreference 2657 raw := NoMethod(*s) 2658 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2659} 2660 2661// MaintenanceWindow: Maintenance window. This specifies when a Cloud 2662// SQL instance is restarted for system maintenance purposes. 2663type MaintenanceWindow struct { 2664 // Day: day of week (1-7), starting on Monday. 2665 Day int64 `json:"day,omitempty"` 2666 2667 // Hour: hour of day - 0 to 23. 2668 Hour int64 `json:"hour,omitempty"` 2669 2670 // Kind: This is always **sql#maintenanceWindow**. 2671 Kind string `json:"kind,omitempty"` 2672 2673 // UpdateTrack: Maintenance timing setting: **canary** (Earlier) or 2674 // **stable** (Later). Learn more 2675 // (https://cloud.google.com/sql/docs/mysql/instance-settings#maintenance-timing-2ndgen). 2676 // 2677 // Possible values: 2678 // "SQL_UPDATE_TRACK_UNSPECIFIED" - This is an unknown maintenance 2679 // timing preference. 2680 // "canary" - For instance update that requires a restart, this update 2681 // track indicates your instance prefer to restart for new version early 2682 // in maintenance window. 2683 // "stable" - For instance update that requires a restart, this update 2684 // track indicates your instance prefer to let Cloud SQL choose the 2685 // timing of restart (within its Maintenance window, if applicable). 2686 UpdateTrack string `json:"updateTrack,omitempty"` 2687 2688 // ForceSendFields is a list of field names (e.g. "Day") to 2689 // unconditionally include in API requests. By default, fields with 2690 // empty or default values are omitted from API requests. However, any 2691 // non-pointer, non-interface field appearing in ForceSendFields will be 2692 // sent to the server regardless of whether the field is empty or not. 2693 // This may be used to include empty fields in Patch requests. 2694 ForceSendFields []string `json:"-"` 2695 2696 // NullFields is a list of field names (e.g. "Day") to include in API 2697 // requests with the JSON null value. By default, fields with empty 2698 // values are omitted from API requests. However, any field with an 2699 // empty value appearing in NullFields will be sent to the server as 2700 // null. It is an error if a field in this list has a non-empty value. 2701 // This may be used to include null fields in Patch requests. 2702 NullFields []string `json:"-"` 2703} 2704 2705func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) { 2706 type NoMethod MaintenanceWindow 2707 raw := NoMethod(*s) 2708 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2709} 2710 2711// MySqlReplicaConfiguration: Read-replica configuration specific to 2712// MySQL databases. 2713type MySqlReplicaConfiguration struct { 2714 // CaCertificate: PEM representation of the trusted CA's x509 2715 // certificate. 2716 CaCertificate string `json:"caCertificate,omitempty"` 2717 2718 // ClientCertificate: PEM representation of the replica's x509 2719 // certificate. 2720 ClientCertificate string `json:"clientCertificate,omitempty"` 2721 2722 // ClientKey: PEM representation of the replica's private key. The 2723 // corresponsing public key is encoded in the client's certificate. 2724 ClientKey string `json:"clientKey,omitempty"` 2725 2726 // ConnectRetryInterval: Seconds to wait between connect retries. 2727 // MySQL's default is 60 seconds. 2728 ConnectRetryInterval int64 `json:"connectRetryInterval,omitempty"` 2729 2730 // DumpFilePath: Path to a SQL dump file in Google Cloud Storage from 2731 // which the replica instance is to be created. The URI is in the form 2732 // gs://bucketName/fileName. Compressed gzip files (.gz) are also 2733 // supported. Dumps have the binlog co-ordinates from which replication 2734 // begins. This can be accomplished by setting --master-data to 1 when 2735 // using mysqldump. 2736 DumpFilePath string `json:"dumpFilePath,omitempty"` 2737 2738 // Kind: This is always **sql#mysqlReplicaConfiguration**. 2739 Kind string `json:"kind,omitempty"` 2740 2741 // MasterHeartbeatPeriod: Interval in milliseconds between replication 2742 // heartbeats. 2743 MasterHeartbeatPeriod int64 `json:"masterHeartbeatPeriod,omitempty,string"` 2744 2745 // Password: The password for the replication connection. 2746 Password string `json:"password,omitempty"` 2747 2748 // SslCipher: A list of permissible ciphers to use for SSL encryption. 2749 SslCipher string `json:"sslCipher,omitempty"` 2750 2751 // Username: The username for the replication connection. 2752 Username string `json:"username,omitempty"` 2753 2754 // VerifyServerCertificate: Whether or not to check the primary 2755 // instance's Common Name value in the certificate that it sends during 2756 // the SSL handshake. 2757 VerifyServerCertificate bool `json:"verifyServerCertificate,omitempty"` 2758 2759 // ForceSendFields is a list of field names (e.g. "CaCertificate") to 2760 // unconditionally include in API requests. By default, fields with 2761 // empty or default values are omitted from API requests. However, any 2762 // non-pointer, non-interface field appearing in ForceSendFields will be 2763 // sent to the server regardless of whether the field is empty or not. 2764 // This may be used to include empty fields in Patch requests. 2765 ForceSendFields []string `json:"-"` 2766 2767 // NullFields is a list of field names (e.g. "CaCertificate") to include 2768 // in API requests with the JSON null value. By default, fields with 2769 // empty values are omitted from API requests. However, any field with 2770 // an empty value appearing in NullFields will be sent to the server as 2771 // null. It is an error if a field in this list has a non-empty value. 2772 // This may be used to include null fields in Patch requests. 2773 NullFields []string `json:"-"` 2774} 2775 2776func (s *MySqlReplicaConfiguration) MarshalJSON() ([]byte, error) { 2777 type NoMethod MySqlReplicaConfiguration 2778 raw := NoMethod(*s) 2779 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2780} 2781 2782// MySqlSyncConfig: MySQL-specific external server sync settings. 2783type MySqlSyncConfig struct { 2784 // InitialSyncFlags: Flags to use for the initial dump. 2785 InitialSyncFlags []*SyncFlags `json:"initialSyncFlags,omitempty"` 2786 2787 // ForceSendFields is a list of field names (e.g. "InitialSyncFlags") to 2788 // unconditionally include in API requests. By default, fields with 2789 // empty or default values are omitted from API requests. However, any 2790 // non-pointer, non-interface field appearing in ForceSendFields will be 2791 // sent to the server regardless of whether the field is empty or not. 2792 // This may be used to include empty fields in Patch requests. 2793 ForceSendFields []string `json:"-"` 2794 2795 // NullFields is a list of field names (e.g. "InitialSyncFlags") to 2796 // include in API requests with the JSON null value. By default, fields 2797 // with empty values are omitted from API requests. However, any field 2798 // with an empty value appearing in NullFields will be sent to the 2799 // server as null. It is an error if a field in this list has a 2800 // non-empty value. This may be used to include null fields in Patch 2801 // requests. 2802 NullFields []string `json:"-"` 2803} 2804 2805func (s *MySqlSyncConfig) MarshalJSON() ([]byte, error) { 2806 type NoMethod MySqlSyncConfig 2807 raw := NoMethod(*s) 2808 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2809} 2810 2811// OnPremisesConfiguration: On-premises instance configuration. 2812type OnPremisesConfiguration struct { 2813 // CaCertificate: PEM representation of the trusted CA's x509 2814 // certificate. 2815 CaCertificate string `json:"caCertificate,omitempty"` 2816 2817 // ClientCertificate: PEM representation of the replica's x509 2818 // certificate. 2819 ClientCertificate string `json:"clientCertificate,omitempty"` 2820 2821 // ClientKey: PEM representation of the replica's private key. The 2822 // corresponsing public key is encoded in the client's certificate. 2823 ClientKey string `json:"clientKey,omitempty"` 2824 2825 // DumpFilePath: The dump file to create the Cloud SQL replica. 2826 DumpFilePath string `json:"dumpFilePath,omitempty"` 2827 2828 // HostPort: The host and port of the on-premises instance in host:port 2829 // format 2830 HostPort string `json:"hostPort,omitempty"` 2831 2832 // Kind: This is always **sql#onPremisesConfiguration**. 2833 Kind string `json:"kind,omitempty"` 2834 2835 // Password: The password for connecting to on-premises instance. 2836 Password string `json:"password,omitempty"` 2837 2838 // SourceInstance: The reference to Cloud SQL instance if the source is 2839 // Cloud SQL. 2840 SourceInstance *InstanceReference `json:"sourceInstance,omitempty"` 2841 2842 // Username: The username for connecting to on-premises instance. 2843 Username string `json:"username,omitempty"` 2844 2845 // ForceSendFields is a list of field names (e.g. "CaCertificate") to 2846 // unconditionally include in API requests. By default, fields with 2847 // empty or default values are omitted from API requests. However, any 2848 // non-pointer, non-interface field appearing in ForceSendFields will be 2849 // sent to the server regardless of whether the field is empty or not. 2850 // This may be used to include empty fields in Patch requests. 2851 ForceSendFields []string `json:"-"` 2852 2853 // NullFields is a list of field names (e.g. "CaCertificate") to include 2854 // in API requests with the JSON null value. By default, fields with 2855 // empty values are omitted from API requests. However, any field with 2856 // an empty value appearing in NullFields will be sent to the server as 2857 // null. It is an error if a field in this list has a non-empty value. 2858 // This may be used to include null fields in Patch requests. 2859 NullFields []string `json:"-"` 2860} 2861 2862func (s *OnPremisesConfiguration) MarshalJSON() ([]byte, error) { 2863 type NoMethod OnPremisesConfiguration 2864 raw := NoMethod(*s) 2865 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2866} 2867 2868// Operation: An Operation resource. For successful operations that 2869// return an Operation resource, only the fields relevant to the 2870// operation are populated in the resource. 2871type Operation struct { 2872 // BackupContext: The context for backup operation, if applicable. 2873 BackupContext *BackupContext `json:"backupContext,omitempty"` 2874 2875 // EndTime: The time this operation finished in UTC timezone in RFC 3339 2876 // (https://tools.ietf.org/html/rfc3339) format, for example 2877 // **2012-11-15T16:19:00.094Z**. 2878 EndTime string `json:"endTime,omitempty"` 2879 2880 // Error: If errors occurred during processing of this operation, this 2881 // field will be populated. 2882 Error *OperationErrors `json:"error,omitempty"` 2883 2884 // ExportContext: The context for export operation, if applicable. 2885 ExportContext *ExportContext `json:"exportContext,omitempty"` 2886 2887 // ImportContext: The context for import operation, if applicable. 2888 ImportContext *ImportContext `json:"importContext,omitempty"` 2889 2890 // InsertTime: The time this operation was enqueued in UTC timezone in 2891 // RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example 2892 // **2012-11-15T16:19:00.094Z**. 2893 InsertTime string `json:"insertTime,omitempty"` 2894 2895 // Kind: This is always **sql#operation**. 2896 Kind string `json:"kind,omitempty"` 2897 2898 // Name: An identifier that uniquely identifies the operation. You can 2899 // use this identifier to retrieve the Operations resource that has 2900 // information about the operation. 2901 Name string `json:"name,omitempty"` 2902 2903 // OperationType: The type of the operation. Valid values are: * 2904 // **CREATE** * **DELETE** * **UPDATE** * **RESTART** * **IMPORT** * 2905 // **EXPORT** * **BACKUP_VOLUME** * **RESTORE_VOLUME** * **CREATE_USER** 2906 // * **DELETE_USER** * **CREATE_DATABASE** * **DELETE_DATABASE** 2907 // 2908 // Possible values: 2909 // "SQL_OPERATION_TYPE_UNSPECIFIED" - Unknown operation type. 2910 // "IMPORT" - Imports data into a Cloud SQL instance. 2911 // "EXPORT" - Exports data from a Cloud SQL instance to a Cloud 2912 // Storage bucket. 2913 // "CREATE" - Creates a new Cloud SQL instance. 2914 // "UPDATE" - Updates the settings of a Cloud SQL instance. 2915 // "DELETE" - Deletes a Cloud SQL instance. 2916 // "RESTART" - Restarts the Cloud SQL instance. 2917 // "BACKUP" 2918 // "SNAPSHOT" 2919 // "BACKUP_VOLUME" - Performs instance backup. 2920 // "DELETE_VOLUME" - Deletes an instance backup. 2921 // "RESTORE_VOLUME" - Restores an instance backup. 2922 // "INJECT_USER" - Injects a privileged user in mysql for MOB 2923 // instances. 2924 // "CLONE" - Clones a Cloud SQL instance. 2925 // "STOP_REPLICA" - Stops replication on a Cloud SQL read replica 2926 // instance. 2927 // "START_REPLICA" - Starts replication on a Cloud SQL read replica 2928 // instance. 2929 // "PROMOTE_REPLICA" - Promotes a Cloud SQL replica instance. 2930 // "CREATE_REPLICA" - Creates a Cloud SQL replica instance. 2931 // "CREATE_USER" - Creates a new user in a Cloud SQL instance. 2932 // "DELETE_USER" - Deletes a user from a Cloud SQL instance. 2933 // "UPDATE_USER" - Updates an existing user in a Cloud SQL instance. 2934 // "CREATE_DATABASE" - Creates a database in the Cloud SQL instance. 2935 // "DELETE_DATABASE" - Deletes a database in the Cloud SQL instance. 2936 // "UPDATE_DATABASE" - Updates a database in the Cloud SQL instance. 2937 // "FAILOVER" - Performs failover of an HA-enabled Cloud SQL failover 2938 // replica. 2939 // "DELETE_BACKUP" - Deletes the backup taken by a backup run. 2940 // "RECREATE_REPLICA" 2941 // "TRUNCATE_LOG" - Truncates a general or slow log table in MySQL. 2942 // "DEMOTE_MASTER" - Demotes the stand-alone instance to be a Cloud 2943 // SQL read replica for an external database server. 2944 // "MAINTENANCE" - Indicates that the instance is currently in 2945 // maintenance. Maintenance typically causes the instance to be 2946 // unavailable for 1-3 minutes. 2947 // "ENABLE_PRIVATE_IP" - This field is deprecated, and will be removed 2948 // in future version of API. 2949 // "DEFER_MAINTENANCE" 2950 // "CREATE_CLONE" - Creates clone instance. 2951 // "RESCHEDULE_MAINTENANCE" - Reschedule maintenance to another time. 2952 // "START_EXTERNAL_SYNC" - Starts external sync of a Cloud SQL EM 2953 // replica to an external primary instance. 2954 OperationType string `json:"operationType,omitempty"` 2955 2956 // SelfLink: The URI of this resource. 2957 SelfLink string `json:"selfLink,omitempty"` 2958 2959 // StartTime: The time this operation actually started in UTC timezone 2960 // in RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example 2961 // **2012-11-15T16:19:00.094Z**. 2962 StartTime string `json:"startTime,omitempty"` 2963 2964 // Status: The status of an operation. 2965 // 2966 // Possible values: 2967 // "SQL_OPERATION_STATUS_UNSPECIFIED" - The state of the operation is 2968 // unknown. 2969 // "PENDING" - The operation has been queued, but has not started yet. 2970 // "RUNNING" - The operation is running. 2971 // "DONE" - The operation completed. 2972 Status string `json:"status,omitempty"` 2973 2974 // TargetId: Name of the database instance related to this operation. 2975 TargetId string `json:"targetId,omitempty"` 2976 2977 TargetLink string `json:"targetLink,omitempty"` 2978 2979 // TargetProject: The project ID of the target instance related to this 2980 // operation. 2981 TargetProject string `json:"targetProject,omitempty"` 2982 2983 // User: The email address of the user who initiated this operation. 2984 User string `json:"user,omitempty"` 2985 2986 // ServerResponse contains the HTTP response code and headers from the 2987 // server. 2988 googleapi.ServerResponse `json:"-"` 2989 2990 // ForceSendFields is a list of field names (e.g. "BackupContext") to 2991 // unconditionally include in API requests. By default, fields with 2992 // empty or default values are omitted from API requests. However, any 2993 // non-pointer, non-interface field appearing in ForceSendFields will be 2994 // sent to the server regardless of whether the field is empty or not. 2995 // This may be used to include empty fields in Patch requests. 2996 ForceSendFields []string `json:"-"` 2997 2998 // NullFields is a list of field names (e.g. "BackupContext") to include 2999 // in API requests with the JSON null value. By default, fields with 3000 // empty values are omitted from API requests. However, any field with 3001 // an empty value appearing in NullFields will be sent to the server as 3002 // null. It is an error if a field in this list has a non-empty value. 3003 // This may be used to include null fields in Patch requests. 3004 NullFields []string `json:"-"` 3005} 3006 3007func (s *Operation) MarshalJSON() ([]byte, error) { 3008 type NoMethod Operation 3009 raw := NoMethod(*s) 3010 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3011} 3012 3013// OperationError: Database instance operation error. 3014type OperationError struct { 3015 // Code: Identifies the specific error that occurred. 3016 Code string `json:"code,omitempty"` 3017 3018 // Kind: This is always **sql#operationError**. 3019 Kind string `json:"kind,omitempty"` 3020 3021 // Message: Additional information about the error encountered. 3022 Message string `json:"message,omitempty"` 3023 3024 // ForceSendFields is a list of field names (e.g. "Code") to 3025 // unconditionally include in API requests. By default, fields with 3026 // empty or default values are omitted from API requests. However, any 3027 // non-pointer, non-interface field appearing in ForceSendFields will be 3028 // sent to the server regardless of whether the field is empty or not. 3029 // This may be used to include empty fields in Patch requests. 3030 ForceSendFields []string `json:"-"` 3031 3032 // NullFields is a list of field names (e.g. "Code") to include in API 3033 // requests with the JSON null value. By default, fields with empty 3034 // values are omitted from API requests. However, any field with an 3035 // empty value appearing in NullFields will be sent to the server as 3036 // null. It is an error if a field in this list has a non-empty value. 3037 // This may be used to include null fields in Patch requests. 3038 NullFields []string `json:"-"` 3039} 3040 3041func (s *OperationError) MarshalJSON() ([]byte, error) { 3042 type NoMethod OperationError 3043 raw := NoMethod(*s) 3044 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3045} 3046 3047// OperationErrors: Database instance operation errors list wrapper. 3048type OperationErrors struct { 3049 // Errors: The list of errors encountered while processing this 3050 // operation. 3051 Errors []*OperationError `json:"errors,omitempty"` 3052 3053 // Kind: This is always **sql#operationErrors**. 3054 Kind string `json:"kind,omitempty"` 3055 3056 // ForceSendFields is a list of field names (e.g. "Errors") to 3057 // unconditionally include in API requests. By default, fields with 3058 // empty or default values are omitted from API requests. However, any 3059 // non-pointer, non-interface field appearing in ForceSendFields will be 3060 // sent to the server regardless of whether the field is empty or not. 3061 // This may be used to include empty fields in Patch requests. 3062 ForceSendFields []string `json:"-"` 3063 3064 // NullFields is a list of field names (e.g. "Errors") to include in API 3065 // requests with the JSON null value. By default, fields with empty 3066 // values are omitted from API requests. However, any field with an 3067 // empty value appearing in NullFields will be sent to the server as 3068 // null. It is an error if a field in this list has a non-empty value. 3069 // This may be used to include null fields in Patch requests. 3070 NullFields []string `json:"-"` 3071} 3072 3073func (s *OperationErrors) MarshalJSON() ([]byte, error) { 3074 type NoMethod OperationErrors 3075 raw := NoMethod(*s) 3076 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3077} 3078 3079// OperationsListResponse: Operations list response. 3080type OperationsListResponse struct { 3081 // Items: List of operation resources. 3082 Items []*Operation `json:"items,omitempty"` 3083 3084 // Kind: This is always **sql#operationsList**. 3085 Kind string `json:"kind,omitempty"` 3086 3087 // NextPageToken: The continuation token, used to page through large 3088 // result sets. Provide this value in a subsequent request to return the 3089 // next page of results. 3090 NextPageToken string `json:"nextPageToken,omitempty"` 3091 3092 // ServerResponse contains the HTTP response code and headers from the 3093 // server. 3094 googleapi.ServerResponse `json:"-"` 3095 3096 // ForceSendFields is a list of field names (e.g. "Items") to 3097 // unconditionally include in API requests. By default, fields with 3098 // empty or default values are omitted from API requests. However, any 3099 // non-pointer, non-interface field appearing in ForceSendFields will be 3100 // sent to the server regardless of whether the field is empty or not. 3101 // This may be used to include empty fields in Patch requests. 3102 ForceSendFields []string `json:"-"` 3103 3104 // NullFields is a list of field names (e.g. "Items") to include in API 3105 // requests with the JSON null value. By default, fields with empty 3106 // values are omitted from API requests. However, any field with an 3107 // empty value appearing in NullFields will be sent to the server as 3108 // null. It is an error if a field in this list has a non-empty value. 3109 // This may be used to include null fields in Patch requests. 3110 NullFields []string `json:"-"` 3111} 3112 3113func (s *OperationsListResponse) MarshalJSON() ([]byte, error) { 3114 type NoMethod OperationsListResponse 3115 raw := NoMethod(*s) 3116 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3117} 3118 3119// PasswordStatus: Read-only password status. 3120type PasswordStatus struct { 3121 // Locked: If true, user does not have login privileges. 3122 Locked bool `json:"locked,omitempty"` 3123 3124 // PasswordExpirationTime: The expiration time of the current password. 3125 PasswordExpirationTime string `json:"passwordExpirationTime,omitempty"` 3126 3127 // ForceSendFields is a list of field names (e.g. "Locked") to 3128 // unconditionally include in API requests. By default, fields with 3129 // empty or default values are omitted from API requests. However, any 3130 // non-pointer, non-interface field appearing in ForceSendFields will be 3131 // sent to the server regardless of whether the field is empty or not. 3132 // This may be used to include empty fields in Patch requests. 3133 ForceSendFields []string `json:"-"` 3134 3135 // NullFields is a list of field names (e.g. "Locked") to include in API 3136 // requests with the JSON null value. By default, fields with empty 3137 // values are omitted from API requests. However, any field with an 3138 // empty value appearing in NullFields will be sent to the server as 3139 // null. It is an error if a field in this list has a non-empty value. 3140 // This may be used to include null fields in Patch requests. 3141 NullFields []string `json:"-"` 3142} 3143 3144func (s *PasswordStatus) MarshalJSON() ([]byte, error) { 3145 type NoMethod PasswordStatus 3146 raw := NoMethod(*s) 3147 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3148} 3149 3150// PasswordValidationPolicy: Database instance local user password 3151// validation policy 3152type PasswordValidationPolicy struct { 3153 // Complexity: The complexity of the password. 3154 // 3155 // Possible values: 3156 // "COMPLEXITY_UNSPECIFIED" - Complexity check is not specified. 3157 // "COMPLEXITY_DEFAULT" - A combination of lowercase, uppercase, 3158 // numeric, and non-alphanumeric characters. 3159 Complexity string `json:"complexity,omitempty"` 3160 3161 // DisallowUsernameSubstring: Disallow username as a part of the 3162 // password. 3163 DisallowUsernameSubstring bool `json:"disallowUsernameSubstring,omitempty"` 3164 3165 // MinLength: Minimum number of characters allowed. 3166 MinLength int64 `json:"minLength,omitempty"` 3167 3168 // PasswordChangeInterval: Minimum interval after which the password can 3169 // be changed. 3170 PasswordChangeInterval string `json:"passwordChangeInterval,omitempty"` 3171 3172 // ReuseInterval: Number of previous passwords that cannot be reused. 3173 ReuseInterval int64 `json:"reuseInterval,omitempty"` 3174 3175 // ForceSendFields is a list of field names (e.g. "Complexity") to 3176 // unconditionally include in API requests. By default, fields with 3177 // empty or default values are omitted from API requests. However, any 3178 // non-pointer, non-interface field appearing in ForceSendFields will be 3179 // sent to the server regardless of whether the field is empty or not. 3180 // This may be used to include empty fields in Patch requests. 3181 ForceSendFields []string `json:"-"` 3182 3183 // NullFields is a list of field names (e.g. "Complexity") to include in 3184 // API requests with the JSON null value. By default, fields with empty 3185 // values are omitted from API requests. However, any field with an 3186 // empty value appearing in NullFields will be sent to the server as 3187 // null. It is an error if a field in this list has a non-empty value. 3188 // This may be used to include null fields in Patch requests. 3189 NullFields []string `json:"-"` 3190} 3191 3192func (s *PasswordValidationPolicy) MarshalJSON() ([]byte, error) { 3193 type NoMethod PasswordValidationPolicy 3194 raw := NoMethod(*s) 3195 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3196} 3197 3198// ReplicaConfiguration: Read-replica configuration for connecting to 3199// the primary instance. 3200type ReplicaConfiguration struct { 3201 // FailoverTarget: Specifies if the replica is the failover target. If 3202 // the field is set to **true** the replica will be designated as a 3203 // failover replica. In case the primary instance fails, the replica 3204 // instance will be promoted as the new primary instance. Only one 3205 // replica can be specified as failover target, and the replica has to 3206 // be in different zone with the primary instance. 3207 FailoverTarget bool `json:"failoverTarget,omitempty"` 3208 3209 // Kind: This is always **sql#replicaConfiguration**. 3210 Kind string `json:"kind,omitempty"` 3211 3212 // MysqlReplicaConfiguration: MySQL specific configuration when 3213 // replicating from a MySQL on-premises primary instance. Replication 3214 // configuration information such as the username, password, 3215 // certificates, and keys are not stored in the instance metadata. The 3216 // configuration information is used only to set up the replication 3217 // connection and is stored by MySQL in a file named **master.info** in 3218 // the data directory. 3219 MysqlReplicaConfiguration *MySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"` 3220 3221 // ForceSendFields is a list of field names (e.g. "FailoverTarget") to 3222 // unconditionally include in API requests. By default, fields with 3223 // empty or default values are omitted from API requests. However, any 3224 // non-pointer, non-interface field appearing in ForceSendFields will be 3225 // sent to the server regardless of whether the field is empty or not. 3226 // This may be used to include empty fields in Patch requests. 3227 ForceSendFields []string `json:"-"` 3228 3229 // NullFields is a list of field names (e.g. "FailoverTarget") to 3230 // include in API requests with the JSON null value. By default, fields 3231 // with empty values are omitted from API requests. However, any field 3232 // with an empty value appearing in NullFields will be sent to the 3233 // server as null. It is an error if a field in this list has a 3234 // non-empty value. This may be used to include null fields in Patch 3235 // requests. 3236 NullFields []string `json:"-"` 3237} 3238 3239func (s *ReplicaConfiguration) MarshalJSON() ([]byte, error) { 3240 type NoMethod ReplicaConfiguration 3241 raw := NoMethod(*s) 3242 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3243} 3244 3245type Reschedule struct { 3246 // RescheduleType: Required. The type of the reschedule. 3247 // 3248 // Possible values: 3249 // "RESCHEDULE_TYPE_UNSPECIFIED" 3250 // "IMMEDIATE" - Reschedules maintenance to happen now (within 5 3251 // minutes). 3252 // "NEXT_AVAILABLE_WINDOW" - Reschedules maintenance to occur within 3253 // one week from the originally scheduled day and time. 3254 // "SPECIFIC_TIME" - Reschedules maintenance to a specific time and 3255 // day. 3256 RescheduleType string `json:"rescheduleType,omitempty"` 3257 3258 // ScheduleTime: Optional. Timestamp when the maintenance shall be 3259 // rescheduled to if reschedule_type=SPECIFIC_TIME, in RFC 3339 3260 // (https://tools.ietf.org/html/rfc3339) format, for example 3261 // **2012-11-15T16:19:00.094Z**. 3262 ScheduleTime string `json:"scheduleTime,omitempty"` 3263 3264 // ForceSendFields is a list of field names (e.g. "RescheduleType") to 3265 // unconditionally include in API requests. By default, fields with 3266 // empty or default values are omitted from API requests. However, any 3267 // non-pointer, non-interface field appearing in ForceSendFields will be 3268 // sent to the server regardless of whether the field is empty or not. 3269 // This may be used to include empty fields in Patch requests. 3270 ForceSendFields []string `json:"-"` 3271 3272 // NullFields is a list of field names (e.g. "RescheduleType") to 3273 // include in API requests with the JSON null value. By default, fields 3274 // with empty values are omitted from API requests. However, any field 3275 // with an empty value appearing in NullFields will be sent to the 3276 // server as null. It is an error if a field in this list has a 3277 // non-empty value. This may be used to include null fields in Patch 3278 // requests. 3279 NullFields []string `json:"-"` 3280} 3281 3282func (s *Reschedule) MarshalJSON() ([]byte, error) { 3283 type NoMethod Reschedule 3284 raw := NoMethod(*s) 3285 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3286} 3287 3288// RestoreBackupContext: Database instance restore from backup context. 3289// Backup context contains source instance id and project id. 3290type RestoreBackupContext struct { 3291 // BackupRunId: The ID of the backup run to restore from. 3292 BackupRunId int64 `json:"backupRunId,omitempty,string"` 3293 3294 // InstanceId: The ID of the instance that the backup was taken from. 3295 InstanceId string `json:"instanceId,omitempty"` 3296 3297 // Kind: This is always **sql#restoreBackupContext**. 3298 Kind string `json:"kind,omitempty"` 3299 3300 // Project: The full project ID of the source instance. 3301 Project string `json:"project,omitempty"` 3302 3303 // ForceSendFields is a list of field names (e.g. "BackupRunId") to 3304 // unconditionally include in API requests. By default, fields with 3305 // empty or default values are omitted from API requests. However, any 3306 // non-pointer, non-interface field appearing in ForceSendFields will be 3307 // sent to the server regardless of whether the field is empty or not. 3308 // This may be used to include empty fields in Patch requests. 3309 ForceSendFields []string `json:"-"` 3310 3311 // NullFields is a list of field names (e.g. "BackupRunId") to include 3312 // in API requests with the JSON null value. By default, fields with 3313 // empty values are omitted from API requests. However, any field with 3314 // an empty value appearing in NullFields will be sent to the server as 3315 // null. It is an error if a field in this list has a non-empty value. 3316 // This may be used to include null fields in Patch requests. 3317 NullFields []string `json:"-"` 3318} 3319 3320func (s *RestoreBackupContext) MarshalJSON() ([]byte, error) { 3321 type NoMethod RestoreBackupContext 3322 raw := NoMethod(*s) 3323 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3324} 3325 3326// RotateServerCaContext: Instance rotate server CA context. 3327type RotateServerCaContext struct { 3328 // Kind: This is always **sql#rotateServerCaContext**. 3329 Kind string `json:"kind,omitempty"` 3330 3331 // NextVersion: The fingerprint of the next version to be rotated to. If 3332 // left unspecified, will be rotated to the most recently added server 3333 // CA version. 3334 NextVersion string `json:"nextVersion,omitempty"` 3335 3336 // ForceSendFields is a list of field names (e.g. "Kind") to 3337 // unconditionally include in API requests. By default, fields with 3338 // empty or default values are omitted from API requests. However, any 3339 // non-pointer, non-interface field appearing in ForceSendFields will be 3340 // sent to the server regardless of whether the field is empty or not. 3341 // This may be used to include empty fields in Patch requests. 3342 ForceSendFields []string `json:"-"` 3343 3344 // NullFields is a list of field names (e.g. "Kind") to include in API 3345 // requests with the JSON null value. By default, fields with empty 3346 // values are omitted from API requests. However, any field with an 3347 // empty value appearing in NullFields will be sent to the server as 3348 // null. It is an error if a field in this list has a non-empty value. 3349 // This may be used to include null fields in Patch requests. 3350 NullFields []string `json:"-"` 3351} 3352 3353func (s *RotateServerCaContext) MarshalJSON() ([]byte, error) { 3354 type NoMethod RotateServerCaContext 3355 raw := NoMethod(*s) 3356 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3357} 3358 3359// Settings: Database instance settings. 3360type Settings struct { 3361 // ActivationPolicy: The activation policy specifies when the instance 3362 // is activated; it is applicable only when the instance state is 3363 // RUNNABLE. Valid values: * **ALWAYS**: The instance is on, and remains 3364 // so even in the absence of connection requests. * **NEVER**: The 3365 // instance is off; it is not activated, even if a connection request 3366 // arrives. 3367 // 3368 // Possible values: 3369 // "SQL_ACTIVATION_POLICY_UNSPECIFIED" - Unknown activation plan. 3370 // "ALWAYS" - The instance is always up and running. 3371 // "NEVER" - The instance never starts. 3372 // "ON_DEMAND" - The instance starts upon receiving requests. 3373 ActivationPolicy string `json:"activationPolicy,omitempty"` 3374 3375 // ActiveDirectoryConfig: Active Directory configuration, relevant only 3376 // for Cloud SQL for SQL Server. 3377 ActiveDirectoryConfig *SqlActiveDirectoryConfig `json:"activeDirectoryConfig,omitempty"` 3378 3379 // AuthorizedGaeApplications: The App Engine app IDs that can access 3380 // this instance. (Deprecated) Applied to First Generation instances 3381 // only. 3382 AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"` 3383 3384 // AvailabilityType: Availability type. Potential values: * **ZONAL**: 3385 // The instance serves data from only one zone. Outages in that zone 3386 // affect data accessibility. * **REGIONAL**: The instance can serve 3387 // data from more than one zone in a region (it is highly available)./ 3388 // For more information, see Overview of the High Availability 3389 // Configuration 3390 // (https://cloud.google.com/sql/docs/mysql/high-availability). 3391 // 3392 // Possible values: 3393 // "SQL_AVAILABILITY_TYPE_UNSPECIFIED" - This is an unknown 3394 // Availability type. 3395 // "ZONAL" - Zonal available instance. 3396 // "REGIONAL" - Regional available instance. 3397 AvailabilityType string `json:"availabilityType,omitempty"` 3398 3399 // BackupConfiguration: The daily backup configuration for the instance. 3400 BackupConfiguration *BackupConfiguration `json:"backupConfiguration,omitempty"` 3401 3402 // Collation: The name of server Instance collation. 3403 Collation string `json:"collation,omitempty"` 3404 3405 // CrashSafeReplicationEnabled: Configuration specific to read replica 3406 // instances. Indicates whether database flags for crash-safe 3407 // replication are enabled. This property was only applicable to First 3408 // Generation instances. 3409 CrashSafeReplicationEnabled bool `json:"crashSafeReplicationEnabled,omitempty"` 3410 3411 // DataDiskSizeGb: The size of data disk, in GB. The data disk size 3412 // minimum is 10GB. 3413 DataDiskSizeGb int64 `json:"dataDiskSizeGb,omitempty,string"` 3414 3415 // DataDiskType: The type of data disk: **PD_SSD** (default) or 3416 // **PD_HDD**. Not used for First Generation instances. 3417 // 3418 // Possible values: 3419 // "SQL_DATA_DISK_TYPE_UNSPECIFIED" - This is an unknown data disk 3420 // type. 3421 // "PD_SSD" - An SSD data disk. 3422 // "PD_HDD" - An HDD data disk. 3423 // "OBSOLETE_LOCAL_SSD" - This field is deprecated and will be removed 3424 // from a future version of the API. 3425 DataDiskType string `json:"dataDiskType,omitempty"` 3426 3427 // DatabaseFlags: The database flags passed to the instance at startup. 3428 DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"` 3429 3430 // DatabaseReplicationEnabled: Configuration specific to read replica 3431 // instances. Indicates whether replication is enabled or not. 3432 DatabaseReplicationEnabled bool `json:"databaseReplicationEnabled,omitempty"` 3433 3434 // DenyMaintenancePeriods: Deny maintenance periods 3435 DenyMaintenancePeriods []*DenyMaintenancePeriod `json:"denyMaintenancePeriods,omitempty"` 3436 3437 // InsightsConfig: Insights configuration, for now relevant only for 3438 // Postgres. 3439 InsightsConfig *InsightsConfig `json:"insightsConfig,omitempty"` 3440 3441 // IpConfiguration: The settings for IP Management. This allows to 3442 // enable or disable the instance IP and manage which external networks 3443 // can connect to the instance. The IPv4 address cannot be disabled for 3444 // Second Generation instances. 3445 IpConfiguration *IpConfiguration `json:"ipConfiguration,omitempty"` 3446 3447 // Kind: This is always **sql#settings**. 3448 Kind string `json:"kind,omitempty"` 3449 3450 // LocationPreference: The location preference settings. This allows the 3451 // instance to be located as near as possible to either an App Engine 3452 // app or Compute Engine zone for better performance. App Engine 3453 // co-location was only applicable to First Generation instances. 3454 LocationPreference *LocationPreference `json:"locationPreference,omitempty"` 3455 3456 // MaintenanceWindow: The maintenance window for this instance. This 3457 // specifies when the instance can be restarted for maintenance 3458 // purposes. 3459 MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` 3460 3461 // PasswordValidationPolicy: The local user password validation policy 3462 // of the instance. 3463 PasswordValidationPolicy *PasswordValidationPolicy `json:"passwordValidationPolicy,omitempty"` 3464 3465 // PricingPlan: The pricing plan for this instance. This can be either 3466 // **PER_USE** or **PACKAGE**. Only **PER_USE** is supported for Second 3467 // Generation instances. 3468 // 3469 // Possible values: 3470 // "SQL_PRICING_PLAN_UNSPECIFIED" - This is an unknown pricing plan 3471 // for this instance. 3472 // "PACKAGE" - The instance is billed at a monthly flat rate. 3473 // "PER_USE" - The instance is billed per usage. 3474 PricingPlan string `json:"pricingPlan,omitempty"` 3475 3476 // ReplicationType: The type of replication this instance uses. This can 3477 // be either **ASYNCHRONOUS** or **SYNCHRONOUS**. (Deprecated) This 3478 // property was only applicable to First Generation instances. 3479 // 3480 // Possible values: 3481 // "SQL_REPLICATION_TYPE_UNSPECIFIED" - This is an unknown replication 3482 // type for a Cloud SQL instance. 3483 // "SYNCHRONOUS" - The synchronous replication mode for First 3484 // Generation instances. It is the default value. 3485 // "ASYNCHRONOUS" - The asynchronous replication mode for First 3486 // Generation instances. It provides a slight performance gain, but if 3487 // an outage occurs while this option is set to asynchronous, you can 3488 // lose up to a few seconds of updates to your data. 3489 ReplicationType string `json:"replicationType,omitempty"` 3490 3491 // SettingsVersion: The version of instance settings. This is a required 3492 // field for update method to make sure concurrent updates are handled 3493 // properly. During update, use the most recent settingsVersion value 3494 // for this instance and do not try to update this value. 3495 SettingsVersion int64 `json:"settingsVersion,omitempty,string"` 3496 3497 // SqlServerAuditConfig: SQL Server specific audit configuration. 3498 SqlServerAuditConfig *SqlServerAuditConfig `json:"sqlServerAuditConfig,omitempty"` 3499 3500 // StorageAutoResize: Configuration to increase storage size 3501 // automatically. The default value is true. 3502 StorageAutoResize *bool `json:"storageAutoResize,omitempty"` 3503 3504 // StorageAutoResizeLimit: The maximum size to which storage capacity 3505 // can be automatically increased. The default value is 0, which 3506 // specifies that there is no limit. 3507 StorageAutoResizeLimit int64 `json:"storageAutoResizeLimit,omitempty,string"` 3508 3509 // Tier: The tier (or machine type) for this instance, for example 3510 // **db-custom-1-3840**. 3511 Tier string `json:"tier,omitempty"` 3512 3513 // UserLabels: User-provided labels, represented as a dictionary where 3514 // each label is a single key value pair. 3515 UserLabels map[string]string `json:"userLabels,omitempty"` 3516 3517 // ForceSendFields is a list of field names (e.g. "ActivationPolicy") to 3518 // unconditionally include in API requests. By default, fields with 3519 // empty or default values are omitted from API requests. However, any 3520 // non-pointer, non-interface field appearing in ForceSendFields will be 3521 // sent to the server regardless of whether the field is empty or not. 3522 // This may be used to include empty fields in Patch requests. 3523 ForceSendFields []string `json:"-"` 3524 3525 // NullFields is a list of field names (e.g. "ActivationPolicy") to 3526 // include in API requests with the JSON null value. By default, fields 3527 // with empty values are omitted from API requests. However, any field 3528 // with an empty value appearing in NullFields will be sent to the 3529 // server as null. It is an error if a field in this list has a 3530 // non-empty value. This may be used to include null fields in Patch 3531 // requests. 3532 NullFields []string `json:"-"` 3533} 3534 3535func (s *Settings) MarshalJSON() ([]byte, error) { 3536 type NoMethod Settings 3537 raw := NoMethod(*s) 3538 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3539} 3540 3541// SqlActiveDirectoryConfig: Active Directory configuration, relevant 3542// only for Cloud SQL for SQL Server. 3543type SqlActiveDirectoryConfig struct { 3544 // Domain: The name of the domain (e.g., mydomain.com). 3545 Domain string `json:"domain,omitempty"` 3546 3547 // Kind: This is always sql#activeDirectoryConfig. 3548 Kind string `json:"kind,omitempty"` 3549 3550 // ForceSendFields is a list of field names (e.g. "Domain") to 3551 // unconditionally include in API requests. By default, fields with 3552 // empty or default values are omitted from API requests. However, any 3553 // non-pointer, non-interface field appearing in ForceSendFields will be 3554 // sent to the server regardless of whether the field is empty or not. 3555 // This may be used to include empty fields in Patch requests. 3556 ForceSendFields []string `json:"-"` 3557 3558 // NullFields is a list of field names (e.g. "Domain") to include in API 3559 // requests with the JSON null value. By default, fields with empty 3560 // values are omitted from API requests. However, any field with an 3561 // empty value appearing in NullFields will be sent to the server as 3562 // null. It is an error if a field in this list has a non-empty value. 3563 // This may be used to include null fields in Patch requests. 3564 NullFields []string `json:"-"` 3565} 3566 3567func (s *SqlActiveDirectoryConfig) MarshalJSON() ([]byte, error) { 3568 type NoMethod SqlActiveDirectoryConfig 3569 raw := NoMethod(*s) 3570 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3571} 3572 3573// SqlExternalSyncSettingError: External primary instance migration 3574// setting error/warning. 3575type SqlExternalSyncSettingError struct { 3576 // Detail: Additional information about the error encountered. 3577 Detail string `json:"detail,omitempty"` 3578 3579 // Kind: Can be **sql#externalSyncSettingError** or 3580 // **sql#externalSyncSettingWarning**. 3581 Kind string `json:"kind,omitempty"` 3582 3583 // Type: Identifies the specific error that occurred. 3584 // 3585 // Possible values: 3586 // "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" 3587 // "CONNECTION_FAILURE" 3588 // "BINLOG_NOT_ENABLED" 3589 // "INCOMPATIBLE_DATABASE_VERSION" 3590 // "REPLICA_ALREADY_SETUP" 3591 // "INSUFFICIENT_PRIVILEGE" 3592 // "UNSUPPORTED_MIGRATION_TYPE" - Unsupported migration type. 3593 // "NO_PGLOGICAL_INSTALLED" - No pglogical extension installed on 3594 // databases, applicable for postgres. 3595 // "PGLOGICAL_NODE_ALREADY_EXISTS" - pglogical node already exists on 3596 // databases, applicable for postgres. 3597 // "INVALID_WAL_LEVEL" - The value of parameter wal_level is not set 3598 // to logical. 3599 // "INVALID_SHARED_PRELOAD_LIBRARY" - The value of parameter 3600 // shared_preload_libraries does not include pglogical. 3601 // "INSUFFICIENT_MAX_REPLICATION_SLOTS" - The value of parameter 3602 // max_replication_slots is not sufficient. 3603 // "INSUFFICIENT_MAX_WAL_SENDERS" - The value of parameter 3604 // max_wal_senders is not sufficient. 3605 // "INSUFFICIENT_MAX_WORKER_PROCESSES" - The value of parameter 3606 // max_worker_processes is not sufficient. 3607 // "UNSUPPORTED_EXTENSIONS" - Extensions installed are either not 3608 // supported or having unsupported versions 3609 // "INVALID_RDS_LOGICAL_REPLICATION" - The value of parameter 3610 // rds.logical_replication is not set to 1. 3611 // "INVALID_LOGGING_SETUP" - The primary instance logging setup 3612 // doesn't allow EM sync. 3613 // "INVALID_DB_PARAM" - The primary instance database parameter setup 3614 // doesn't allow EM sync. 3615 // "UNSUPPORTED_GTID_MODE" - The gtid_mode is not supported, 3616 // applicable for MySQL. 3617 // "SQLSERVER_AGENT_NOT_RUNNING" - SQL Server Agent is not running. 3618 // "UNSUPPORTED_TABLE_DEFINITION" - The table definition is not 3619 // support due to missing primary key or replica identity, applicable 3620 // for postgres. 3621 // "UNSUPPORTED_DEFINER" - The customer has a definer that will break 3622 // EM setup. 3623 // "SQLSERVER_SERVERNAME_MISMATCH" - SQL Server @@SERVERNAME does not 3624 // match actual host name 3625 // "PRIMARY_ALREADY_SETUP" - The primary instance has been setup and 3626 // will fail the setup. 3627 // "UNSUPPORTED_BINLOG_FORMAT" - The primary instance has unsupported 3628 // binary log format. 3629 // "BINLOG_RETENTION_SETTING" - The primary instance's binary log 3630 // retention setting. 3631 Type string `json:"type,omitempty"` 3632 3633 // ForceSendFields is a list of field names (e.g. "Detail") to 3634 // unconditionally include in API requests. By default, fields with 3635 // empty or default values are omitted from API requests. However, any 3636 // non-pointer, non-interface field appearing in ForceSendFields will be 3637 // sent to the server regardless of whether the field is empty or not. 3638 // This may be used to include empty fields in Patch requests. 3639 ForceSendFields []string `json:"-"` 3640 3641 // NullFields is a list of field names (e.g. "Detail") to include in API 3642 // requests with the JSON null value. By default, fields with empty 3643 // values are omitted from API requests. However, any field with an 3644 // empty value appearing in NullFields will be sent to the server as 3645 // null. It is an error if a field in this list has a non-empty value. 3646 // This may be used to include null fields in Patch requests. 3647 NullFields []string `json:"-"` 3648} 3649 3650func (s *SqlExternalSyncSettingError) MarshalJSON() ([]byte, error) { 3651 type NoMethod SqlExternalSyncSettingError 3652 raw := NoMethod(*s) 3653 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3654} 3655 3656// SqlInstancesRescheduleMaintenanceRequestBody: Reschedule options for 3657// maintenance windows. 3658type SqlInstancesRescheduleMaintenanceRequestBody struct { 3659 // Reschedule: Required. The type of the reschedule the user wants. 3660 Reschedule *Reschedule `json:"reschedule,omitempty"` 3661 3662 // ForceSendFields is a list of field names (e.g. "Reschedule") to 3663 // unconditionally include in API requests. By default, fields with 3664 // empty or default values are omitted from API requests. However, any 3665 // non-pointer, non-interface field appearing in ForceSendFields will be 3666 // sent to the server regardless of whether the field is empty or not. 3667 // This may be used to include empty fields in Patch requests. 3668 ForceSendFields []string `json:"-"` 3669 3670 // NullFields is a list of field names (e.g. "Reschedule") to include in 3671 // API requests with the JSON null value. By default, fields with empty 3672 // values are omitted from API requests. However, any field with an 3673 // empty value appearing in NullFields will be sent to the server as 3674 // null. It is an error if a field in this list has a non-empty value. 3675 // This may be used to include null fields in Patch requests. 3676 NullFields []string `json:"-"` 3677} 3678 3679func (s *SqlInstancesRescheduleMaintenanceRequestBody) MarshalJSON() ([]byte, error) { 3680 type NoMethod SqlInstancesRescheduleMaintenanceRequestBody 3681 raw := NoMethod(*s) 3682 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3683} 3684 3685type SqlInstancesStartExternalSyncRequest struct { 3686 // MysqlSyncConfig: MySQL-specific settings for start external sync. 3687 MysqlSyncConfig *MySqlSyncConfig `json:"mysqlSyncConfig,omitempty"` 3688 3689 // SkipVerification: Whether to skip the verification step (VESS). 3690 SkipVerification bool `json:"skipVerification,omitempty"` 3691 3692 // SyncMode: External sync mode. 3693 // 3694 // Possible values: 3695 // "EXTERNAL_SYNC_MODE_UNSPECIFIED" - Unknown external sync mode, will 3696 // be defaulted to ONLINE mode 3697 // "ONLINE" - Online external sync will set up replication after 3698 // initial data external sync 3699 // "OFFLINE" - Offline external sync only dumps and loads a one-time 3700 // snapshot of the primary instance's data 3701 SyncMode string `json:"syncMode,omitempty"` 3702 3703 // ForceSendFields is a list of field names (e.g. "MysqlSyncConfig") to 3704 // unconditionally include in API requests. By default, fields with 3705 // empty or default values are omitted from API requests. However, any 3706 // non-pointer, non-interface field appearing in ForceSendFields will be 3707 // sent to the server regardless of whether the field is empty or not. 3708 // This may be used to include empty fields in Patch requests. 3709 ForceSendFields []string `json:"-"` 3710 3711 // NullFields is a list of field names (e.g. "MysqlSyncConfig") to 3712 // include in API requests with the JSON null value. By default, fields 3713 // with empty values are omitted from API requests. However, any field 3714 // with an empty value appearing in NullFields will be sent to the 3715 // server as null. It is an error if a field in this list has a 3716 // non-empty value. This may be used to include null fields in Patch 3717 // requests. 3718 NullFields []string `json:"-"` 3719} 3720 3721func (s *SqlInstancesStartExternalSyncRequest) MarshalJSON() ([]byte, error) { 3722 type NoMethod SqlInstancesStartExternalSyncRequest 3723 raw := NoMethod(*s) 3724 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3725} 3726 3727type SqlInstancesVerifyExternalSyncSettingsRequest struct { 3728 // MysqlSyncConfig: Optional. MySQL-specific settings for start external 3729 // sync. 3730 MysqlSyncConfig *MySqlSyncConfig `json:"mysqlSyncConfig,omitempty"` 3731 3732 // SyncMode: External sync mode 3733 // 3734 // Possible values: 3735 // "EXTERNAL_SYNC_MODE_UNSPECIFIED" - Unknown external sync mode, will 3736 // be defaulted to ONLINE mode 3737 // "ONLINE" - Online external sync will set up replication after 3738 // initial data external sync 3739 // "OFFLINE" - Offline external sync only dumps and loads a one-time 3740 // snapshot of the primary instance's data 3741 SyncMode string `json:"syncMode,omitempty"` 3742 3743 // VerifyConnectionOnly: Flag to enable verifying connection only 3744 VerifyConnectionOnly bool `json:"verifyConnectionOnly,omitempty"` 3745 3746 // VerifyReplicationOnly: Optional. Flag to verify settings required by 3747 // replication setup only 3748 VerifyReplicationOnly bool `json:"verifyReplicationOnly,omitempty"` 3749 3750 // ForceSendFields is a list of field names (e.g. "MysqlSyncConfig") to 3751 // unconditionally include in API requests. By default, fields with 3752 // empty or default values are omitted from API requests. However, any 3753 // non-pointer, non-interface field appearing in ForceSendFields will be 3754 // sent to the server regardless of whether the field is empty or not. 3755 // This may be used to include empty fields in Patch requests. 3756 ForceSendFields []string `json:"-"` 3757 3758 // NullFields is a list of field names (e.g. "MysqlSyncConfig") to 3759 // include in API requests with the JSON null value. By default, fields 3760 // with empty values are omitted from API requests. However, any field 3761 // with an empty value appearing in NullFields will be sent to the 3762 // server as null. It is an error if a field in this list has a 3763 // non-empty value. This may be used to include null fields in Patch 3764 // requests. 3765 NullFields []string `json:"-"` 3766} 3767 3768func (s *SqlInstancesVerifyExternalSyncSettingsRequest) MarshalJSON() ([]byte, error) { 3769 type NoMethod SqlInstancesVerifyExternalSyncSettingsRequest 3770 raw := NoMethod(*s) 3771 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3772} 3773 3774// SqlInstancesVerifyExternalSyncSettingsResponse: Instance verify 3775// external sync settings response. 3776type SqlInstancesVerifyExternalSyncSettingsResponse struct { 3777 // Errors: List of migration violations. 3778 Errors []*SqlExternalSyncSettingError `json:"errors,omitempty"` 3779 3780 // Kind: This is always **sql#migrationSettingErrorList**. 3781 Kind string `json:"kind,omitempty"` 3782 3783 // Warnings: List of migration warnings. 3784 Warnings []*SqlExternalSyncSettingError `json:"warnings,omitempty"` 3785 3786 // ServerResponse contains the HTTP response code and headers from the 3787 // server. 3788 googleapi.ServerResponse `json:"-"` 3789 3790 // ForceSendFields is a list of field names (e.g. "Errors") to 3791 // unconditionally include in API requests. By default, fields with 3792 // empty or default values are omitted from API requests. However, any 3793 // non-pointer, non-interface field appearing in ForceSendFields will be 3794 // sent to the server regardless of whether the field is empty or not. 3795 // This may be used to include empty fields in Patch requests. 3796 ForceSendFields []string `json:"-"` 3797 3798 // NullFields is a list of field names (e.g. "Errors") to include in API 3799 // requests with the JSON null value. By default, fields with empty 3800 // values are omitted from API requests. However, any field with an 3801 // empty value appearing in NullFields will be sent to the server as 3802 // null. It is an error if a field in this list has a non-empty value. 3803 // This may be used to include null fields in Patch requests. 3804 NullFields []string `json:"-"` 3805} 3806 3807func (s *SqlInstancesVerifyExternalSyncSettingsResponse) MarshalJSON() ([]byte, error) { 3808 type NoMethod SqlInstancesVerifyExternalSyncSettingsResponse 3809 raw := NoMethod(*s) 3810 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3811} 3812 3813// SqlOutOfDiskReport: This message wraps up the information written by 3814// out-of-disk detection job. 3815type SqlOutOfDiskReport struct { 3816 // SqlMinRecommendedIncreaseSizeGb: The minimum recommended increase 3817 // size in GigaBytes This field is consumed by the frontend * Writers: * 3818 // the proactive database wellness job for OOD. * Readers: 3819 SqlMinRecommendedIncreaseSizeGb int64 `json:"sqlMinRecommendedIncreaseSizeGb,omitempty"` 3820 3821 // SqlOutOfDiskState: This field represents the state generated by the 3822 // proactive database wellness job for OutOfDisk issues. * Writers: * 3823 // the proactive database wellness job for OOD. * Readers: * the 3824 // proactive database wellness job 3825 // 3826 // Possible values: 3827 // "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" - Unspecified state 3828 // "NORMAL" - The instance has plenty space on data disk 3829 // "SOFT_SHUTDOWN" - Data disk is almost used up. It is shutdown to 3830 // prevent data corruption. 3831 SqlOutOfDiskState string `json:"sqlOutOfDiskState,omitempty"` 3832 3833 // ForceSendFields is a list of field names (e.g. 3834 // "SqlMinRecommendedIncreaseSizeGb") to unconditionally include in API 3835 // requests. By default, fields with empty or default values are omitted 3836 // from API requests. However, any non-pointer, non-interface field 3837 // appearing in ForceSendFields will be sent to the server regardless of 3838 // whether the field is empty or not. This may be used to include empty 3839 // fields in Patch requests. 3840 ForceSendFields []string `json:"-"` 3841 3842 // NullFields is a list of field names (e.g. 3843 // "SqlMinRecommendedIncreaseSizeGb") to include in API requests with 3844 // the JSON null value. By default, fields with empty values are omitted 3845 // from API requests. However, any field with an empty value appearing 3846 // in NullFields will be sent to the server as null. It is an error if a 3847 // field in this list has a non-empty value. This may be used to include 3848 // null fields in Patch requests. 3849 NullFields []string `json:"-"` 3850} 3851 3852func (s *SqlOutOfDiskReport) MarshalJSON() ([]byte, error) { 3853 type NoMethod SqlOutOfDiskReport 3854 raw := NoMethod(*s) 3855 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3856} 3857 3858// SqlScheduledMaintenance: Any scheduled maintenancce for this 3859// instance. 3860type SqlScheduledMaintenance struct { 3861 CanDefer bool `json:"canDefer,omitempty"` 3862 3863 // CanReschedule: If the scheduled maintenance can be rescheduled. 3864 CanReschedule bool `json:"canReschedule,omitempty"` 3865 3866 // ScheduleDeadlineTime: Maintenance cannot be rescheduled to start 3867 // beyond this deadline. 3868 ScheduleDeadlineTime string `json:"scheduleDeadlineTime,omitempty"` 3869 3870 // StartTime: The start time of any upcoming scheduled maintenance for 3871 // this instance. 3872 StartTime string `json:"startTime,omitempty"` 3873 3874 // ForceSendFields is a list of field names (e.g. "CanDefer") to 3875 // unconditionally include in API requests. By default, fields with 3876 // empty or default values are omitted from API requests. However, any 3877 // non-pointer, non-interface field appearing in ForceSendFields will be 3878 // sent to the server regardless of whether the field is empty or not. 3879 // This may be used to include empty fields in Patch requests. 3880 ForceSendFields []string `json:"-"` 3881 3882 // NullFields is a list of field names (e.g. "CanDefer") to include in 3883 // API requests with the JSON null value. By default, fields with empty 3884 // values are omitted from API requests. However, any field with an 3885 // empty value appearing in NullFields will be sent to the server as 3886 // null. It is an error if a field in this list has a non-empty value. 3887 // This may be used to include null fields in Patch requests. 3888 NullFields []string `json:"-"` 3889} 3890 3891func (s *SqlScheduledMaintenance) MarshalJSON() ([]byte, error) { 3892 type NoMethod SqlScheduledMaintenance 3893 raw := NoMethod(*s) 3894 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3895} 3896 3897// SqlServerAuditConfig: SQL Server specific audit configuration. 3898type SqlServerAuditConfig struct { 3899 // Bucket: The name of the destination bucket (e.g., gs://mybucket). 3900 Bucket string `json:"bucket,omitempty"` 3901 3902 // Kind: This is always sql#sqlServerAuditConfig 3903 Kind string `json:"kind,omitempty"` 3904 3905 // ForceSendFields is a list of field names (e.g. "Bucket") to 3906 // unconditionally include in API requests. By default, fields with 3907 // empty or default values are omitted from API requests. However, any 3908 // non-pointer, non-interface field appearing in ForceSendFields will be 3909 // sent to the server regardless of whether the field is empty or not. 3910 // This may be used to include empty fields in Patch requests. 3911 ForceSendFields []string `json:"-"` 3912 3913 // NullFields is a list of field names (e.g. "Bucket") to include in API 3914 // requests with the JSON null value. By default, fields with empty 3915 // values are omitted from API requests. However, any field with an 3916 // empty value appearing in NullFields will be sent to the server as 3917 // null. It is an error if a field in this list has a non-empty value. 3918 // This may be used to include null fields in Patch requests. 3919 NullFields []string `json:"-"` 3920} 3921 3922func (s *SqlServerAuditConfig) MarshalJSON() ([]byte, error) { 3923 type NoMethod SqlServerAuditConfig 3924 raw := NoMethod(*s) 3925 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3926} 3927 3928// SqlServerDatabaseDetails: Represents a Sql Server database on the 3929// Cloud SQL instance. 3930type SqlServerDatabaseDetails struct { 3931 // CompatibilityLevel: The version of SQL Server with which the database 3932 // is to be made compatible 3933 CompatibilityLevel int64 `json:"compatibilityLevel,omitempty"` 3934 3935 // RecoveryModel: The recovery model of a SQL Server database 3936 RecoveryModel string `json:"recoveryModel,omitempty"` 3937 3938 // ForceSendFields is a list of field names (e.g. "CompatibilityLevel") 3939 // to unconditionally include in API requests. By default, fields with 3940 // empty or default values are omitted from API requests. However, any 3941 // non-pointer, non-interface field appearing in ForceSendFields will be 3942 // sent to the server regardless of whether the field is empty or not. 3943 // This may be used to include empty fields in Patch requests. 3944 ForceSendFields []string `json:"-"` 3945 3946 // NullFields is a list of field names (e.g. "CompatibilityLevel") to 3947 // include in API requests with the JSON null value. By default, fields 3948 // with empty values are omitted from API requests. However, any field 3949 // with an empty value appearing in NullFields will be sent to the 3950 // server as null. It is an error if a field in this list has a 3951 // non-empty value. This may be used to include null fields in Patch 3952 // requests. 3953 NullFields []string `json:"-"` 3954} 3955 3956func (s *SqlServerDatabaseDetails) MarshalJSON() ([]byte, error) { 3957 type NoMethod SqlServerDatabaseDetails 3958 raw := NoMethod(*s) 3959 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3960} 3961 3962// SqlServerUserDetails: Represents a Sql Server user on the Cloud SQL 3963// instance. 3964type SqlServerUserDetails struct { 3965 // Disabled: If the user has been disabled 3966 Disabled bool `json:"disabled,omitempty"` 3967 3968 // ServerRoles: The server roles for this user 3969 ServerRoles []string `json:"serverRoles,omitempty"` 3970 3971 // ForceSendFields is a list of field names (e.g. "Disabled") to 3972 // unconditionally include in API requests. By default, fields with 3973 // empty or default values are omitted from API requests. However, any 3974 // non-pointer, non-interface field appearing in ForceSendFields will be 3975 // sent to the server regardless of whether the field is empty or not. 3976 // This may be used to include empty fields in Patch requests. 3977 ForceSendFields []string `json:"-"` 3978 3979 // NullFields is a list of field names (e.g. "Disabled") to include in 3980 // API requests with the JSON null value. By default, fields with empty 3981 // values are omitted from API requests. However, any field with an 3982 // empty value appearing in NullFields will be sent to the server as 3983 // null. It is an error if a field in this list has a non-empty value. 3984 // This may be used to include null fields in Patch requests. 3985 NullFields []string `json:"-"` 3986} 3987 3988func (s *SqlServerUserDetails) MarshalJSON() ([]byte, error) { 3989 type NoMethod SqlServerUserDetails 3990 raw := NoMethod(*s) 3991 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3992} 3993 3994// SslCert: SslCerts Resource 3995type SslCert struct { 3996 // Cert: PEM representation. 3997 Cert string `json:"cert,omitempty"` 3998 3999 // CertSerialNumber: Serial number, as extracted from the certificate. 4000 CertSerialNumber string `json:"certSerialNumber,omitempty"` 4001 4002 // CommonName: User supplied name. Constrained to [a-zA-Z.-_ ]+. 4003 CommonName string `json:"commonName,omitempty"` 4004 4005 // CreateTime: The time when the certificate was created in RFC 3339 4006 // (https://tools.ietf.org/html/rfc3339) format, for example 4007 // **2012-11-15T16:19:00.094Z**. 4008 CreateTime string `json:"createTime,omitempty"` 4009 4010 // ExpirationTime: The time when the certificate expires in RFC 3339 4011 // (https://tools.ietf.org/html/rfc3339) format, for example 4012 // **2012-11-15T16:19:00.094Z**. 4013 ExpirationTime string `json:"expirationTime,omitempty"` 4014 4015 // Instance: Name of the database instance. 4016 Instance string `json:"instance,omitempty"` 4017 4018 // Kind: This is always **sql#sslCert**. 4019 Kind string `json:"kind,omitempty"` 4020 4021 // SelfLink: The URI of this resource. 4022 SelfLink string `json:"selfLink,omitempty"` 4023 4024 // Sha1Fingerprint: Sha1 Fingerprint. 4025 Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"` 4026 4027 // ServerResponse contains the HTTP response code and headers from the 4028 // server. 4029 googleapi.ServerResponse `json:"-"` 4030 4031 // ForceSendFields is a list of field names (e.g. "Cert") to 4032 // unconditionally include in API requests. By default, fields with 4033 // empty or default values are omitted from API requests. However, any 4034 // non-pointer, non-interface field appearing in ForceSendFields will be 4035 // sent to the server regardless of whether the field is empty or not. 4036 // This may be used to include empty fields in Patch requests. 4037 ForceSendFields []string `json:"-"` 4038 4039 // NullFields is a list of field names (e.g. "Cert") to include in API 4040 // requests with the JSON null value. By default, fields with empty 4041 // values are omitted from API requests. However, any field with an 4042 // empty value appearing in NullFields will be sent to the server as 4043 // null. It is an error if a field in this list has a non-empty value. 4044 // This may be used to include null fields in Patch requests. 4045 NullFields []string `json:"-"` 4046} 4047 4048func (s *SslCert) MarshalJSON() ([]byte, error) { 4049 type NoMethod SslCert 4050 raw := NoMethod(*s) 4051 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4052} 4053 4054// SslCertDetail: SslCertDetail. 4055type SslCertDetail struct { 4056 // CertInfo: The public information about the cert. 4057 CertInfo *SslCert `json:"certInfo,omitempty"` 4058 4059 // CertPrivateKey: The private key for the client cert, in pem format. 4060 // Keep private in order to protect your security. 4061 CertPrivateKey string `json:"certPrivateKey,omitempty"` 4062 4063 // ForceSendFields is a list of field names (e.g. "CertInfo") to 4064 // unconditionally include in API requests. By default, fields with 4065 // empty or default values are omitted from API requests. However, any 4066 // non-pointer, non-interface field appearing in ForceSendFields will be 4067 // sent to the server regardless of whether the field is empty or not. 4068 // This may be used to include empty fields in Patch requests. 4069 ForceSendFields []string `json:"-"` 4070 4071 // NullFields is a list of field names (e.g. "CertInfo") to include in 4072 // API requests with the JSON null value. By default, fields with empty 4073 // values are omitted from API requests. However, any field with an 4074 // empty value appearing in NullFields will be sent to the server as 4075 // null. It is an error if a field in this list has a non-empty value. 4076 // This may be used to include null fields in Patch requests. 4077 NullFields []string `json:"-"` 4078} 4079 4080func (s *SslCertDetail) MarshalJSON() ([]byte, error) { 4081 type NoMethod SslCertDetail 4082 raw := NoMethod(*s) 4083 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4084} 4085 4086// SslCertsCreateEphemeralRequest: SslCerts create ephemeral certificate 4087// request. 4088type SslCertsCreateEphemeralRequest struct { 4089 // AccessToken: Access token to include in the signed certificate. 4090 AccessToken string `json:"access_token,omitempty"` 4091 4092 // PublicKey: PEM encoded public key to include in the signed 4093 // certificate. 4094 PublicKey string `json:"public_key,omitempty"` 4095 4096 // ForceSendFields is a list of field names (e.g. "AccessToken") to 4097 // unconditionally include in API requests. By default, fields with 4098 // empty or default values are omitted from API requests. However, any 4099 // non-pointer, non-interface field appearing in ForceSendFields will be 4100 // sent to the server regardless of whether the field is empty or not. 4101 // This may be used to include empty fields in Patch requests. 4102 ForceSendFields []string `json:"-"` 4103 4104 // NullFields is a list of field names (e.g. "AccessToken") to include 4105 // in API requests with the JSON null value. By default, fields with 4106 // empty values are omitted from API requests. However, any field with 4107 // an empty value appearing in NullFields will be sent to the server as 4108 // null. It is an error if a field in this list has a non-empty value. 4109 // This may be used to include null fields in Patch requests. 4110 NullFields []string `json:"-"` 4111} 4112 4113func (s *SslCertsCreateEphemeralRequest) MarshalJSON() ([]byte, error) { 4114 type NoMethod SslCertsCreateEphemeralRequest 4115 raw := NoMethod(*s) 4116 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4117} 4118 4119// SslCertsInsertRequest: SslCerts insert request. 4120type SslCertsInsertRequest struct { 4121 // CommonName: User supplied name. Must be a distinct name from the 4122 // other certificates for this instance. 4123 CommonName string `json:"commonName,omitempty"` 4124 4125 // ForceSendFields is a list of field names (e.g. "CommonName") to 4126 // unconditionally include in API requests. By default, fields with 4127 // empty or default values are omitted from API requests. However, any 4128 // non-pointer, non-interface field appearing in ForceSendFields will be 4129 // sent to the server regardless of whether the field is empty or not. 4130 // This may be used to include empty fields in Patch requests. 4131 ForceSendFields []string `json:"-"` 4132 4133 // NullFields is a list of field names (e.g. "CommonName") to include in 4134 // API requests with the JSON null value. By default, fields with empty 4135 // values are omitted from API requests. However, any field with an 4136 // empty value appearing in NullFields will be sent to the server as 4137 // null. It is an error if a field in this list has a non-empty value. 4138 // This may be used to include null fields in Patch requests. 4139 NullFields []string `json:"-"` 4140} 4141 4142func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error) { 4143 type NoMethod SslCertsInsertRequest 4144 raw := NoMethod(*s) 4145 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4146} 4147 4148// SslCertsInsertResponse: SslCert insert response. 4149type SslCertsInsertResponse struct { 4150 // ClientCert: The new client certificate and private key. 4151 ClientCert *SslCertDetail `json:"clientCert,omitempty"` 4152 4153 // Kind: This is always **sql#sslCertsInsert**. 4154 Kind string `json:"kind,omitempty"` 4155 4156 // Operation: The operation to track the ssl certs insert request. 4157 Operation *Operation `json:"operation,omitempty"` 4158 4159 // ServerCaCert: The server Certificate Authority's certificate. If this 4160 // is missing you can force a new one to be generated by calling 4161 // resetSslConfig method on instances resource. 4162 ServerCaCert *SslCert `json:"serverCaCert,omitempty"` 4163 4164 // ServerResponse contains the HTTP response code and headers from the 4165 // server. 4166 googleapi.ServerResponse `json:"-"` 4167 4168 // ForceSendFields is a list of field names (e.g. "ClientCert") to 4169 // unconditionally include in API requests. By default, fields with 4170 // empty or default values are omitted from API requests. However, any 4171 // non-pointer, non-interface field appearing in ForceSendFields will be 4172 // sent to the server regardless of whether the field is empty or not. 4173 // This may be used to include empty fields in Patch requests. 4174 ForceSendFields []string `json:"-"` 4175 4176 // NullFields is a list of field names (e.g. "ClientCert") to include in 4177 // API requests with the JSON null value. By default, fields with empty 4178 // values are omitted from API requests. However, any field with an 4179 // empty value appearing in NullFields will be sent to the server as 4180 // null. It is an error if a field in this list has a non-empty value. 4181 // This may be used to include null fields in Patch requests. 4182 NullFields []string `json:"-"` 4183} 4184 4185func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error) { 4186 type NoMethod SslCertsInsertResponse 4187 raw := NoMethod(*s) 4188 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4189} 4190 4191// SslCertsListResponse: SslCerts list response. 4192type SslCertsListResponse struct { 4193 // Items: List of client certificates for the instance. 4194 Items []*SslCert `json:"items,omitempty"` 4195 4196 // Kind: This is always **sql#sslCertsList**. 4197 Kind string `json:"kind,omitempty"` 4198 4199 // ServerResponse contains the HTTP response code and headers from the 4200 // server. 4201 googleapi.ServerResponse `json:"-"` 4202 4203 // ForceSendFields is a list of field names (e.g. "Items") to 4204 // unconditionally include in API requests. By default, fields with 4205 // empty or default values are omitted from API requests. However, any 4206 // non-pointer, non-interface field appearing in ForceSendFields will be 4207 // sent to the server regardless of whether the field is empty or not. 4208 // This may be used to include empty fields in Patch requests. 4209 ForceSendFields []string `json:"-"` 4210 4211 // NullFields is a list of field names (e.g. "Items") to include in API 4212 // requests with the JSON null value. By default, fields with empty 4213 // values are omitted from API requests. However, any field with an 4214 // empty value appearing in NullFields will be sent to the server as 4215 // null. It is an error if a field in this list has a non-empty value. 4216 // This may be used to include null fields in Patch requests. 4217 NullFields []string `json:"-"` 4218} 4219 4220func (s *SslCertsListResponse) MarshalJSON() ([]byte, error) { 4221 type NoMethod SslCertsListResponse 4222 raw := NoMethod(*s) 4223 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4224} 4225 4226// SyncFlags: Initial sync flags for certain Cloud SQL APIs. Currently 4227// used for the MySQL external server initial dump. 4228type SyncFlags struct { 4229 // Name: The name of the flag. 4230 Name string `json:"name,omitempty"` 4231 4232 // Value: The value of the flag. This field must be omitted if the flag 4233 // doesn't take a value. 4234 Value string `json:"value,omitempty"` 4235 4236 // ForceSendFields is a list of field names (e.g. "Name") to 4237 // unconditionally include in API requests. By default, fields with 4238 // empty or default values are omitted from API requests. However, any 4239 // non-pointer, non-interface field appearing in ForceSendFields will be 4240 // sent to the server regardless of whether the field is empty or not. 4241 // This may be used to include empty fields in Patch requests. 4242 ForceSendFields []string `json:"-"` 4243 4244 // NullFields is a list of field names (e.g. "Name") to include in API 4245 // requests with the JSON null value. By default, fields with empty 4246 // values are omitted from API requests. However, any field with an 4247 // empty value appearing in NullFields will be sent to the server as 4248 // null. It is an error if a field in this list has a non-empty value. 4249 // This may be used to include null fields in Patch requests. 4250 NullFields []string `json:"-"` 4251} 4252 4253func (s *SyncFlags) MarshalJSON() ([]byte, error) { 4254 type NoMethod SyncFlags 4255 raw := NoMethod(*s) 4256 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4257} 4258 4259// Tier: A Google Cloud SQL service tier resource. 4260type Tier struct { 4261 // DiskQuota: The maximum disk size of this tier in bytes. 4262 DiskQuota int64 `json:"DiskQuota,omitempty,string"` 4263 4264 // RAM: The maximum RAM usage of this tier in bytes. 4265 RAM int64 `json:"RAM,omitempty,string"` 4266 4267 // Kind: This is always *sql#tier*. 4268 Kind string `json:"kind,omitempty"` 4269 4270 // Region: The applicable regions for this tier. 4271 Region []string `json:"region,omitempty"` 4272 4273 // Tier: An identifier for the machine type, for example, 4274 // db-custom-1-3840. For related information, see Pricing. 4275 Tier string `json:"tier,omitempty"` 4276 4277 // ForceSendFields is a list of field names (e.g. "DiskQuota") to 4278 // unconditionally include in API requests. By default, fields with 4279 // empty or default values are omitted from API requests. However, any 4280 // non-pointer, non-interface field appearing in ForceSendFields will be 4281 // sent to the server regardless of whether the field is empty or not. 4282 // This may be used to include empty fields in Patch requests. 4283 ForceSendFields []string `json:"-"` 4284 4285 // NullFields is a list of field names (e.g. "DiskQuota") to include in 4286 // API requests with the JSON null value. By default, fields with empty 4287 // values are omitted from API requests. However, any field with an 4288 // empty value appearing in NullFields will be sent to the server as 4289 // null. It is an error if a field in this list has a non-empty value. 4290 // This may be used to include null fields in Patch requests. 4291 NullFields []string `json:"-"` 4292} 4293 4294func (s *Tier) MarshalJSON() ([]byte, error) { 4295 type NoMethod Tier 4296 raw := NoMethod(*s) 4297 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4298} 4299 4300// TiersListResponse: Tiers list response. 4301type TiersListResponse struct { 4302 // Items: List of tiers. 4303 Items []*Tier `json:"items,omitempty"` 4304 4305 // Kind: This is always *sql#tiersList*. 4306 Kind string `json:"kind,omitempty"` 4307 4308 // ServerResponse contains the HTTP response code and headers from the 4309 // server. 4310 googleapi.ServerResponse `json:"-"` 4311 4312 // ForceSendFields is a list of field names (e.g. "Items") to 4313 // unconditionally include in API requests. By default, fields with 4314 // empty or default values are omitted from API requests. However, any 4315 // non-pointer, non-interface field appearing in ForceSendFields will be 4316 // sent to the server regardless of whether the field is empty or not. 4317 // This may be used to include empty fields in Patch requests. 4318 ForceSendFields []string `json:"-"` 4319 4320 // NullFields is a list of field names (e.g. "Items") to include in API 4321 // requests with the JSON null value. By default, fields with empty 4322 // values are omitted from API requests. However, any field with an 4323 // empty value appearing in NullFields will be sent to the server as 4324 // null. It is an error if a field in this list has a non-empty value. 4325 // This may be used to include null fields in Patch requests. 4326 NullFields []string `json:"-"` 4327} 4328 4329func (s *TiersListResponse) MarshalJSON() ([]byte, error) { 4330 type NoMethod TiersListResponse 4331 raw := NoMethod(*s) 4332 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4333} 4334 4335// TruncateLogContext: Database Instance truncate log context. 4336type TruncateLogContext struct { 4337 // Kind: This is always **sql#truncateLogContext**. 4338 Kind string `json:"kind,omitempty"` 4339 4340 // LogType: The type of log to truncate. Valid values are 4341 // **MYSQL_GENERAL_TABLE** and **MYSQL_SLOW_TABLE**. 4342 LogType string `json:"logType,omitempty"` 4343 4344 // ForceSendFields is a list of field names (e.g. "Kind") to 4345 // unconditionally include in API requests. By default, fields with 4346 // empty or default values are omitted from API requests. However, any 4347 // non-pointer, non-interface field appearing in ForceSendFields will be 4348 // sent to the server regardless of whether the field is empty or not. 4349 // This may be used to include empty fields in Patch requests. 4350 ForceSendFields []string `json:"-"` 4351 4352 // NullFields is a list of field names (e.g. "Kind") to include in API 4353 // requests with the JSON null value. By default, fields with empty 4354 // values are omitted from API requests. However, any field with an 4355 // empty value appearing in NullFields will be sent to the server as 4356 // null. It is an error if a field in this list has a non-empty value. 4357 // This may be used to include null fields in Patch requests. 4358 NullFields []string `json:"-"` 4359} 4360 4361func (s *TruncateLogContext) MarshalJSON() ([]byte, error) { 4362 type NoMethod TruncateLogContext 4363 raw := NoMethod(*s) 4364 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4365} 4366 4367// User: A Cloud SQL user resource. 4368type User struct { 4369 // Etag: This field is deprecated and will be removed from a future 4370 // version of the API. 4371 Etag string `json:"etag,omitempty"` 4372 4373 // Host: Optional. The host name from which the user can connect. For 4374 // **insert** operations, host defaults to an empty string. For 4375 // **update** operations, host is specified as part of the request URL. 4376 // The host name cannot be updated after insertion. For a MySQL 4377 // instance, it's required; for a PostgreSQL or SQL Server instance, 4378 // it's optional. 4379 Host string `json:"host,omitempty"` 4380 4381 // Instance: The name of the Cloud SQL instance. This does not include 4382 // the project ID. Can be omitted for *update* since it is already 4383 // specified on the URL. 4384 Instance string `json:"instance,omitempty"` 4385 4386 // Kind: This is always *sql#user*. 4387 Kind string `json:"kind,omitempty"` 4388 4389 // Name: The name of the user in the Cloud SQL instance. Can be omitted 4390 // for **update** since it is already specified in the URL. 4391 Name string `json:"name,omitempty"` 4392 4393 // Password: The password for the user. 4394 Password string `json:"password,omitempty"` 4395 4396 // PasswordPolicy: User level password validation policy. 4397 PasswordPolicy *UserPasswordValidationPolicy `json:"passwordPolicy,omitempty"` 4398 4399 // Project: The project ID of the project containing the Cloud SQL 4400 // database. The Google apps domain is prefixed if applicable. Can be 4401 // omitted for *update* since it is already specified on the URL. 4402 Project string `json:"project,omitempty"` 4403 4404 SqlserverUserDetails *SqlServerUserDetails `json:"sqlserverUserDetails,omitempty"` 4405 4406 // Type: The user type. It determines the method to authenticate the 4407 // user during login. The default is the database's built-in user type. 4408 // 4409 // Possible values: 4410 // "BUILT_IN" - The database's built-in user type. 4411 // "CLOUD_IAM_USER" - Cloud IAM user. 4412 // "CLOUD_IAM_SERVICE_ACCOUNT" - Cloud IAM service account. 4413 Type string `json:"type,omitempty"` 4414 4415 // ForceSendFields is a list of field names (e.g. "Etag") to 4416 // unconditionally include in API requests. By default, fields with 4417 // empty or default values are omitted from API requests. However, any 4418 // non-pointer, non-interface field appearing in ForceSendFields will be 4419 // sent to the server regardless of whether the field is empty or not. 4420 // This may be used to include empty fields in Patch requests. 4421 ForceSendFields []string `json:"-"` 4422 4423 // NullFields is a list of field names (e.g. "Etag") to include in API 4424 // requests with the JSON null value. By default, fields with empty 4425 // values are omitted from API requests. However, any field with an 4426 // empty value appearing in NullFields will be sent to the server as 4427 // null. It is an error if a field in this list has a non-empty value. 4428 // This may be used to include null fields in Patch requests. 4429 NullFields []string `json:"-"` 4430} 4431 4432func (s *User) MarshalJSON() ([]byte, error) { 4433 type NoMethod User 4434 raw := NoMethod(*s) 4435 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4436} 4437 4438// UserPasswordValidationPolicy: User level password validation policy. 4439type UserPasswordValidationPolicy struct { 4440 // AllowedFailedAttempts: Number of failed login attempts allowed before 4441 // user get locked. 4442 AllowedFailedAttempts int64 `json:"allowedFailedAttempts,omitempty"` 4443 4444 // EnableFailedAttemptsCheck: If true, failed login attempts check will 4445 // be enabled. 4446 EnableFailedAttemptsCheck bool `json:"enableFailedAttemptsCheck,omitempty"` 4447 4448 // PasswordExpirationDuration: Expiration duration after password is 4449 // updated. 4450 PasswordExpirationDuration string `json:"passwordExpirationDuration,omitempty"` 4451 4452 // Status: Output only. Read-only password status. 4453 Status *PasswordStatus `json:"status,omitempty"` 4454 4455 // ForceSendFields is a list of field names (e.g. 4456 // "AllowedFailedAttempts") to unconditionally include in API requests. 4457 // By default, fields with empty or default values are omitted from API 4458 // requests. However, any non-pointer, non-interface field appearing in 4459 // ForceSendFields will be sent to the server regardless of whether the 4460 // field is empty or not. This may be used to include empty fields in 4461 // Patch requests. 4462 ForceSendFields []string `json:"-"` 4463 4464 // NullFields is a list of field names (e.g. "AllowedFailedAttempts") to 4465 // include in API requests with the JSON null value. By default, fields 4466 // with empty values are omitted from API requests. However, any field 4467 // with an empty value appearing in NullFields will be sent to the 4468 // server as null. It is an error if a field in this list has a 4469 // non-empty value. This may be used to include null fields in Patch 4470 // requests. 4471 NullFields []string `json:"-"` 4472} 4473 4474func (s *UserPasswordValidationPolicy) MarshalJSON() ([]byte, error) { 4475 type NoMethod UserPasswordValidationPolicy 4476 raw := NoMethod(*s) 4477 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4478} 4479 4480// UsersListResponse: User list response. 4481type UsersListResponse struct { 4482 // Items: List of user resources in the instance. 4483 Items []*User `json:"items,omitempty"` 4484 4485 // Kind: This is always *sql#usersList*. 4486 Kind string `json:"kind,omitempty"` 4487 4488 // NextPageToken: An identifier that uniquely identifies the operation. 4489 // You can use this identifier to retrieve the Operations resource that 4490 // has information about the operation. 4491 NextPageToken string `json:"nextPageToken,omitempty"` 4492 4493 // ServerResponse contains the HTTP response code and headers from the 4494 // server. 4495 googleapi.ServerResponse `json:"-"` 4496 4497 // ForceSendFields is a list of field names (e.g. "Items") to 4498 // unconditionally include in API requests. By default, fields with 4499 // empty or default values are omitted from API requests. However, any 4500 // non-pointer, non-interface field appearing in ForceSendFields will be 4501 // sent to the server regardless of whether the field is empty or not. 4502 // This may be used to include empty fields in Patch requests. 4503 ForceSendFields []string `json:"-"` 4504 4505 // NullFields is a list of field names (e.g. "Items") to include in API 4506 // requests with the JSON null value. By default, fields with empty 4507 // values are omitted from API requests. However, any field with an 4508 // empty value appearing in NullFields will be sent to the server as 4509 // null. It is an error if a field in this list has a non-empty value. 4510 // This may be used to include null fields in Patch requests. 4511 NullFields []string `json:"-"` 4512} 4513 4514func (s *UsersListResponse) MarshalJSON() ([]byte, error) { 4515 type NoMethod UsersListResponse 4516 raw := NoMethod(*s) 4517 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4518} 4519 4520// method id "sql.backupRuns.delete": 4521 4522type BackupRunsDeleteCall struct { 4523 s *Service 4524 project string 4525 instance string 4526 id int64 4527 urlParams_ gensupport.URLParams 4528 ctx_ context.Context 4529 header_ http.Header 4530} 4531 4532// Delete: Deletes the backup taken by a backup run. 4533// 4534// - id: The ID of the backup run to delete. To find a backup run ID, 4535// use the list 4536// (https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/backupRuns/list) 4537// method. 4538// - instance: Cloud SQL instance ID. This does not include the project 4539// ID. 4540// - project: Project ID of the project that contains the instance. 4541func (r *BackupRunsService) Delete(project string, instance string, id int64) *BackupRunsDeleteCall { 4542 c := &BackupRunsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4543 c.project = project 4544 c.instance = instance 4545 c.id = id 4546 return c 4547} 4548 4549// Fields allows partial responses to be retrieved. See 4550// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4551// for more information. 4552func (c *BackupRunsDeleteCall) Fields(s ...googleapi.Field) *BackupRunsDeleteCall { 4553 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4554 return c 4555} 4556 4557// Context sets the context to be used in this call's Do method. Any 4558// pending HTTP request will be aborted if the provided context is 4559// canceled. 4560func (c *BackupRunsDeleteCall) Context(ctx context.Context) *BackupRunsDeleteCall { 4561 c.ctx_ = ctx 4562 return c 4563} 4564 4565// Header returns an http.Header that can be modified by the caller to 4566// add HTTP headers to the request. 4567func (c *BackupRunsDeleteCall) Header() http.Header { 4568 if c.header_ == nil { 4569 c.header_ = make(http.Header) 4570 } 4571 return c.header_ 4572} 4573 4574func (c *BackupRunsDeleteCall) doRequest(alt string) (*http.Response, error) { 4575 reqHeaders := make(http.Header) 4576 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 4577 for k, v := range c.header_ { 4578 reqHeaders[k] = v 4579 } 4580 reqHeaders.Set("User-Agent", c.s.userAgent()) 4581 var body io.Reader = nil 4582 c.urlParams_.Set("alt", alt) 4583 c.urlParams_.Set("prettyPrint", "false") 4584 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}") 4585 urls += "?" + c.urlParams_.Encode() 4586 req, err := http.NewRequest("DELETE", urls, body) 4587 if err != nil { 4588 return nil, err 4589 } 4590 req.Header = reqHeaders 4591 googleapi.Expand(req.URL, map[string]string{ 4592 "project": c.project, 4593 "instance": c.instance, 4594 "id": strconv.FormatInt(c.id, 10), 4595 }) 4596 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4597} 4598 4599// Do executes the "sql.backupRuns.delete" call. 4600// Exactly one of *Operation or error will be non-nil. Any non-2xx 4601// status code is an error. Response headers are in either 4602// *Operation.ServerResponse.Header or (if a response was returned at 4603// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4604// to check whether the returned error was because 4605// http.StatusNotModified was returned. 4606func (c *BackupRunsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4607 gensupport.SetOptions(c.urlParams_, opts...) 4608 res, err := c.doRequest("json") 4609 if res != nil && res.StatusCode == http.StatusNotModified { 4610 if res.Body != nil { 4611 res.Body.Close() 4612 } 4613 return nil, &googleapi.Error{ 4614 Code: res.StatusCode, 4615 Header: res.Header, 4616 } 4617 } 4618 if err != nil { 4619 return nil, err 4620 } 4621 defer googleapi.CloseBody(res) 4622 if err := googleapi.CheckResponse(res); err != nil { 4623 return nil, err 4624 } 4625 ret := &Operation{ 4626 ServerResponse: googleapi.ServerResponse{ 4627 Header: res.Header, 4628 HTTPStatusCode: res.StatusCode, 4629 }, 4630 } 4631 target := &ret 4632 if err := gensupport.DecodeResponse(target, res); err != nil { 4633 return nil, err 4634 } 4635 return ret, nil 4636 // { 4637 // "description": "Deletes the backup taken by a backup run.", 4638 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4639 // "httpMethod": "DELETE", 4640 // "id": "sql.backupRuns.delete", 4641 // "parameterOrder": [ 4642 // "project", 4643 // "instance", 4644 // "id" 4645 // ], 4646 // "parameters": { 4647 // "id": { 4648 // "description": "The ID of the backup run to delete. To find a backup run ID, use the [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/backupRuns/list) method.", 4649 // "format": "int64", 4650 // "location": "path", 4651 // "required": true, 4652 // "type": "string" 4653 // }, 4654 // "instance": { 4655 // "description": "Cloud SQL instance ID. This does not include the project ID.", 4656 // "location": "path", 4657 // "required": true, 4658 // "type": "string" 4659 // }, 4660 // "project": { 4661 // "description": "Project ID of the project that contains the instance.", 4662 // "location": "path", 4663 // "required": true, 4664 // "type": "string" 4665 // } 4666 // }, 4667 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4668 // "response": { 4669 // "$ref": "Operation" 4670 // }, 4671 // "scopes": [ 4672 // "https://www.googleapis.com/auth/cloud-platform", 4673 // "https://www.googleapis.com/auth/sqlservice.admin" 4674 // ] 4675 // } 4676 4677} 4678 4679// method id "sql.backupRuns.get": 4680 4681type BackupRunsGetCall struct { 4682 s *Service 4683 project string 4684 instance string 4685 id int64 4686 urlParams_ gensupport.URLParams 4687 ifNoneMatch_ string 4688 ctx_ context.Context 4689 header_ http.Header 4690} 4691 4692// Get: Retrieves a resource containing information about a backup run. 4693// 4694// - id: The ID of this backup run. 4695// - instance: Cloud SQL instance ID. This does not include the project 4696// ID. 4697// - project: Project ID of the project that contains the instance. 4698func (r *BackupRunsService) Get(project string, instance string, id int64) *BackupRunsGetCall { 4699 c := &BackupRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4700 c.project = project 4701 c.instance = instance 4702 c.id = id 4703 return c 4704} 4705 4706// Fields allows partial responses to be retrieved. See 4707// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4708// for more information. 4709func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall { 4710 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4711 return c 4712} 4713 4714// IfNoneMatch sets the optional parameter which makes the operation 4715// fail if the object's ETag matches the given value. This is useful for 4716// getting updates only after the object has changed since the last 4717// request. Use googleapi.IsNotModified to check whether the response 4718// error from Do is the result of In-None-Match. 4719func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall { 4720 c.ifNoneMatch_ = entityTag 4721 return c 4722} 4723 4724// Context sets the context to be used in this call's Do method. Any 4725// pending HTTP request will be aborted if the provided context is 4726// canceled. 4727func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall { 4728 c.ctx_ = ctx 4729 return c 4730} 4731 4732// Header returns an http.Header that can be modified by the caller to 4733// add HTTP headers to the request. 4734func (c *BackupRunsGetCall) Header() http.Header { 4735 if c.header_ == nil { 4736 c.header_ = make(http.Header) 4737 } 4738 return c.header_ 4739} 4740 4741func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) { 4742 reqHeaders := make(http.Header) 4743 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 4744 for k, v := range c.header_ { 4745 reqHeaders[k] = v 4746 } 4747 reqHeaders.Set("User-Agent", c.s.userAgent()) 4748 if c.ifNoneMatch_ != "" { 4749 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4750 } 4751 var body io.Reader = nil 4752 c.urlParams_.Set("alt", alt) 4753 c.urlParams_.Set("prettyPrint", "false") 4754 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}") 4755 urls += "?" + c.urlParams_.Encode() 4756 req, err := http.NewRequest("GET", urls, body) 4757 if err != nil { 4758 return nil, err 4759 } 4760 req.Header = reqHeaders 4761 googleapi.Expand(req.URL, map[string]string{ 4762 "project": c.project, 4763 "instance": c.instance, 4764 "id": strconv.FormatInt(c.id, 10), 4765 }) 4766 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4767} 4768 4769// Do executes the "sql.backupRuns.get" call. 4770// Exactly one of *BackupRun or error will be non-nil. Any non-2xx 4771// status code is an error. Response headers are in either 4772// *BackupRun.ServerResponse.Header or (if a response was returned at 4773// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4774// to check whether the returned error was because 4775// http.StatusNotModified was returned. 4776func (c *BackupRunsGetCall) Do(opts ...googleapi.CallOption) (*BackupRun, error) { 4777 gensupport.SetOptions(c.urlParams_, opts...) 4778 res, err := c.doRequest("json") 4779 if res != nil && res.StatusCode == http.StatusNotModified { 4780 if res.Body != nil { 4781 res.Body.Close() 4782 } 4783 return nil, &googleapi.Error{ 4784 Code: res.StatusCode, 4785 Header: res.Header, 4786 } 4787 } 4788 if err != nil { 4789 return nil, err 4790 } 4791 defer googleapi.CloseBody(res) 4792 if err := googleapi.CheckResponse(res); err != nil { 4793 return nil, err 4794 } 4795 ret := &BackupRun{ 4796 ServerResponse: googleapi.ServerResponse{ 4797 Header: res.Header, 4798 HTTPStatusCode: res.StatusCode, 4799 }, 4800 } 4801 target := &ret 4802 if err := gensupport.DecodeResponse(target, res); err != nil { 4803 return nil, err 4804 } 4805 return ret, nil 4806 // { 4807 // "description": "Retrieves a resource containing information about a backup run.", 4808 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4809 // "httpMethod": "GET", 4810 // "id": "sql.backupRuns.get", 4811 // "parameterOrder": [ 4812 // "project", 4813 // "instance", 4814 // "id" 4815 // ], 4816 // "parameters": { 4817 // "id": { 4818 // "description": "The ID of this backup run.", 4819 // "format": "int64", 4820 // "location": "path", 4821 // "required": true, 4822 // "type": "string" 4823 // }, 4824 // "instance": { 4825 // "description": "Cloud SQL instance ID. This does not include the project ID.", 4826 // "location": "path", 4827 // "required": true, 4828 // "type": "string" 4829 // }, 4830 // "project": { 4831 // "description": "Project ID of the project that contains the instance.", 4832 // "location": "path", 4833 // "required": true, 4834 // "type": "string" 4835 // } 4836 // }, 4837 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4838 // "response": { 4839 // "$ref": "BackupRun" 4840 // }, 4841 // "scopes": [ 4842 // "https://www.googleapis.com/auth/cloud-platform", 4843 // "https://www.googleapis.com/auth/sqlservice.admin" 4844 // ] 4845 // } 4846 4847} 4848 4849// method id "sql.backupRuns.insert": 4850 4851type BackupRunsInsertCall struct { 4852 s *Service 4853 project string 4854 instance string 4855 backuprun *BackupRun 4856 urlParams_ gensupport.URLParams 4857 ctx_ context.Context 4858 header_ http.Header 4859} 4860 4861// Insert: Creates a new backup run on demand. 4862// 4863// - instance: Cloud SQL instance ID. This does not include the project 4864// ID. 4865// - project: Project ID of the project that contains the instance. 4866func (r *BackupRunsService) Insert(project string, instance string, backuprun *BackupRun) *BackupRunsInsertCall { 4867 c := &BackupRunsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4868 c.project = project 4869 c.instance = instance 4870 c.backuprun = backuprun 4871 return c 4872} 4873 4874// Fields allows partial responses to be retrieved. See 4875// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4876// for more information. 4877func (c *BackupRunsInsertCall) Fields(s ...googleapi.Field) *BackupRunsInsertCall { 4878 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4879 return c 4880} 4881 4882// Context sets the context to be used in this call's Do method. Any 4883// pending HTTP request will be aborted if the provided context is 4884// canceled. 4885func (c *BackupRunsInsertCall) Context(ctx context.Context) *BackupRunsInsertCall { 4886 c.ctx_ = ctx 4887 return c 4888} 4889 4890// Header returns an http.Header that can be modified by the caller to 4891// add HTTP headers to the request. 4892func (c *BackupRunsInsertCall) Header() http.Header { 4893 if c.header_ == nil { 4894 c.header_ = make(http.Header) 4895 } 4896 return c.header_ 4897} 4898 4899func (c *BackupRunsInsertCall) doRequest(alt string) (*http.Response, error) { 4900 reqHeaders := make(http.Header) 4901 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 4902 for k, v := range c.header_ { 4903 reqHeaders[k] = v 4904 } 4905 reqHeaders.Set("User-Agent", c.s.userAgent()) 4906 var body io.Reader = nil 4907 body, err := googleapi.WithoutDataWrapper.JSONReader(c.backuprun) 4908 if err != nil { 4909 return nil, err 4910 } 4911 reqHeaders.Set("Content-Type", "application/json") 4912 c.urlParams_.Set("alt", alt) 4913 c.urlParams_.Set("prettyPrint", "false") 4914 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns") 4915 urls += "?" + c.urlParams_.Encode() 4916 req, err := http.NewRequest("POST", urls, body) 4917 if err != nil { 4918 return nil, err 4919 } 4920 req.Header = reqHeaders 4921 googleapi.Expand(req.URL, map[string]string{ 4922 "project": c.project, 4923 "instance": c.instance, 4924 }) 4925 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4926} 4927 4928// Do executes the "sql.backupRuns.insert" call. 4929// Exactly one of *Operation or error will be non-nil. Any non-2xx 4930// status code is an error. Response headers are in either 4931// *Operation.ServerResponse.Header or (if a response was returned at 4932// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4933// to check whether the returned error was because 4934// http.StatusNotModified was returned. 4935func (c *BackupRunsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4936 gensupport.SetOptions(c.urlParams_, opts...) 4937 res, err := c.doRequest("json") 4938 if res != nil && res.StatusCode == http.StatusNotModified { 4939 if res.Body != nil { 4940 res.Body.Close() 4941 } 4942 return nil, &googleapi.Error{ 4943 Code: res.StatusCode, 4944 Header: res.Header, 4945 } 4946 } 4947 if err != nil { 4948 return nil, err 4949 } 4950 defer googleapi.CloseBody(res) 4951 if err := googleapi.CheckResponse(res); err != nil { 4952 return nil, err 4953 } 4954 ret := &Operation{ 4955 ServerResponse: googleapi.ServerResponse{ 4956 Header: res.Header, 4957 HTTPStatusCode: res.StatusCode, 4958 }, 4959 } 4960 target := &ret 4961 if err := gensupport.DecodeResponse(target, res); err != nil { 4962 return nil, err 4963 } 4964 return ret, nil 4965 // { 4966 // "description": "Creates a new backup run on demand.", 4967 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 4968 // "httpMethod": "POST", 4969 // "id": "sql.backupRuns.insert", 4970 // "parameterOrder": [ 4971 // "project", 4972 // "instance" 4973 // ], 4974 // "parameters": { 4975 // "instance": { 4976 // "description": "Cloud SQL instance ID. This does not include the project ID.", 4977 // "location": "path", 4978 // "required": true, 4979 // "type": "string" 4980 // }, 4981 // "project": { 4982 // "description": "Project ID of the project that contains the instance.", 4983 // "location": "path", 4984 // "required": true, 4985 // "type": "string" 4986 // } 4987 // }, 4988 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 4989 // "request": { 4990 // "$ref": "BackupRun" 4991 // }, 4992 // "response": { 4993 // "$ref": "Operation" 4994 // }, 4995 // "scopes": [ 4996 // "https://www.googleapis.com/auth/cloud-platform", 4997 // "https://www.googleapis.com/auth/sqlservice.admin" 4998 // ] 4999 // } 5000 5001} 5002 5003// method id "sql.backupRuns.list": 5004 5005type BackupRunsListCall struct { 5006 s *Service 5007 project string 5008 instance string 5009 urlParams_ gensupport.URLParams 5010 ifNoneMatch_ string 5011 ctx_ context.Context 5012 header_ http.Header 5013} 5014 5015// List: Lists all backup runs associated with the project or a given 5016// instance and configuration in the reverse chronological order of the 5017// backup initiation time. 5018// 5019// - instance: Cloud SQL instance ID, or "-" for all instances. This 5020// does not include the project ID. 5021// - project: Project ID of the project that contains the instance. 5022func (r *BackupRunsService) List(project string, instance string) *BackupRunsListCall { 5023 c := &BackupRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5024 c.project = project 5025 c.instance = instance 5026 return c 5027} 5028 5029// MaxResults sets the optional parameter "maxResults": Maximum number 5030// of backup runs per response. 5031func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall { 5032 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 5033 return c 5034} 5035 5036// PageToken sets the optional parameter "pageToken": A 5037// previously-returned page token representing part of the larger set of 5038// results to view. 5039func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall { 5040 c.urlParams_.Set("pageToken", pageToken) 5041 return c 5042} 5043 5044// Fields allows partial responses to be retrieved. See 5045// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5046// for more information. 5047func (c *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall { 5048 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5049 return c 5050} 5051 5052// IfNoneMatch sets the optional parameter which makes the operation 5053// fail if the object's ETag matches the given value. This is useful for 5054// getting updates only after the object has changed since the last 5055// request. Use googleapi.IsNotModified to check whether the response 5056// error from Do is the result of In-None-Match. 5057func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall { 5058 c.ifNoneMatch_ = entityTag 5059 return c 5060} 5061 5062// Context sets the context to be used in this call's Do method. Any 5063// pending HTTP request will be aborted if the provided context is 5064// canceled. 5065func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall { 5066 c.ctx_ = ctx 5067 return c 5068} 5069 5070// Header returns an http.Header that can be modified by the caller to 5071// add HTTP headers to the request. 5072func (c *BackupRunsListCall) Header() http.Header { 5073 if c.header_ == nil { 5074 c.header_ = make(http.Header) 5075 } 5076 return c.header_ 5077} 5078 5079func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) { 5080 reqHeaders := make(http.Header) 5081 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 5082 for k, v := range c.header_ { 5083 reqHeaders[k] = v 5084 } 5085 reqHeaders.Set("User-Agent", c.s.userAgent()) 5086 if c.ifNoneMatch_ != "" { 5087 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5088 } 5089 var body io.Reader = nil 5090 c.urlParams_.Set("alt", alt) 5091 c.urlParams_.Set("prettyPrint", "false") 5092 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns") 5093 urls += "?" + c.urlParams_.Encode() 5094 req, err := http.NewRequest("GET", urls, body) 5095 if err != nil { 5096 return nil, err 5097 } 5098 req.Header = reqHeaders 5099 googleapi.Expand(req.URL, map[string]string{ 5100 "project": c.project, 5101 "instance": c.instance, 5102 }) 5103 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5104} 5105 5106// Do executes the "sql.backupRuns.list" call. 5107// Exactly one of *BackupRunsListResponse or error will be non-nil. Any 5108// non-2xx status code is an error. Response headers are in either 5109// *BackupRunsListResponse.ServerResponse.Header or (if a response was 5110// returned at all) in error.(*googleapi.Error).Header. Use 5111// googleapi.IsNotModified to check whether the returned error was 5112// because http.StatusNotModified was returned. 5113func (c *BackupRunsListCall) Do(opts ...googleapi.CallOption) (*BackupRunsListResponse, error) { 5114 gensupport.SetOptions(c.urlParams_, opts...) 5115 res, err := c.doRequest("json") 5116 if res != nil && res.StatusCode == http.StatusNotModified { 5117 if res.Body != nil { 5118 res.Body.Close() 5119 } 5120 return nil, &googleapi.Error{ 5121 Code: res.StatusCode, 5122 Header: res.Header, 5123 } 5124 } 5125 if err != nil { 5126 return nil, err 5127 } 5128 defer googleapi.CloseBody(res) 5129 if err := googleapi.CheckResponse(res); err != nil { 5130 return nil, err 5131 } 5132 ret := &BackupRunsListResponse{ 5133 ServerResponse: googleapi.ServerResponse{ 5134 Header: res.Header, 5135 HTTPStatusCode: res.StatusCode, 5136 }, 5137 } 5138 target := &ret 5139 if err := gensupport.DecodeResponse(target, res); err != nil { 5140 return nil, err 5141 } 5142 return ret, nil 5143 // { 5144 // "description": "Lists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.", 5145 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 5146 // "httpMethod": "GET", 5147 // "id": "sql.backupRuns.list", 5148 // "parameterOrder": [ 5149 // "project", 5150 // "instance" 5151 // ], 5152 // "parameters": { 5153 // "instance": { 5154 // "description": "Cloud SQL instance ID, or \"-\" for all instances. This does not include the project ID.", 5155 // "location": "path", 5156 // "required": true, 5157 // "type": "string" 5158 // }, 5159 // "maxResults": { 5160 // "description": "Maximum number of backup runs per response.", 5161 // "format": "int32", 5162 // "location": "query", 5163 // "type": "integer" 5164 // }, 5165 // "pageToken": { 5166 // "description": "A previously-returned page token representing part of the larger set of results to view.", 5167 // "location": "query", 5168 // "type": "string" 5169 // }, 5170 // "project": { 5171 // "description": "Project ID of the project that contains the instance.", 5172 // "location": "path", 5173 // "required": true, 5174 // "type": "string" 5175 // } 5176 // }, 5177 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 5178 // "response": { 5179 // "$ref": "BackupRunsListResponse" 5180 // }, 5181 // "scopes": [ 5182 // "https://www.googleapis.com/auth/cloud-platform", 5183 // "https://www.googleapis.com/auth/sqlservice.admin" 5184 // ] 5185 // } 5186 5187} 5188 5189// Pages invokes f for each page of results. 5190// A non-nil error returned from f will halt the iteration. 5191// The provided context supersedes any context provided to the Context method. 5192func (c *BackupRunsListCall) Pages(ctx context.Context, f func(*BackupRunsListResponse) error) error { 5193 c.ctx_ = ctx 5194 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5195 for { 5196 x, err := c.Do() 5197 if err != nil { 5198 return err 5199 } 5200 if err := f(x); err != nil { 5201 return err 5202 } 5203 if x.NextPageToken == "" { 5204 return nil 5205 } 5206 c.PageToken(x.NextPageToken) 5207 } 5208} 5209 5210// method id "sql.connect.generateEphemeral": 5211 5212type ConnectGenerateEphemeralCertCall struct { 5213 s *Service 5214 project string 5215 instance string 5216 generateephemeralcertrequest *GenerateEphemeralCertRequest 5217 urlParams_ gensupport.URLParams 5218 ctx_ context.Context 5219 header_ http.Header 5220} 5221 5222// GenerateEphemeralCert: Generates a short-lived X509 certificate 5223// containing the provided public key and signed by a private key 5224// specific to the target instance. Users may use the certificate to 5225// authenticate as themselves when connecting to the database. 5226// 5227// - instance: Cloud SQL instance ID. This does not include the project 5228// ID. 5229// - project: Project ID of the project that contains the instance. 5230func (r *ConnectService) GenerateEphemeralCert(project string, instance string, generateephemeralcertrequest *GenerateEphemeralCertRequest) *ConnectGenerateEphemeralCertCall { 5231 c := &ConnectGenerateEphemeralCertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5232 c.project = project 5233 c.instance = instance 5234 c.generateephemeralcertrequest = generateephemeralcertrequest 5235 return c 5236} 5237 5238// Fields allows partial responses to be retrieved. See 5239// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5240// for more information. 5241func (c *ConnectGenerateEphemeralCertCall) Fields(s ...googleapi.Field) *ConnectGenerateEphemeralCertCall { 5242 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5243 return c 5244} 5245 5246// Context sets the context to be used in this call's Do method. Any 5247// pending HTTP request will be aborted if the provided context is 5248// canceled. 5249func (c *ConnectGenerateEphemeralCertCall) Context(ctx context.Context) *ConnectGenerateEphemeralCertCall { 5250 c.ctx_ = ctx 5251 return c 5252} 5253 5254// Header returns an http.Header that can be modified by the caller to 5255// add HTTP headers to the request. 5256func (c *ConnectGenerateEphemeralCertCall) Header() http.Header { 5257 if c.header_ == nil { 5258 c.header_ = make(http.Header) 5259 } 5260 return c.header_ 5261} 5262 5263func (c *ConnectGenerateEphemeralCertCall) doRequest(alt string) (*http.Response, error) { 5264 reqHeaders := make(http.Header) 5265 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 5266 for k, v := range c.header_ { 5267 reqHeaders[k] = v 5268 } 5269 reqHeaders.Set("User-Agent", c.s.userAgent()) 5270 var body io.Reader = nil 5271 body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateephemeralcertrequest) 5272 if err != nil { 5273 return nil, err 5274 } 5275 reqHeaders.Set("Content-Type", "application/json") 5276 c.urlParams_.Set("alt", alt) 5277 c.urlParams_.Set("prettyPrint", "false") 5278 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}:generateEphemeralCert") 5279 urls += "?" + c.urlParams_.Encode() 5280 req, err := http.NewRequest("POST", urls, body) 5281 if err != nil { 5282 return nil, err 5283 } 5284 req.Header = reqHeaders 5285 googleapi.Expand(req.URL, map[string]string{ 5286 "project": c.project, 5287 "instance": c.instance, 5288 }) 5289 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5290} 5291 5292// Do executes the "sql.connect.generateEphemeral" call. 5293// Exactly one of *GenerateEphemeralCertResponse or error will be 5294// non-nil. Any non-2xx status code is an error. Response headers are in 5295// either *GenerateEphemeralCertResponse.ServerResponse.Header or (if a 5296// response was returned at all) in error.(*googleapi.Error).Header. Use 5297// googleapi.IsNotModified to check whether the returned error was 5298// because http.StatusNotModified was returned. 5299func (c *ConnectGenerateEphemeralCertCall) Do(opts ...googleapi.CallOption) (*GenerateEphemeralCertResponse, error) { 5300 gensupport.SetOptions(c.urlParams_, opts...) 5301 res, err := c.doRequest("json") 5302 if res != nil && res.StatusCode == http.StatusNotModified { 5303 if res.Body != nil { 5304 res.Body.Close() 5305 } 5306 return nil, &googleapi.Error{ 5307 Code: res.StatusCode, 5308 Header: res.Header, 5309 } 5310 } 5311 if err != nil { 5312 return nil, err 5313 } 5314 defer googleapi.CloseBody(res) 5315 if err := googleapi.CheckResponse(res); err != nil { 5316 return nil, err 5317 } 5318 ret := &GenerateEphemeralCertResponse{ 5319 ServerResponse: googleapi.ServerResponse{ 5320 Header: res.Header, 5321 HTTPStatusCode: res.StatusCode, 5322 }, 5323 } 5324 target := &ret 5325 if err := gensupport.DecodeResponse(target, res); err != nil { 5326 return nil, err 5327 } 5328 return ret, nil 5329 // { 5330 // "description": "Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.", 5331 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}:generateEphemeralCert", 5332 // "httpMethod": "POST", 5333 // "id": "sql.connect.generateEphemeral", 5334 // "parameterOrder": [ 5335 // "project", 5336 // "instance" 5337 // ], 5338 // "parameters": { 5339 // "instance": { 5340 // "description": "Cloud SQL instance ID. This does not include the project ID.", 5341 // "location": "path", 5342 // "required": true, 5343 // "type": "string" 5344 // }, 5345 // "project": { 5346 // "description": "Project ID of the project that contains the instance.", 5347 // "location": "path", 5348 // "required": true, 5349 // "type": "string" 5350 // } 5351 // }, 5352 // "path": "sql/v1beta4/projects/{project}/instances/{instance}:generateEphemeralCert", 5353 // "request": { 5354 // "$ref": "GenerateEphemeralCertRequest" 5355 // }, 5356 // "response": { 5357 // "$ref": "GenerateEphemeralCertResponse" 5358 // }, 5359 // "scopes": [ 5360 // "https://www.googleapis.com/auth/cloud-platform", 5361 // "https://www.googleapis.com/auth/sqlservice.admin" 5362 // ] 5363 // } 5364 5365} 5366 5367// method id "sql.connect.get": 5368 5369type ConnectGetCall struct { 5370 s *Service 5371 project string 5372 instance string 5373 urlParams_ gensupport.URLParams 5374 ifNoneMatch_ string 5375 ctx_ context.Context 5376 header_ http.Header 5377} 5378 5379// Get: Retrieves connect settings about a Cloud SQL instance. 5380// 5381// - instance: Cloud SQL instance ID. This does not include the project 5382// ID. 5383// - project: Project ID of the project that contains the instance. 5384func (r *ConnectService) Get(project string, instance string) *ConnectGetCall { 5385 c := &ConnectGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5386 c.project = project 5387 c.instance = instance 5388 return c 5389} 5390 5391// ReadTime sets the optional parameter "readTime": Optional snapshot 5392// read timestamp to trade freshness for performance. 5393func (c *ConnectGetCall) ReadTime(readTime string) *ConnectGetCall { 5394 c.urlParams_.Set("readTime", readTime) 5395 return c 5396} 5397 5398// Fields allows partial responses to be retrieved. See 5399// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5400// for more information. 5401func (c *ConnectGetCall) Fields(s ...googleapi.Field) *ConnectGetCall { 5402 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5403 return c 5404} 5405 5406// IfNoneMatch sets the optional parameter which makes the operation 5407// fail if the object's ETag matches the given value. This is useful for 5408// getting updates only after the object has changed since the last 5409// request. Use googleapi.IsNotModified to check whether the response 5410// error from Do is the result of In-None-Match. 5411func (c *ConnectGetCall) IfNoneMatch(entityTag string) *ConnectGetCall { 5412 c.ifNoneMatch_ = entityTag 5413 return c 5414} 5415 5416// Context sets the context to be used in this call's Do method. Any 5417// pending HTTP request will be aborted if the provided context is 5418// canceled. 5419func (c *ConnectGetCall) Context(ctx context.Context) *ConnectGetCall { 5420 c.ctx_ = ctx 5421 return c 5422} 5423 5424// Header returns an http.Header that can be modified by the caller to 5425// add HTTP headers to the request. 5426func (c *ConnectGetCall) Header() http.Header { 5427 if c.header_ == nil { 5428 c.header_ = make(http.Header) 5429 } 5430 return c.header_ 5431} 5432 5433func (c *ConnectGetCall) doRequest(alt string) (*http.Response, error) { 5434 reqHeaders := make(http.Header) 5435 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 5436 for k, v := range c.header_ { 5437 reqHeaders[k] = v 5438 } 5439 reqHeaders.Set("User-Agent", c.s.userAgent()) 5440 if c.ifNoneMatch_ != "" { 5441 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5442 } 5443 var body io.Reader = nil 5444 c.urlParams_.Set("alt", alt) 5445 c.urlParams_.Set("prettyPrint", "false") 5446 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/connectSettings") 5447 urls += "?" + c.urlParams_.Encode() 5448 req, err := http.NewRequest("GET", urls, body) 5449 if err != nil { 5450 return nil, err 5451 } 5452 req.Header = reqHeaders 5453 googleapi.Expand(req.URL, map[string]string{ 5454 "project": c.project, 5455 "instance": c.instance, 5456 }) 5457 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5458} 5459 5460// Do executes the "sql.connect.get" call. 5461// Exactly one of *ConnectSettings or error will be non-nil. Any non-2xx 5462// status code is an error. Response headers are in either 5463// *ConnectSettings.ServerResponse.Header or (if a response was returned 5464// at all) in error.(*googleapi.Error).Header. Use 5465// googleapi.IsNotModified to check whether the returned error was 5466// because http.StatusNotModified was returned. 5467func (c *ConnectGetCall) Do(opts ...googleapi.CallOption) (*ConnectSettings, error) { 5468 gensupport.SetOptions(c.urlParams_, opts...) 5469 res, err := c.doRequest("json") 5470 if res != nil && res.StatusCode == http.StatusNotModified { 5471 if res.Body != nil { 5472 res.Body.Close() 5473 } 5474 return nil, &googleapi.Error{ 5475 Code: res.StatusCode, 5476 Header: res.Header, 5477 } 5478 } 5479 if err != nil { 5480 return nil, err 5481 } 5482 defer googleapi.CloseBody(res) 5483 if err := googleapi.CheckResponse(res); err != nil { 5484 return nil, err 5485 } 5486 ret := &ConnectSettings{ 5487 ServerResponse: googleapi.ServerResponse{ 5488 Header: res.Header, 5489 HTTPStatusCode: res.StatusCode, 5490 }, 5491 } 5492 target := &ret 5493 if err := gensupport.DecodeResponse(target, res); err != nil { 5494 return nil, err 5495 } 5496 return ret, nil 5497 // { 5498 // "description": "Retrieves connect settings about a Cloud SQL instance.", 5499 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/connectSettings", 5500 // "httpMethod": "GET", 5501 // "id": "sql.connect.get", 5502 // "parameterOrder": [ 5503 // "project", 5504 // "instance" 5505 // ], 5506 // "parameters": { 5507 // "instance": { 5508 // "description": "Cloud SQL instance ID. This does not include the project ID.", 5509 // "location": "path", 5510 // "required": true, 5511 // "type": "string" 5512 // }, 5513 // "project": { 5514 // "description": "Project ID of the project that contains the instance.", 5515 // "location": "path", 5516 // "required": true, 5517 // "type": "string" 5518 // }, 5519 // "readTime": { 5520 // "description": "Optional. Optional snapshot read timestamp to trade freshness for performance.", 5521 // "format": "google-datetime", 5522 // "location": "query", 5523 // "type": "string" 5524 // } 5525 // }, 5526 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/connectSettings", 5527 // "response": { 5528 // "$ref": "ConnectSettings" 5529 // }, 5530 // "scopes": [ 5531 // "https://www.googleapis.com/auth/cloud-platform", 5532 // "https://www.googleapis.com/auth/sqlservice.admin" 5533 // ] 5534 // } 5535 5536} 5537 5538// method id "sql.databases.delete": 5539 5540type DatabasesDeleteCall struct { 5541 s *Service 5542 project string 5543 instance string 5544 database string 5545 urlParams_ gensupport.URLParams 5546 ctx_ context.Context 5547 header_ http.Header 5548} 5549 5550// Delete: Deletes a database from a Cloud SQL instance. 5551// 5552// - database: Name of the database to be deleted in the instance. 5553// - instance: Database instance ID. This does not include the project 5554// ID. 5555// - project: Project ID of the project that contains the instance. 5556func (r *DatabasesService) Delete(project string, instance string, database string) *DatabasesDeleteCall { 5557 c := &DatabasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5558 c.project = project 5559 c.instance = instance 5560 c.database = database 5561 return c 5562} 5563 5564// Fields allows partial responses to be retrieved. See 5565// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5566// for more information. 5567func (c *DatabasesDeleteCall) Fields(s ...googleapi.Field) *DatabasesDeleteCall { 5568 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5569 return c 5570} 5571 5572// Context sets the context to be used in this call's Do method. Any 5573// pending HTTP request will be aborted if the provided context is 5574// canceled. 5575func (c *DatabasesDeleteCall) Context(ctx context.Context) *DatabasesDeleteCall { 5576 c.ctx_ = ctx 5577 return c 5578} 5579 5580// Header returns an http.Header that can be modified by the caller to 5581// add HTTP headers to the request. 5582func (c *DatabasesDeleteCall) Header() http.Header { 5583 if c.header_ == nil { 5584 c.header_ = make(http.Header) 5585 } 5586 return c.header_ 5587} 5588 5589func (c *DatabasesDeleteCall) doRequest(alt string) (*http.Response, error) { 5590 reqHeaders := make(http.Header) 5591 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 5592 for k, v := range c.header_ { 5593 reqHeaders[k] = v 5594 } 5595 reqHeaders.Set("User-Agent", c.s.userAgent()) 5596 var body io.Reader = nil 5597 c.urlParams_.Set("alt", alt) 5598 c.urlParams_.Set("prettyPrint", "false") 5599 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 5600 urls += "?" + c.urlParams_.Encode() 5601 req, err := http.NewRequest("DELETE", urls, body) 5602 if err != nil { 5603 return nil, err 5604 } 5605 req.Header = reqHeaders 5606 googleapi.Expand(req.URL, map[string]string{ 5607 "project": c.project, 5608 "instance": c.instance, 5609 "database": c.database, 5610 }) 5611 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5612} 5613 5614// Do executes the "sql.databases.delete" call. 5615// Exactly one of *Operation or error will be non-nil. Any non-2xx 5616// status code is an error. Response headers are in either 5617// *Operation.ServerResponse.Header or (if a response was returned at 5618// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5619// to check whether the returned error was because 5620// http.StatusNotModified was returned. 5621func (c *DatabasesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5622 gensupport.SetOptions(c.urlParams_, opts...) 5623 res, err := c.doRequest("json") 5624 if res != nil && res.StatusCode == http.StatusNotModified { 5625 if res.Body != nil { 5626 res.Body.Close() 5627 } 5628 return nil, &googleapi.Error{ 5629 Code: res.StatusCode, 5630 Header: res.Header, 5631 } 5632 } 5633 if err != nil { 5634 return nil, err 5635 } 5636 defer googleapi.CloseBody(res) 5637 if err := googleapi.CheckResponse(res); err != nil { 5638 return nil, err 5639 } 5640 ret := &Operation{ 5641 ServerResponse: googleapi.ServerResponse{ 5642 Header: res.Header, 5643 HTTPStatusCode: res.StatusCode, 5644 }, 5645 } 5646 target := &ret 5647 if err := gensupport.DecodeResponse(target, res); err != nil { 5648 return nil, err 5649 } 5650 return ret, nil 5651 // { 5652 // "description": "Deletes a database from a Cloud SQL instance.", 5653 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5654 // "httpMethod": "DELETE", 5655 // "id": "sql.databases.delete", 5656 // "parameterOrder": [ 5657 // "project", 5658 // "instance", 5659 // "database" 5660 // ], 5661 // "parameters": { 5662 // "database": { 5663 // "description": "Name of the database to be deleted in the instance.", 5664 // "location": "path", 5665 // "required": true, 5666 // "type": "string" 5667 // }, 5668 // "instance": { 5669 // "description": "Database instance ID. This does not include the project ID.", 5670 // "location": "path", 5671 // "required": true, 5672 // "type": "string" 5673 // }, 5674 // "project": { 5675 // "description": "Project ID of the project that contains the instance.", 5676 // "location": "path", 5677 // "required": true, 5678 // "type": "string" 5679 // } 5680 // }, 5681 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5682 // "response": { 5683 // "$ref": "Operation" 5684 // }, 5685 // "scopes": [ 5686 // "https://www.googleapis.com/auth/cloud-platform", 5687 // "https://www.googleapis.com/auth/sqlservice.admin" 5688 // ] 5689 // } 5690 5691} 5692 5693// method id "sql.databases.get": 5694 5695type DatabasesGetCall struct { 5696 s *Service 5697 project string 5698 instance string 5699 database string 5700 urlParams_ gensupport.URLParams 5701 ifNoneMatch_ string 5702 ctx_ context.Context 5703 header_ http.Header 5704} 5705 5706// Get: Retrieves a resource containing information about a database 5707// inside a Cloud SQL instance. 5708// 5709// - database: Name of the database in the instance. 5710// - instance: Database instance ID. This does not include the project 5711// ID. 5712// - project: Project ID of the project that contains the instance. 5713func (r *DatabasesService) Get(project string, instance string, database string) *DatabasesGetCall { 5714 c := &DatabasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5715 c.project = project 5716 c.instance = instance 5717 c.database = database 5718 return c 5719} 5720 5721// Fields allows partial responses to be retrieved. See 5722// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5723// for more information. 5724func (c *DatabasesGetCall) Fields(s ...googleapi.Field) *DatabasesGetCall { 5725 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5726 return c 5727} 5728 5729// IfNoneMatch sets the optional parameter which makes the operation 5730// fail if the object's ETag matches the given value. This is useful for 5731// getting updates only after the object has changed since the last 5732// request. Use googleapi.IsNotModified to check whether the response 5733// error from Do is the result of In-None-Match. 5734func (c *DatabasesGetCall) IfNoneMatch(entityTag string) *DatabasesGetCall { 5735 c.ifNoneMatch_ = entityTag 5736 return c 5737} 5738 5739// Context sets the context to be used in this call's Do method. Any 5740// pending HTTP request will be aborted if the provided context is 5741// canceled. 5742func (c *DatabasesGetCall) Context(ctx context.Context) *DatabasesGetCall { 5743 c.ctx_ = ctx 5744 return c 5745} 5746 5747// Header returns an http.Header that can be modified by the caller to 5748// add HTTP headers to the request. 5749func (c *DatabasesGetCall) Header() http.Header { 5750 if c.header_ == nil { 5751 c.header_ = make(http.Header) 5752 } 5753 return c.header_ 5754} 5755 5756func (c *DatabasesGetCall) doRequest(alt string) (*http.Response, error) { 5757 reqHeaders := make(http.Header) 5758 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 5759 for k, v := range c.header_ { 5760 reqHeaders[k] = v 5761 } 5762 reqHeaders.Set("User-Agent", c.s.userAgent()) 5763 if c.ifNoneMatch_ != "" { 5764 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5765 } 5766 var body io.Reader = nil 5767 c.urlParams_.Set("alt", alt) 5768 c.urlParams_.Set("prettyPrint", "false") 5769 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 5770 urls += "?" + c.urlParams_.Encode() 5771 req, err := http.NewRequest("GET", urls, body) 5772 if err != nil { 5773 return nil, err 5774 } 5775 req.Header = reqHeaders 5776 googleapi.Expand(req.URL, map[string]string{ 5777 "project": c.project, 5778 "instance": c.instance, 5779 "database": c.database, 5780 }) 5781 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5782} 5783 5784// Do executes the "sql.databases.get" call. 5785// Exactly one of *Database or error will be non-nil. Any non-2xx status 5786// code is an error. Response headers are in either 5787// *Database.ServerResponse.Header or (if a response was returned at 5788// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5789// to check whether the returned error was because 5790// http.StatusNotModified was returned. 5791func (c *DatabasesGetCall) Do(opts ...googleapi.CallOption) (*Database, error) { 5792 gensupport.SetOptions(c.urlParams_, opts...) 5793 res, err := c.doRequest("json") 5794 if res != nil && res.StatusCode == http.StatusNotModified { 5795 if res.Body != nil { 5796 res.Body.Close() 5797 } 5798 return nil, &googleapi.Error{ 5799 Code: res.StatusCode, 5800 Header: res.Header, 5801 } 5802 } 5803 if err != nil { 5804 return nil, err 5805 } 5806 defer googleapi.CloseBody(res) 5807 if err := googleapi.CheckResponse(res); err != nil { 5808 return nil, err 5809 } 5810 ret := &Database{ 5811 ServerResponse: googleapi.ServerResponse{ 5812 Header: res.Header, 5813 HTTPStatusCode: res.StatusCode, 5814 }, 5815 } 5816 target := &ret 5817 if err := gensupport.DecodeResponse(target, res); err != nil { 5818 return nil, err 5819 } 5820 return ret, nil 5821 // { 5822 // "description": "Retrieves a resource containing information about a database inside a Cloud SQL instance.", 5823 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5824 // "httpMethod": "GET", 5825 // "id": "sql.databases.get", 5826 // "parameterOrder": [ 5827 // "project", 5828 // "instance", 5829 // "database" 5830 // ], 5831 // "parameters": { 5832 // "database": { 5833 // "description": "Name of the database in the instance.", 5834 // "location": "path", 5835 // "required": true, 5836 // "type": "string" 5837 // }, 5838 // "instance": { 5839 // "description": "Database instance ID. This does not include the project ID.", 5840 // "location": "path", 5841 // "required": true, 5842 // "type": "string" 5843 // }, 5844 // "project": { 5845 // "description": "Project ID of the project that contains the instance.", 5846 // "location": "path", 5847 // "required": true, 5848 // "type": "string" 5849 // } 5850 // }, 5851 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5852 // "response": { 5853 // "$ref": "Database" 5854 // }, 5855 // "scopes": [ 5856 // "https://www.googleapis.com/auth/cloud-platform", 5857 // "https://www.googleapis.com/auth/sqlservice.admin" 5858 // ] 5859 // } 5860 5861} 5862 5863// method id "sql.databases.insert": 5864 5865type DatabasesInsertCall struct { 5866 s *Service 5867 project string 5868 instance string 5869 database *Database 5870 urlParams_ gensupport.URLParams 5871 ctx_ context.Context 5872 header_ http.Header 5873} 5874 5875// Insert: Inserts a resource containing information about a database 5876// inside a Cloud SQL instance. 5877// 5878// - instance: Database instance ID. This does not include the project 5879// ID. 5880// - project: Project ID of the project that contains the instance. 5881func (r *DatabasesService) Insert(project string, instance string, database *Database) *DatabasesInsertCall { 5882 c := &DatabasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5883 c.project = project 5884 c.instance = instance 5885 c.database = database 5886 return c 5887} 5888 5889// Fields allows partial responses to be retrieved. See 5890// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5891// for more information. 5892func (c *DatabasesInsertCall) Fields(s ...googleapi.Field) *DatabasesInsertCall { 5893 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5894 return c 5895} 5896 5897// Context sets the context to be used in this call's Do method. Any 5898// pending HTTP request will be aborted if the provided context is 5899// canceled. 5900func (c *DatabasesInsertCall) Context(ctx context.Context) *DatabasesInsertCall { 5901 c.ctx_ = ctx 5902 return c 5903} 5904 5905// Header returns an http.Header that can be modified by the caller to 5906// add HTTP headers to the request. 5907func (c *DatabasesInsertCall) Header() http.Header { 5908 if c.header_ == nil { 5909 c.header_ = make(http.Header) 5910 } 5911 return c.header_ 5912} 5913 5914func (c *DatabasesInsertCall) doRequest(alt string) (*http.Response, error) { 5915 reqHeaders := make(http.Header) 5916 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 5917 for k, v := range c.header_ { 5918 reqHeaders[k] = v 5919 } 5920 reqHeaders.Set("User-Agent", c.s.userAgent()) 5921 var body io.Reader = nil 5922 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database) 5923 if err != nil { 5924 return nil, err 5925 } 5926 reqHeaders.Set("Content-Type", "application/json") 5927 c.urlParams_.Set("alt", alt) 5928 c.urlParams_.Set("prettyPrint", "false") 5929 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases") 5930 urls += "?" + c.urlParams_.Encode() 5931 req, err := http.NewRequest("POST", urls, body) 5932 if err != nil { 5933 return nil, err 5934 } 5935 req.Header = reqHeaders 5936 googleapi.Expand(req.URL, map[string]string{ 5937 "project": c.project, 5938 "instance": c.instance, 5939 }) 5940 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5941} 5942 5943// Do executes the "sql.databases.insert" call. 5944// Exactly one of *Operation or error will be non-nil. Any non-2xx 5945// status code is an error. Response headers are in either 5946// *Operation.ServerResponse.Header or (if a response was returned at 5947// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5948// to check whether the returned error was because 5949// http.StatusNotModified was returned. 5950func (c *DatabasesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5951 gensupport.SetOptions(c.urlParams_, opts...) 5952 res, err := c.doRequest("json") 5953 if res != nil && res.StatusCode == http.StatusNotModified { 5954 if res.Body != nil { 5955 res.Body.Close() 5956 } 5957 return nil, &googleapi.Error{ 5958 Code: res.StatusCode, 5959 Header: res.Header, 5960 } 5961 } 5962 if err != nil { 5963 return nil, err 5964 } 5965 defer googleapi.CloseBody(res) 5966 if err := googleapi.CheckResponse(res); err != nil { 5967 return nil, err 5968 } 5969 ret := &Operation{ 5970 ServerResponse: googleapi.ServerResponse{ 5971 Header: res.Header, 5972 HTTPStatusCode: res.StatusCode, 5973 }, 5974 } 5975 target := &ret 5976 if err := gensupport.DecodeResponse(target, res); err != nil { 5977 return nil, err 5978 } 5979 return ret, nil 5980 // { 5981 // "description": "Inserts a resource containing information about a database inside a Cloud SQL instance.", 5982 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 5983 // "httpMethod": "POST", 5984 // "id": "sql.databases.insert", 5985 // "parameterOrder": [ 5986 // "project", 5987 // "instance" 5988 // ], 5989 // "parameters": { 5990 // "instance": { 5991 // "description": "Database instance ID. This does not include the project ID.", 5992 // "location": "path", 5993 // "required": true, 5994 // "type": "string" 5995 // }, 5996 // "project": { 5997 // "description": "Project ID of the project that contains the instance.", 5998 // "location": "path", 5999 // "required": true, 6000 // "type": "string" 6001 // } 6002 // }, 6003 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 6004 // "request": { 6005 // "$ref": "Database" 6006 // }, 6007 // "response": { 6008 // "$ref": "Operation" 6009 // }, 6010 // "scopes": [ 6011 // "https://www.googleapis.com/auth/cloud-platform", 6012 // "https://www.googleapis.com/auth/sqlservice.admin" 6013 // ] 6014 // } 6015 6016} 6017 6018// method id "sql.databases.list": 6019 6020type DatabasesListCall struct { 6021 s *Service 6022 project string 6023 instance string 6024 urlParams_ gensupport.URLParams 6025 ifNoneMatch_ string 6026 ctx_ context.Context 6027 header_ http.Header 6028} 6029 6030// List: Lists databases in the specified Cloud SQL instance. 6031// 6032// - instance: Cloud SQL instance ID. This does not include the project 6033// ID. 6034// - project: Project ID of the project that contains the instance. 6035func (r *DatabasesService) List(project string, instance string) *DatabasesListCall { 6036 c := &DatabasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6037 c.project = project 6038 c.instance = instance 6039 return c 6040} 6041 6042// Fields allows partial responses to be retrieved. See 6043// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6044// for more information. 6045func (c *DatabasesListCall) Fields(s ...googleapi.Field) *DatabasesListCall { 6046 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6047 return c 6048} 6049 6050// IfNoneMatch sets the optional parameter which makes the operation 6051// fail if the object's ETag matches the given value. This is useful for 6052// getting updates only after the object has changed since the last 6053// request. Use googleapi.IsNotModified to check whether the response 6054// error from Do is the result of In-None-Match. 6055func (c *DatabasesListCall) IfNoneMatch(entityTag string) *DatabasesListCall { 6056 c.ifNoneMatch_ = entityTag 6057 return c 6058} 6059 6060// Context sets the context to be used in this call's Do method. Any 6061// pending HTTP request will be aborted if the provided context is 6062// canceled. 6063func (c *DatabasesListCall) Context(ctx context.Context) *DatabasesListCall { 6064 c.ctx_ = ctx 6065 return c 6066} 6067 6068// Header returns an http.Header that can be modified by the caller to 6069// add HTTP headers to the request. 6070func (c *DatabasesListCall) Header() http.Header { 6071 if c.header_ == nil { 6072 c.header_ = make(http.Header) 6073 } 6074 return c.header_ 6075} 6076 6077func (c *DatabasesListCall) doRequest(alt string) (*http.Response, error) { 6078 reqHeaders := make(http.Header) 6079 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 6080 for k, v := range c.header_ { 6081 reqHeaders[k] = v 6082 } 6083 reqHeaders.Set("User-Agent", c.s.userAgent()) 6084 if c.ifNoneMatch_ != "" { 6085 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6086 } 6087 var body io.Reader = nil 6088 c.urlParams_.Set("alt", alt) 6089 c.urlParams_.Set("prettyPrint", "false") 6090 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases") 6091 urls += "?" + c.urlParams_.Encode() 6092 req, err := http.NewRequest("GET", urls, body) 6093 if err != nil { 6094 return nil, err 6095 } 6096 req.Header = reqHeaders 6097 googleapi.Expand(req.URL, map[string]string{ 6098 "project": c.project, 6099 "instance": c.instance, 6100 }) 6101 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6102} 6103 6104// Do executes the "sql.databases.list" call. 6105// Exactly one of *DatabasesListResponse or error will be non-nil. Any 6106// non-2xx status code is an error. Response headers are in either 6107// *DatabasesListResponse.ServerResponse.Header or (if a response was 6108// returned at all) in error.(*googleapi.Error).Header. Use 6109// googleapi.IsNotModified to check whether the returned error was 6110// because http.StatusNotModified was returned. 6111func (c *DatabasesListCall) Do(opts ...googleapi.CallOption) (*DatabasesListResponse, error) { 6112 gensupport.SetOptions(c.urlParams_, opts...) 6113 res, err := c.doRequest("json") 6114 if res != nil && res.StatusCode == http.StatusNotModified { 6115 if res.Body != nil { 6116 res.Body.Close() 6117 } 6118 return nil, &googleapi.Error{ 6119 Code: res.StatusCode, 6120 Header: res.Header, 6121 } 6122 } 6123 if err != nil { 6124 return nil, err 6125 } 6126 defer googleapi.CloseBody(res) 6127 if err := googleapi.CheckResponse(res); err != nil { 6128 return nil, err 6129 } 6130 ret := &DatabasesListResponse{ 6131 ServerResponse: googleapi.ServerResponse{ 6132 Header: res.Header, 6133 HTTPStatusCode: res.StatusCode, 6134 }, 6135 } 6136 target := &ret 6137 if err := gensupport.DecodeResponse(target, res); err != nil { 6138 return nil, err 6139 } 6140 return ret, nil 6141 // { 6142 // "description": "Lists databases in the specified Cloud SQL instance.", 6143 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 6144 // "httpMethod": "GET", 6145 // "id": "sql.databases.list", 6146 // "parameterOrder": [ 6147 // "project", 6148 // "instance" 6149 // ], 6150 // "parameters": { 6151 // "instance": { 6152 // "description": "Cloud SQL instance ID. This does not include the project ID.", 6153 // "location": "path", 6154 // "required": true, 6155 // "type": "string" 6156 // }, 6157 // "project": { 6158 // "description": "Project ID of the project that contains the instance.", 6159 // "location": "path", 6160 // "required": true, 6161 // "type": "string" 6162 // } 6163 // }, 6164 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 6165 // "response": { 6166 // "$ref": "DatabasesListResponse" 6167 // }, 6168 // "scopes": [ 6169 // "https://www.googleapis.com/auth/cloud-platform", 6170 // "https://www.googleapis.com/auth/sqlservice.admin" 6171 // ] 6172 // } 6173 6174} 6175 6176// method id "sql.databases.patch": 6177 6178type DatabasesPatchCall struct { 6179 s *Service 6180 project string 6181 instance string 6182 database string 6183 database2 *Database 6184 urlParams_ gensupport.URLParams 6185 ctx_ context.Context 6186 header_ http.Header 6187} 6188 6189// Patch: Partially updates a resource containing information about a 6190// database inside a Cloud SQL instance. This method supports patch 6191// semantics. 6192// 6193// - database: Name of the database to be updated in the instance. 6194// - instance: Database instance ID. This does not include the project 6195// ID. 6196// - project: Project ID of the project that contains the instance. 6197func (r *DatabasesService) Patch(project string, instance string, database string, database2 *Database) *DatabasesPatchCall { 6198 c := &DatabasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6199 c.project = project 6200 c.instance = instance 6201 c.database = database 6202 c.database2 = database2 6203 return c 6204} 6205 6206// Fields allows partial responses to be retrieved. See 6207// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6208// for more information. 6209func (c *DatabasesPatchCall) Fields(s ...googleapi.Field) *DatabasesPatchCall { 6210 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6211 return c 6212} 6213 6214// Context sets the context to be used in this call's Do method. Any 6215// pending HTTP request will be aborted if the provided context is 6216// canceled. 6217func (c *DatabasesPatchCall) Context(ctx context.Context) *DatabasesPatchCall { 6218 c.ctx_ = ctx 6219 return c 6220} 6221 6222// Header returns an http.Header that can be modified by the caller to 6223// add HTTP headers to the request. 6224func (c *DatabasesPatchCall) Header() http.Header { 6225 if c.header_ == nil { 6226 c.header_ = make(http.Header) 6227 } 6228 return c.header_ 6229} 6230 6231func (c *DatabasesPatchCall) doRequest(alt string) (*http.Response, error) { 6232 reqHeaders := make(http.Header) 6233 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 6234 for k, v := range c.header_ { 6235 reqHeaders[k] = v 6236 } 6237 reqHeaders.Set("User-Agent", c.s.userAgent()) 6238 var body io.Reader = nil 6239 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) 6240 if err != nil { 6241 return nil, err 6242 } 6243 reqHeaders.Set("Content-Type", "application/json") 6244 c.urlParams_.Set("alt", alt) 6245 c.urlParams_.Set("prettyPrint", "false") 6246 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 6247 urls += "?" + c.urlParams_.Encode() 6248 req, err := http.NewRequest("PATCH", urls, body) 6249 if err != nil { 6250 return nil, err 6251 } 6252 req.Header = reqHeaders 6253 googleapi.Expand(req.URL, map[string]string{ 6254 "project": c.project, 6255 "instance": c.instance, 6256 "database": c.database, 6257 }) 6258 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6259} 6260 6261// Do executes the "sql.databases.patch" call. 6262// Exactly one of *Operation or error will be non-nil. Any non-2xx 6263// status code is an error. Response headers are in either 6264// *Operation.ServerResponse.Header or (if a response was returned at 6265// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6266// to check whether the returned error was because 6267// http.StatusNotModified was returned. 6268func (c *DatabasesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6269 gensupport.SetOptions(c.urlParams_, opts...) 6270 res, err := c.doRequest("json") 6271 if res != nil && res.StatusCode == http.StatusNotModified { 6272 if res.Body != nil { 6273 res.Body.Close() 6274 } 6275 return nil, &googleapi.Error{ 6276 Code: res.StatusCode, 6277 Header: res.Header, 6278 } 6279 } 6280 if err != nil { 6281 return nil, err 6282 } 6283 defer googleapi.CloseBody(res) 6284 if err := googleapi.CheckResponse(res); err != nil { 6285 return nil, err 6286 } 6287 ret := &Operation{ 6288 ServerResponse: googleapi.ServerResponse{ 6289 Header: res.Header, 6290 HTTPStatusCode: res.StatusCode, 6291 }, 6292 } 6293 target := &ret 6294 if err := gensupport.DecodeResponse(target, res); err != nil { 6295 return nil, err 6296 } 6297 return ret, nil 6298 // { 6299 // "description": "Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.", 6300 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 6301 // "httpMethod": "PATCH", 6302 // "id": "sql.databases.patch", 6303 // "parameterOrder": [ 6304 // "project", 6305 // "instance", 6306 // "database" 6307 // ], 6308 // "parameters": { 6309 // "database": { 6310 // "description": "Name of the database to be updated in the instance.", 6311 // "location": "path", 6312 // "required": true, 6313 // "type": "string" 6314 // }, 6315 // "instance": { 6316 // "description": "Database instance ID. This does not include the project ID.", 6317 // "location": "path", 6318 // "required": true, 6319 // "type": "string" 6320 // }, 6321 // "project": { 6322 // "description": "Project ID of the project that contains the instance.", 6323 // "location": "path", 6324 // "required": true, 6325 // "type": "string" 6326 // } 6327 // }, 6328 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 6329 // "request": { 6330 // "$ref": "Database" 6331 // }, 6332 // "response": { 6333 // "$ref": "Operation" 6334 // }, 6335 // "scopes": [ 6336 // "https://www.googleapis.com/auth/cloud-platform", 6337 // "https://www.googleapis.com/auth/sqlservice.admin" 6338 // ] 6339 // } 6340 6341} 6342 6343// method id "sql.databases.update": 6344 6345type DatabasesUpdateCall struct { 6346 s *Service 6347 project string 6348 instance string 6349 database string 6350 database2 *Database 6351 urlParams_ gensupport.URLParams 6352 ctx_ context.Context 6353 header_ http.Header 6354} 6355 6356// Update: Updates a resource containing information about a database 6357// inside a Cloud SQL instance. 6358// 6359// - database: Name of the database to be updated in the instance. 6360// - instance: Database instance ID. This does not include the project 6361// ID. 6362// - project: Project ID of the project that contains the instance. 6363func (r *DatabasesService) Update(project string, instance string, database string, database2 *Database) *DatabasesUpdateCall { 6364 c := &DatabasesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6365 c.project = project 6366 c.instance = instance 6367 c.database = database 6368 c.database2 = database2 6369 return c 6370} 6371 6372// Fields allows partial responses to be retrieved. See 6373// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6374// for more information. 6375func (c *DatabasesUpdateCall) Fields(s ...googleapi.Field) *DatabasesUpdateCall { 6376 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6377 return c 6378} 6379 6380// Context sets the context to be used in this call's Do method. Any 6381// pending HTTP request will be aborted if the provided context is 6382// canceled. 6383func (c *DatabasesUpdateCall) Context(ctx context.Context) *DatabasesUpdateCall { 6384 c.ctx_ = ctx 6385 return c 6386} 6387 6388// Header returns an http.Header that can be modified by the caller to 6389// add HTTP headers to the request. 6390func (c *DatabasesUpdateCall) Header() http.Header { 6391 if c.header_ == nil { 6392 c.header_ = make(http.Header) 6393 } 6394 return c.header_ 6395} 6396 6397func (c *DatabasesUpdateCall) doRequest(alt string) (*http.Response, error) { 6398 reqHeaders := make(http.Header) 6399 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 6400 for k, v := range c.header_ { 6401 reqHeaders[k] = v 6402 } 6403 reqHeaders.Set("User-Agent", c.s.userAgent()) 6404 var body io.Reader = nil 6405 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) 6406 if err != nil { 6407 return nil, err 6408 } 6409 reqHeaders.Set("Content-Type", "application/json") 6410 c.urlParams_.Set("alt", alt) 6411 c.urlParams_.Set("prettyPrint", "false") 6412 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 6413 urls += "?" + c.urlParams_.Encode() 6414 req, err := http.NewRequest("PUT", urls, body) 6415 if err != nil { 6416 return nil, err 6417 } 6418 req.Header = reqHeaders 6419 googleapi.Expand(req.URL, map[string]string{ 6420 "project": c.project, 6421 "instance": c.instance, 6422 "database": c.database, 6423 }) 6424 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6425} 6426 6427// Do executes the "sql.databases.update" call. 6428// Exactly one of *Operation or error will be non-nil. Any non-2xx 6429// status code is an error. Response headers are in either 6430// *Operation.ServerResponse.Header or (if a response was returned at 6431// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6432// to check whether the returned error was because 6433// http.StatusNotModified was returned. 6434func (c *DatabasesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6435 gensupport.SetOptions(c.urlParams_, opts...) 6436 res, err := c.doRequest("json") 6437 if res != nil && res.StatusCode == http.StatusNotModified { 6438 if res.Body != nil { 6439 res.Body.Close() 6440 } 6441 return nil, &googleapi.Error{ 6442 Code: res.StatusCode, 6443 Header: res.Header, 6444 } 6445 } 6446 if err != nil { 6447 return nil, err 6448 } 6449 defer googleapi.CloseBody(res) 6450 if err := googleapi.CheckResponse(res); err != nil { 6451 return nil, err 6452 } 6453 ret := &Operation{ 6454 ServerResponse: googleapi.ServerResponse{ 6455 Header: res.Header, 6456 HTTPStatusCode: res.StatusCode, 6457 }, 6458 } 6459 target := &ret 6460 if err := gensupport.DecodeResponse(target, res); err != nil { 6461 return nil, err 6462 } 6463 return ret, nil 6464 // { 6465 // "description": "Updates a resource containing information about a database inside a Cloud SQL instance.", 6466 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 6467 // "httpMethod": "PUT", 6468 // "id": "sql.databases.update", 6469 // "parameterOrder": [ 6470 // "project", 6471 // "instance", 6472 // "database" 6473 // ], 6474 // "parameters": { 6475 // "database": { 6476 // "description": "Name of the database to be updated in the instance.", 6477 // "location": "path", 6478 // "required": true, 6479 // "type": "string" 6480 // }, 6481 // "instance": { 6482 // "description": "Database instance ID. This does not include the project ID.", 6483 // "location": "path", 6484 // "required": true, 6485 // "type": "string" 6486 // }, 6487 // "project": { 6488 // "description": "Project ID of the project that contains the instance.", 6489 // "location": "path", 6490 // "required": true, 6491 // "type": "string" 6492 // } 6493 // }, 6494 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 6495 // "request": { 6496 // "$ref": "Database" 6497 // }, 6498 // "response": { 6499 // "$ref": "Operation" 6500 // }, 6501 // "scopes": [ 6502 // "https://www.googleapis.com/auth/cloud-platform", 6503 // "https://www.googleapis.com/auth/sqlservice.admin" 6504 // ] 6505 // } 6506 6507} 6508 6509// method id "sql.flags.list": 6510 6511type FlagsListCall struct { 6512 s *Service 6513 urlParams_ gensupport.URLParams 6514 ifNoneMatch_ string 6515 ctx_ context.Context 6516 header_ http.Header 6517} 6518 6519// List: Lists all available database flags for Cloud SQL instances. 6520func (r *FlagsService) List() *FlagsListCall { 6521 c := &FlagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6522 return c 6523} 6524 6525// DatabaseVersion sets the optional parameter "databaseVersion": 6526// Database type and version you want to retrieve flags for. By default, 6527// this method returns flags for all database types and versions. 6528func (c *FlagsListCall) DatabaseVersion(databaseVersion string) *FlagsListCall { 6529 c.urlParams_.Set("databaseVersion", databaseVersion) 6530 return c 6531} 6532 6533// Fields allows partial responses to be retrieved. See 6534// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6535// for more information. 6536func (c *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall { 6537 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6538 return c 6539} 6540 6541// IfNoneMatch sets the optional parameter which makes the operation 6542// fail if the object's ETag matches the given value. This is useful for 6543// getting updates only after the object has changed since the last 6544// request. Use googleapi.IsNotModified to check whether the response 6545// error from Do is the result of In-None-Match. 6546func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall { 6547 c.ifNoneMatch_ = entityTag 6548 return c 6549} 6550 6551// Context sets the context to be used in this call's Do method. Any 6552// pending HTTP request will be aborted if the provided context is 6553// canceled. 6554func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall { 6555 c.ctx_ = ctx 6556 return c 6557} 6558 6559// Header returns an http.Header that can be modified by the caller to 6560// add HTTP headers to the request. 6561func (c *FlagsListCall) Header() http.Header { 6562 if c.header_ == nil { 6563 c.header_ = make(http.Header) 6564 } 6565 return c.header_ 6566} 6567 6568func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) { 6569 reqHeaders := make(http.Header) 6570 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 6571 for k, v := range c.header_ { 6572 reqHeaders[k] = v 6573 } 6574 reqHeaders.Set("User-Agent", c.s.userAgent()) 6575 if c.ifNoneMatch_ != "" { 6576 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6577 } 6578 var body io.Reader = nil 6579 c.urlParams_.Set("alt", alt) 6580 c.urlParams_.Set("prettyPrint", "false") 6581 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/flags") 6582 urls += "?" + c.urlParams_.Encode() 6583 req, err := http.NewRequest("GET", urls, body) 6584 if err != nil { 6585 return nil, err 6586 } 6587 req.Header = reqHeaders 6588 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6589} 6590 6591// Do executes the "sql.flags.list" call. 6592// Exactly one of *FlagsListResponse or error will be non-nil. Any 6593// non-2xx status code is an error. Response headers are in either 6594// *FlagsListResponse.ServerResponse.Header or (if a response was 6595// returned at all) in error.(*googleapi.Error).Header. Use 6596// googleapi.IsNotModified to check whether the returned error was 6597// because http.StatusNotModified was returned. 6598func (c *FlagsListCall) Do(opts ...googleapi.CallOption) (*FlagsListResponse, error) { 6599 gensupport.SetOptions(c.urlParams_, opts...) 6600 res, err := c.doRequest("json") 6601 if res != nil && res.StatusCode == http.StatusNotModified { 6602 if res.Body != nil { 6603 res.Body.Close() 6604 } 6605 return nil, &googleapi.Error{ 6606 Code: res.StatusCode, 6607 Header: res.Header, 6608 } 6609 } 6610 if err != nil { 6611 return nil, err 6612 } 6613 defer googleapi.CloseBody(res) 6614 if err := googleapi.CheckResponse(res); err != nil { 6615 return nil, err 6616 } 6617 ret := &FlagsListResponse{ 6618 ServerResponse: googleapi.ServerResponse{ 6619 Header: res.Header, 6620 HTTPStatusCode: res.StatusCode, 6621 }, 6622 } 6623 target := &ret 6624 if err := gensupport.DecodeResponse(target, res); err != nil { 6625 return nil, err 6626 } 6627 return ret, nil 6628 // { 6629 // "description": "Lists all available database flags for Cloud SQL instances.", 6630 // "flatPath": "sql/v1beta4/flags", 6631 // "httpMethod": "GET", 6632 // "id": "sql.flags.list", 6633 // "parameterOrder": [], 6634 // "parameters": { 6635 // "databaseVersion": { 6636 // "description": "Database type and version you want to retrieve flags for. By default, this method returns flags for all database types and versions.", 6637 // "location": "query", 6638 // "type": "string" 6639 // } 6640 // }, 6641 // "path": "sql/v1beta4/flags", 6642 // "response": { 6643 // "$ref": "FlagsListResponse" 6644 // }, 6645 // "scopes": [ 6646 // "https://www.googleapis.com/auth/cloud-platform", 6647 // "https://www.googleapis.com/auth/sqlservice.admin" 6648 // ] 6649 // } 6650 6651} 6652 6653// method id "sql.instances.addServerCa": 6654 6655type InstancesAddServerCaCall struct { 6656 s *Service 6657 project string 6658 instance string 6659 urlParams_ gensupport.URLParams 6660 ctx_ context.Context 6661 header_ http.Header 6662} 6663 6664// AddServerCa: Add a new trusted Certificate Authority (CA) version for 6665// the specified instance. Required to prepare for a certificate 6666// rotation. If a CA version was previously added but never used in a 6667// certificate rotation, this operation replaces that version. There 6668// cannot be more than one CA version waiting to be rotated in. 6669// 6670// - instance: Cloud SQL instance ID. This does not include the project 6671// ID. 6672// - project: Project ID of the project that contains the instance. 6673func (r *InstancesService) AddServerCa(project string, instance string) *InstancesAddServerCaCall { 6674 c := &InstancesAddServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6675 c.project = project 6676 c.instance = instance 6677 return c 6678} 6679 6680// Fields allows partial responses to be retrieved. See 6681// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6682// for more information. 6683func (c *InstancesAddServerCaCall) Fields(s ...googleapi.Field) *InstancesAddServerCaCall { 6684 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6685 return c 6686} 6687 6688// Context sets the context to be used in this call's Do method. Any 6689// pending HTTP request will be aborted if the provided context is 6690// canceled. 6691func (c *InstancesAddServerCaCall) Context(ctx context.Context) *InstancesAddServerCaCall { 6692 c.ctx_ = ctx 6693 return c 6694} 6695 6696// Header returns an http.Header that can be modified by the caller to 6697// add HTTP headers to the request. 6698func (c *InstancesAddServerCaCall) Header() http.Header { 6699 if c.header_ == nil { 6700 c.header_ = make(http.Header) 6701 } 6702 return c.header_ 6703} 6704 6705func (c *InstancesAddServerCaCall) doRequest(alt string) (*http.Response, error) { 6706 reqHeaders := make(http.Header) 6707 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 6708 for k, v := range c.header_ { 6709 reqHeaders[k] = v 6710 } 6711 reqHeaders.Set("User-Agent", c.s.userAgent()) 6712 var body io.Reader = nil 6713 c.urlParams_.Set("alt", alt) 6714 c.urlParams_.Set("prettyPrint", "false") 6715 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa") 6716 urls += "?" + c.urlParams_.Encode() 6717 req, err := http.NewRequest("POST", urls, body) 6718 if err != nil { 6719 return nil, err 6720 } 6721 req.Header = reqHeaders 6722 googleapi.Expand(req.URL, map[string]string{ 6723 "project": c.project, 6724 "instance": c.instance, 6725 }) 6726 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6727} 6728 6729// Do executes the "sql.instances.addServerCa" call. 6730// Exactly one of *Operation or error will be non-nil. Any non-2xx 6731// status code is an error. Response headers are in either 6732// *Operation.ServerResponse.Header or (if a response was returned at 6733// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6734// to check whether the returned error was because 6735// http.StatusNotModified was returned. 6736func (c *InstancesAddServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6737 gensupport.SetOptions(c.urlParams_, opts...) 6738 res, err := c.doRequest("json") 6739 if res != nil && res.StatusCode == http.StatusNotModified { 6740 if res.Body != nil { 6741 res.Body.Close() 6742 } 6743 return nil, &googleapi.Error{ 6744 Code: res.StatusCode, 6745 Header: res.Header, 6746 } 6747 } 6748 if err != nil { 6749 return nil, err 6750 } 6751 defer googleapi.CloseBody(res) 6752 if err := googleapi.CheckResponse(res); err != nil { 6753 return nil, err 6754 } 6755 ret := &Operation{ 6756 ServerResponse: googleapi.ServerResponse{ 6757 Header: res.Header, 6758 HTTPStatusCode: res.StatusCode, 6759 }, 6760 } 6761 target := &ret 6762 if err := gensupport.DecodeResponse(target, res); err != nil { 6763 return nil, err 6764 } 6765 return ret, nil 6766 // { 6767 // "description": "Add a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in.", 6768 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa", 6769 // "httpMethod": "POST", 6770 // "id": "sql.instances.addServerCa", 6771 // "parameterOrder": [ 6772 // "project", 6773 // "instance" 6774 // ], 6775 // "parameters": { 6776 // "instance": { 6777 // "description": "Cloud SQL instance ID. This does not include the project ID.", 6778 // "location": "path", 6779 // "required": true, 6780 // "type": "string" 6781 // }, 6782 // "project": { 6783 // "description": "Project ID of the project that contains the instance.", 6784 // "location": "path", 6785 // "required": true, 6786 // "type": "string" 6787 // } 6788 // }, 6789 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa", 6790 // "response": { 6791 // "$ref": "Operation" 6792 // }, 6793 // "scopes": [ 6794 // "https://www.googleapis.com/auth/cloud-platform", 6795 // "https://www.googleapis.com/auth/sqlservice.admin" 6796 // ] 6797 // } 6798 6799} 6800 6801// method id "sql.instances.clone": 6802 6803type InstancesCloneCall struct { 6804 s *Service 6805 project string 6806 instance string 6807 instancesclonerequest *InstancesCloneRequest 6808 urlParams_ gensupport.URLParams 6809 ctx_ context.Context 6810 header_ http.Header 6811} 6812 6813// Clone: Creates a Cloud SQL instance as a clone of the source 6814// instance. Using this operation might cause your instance to restart. 6815// 6816// - instance: The ID of the Cloud SQL instance to be cloned (source). 6817// This does not include the project ID. 6818// - project: Project ID of the source as well as the clone Cloud SQL 6819// instance. 6820func (r *InstancesService) Clone(project string, instance string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall { 6821 c := &InstancesCloneCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6822 c.project = project 6823 c.instance = instance 6824 c.instancesclonerequest = instancesclonerequest 6825 return c 6826} 6827 6828// Fields allows partial responses to be retrieved. See 6829// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6830// for more information. 6831func (c *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall { 6832 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6833 return c 6834} 6835 6836// Context sets the context to be used in this call's Do method. Any 6837// pending HTTP request will be aborted if the provided context is 6838// canceled. 6839func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall { 6840 c.ctx_ = ctx 6841 return c 6842} 6843 6844// Header returns an http.Header that can be modified by the caller to 6845// add HTTP headers to the request. 6846func (c *InstancesCloneCall) Header() http.Header { 6847 if c.header_ == nil { 6848 c.header_ = make(http.Header) 6849 } 6850 return c.header_ 6851} 6852 6853func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, error) { 6854 reqHeaders := make(http.Header) 6855 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 6856 for k, v := range c.header_ { 6857 reqHeaders[k] = v 6858 } 6859 reqHeaders.Set("User-Agent", c.s.userAgent()) 6860 var body io.Reader = nil 6861 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest) 6862 if err != nil { 6863 return nil, err 6864 } 6865 reqHeaders.Set("Content-Type", "application/json") 6866 c.urlParams_.Set("alt", alt) 6867 c.urlParams_.Set("prettyPrint", "false") 6868 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/clone") 6869 urls += "?" + c.urlParams_.Encode() 6870 req, err := http.NewRequest("POST", urls, body) 6871 if err != nil { 6872 return nil, err 6873 } 6874 req.Header = reqHeaders 6875 googleapi.Expand(req.URL, map[string]string{ 6876 "project": c.project, 6877 "instance": c.instance, 6878 }) 6879 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6880} 6881 6882// Do executes the "sql.instances.clone" call. 6883// Exactly one of *Operation or error will be non-nil. Any non-2xx 6884// status code is an error. Response headers are in either 6885// *Operation.ServerResponse.Header or (if a response was returned at 6886// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6887// to check whether the returned error was because 6888// http.StatusNotModified was returned. 6889func (c *InstancesCloneCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6890 gensupport.SetOptions(c.urlParams_, opts...) 6891 res, err := c.doRequest("json") 6892 if res != nil && res.StatusCode == http.StatusNotModified { 6893 if res.Body != nil { 6894 res.Body.Close() 6895 } 6896 return nil, &googleapi.Error{ 6897 Code: res.StatusCode, 6898 Header: res.Header, 6899 } 6900 } 6901 if err != nil { 6902 return nil, err 6903 } 6904 defer googleapi.CloseBody(res) 6905 if err := googleapi.CheckResponse(res); err != nil { 6906 return nil, err 6907 } 6908 ret := &Operation{ 6909 ServerResponse: googleapi.ServerResponse{ 6910 Header: res.Header, 6911 HTTPStatusCode: res.StatusCode, 6912 }, 6913 } 6914 target := &ret 6915 if err := gensupport.DecodeResponse(target, res); err != nil { 6916 return nil, err 6917 } 6918 return ret, nil 6919 // { 6920 // "description": "Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.", 6921 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/clone", 6922 // "httpMethod": "POST", 6923 // "id": "sql.instances.clone", 6924 // "parameterOrder": [ 6925 // "project", 6926 // "instance" 6927 // ], 6928 // "parameters": { 6929 // "instance": { 6930 // "description": "The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID.", 6931 // "location": "path", 6932 // "required": true, 6933 // "type": "string" 6934 // }, 6935 // "project": { 6936 // "description": "Project ID of the source as well as the clone Cloud SQL instance.", 6937 // "location": "path", 6938 // "required": true, 6939 // "type": "string" 6940 // } 6941 // }, 6942 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/clone", 6943 // "request": { 6944 // "$ref": "InstancesCloneRequest" 6945 // }, 6946 // "response": { 6947 // "$ref": "Operation" 6948 // }, 6949 // "scopes": [ 6950 // "https://www.googleapis.com/auth/cloud-platform", 6951 // "https://www.googleapis.com/auth/sqlservice.admin" 6952 // ] 6953 // } 6954 6955} 6956 6957// method id "sql.instances.delete": 6958 6959type InstancesDeleteCall struct { 6960 s *Service 6961 project string 6962 instance string 6963 urlParams_ gensupport.URLParams 6964 ctx_ context.Context 6965 header_ http.Header 6966} 6967 6968// Delete: Deletes a Cloud SQL instance. 6969// 6970// - instance: Cloud SQL instance ID. This does not include the project 6971// ID. 6972// - project: Project ID of the project that contains the instance to be 6973// deleted. 6974func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall { 6975 c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6976 c.project = project 6977 c.instance = instance 6978 return c 6979} 6980 6981// Fields allows partial responses to be retrieved. See 6982// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6983// for more information. 6984func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall { 6985 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6986 return c 6987} 6988 6989// Context sets the context to be used in this call's Do method. Any 6990// pending HTTP request will be aborted if the provided context is 6991// canceled. 6992func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall { 6993 c.ctx_ = ctx 6994 return c 6995} 6996 6997// Header returns an http.Header that can be modified by the caller to 6998// add HTTP headers to the request. 6999func (c *InstancesDeleteCall) Header() http.Header { 7000 if c.header_ == nil { 7001 c.header_ = make(http.Header) 7002 } 7003 return c.header_ 7004} 7005 7006func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { 7007 reqHeaders := make(http.Header) 7008 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 7009 for k, v := range c.header_ { 7010 reqHeaders[k] = v 7011 } 7012 reqHeaders.Set("User-Agent", c.s.userAgent()) 7013 var body io.Reader = nil 7014 c.urlParams_.Set("alt", alt) 7015 c.urlParams_.Set("prettyPrint", "false") 7016 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 7017 urls += "?" + c.urlParams_.Encode() 7018 req, err := http.NewRequest("DELETE", urls, body) 7019 if err != nil { 7020 return nil, err 7021 } 7022 req.Header = reqHeaders 7023 googleapi.Expand(req.URL, map[string]string{ 7024 "project": c.project, 7025 "instance": c.instance, 7026 }) 7027 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7028} 7029 7030// Do executes the "sql.instances.delete" call. 7031// Exactly one of *Operation or error will be non-nil. Any non-2xx 7032// status code is an error. Response headers are in either 7033// *Operation.ServerResponse.Header or (if a response was returned at 7034// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7035// to check whether the returned error was because 7036// http.StatusNotModified was returned. 7037func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7038 gensupport.SetOptions(c.urlParams_, opts...) 7039 res, err := c.doRequest("json") 7040 if res != nil && res.StatusCode == http.StatusNotModified { 7041 if res.Body != nil { 7042 res.Body.Close() 7043 } 7044 return nil, &googleapi.Error{ 7045 Code: res.StatusCode, 7046 Header: res.Header, 7047 } 7048 } 7049 if err != nil { 7050 return nil, err 7051 } 7052 defer googleapi.CloseBody(res) 7053 if err := googleapi.CheckResponse(res); err != nil { 7054 return nil, err 7055 } 7056 ret := &Operation{ 7057 ServerResponse: googleapi.ServerResponse{ 7058 Header: res.Header, 7059 HTTPStatusCode: res.StatusCode, 7060 }, 7061 } 7062 target := &ret 7063 if err := gensupport.DecodeResponse(target, res); err != nil { 7064 return nil, err 7065 } 7066 return ret, nil 7067 // { 7068 // "description": "Deletes a Cloud SQL instance.", 7069 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 7070 // "httpMethod": "DELETE", 7071 // "id": "sql.instances.delete", 7072 // "parameterOrder": [ 7073 // "project", 7074 // "instance" 7075 // ], 7076 // "parameters": { 7077 // "instance": { 7078 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7079 // "location": "path", 7080 // "required": true, 7081 // "type": "string" 7082 // }, 7083 // "project": { 7084 // "description": "Project ID of the project that contains the instance to be deleted.", 7085 // "location": "path", 7086 // "required": true, 7087 // "type": "string" 7088 // } 7089 // }, 7090 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 7091 // "response": { 7092 // "$ref": "Operation" 7093 // }, 7094 // "scopes": [ 7095 // "https://www.googleapis.com/auth/cloud-platform", 7096 // "https://www.googleapis.com/auth/sqlservice.admin" 7097 // ] 7098 // } 7099 7100} 7101 7102// method id "sql.instances.demoteMaster": 7103 7104type InstancesDemoteMasterCall struct { 7105 s *Service 7106 project string 7107 instance string 7108 instancesdemotemasterrequest *InstancesDemoteMasterRequest 7109 urlParams_ gensupport.URLParams 7110 ctx_ context.Context 7111 header_ http.Header 7112} 7113 7114// DemoteMaster: Demotes the stand-alone instance to be a Cloud SQL read 7115// replica for an external database server. 7116// 7117// - instance: Cloud SQL instance name. 7118// - project: ID of the project that contains the instance. 7119func (r *InstancesService) DemoteMaster(project string, instance string, instancesdemotemasterrequest *InstancesDemoteMasterRequest) *InstancesDemoteMasterCall { 7120 c := &InstancesDemoteMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7121 c.project = project 7122 c.instance = instance 7123 c.instancesdemotemasterrequest = instancesdemotemasterrequest 7124 return c 7125} 7126 7127// Fields allows partial responses to be retrieved. See 7128// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7129// for more information. 7130func (c *InstancesDemoteMasterCall) Fields(s ...googleapi.Field) *InstancesDemoteMasterCall { 7131 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7132 return c 7133} 7134 7135// Context sets the context to be used in this call's Do method. Any 7136// pending HTTP request will be aborted if the provided context is 7137// canceled. 7138func (c *InstancesDemoteMasterCall) Context(ctx context.Context) *InstancesDemoteMasterCall { 7139 c.ctx_ = ctx 7140 return c 7141} 7142 7143// Header returns an http.Header that can be modified by the caller to 7144// add HTTP headers to the request. 7145func (c *InstancesDemoteMasterCall) Header() http.Header { 7146 if c.header_ == nil { 7147 c.header_ = make(http.Header) 7148 } 7149 return c.header_ 7150} 7151 7152func (c *InstancesDemoteMasterCall) doRequest(alt string) (*http.Response, error) { 7153 reqHeaders := make(http.Header) 7154 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 7155 for k, v := range c.header_ { 7156 reqHeaders[k] = v 7157 } 7158 reqHeaders.Set("User-Agent", c.s.userAgent()) 7159 var body io.Reader = nil 7160 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesdemotemasterrequest) 7161 if err != nil { 7162 return nil, err 7163 } 7164 reqHeaders.Set("Content-Type", "application/json") 7165 c.urlParams_.Set("alt", alt) 7166 c.urlParams_.Set("prettyPrint", "false") 7167 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster") 7168 urls += "?" + c.urlParams_.Encode() 7169 req, err := http.NewRequest("POST", urls, body) 7170 if err != nil { 7171 return nil, err 7172 } 7173 req.Header = reqHeaders 7174 googleapi.Expand(req.URL, map[string]string{ 7175 "project": c.project, 7176 "instance": c.instance, 7177 }) 7178 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7179} 7180 7181// Do executes the "sql.instances.demoteMaster" call. 7182// Exactly one of *Operation or error will be non-nil. Any non-2xx 7183// status code is an error. Response headers are in either 7184// *Operation.ServerResponse.Header or (if a response was returned at 7185// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7186// to check whether the returned error was because 7187// http.StatusNotModified was returned. 7188func (c *InstancesDemoteMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7189 gensupport.SetOptions(c.urlParams_, opts...) 7190 res, err := c.doRequest("json") 7191 if res != nil && res.StatusCode == http.StatusNotModified { 7192 if res.Body != nil { 7193 res.Body.Close() 7194 } 7195 return nil, &googleapi.Error{ 7196 Code: res.StatusCode, 7197 Header: res.Header, 7198 } 7199 } 7200 if err != nil { 7201 return nil, err 7202 } 7203 defer googleapi.CloseBody(res) 7204 if err := googleapi.CheckResponse(res); err != nil { 7205 return nil, err 7206 } 7207 ret := &Operation{ 7208 ServerResponse: googleapi.ServerResponse{ 7209 Header: res.Header, 7210 HTTPStatusCode: res.StatusCode, 7211 }, 7212 } 7213 target := &ret 7214 if err := gensupport.DecodeResponse(target, res); err != nil { 7215 return nil, err 7216 } 7217 return ret, nil 7218 // { 7219 // "description": "Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.", 7220 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster", 7221 // "httpMethod": "POST", 7222 // "id": "sql.instances.demoteMaster", 7223 // "parameterOrder": [ 7224 // "project", 7225 // "instance" 7226 // ], 7227 // "parameters": { 7228 // "instance": { 7229 // "description": "Cloud SQL instance name.", 7230 // "location": "path", 7231 // "required": true, 7232 // "type": "string" 7233 // }, 7234 // "project": { 7235 // "description": "ID of the project that contains the instance.", 7236 // "location": "path", 7237 // "required": true, 7238 // "type": "string" 7239 // } 7240 // }, 7241 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster", 7242 // "request": { 7243 // "$ref": "InstancesDemoteMasterRequest" 7244 // }, 7245 // "response": { 7246 // "$ref": "Operation" 7247 // }, 7248 // "scopes": [ 7249 // "https://www.googleapis.com/auth/cloud-platform", 7250 // "https://www.googleapis.com/auth/sqlservice.admin" 7251 // ] 7252 // } 7253 7254} 7255 7256// method id "sql.instances.export": 7257 7258type InstancesExportCall struct { 7259 s *Service 7260 project string 7261 instance string 7262 instancesexportrequest *InstancesExportRequest 7263 urlParams_ gensupport.URLParams 7264 ctx_ context.Context 7265 header_ http.Header 7266} 7267 7268// Export: Exports data from a Cloud SQL instance to a Cloud Storage 7269// bucket as a SQL dump or CSV file. 7270// 7271// - instance: Cloud SQL instance ID. This does not include the project 7272// ID. 7273// - project: Project ID of the project that contains the instance to be 7274// exported. 7275func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall { 7276 c := &InstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7277 c.project = project 7278 c.instance = instance 7279 c.instancesexportrequest = instancesexportrequest 7280 return c 7281} 7282 7283// Fields allows partial responses to be retrieved. See 7284// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7285// for more information. 7286func (c *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall { 7287 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7288 return c 7289} 7290 7291// Context sets the context to be used in this call's Do method. Any 7292// pending HTTP request will be aborted if the provided context is 7293// canceled. 7294func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall { 7295 c.ctx_ = ctx 7296 return c 7297} 7298 7299// Header returns an http.Header that can be modified by the caller to 7300// add HTTP headers to the request. 7301func (c *InstancesExportCall) Header() http.Header { 7302 if c.header_ == nil { 7303 c.header_ = make(http.Header) 7304 } 7305 return c.header_ 7306} 7307 7308func (c *InstancesExportCall) doRequest(alt string) (*http.Response, error) { 7309 reqHeaders := make(http.Header) 7310 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 7311 for k, v := range c.header_ { 7312 reqHeaders[k] = v 7313 } 7314 reqHeaders.Set("User-Agent", c.s.userAgent()) 7315 var body io.Reader = nil 7316 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest) 7317 if err != nil { 7318 return nil, err 7319 } 7320 reqHeaders.Set("Content-Type", "application/json") 7321 c.urlParams_.Set("alt", alt) 7322 c.urlParams_.Set("prettyPrint", "false") 7323 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/export") 7324 urls += "?" + c.urlParams_.Encode() 7325 req, err := http.NewRequest("POST", urls, body) 7326 if err != nil { 7327 return nil, err 7328 } 7329 req.Header = reqHeaders 7330 googleapi.Expand(req.URL, map[string]string{ 7331 "project": c.project, 7332 "instance": c.instance, 7333 }) 7334 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7335} 7336 7337// Do executes the "sql.instances.export" call. 7338// Exactly one of *Operation or error will be non-nil. Any non-2xx 7339// status code is an error. Response headers are in either 7340// *Operation.ServerResponse.Header or (if a response was returned at 7341// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7342// to check whether the returned error was because 7343// http.StatusNotModified was returned. 7344func (c *InstancesExportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7345 gensupport.SetOptions(c.urlParams_, opts...) 7346 res, err := c.doRequest("json") 7347 if res != nil && res.StatusCode == http.StatusNotModified { 7348 if res.Body != nil { 7349 res.Body.Close() 7350 } 7351 return nil, &googleapi.Error{ 7352 Code: res.StatusCode, 7353 Header: res.Header, 7354 } 7355 } 7356 if err != nil { 7357 return nil, err 7358 } 7359 defer googleapi.CloseBody(res) 7360 if err := googleapi.CheckResponse(res); err != nil { 7361 return nil, err 7362 } 7363 ret := &Operation{ 7364 ServerResponse: googleapi.ServerResponse{ 7365 Header: res.Header, 7366 HTTPStatusCode: res.StatusCode, 7367 }, 7368 } 7369 target := &ret 7370 if err := gensupport.DecodeResponse(target, res); err != nil { 7371 return nil, err 7372 } 7373 return ret, nil 7374 // { 7375 // "description": "Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.", 7376 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/export", 7377 // "httpMethod": "POST", 7378 // "id": "sql.instances.export", 7379 // "parameterOrder": [ 7380 // "project", 7381 // "instance" 7382 // ], 7383 // "parameters": { 7384 // "instance": { 7385 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7386 // "location": "path", 7387 // "required": true, 7388 // "type": "string" 7389 // }, 7390 // "project": { 7391 // "description": "Project ID of the project that contains the instance to be exported.", 7392 // "location": "path", 7393 // "required": true, 7394 // "type": "string" 7395 // } 7396 // }, 7397 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/export", 7398 // "request": { 7399 // "$ref": "InstancesExportRequest" 7400 // }, 7401 // "response": { 7402 // "$ref": "Operation" 7403 // }, 7404 // "scopes": [ 7405 // "https://www.googleapis.com/auth/cloud-platform" 7406 // ] 7407 // } 7408 7409} 7410 7411// method id "sql.instances.failover": 7412 7413type InstancesFailoverCall struct { 7414 s *Service 7415 project string 7416 instance string 7417 instancesfailoverrequest *InstancesFailoverRequest 7418 urlParams_ gensupport.URLParams 7419 ctx_ context.Context 7420 header_ http.Header 7421} 7422 7423// Failover: Initiates a manual failover of a high availability (HA) 7424// primary instance to a standby instance, which becomes the primary 7425// instance. Users are then rerouted to the new primary. For more 7426// information, see the Overview of high availability 7427// (https://cloud.google.com/sql/docs/mysql/high-availability) page in 7428// the Cloud SQL documentation. If using Legacy HA (MySQL only), this 7429// causes the instance to failover to its failover replica instance. 7430// 7431// - instance: Cloud SQL instance ID. This does not include the project 7432// ID. 7433// - project: ID of the project that contains the read replica. 7434func (r *InstancesService) Failover(project string, instance string, instancesfailoverrequest *InstancesFailoverRequest) *InstancesFailoverCall { 7435 c := &InstancesFailoverCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7436 c.project = project 7437 c.instance = instance 7438 c.instancesfailoverrequest = instancesfailoverrequest 7439 return c 7440} 7441 7442// Fields allows partial responses to be retrieved. See 7443// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7444// for more information. 7445func (c *InstancesFailoverCall) Fields(s ...googleapi.Field) *InstancesFailoverCall { 7446 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7447 return c 7448} 7449 7450// Context sets the context to be used in this call's Do method. Any 7451// pending HTTP request will be aborted if the provided context is 7452// canceled. 7453func (c *InstancesFailoverCall) Context(ctx context.Context) *InstancesFailoverCall { 7454 c.ctx_ = ctx 7455 return c 7456} 7457 7458// Header returns an http.Header that can be modified by the caller to 7459// add HTTP headers to the request. 7460func (c *InstancesFailoverCall) Header() http.Header { 7461 if c.header_ == nil { 7462 c.header_ = make(http.Header) 7463 } 7464 return c.header_ 7465} 7466 7467func (c *InstancesFailoverCall) doRequest(alt string) (*http.Response, error) { 7468 reqHeaders := make(http.Header) 7469 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 7470 for k, v := range c.header_ { 7471 reqHeaders[k] = v 7472 } 7473 reqHeaders.Set("User-Agent", c.s.userAgent()) 7474 var body io.Reader = nil 7475 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesfailoverrequest) 7476 if err != nil { 7477 return nil, err 7478 } 7479 reqHeaders.Set("Content-Type", "application/json") 7480 c.urlParams_.Set("alt", alt) 7481 c.urlParams_.Set("prettyPrint", "false") 7482 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/failover") 7483 urls += "?" + c.urlParams_.Encode() 7484 req, err := http.NewRequest("POST", urls, body) 7485 if err != nil { 7486 return nil, err 7487 } 7488 req.Header = reqHeaders 7489 googleapi.Expand(req.URL, map[string]string{ 7490 "project": c.project, 7491 "instance": c.instance, 7492 }) 7493 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7494} 7495 7496// Do executes the "sql.instances.failover" call. 7497// Exactly one of *Operation or error will be non-nil. Any non-2xx 7498// status code is an error. Response headers are in either 7499// *Operation.ServerResponse.Header or (if a response was returned at 7500// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7501// to check whether the returned error was because 7502// http.StatusNotModified was returned. 7503func (c *InstancesFailoverCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7504 gensupport.SetOptions(c.urlParams_, opts...) 7505 res, err := c.doRequest("json") 7506 if res != nil && res.StatusCode == http.StatusNotModified { 7507 if res.Body != nil { 7508 res.Body.Close() 7509 } 7510 return nil, &googleapi.Error{ 7511 Code: res.StatusCode, 7512 Header: res.Header, 7513 } 7514 } 7515 if err != nil { 7516 return nil, err 7517 } 7518 defer googleapi.CloseBody(res) 7519 if err := googleapi.CheckResponse(res); err != nil { 7520 return nil, err 7521 } 7522 ret := &Operation{ 7523 ServerResponse: googleapi.ServerResponse{ 7524 Header: res.Header, 7525 HTTPStatusCode: res.StatusCode, 7526 }, 7527 } 7528 target := &ret 7529 if err := gensupport.DecodeResponse(target, res); err != nil { 7530 return nil, err 7531 } 7532 return ret, nil 7533 // { 7534 // "description": "Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to the new primary. For more information, see the [Overview of high availability](https://cloud.google.com/sql/docs/mysql/high-availability) page in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its failover replica instance.", 7535 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/failover", 7536 // "httpMethod": "POST", 7537 // "id": "sql.instances.failover", 7538 // "parameterOrder": [ 7539 // "project", 7540 // "instance" 7541 // ], 7542 // "parameters": { 7543 // "instance": { 7544 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7545 // "location": "path", 7546 // "required": true, 7547 // "type": "string" 7548 // }, 7549 // "project": { 7550 // "description": "ID of the project that contains the read replica.", 7551 // "location": "path", 7552 // "required": true, 7553 // "type": "string" 7554 // } 7555 // }, 7556 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/failover", 7557 // "request": { 7558 // "$ref": "InstancesFailoverRequest" 7559 // }, 7560 // "response": { 7561 // "$ref": "Operation" 7562 // }, 7563 // "scopes": [ 7564 // "https://www.googleapis.com/auth/cloud-platform", 7565 // "https://www.googleapis.com/auth/sqlservice.admin" 7566 // ] 7567 // } 7568 7569} 7570 7571// method id "sql.instances.get": 7572 7573type InstancesGetCall struct { 7574 s *Service 7575 project string 7576 instance string 7577 urlParams_ gensupport.URLParams 7578 ifNoneMatch_ string 7579 ctx_ context.Context 7580 header_ http.Header 7581} 7582 7583// Get: Retrieves a resource containing information about a Cloud SQL 7584// instance. 7585// 7586// - instance: Database instance ID. This does not include the project 7587// ID. 7588// - project: Project ID of the project that contains the instance. 7589func (r *InstancesService) Get(project string, instance string) *InstancesGetCall { 7590 c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7591 c.project = project 7592 c.instance = instance 7593 return c 7594} 7595 7596// Fields allows partial responses to be retrieved. See 7597// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7598// for more information. 7599func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall { 7600 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7601 return c 7602} 7603 7604// IfNoneMatch sets the optional parameter which makes the operation 7605// fail if the object's ETag matches the given value. This is useful for 7606// getting updates only after the object has changed since the last 7607// request. Use googleapi.IsNotModified to check whether the response 7608// error from Do is the result of In-None-Match. 7609func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall { 7610 c.ifNoneMatch_ = entityTag 7611 return c 7612} 7613 7614// Context sets the context to be used in this call's Do method. Any 7615// pending HTTP request will be aborted if the provided context is 7616// canceled. 7617func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall { 7618 c.ctx_ = ctx 7619 return c 7620} 7621 7622// Header returns an http.Header that can be modified by the caller to 7623// add HTTP headers to the request. 7624func (c *InstancesGetCall) Header() http.Header { 7625 if c.header_ == nil { 7626 c.header_ = make(http.Header) 7627 } 7628 return c.header_ 7629} 7630 7631func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { 7632 reqHeaders := make(http.Header) 7633 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 7634 for k, v := range c.header_ { 7635 reqHeaders[k] = v 7636 } 7637 reqHeaders.Set("User-Agent", c.s.userAgent()) 7638 if c.ifNoneMatch_ != "" { 7639 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7640 } 7641 var body io.Reader = nil 7642 c.urlParams_.Set("alt", alt) 7643 c.urlParams_.Set("prettyPrint", "false") 7644 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 7645 urls += "?" + c.urlParams_.Encode() 7646 req, err := http.NewRequest("GET", urls, body) 7647 if err != nil { 7648 return nil, err 7649 } 7650 req.Header = reqHeaders 7651 googleapi.Expand(req.URL, map[string]string{ 7652 "project": c.project, 7653 "instance": c.instance, 7654 }) 7655 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7656} 7657 7658// Do executes the "sql.instances.get" call. 7659// Exactly one of *DatabaseInstance or error will be non-nil. Any 7660// non-2xx status code is an error. Response headers are in either 7661// *DatabaseInstance.ServerResponse.Header or (if a response was 7662// returned at all) in error.(*googleapi.Error).Header. Use 7663// googleapi.IsNotModified to check whether the returned error was 7664// because http.StatusNotModified was returned. 7665func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*DatabaseInstance, error) { 7666 gensupport.SetOptions(c.urlParams_, opts...) 7667 res, err := c.doRequest("json") 7668 if res != nil && res.StatusCode == http.StatusNotModified { 7669 if res.Body != nil { 7670 res.Body.Close() 7671 } 7672 return nil, &googleapi.Error{ 7673 Code: res.StatusCode, 7674 Header: res.Header, 7675 } 7676 } 7677 if err != nil { 7678 return nil, err 7679 } 7680 defer googleapi.CloseBody(res) 7681 if err := googleapi.CheckResponse(res); err != nil { 7682 return nil, err 7683 } 7684 ret := &DatabaseInstance{ 7685 ServerResponse: googleapi.ServerResponse{ 7686 Header: res.Header, 7687 HTTPStatusCode: res.StatusCode, 7688 }, 7689 } 7690 target := &ret 7691 if err := gensupport.DecodeResponse(target, res); err != nil { 7692 return nil, err 7693 } 7694 return ret, nil 7695 // { 7696 // "description": "Retrieves a resource containing information about a Cloud SQL instance.", 7697 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 7698 // "httpMethod": "GET", 7699 // "id": "sql.instances.get", 7700 // "parameterOrder": [ 7701 // "project", 7702 // "instance" 7703 // ], 7704 // "parameters": { 7705 // "instance": { 7706 // "description": "Database instance ID. This does not include the project ID.", 7707 // "location": "path", 7708 // "required": true, 7709 // "type": "string" 7710 // }, 7711 // "project": { 7712 // "description": "Project ID of the project that contains the instance.", 7713 // "location": "path", 7714 // "required": true, 7715 // "type": "string" 7716 // } 7717 // }, 7718 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 7719 // "response": { 7720 // "$ref": "DatabaseInstance" 7721 // }, 7722 // "scopes": [ 7723 // "https://www.googleapis.com/auth/cloud-platform", 7724 // "https://www.googleapis.com/auth/sqlservice.admin" 7725 // ] 7726 // } 7727 7728} 7729 7730// method id "sql.instances.import": 7731 7732type InstancesImportCall struct { 7733 s *Service 7734 project string 7735 instance string 7736 instancesimportrequest *InstancesImportRequest 7737 urlParams_ gensupport.URLParams 7738 ctx_ context.Context 7739 header_ http.Header 7740} 7741 7742// Import: Imports data into a Cloud SQL instance from a SQL dump or CSV 7743// file in Cloud Storage. 7744// 7745// - instance: Cloud SQL instance ID. This does not include the project 7746// ID. 7747// - project: Project ID of the project that contains the instance. 7748func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall { 7749 c := &InstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7750 c.project = project 7751 c.instance = instance 7752 c.instancesimportrequest = instancesimportrequest 7753 return c 7754} 7755 7756// Fields allows partial responses to be retrieved. See 7757// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7758// for more information. 7759func (c *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall { 7760 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7761 return c 7762} 7763 7764// Context sets the context to be used in this call's Do method. Any 7765// pending HTTP request will be aborted if the provided context is 7766// canceled. 7767func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall { 7768 c.ctx_ = ctx 7769 return c 7770} 7771 7772// Header returns an http.Header that can be modified by the caller to 7773// add HTTP headers to the request. 7774func (c *InstancesImportCall) Header() http.Header { 7775 if c.header_ == nil { 7776 c.header_ = make(http.Header) 7777 } 7778 return c.header_ 7779} 7780 7781func (c *InstancesImportCall) doRequest(alt string) (*http.Response, error) { 7782 reqHeaders := make(http.Header) 7783 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 7784 for k, v := range c.header_ { 7785 reqHeaders[k] = v 7786 } 7787 reqHeaders.Set("User-Agent", c.s.userAgent()) 7788 var body io.Reader = nil 7789 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest) 7790 if err != nil { 7791 return nil, err 7792 } 7793 reqHeaders.Set("Content-Type", "application/json") 7794 c.urlParams_.Set("alt", alt) 7795 c.urlParams_.Set("prettyPrint", "false") 7796 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/import") 7797 urls += "?" + c.urlParams_.Encode() 7798 req, err := http.NewRequest("POST", urls, body) 7799 if err != nil { 7800 return nil, err 7801 } 7802 req.Header = reqHeaders 7803 googleapi.Expand(req.URL, map[string]string{ 7804 "project": c.project, 7805 "instance": c.instance, 7806 }) 7807 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7808} 7809 7810// Do executes the "sql.instances.import" call. 7811// Exactly one of *Operation or error will be non-nil. Any non-2xx 7812// status code is an error. Response headers are in either 7813// *Operation.ServerResponse.Header or (if a response was returned at 7814// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7815// to check whether the returned error was because 7816// http.StatusNotModified was returned. 7817func (c *InstancesImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7818 gensupport.SetOptions(c.urlParams_, opts...) 7819 res, err := c.doRequest("json") 7820 if res != nil && res.StatusCode == http.StatusNotModified { 7821 if res.Body != nil { 7822 res.Body.Close() 7823 } 7824 return nil, &googleapi.Error{ 7825 Code: res.StatusCode, 7826 Header: res.Header, 7827 } 7828 } 7829 if err != nil { 7830 return nil, err 7831 } 7832 defer googleapi.CloseBody(res) 7833 if err := googleapi.CheckResponse(res); err != nil { 7834 return nil, err 7835 } 7836 ret := &Operation{ 7837 ServerResponse: googleapi.ServerResponse{ 7838 Header: res.Header, 7839 HTTPStatusCode: res.StatusCode, 7840 }, 7841 } 7842 target := &ret 7843 if err := gensupport.DecodeResponse(target, res); err != nil { 7844 return nil, err 7845 } 7846 return ret, nil 7847 // { 7848 // "description": "Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.", 7849 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/import", 7850 // "httpMethod": "POST", 7851 // "id": "sql.instances.import", 7852 // "parameterOrder": [ 7853 // "project", 7854 // "instance" 7855 // ], 7856 // "parameters": { 7857 // "instance": { 7858 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7859 // "location": "path", 7860 // "required": true, 7861 // "type": "string" 7862 // }, 7863 // "project": { 7864 // "description": "Project ID of the project that contains the instance.", 7865 // "location": "path", 7866 // "required": true, 7867 // "type": "string" 7868 // } 7869 // }, 7870 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/import", 7871 // "request": { 7872 // "$ref": "InstancesImportRequest" 7873 // }, 7874 // "response": { 7875 // "$ref": "Operation" 7876 // }, 7877 // "scopes": [ 7878 // "https://www.googleapis.com/auth/cloud-platform" 7879 // ] 7880 // } 7881 7882} 7883 7884// method id "sql.instances.insert": 7885 7886type InstancesInsertCall struct { 7887 s *Service 7888 project string 7889 databaseinstance *DatabaseInstance 7890 urlParams_ gensupport.URLParams 7891 ctx_ context.Context 7892 header_ http.Header 7893} 7894 7895// Insert: Creates a new Cloud SQL instance. 7896// 7897// - project: Project ID of the project to which the newly created Cloud 7898// SQL instances should belong. 7899func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall { 7900 c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7901 c.project = project 7902 c.databaseinstance = databaseinstance 7903 return c 7904} 7905 7906// Fields allows partial responses to be retrieved. See 7907// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7908// for more information. 7909func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall { 7910 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7911 return c 7912} 7913 7914// Context sets the context to be used in this call's Do method. Any 7915// pending HTTP request will be aborted if the provided context is 7916// canceled. 7917func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall { 7918 c.ctx_ = ctx 7919 return c 7920} 7921 7922// Header returns an http.Header that can be modified by the caller to 7923// add HTTP headers to the request. 7924func (c *InstancesInsertCall) Header() http.Header { 7925 if c.header_ == nil { 7926 c.header_ = make(http.Header) 7927 } 7928 return c.header_ 7929} 7930 7931func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) { 7932 reqHeaders := make(http.Header) 7933 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 7934 for k, v := range c.header_ { 7935 reqHeaders[k] = v 7936 } 7937 reqHeaders.Set("User-Agent", c.s.userAgent()) 7938 var body io.Reader = nil 7939 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) 7940 if err != nil { 7941 return nil, err 7942 } 7943 reqHeaders.Set("Content-Type", "application/json") 7944 c.urlParams_.Set("alt", alt) 7945 c.urlParams_.Set("prettyPrint", "false") 7946 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances") 7947 urls += "?" + c.urlParams_.Encode() 7948 req, err := http.NewRequest("POST", urls, body) 7949 if err != nil { 7950 return nil, err 7951 } 7952 req.Header = reqHeaders 7953 googleapi.Expand(req.URL, map[string]string{ 7954 "project": c.project, 7955 }) 7956 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7957} 7958 7959// Do executes the "sql.instances.insert" call. 7960// Exactly one of *Operation or error will be non-nil. Any non-2xx 7961// status code is an error. Response headers are in either 7962// *Operation.ServerResponse.Header or (if a response was returned at 7963// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7964// to check whether the returned error was because 7965// http.StatusNotModified was returned. 7966func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7967 gensupport.SetOptions(c.urlParams_, opts...) 7968 res, err := c.doRequest("json") 7969 if res != nil && res.StatusCode == http.StatusNotModified { 7970 if res.Body != nil { 7971 res.Body.Close() 7972 } 7973 return nil, &googleapi.Error{ 7974 Code: res.StatusCode, 7975 Header: res.Header, 7976 } 7977 } 7978 if err != nil { 7979 return nil, err 7980 } 7981 defer googleapi.CloseBody(res) 7982 if err := googleapi.CheckResponse(res); err != nil { 7983 return nil, err 7984 } 7985 ret := &Operation{ 7986 ServerResponse: googleapi.ServerResponse{ 7987 Header: res.Header, 7988 HTTPStatusCode: res.StatusCode, 7989 }, 7990 } 7991 target := &ret 7992 if err := gensupport.DecodeResponse(target, res); err != nil { 7993 return nil, err 7994 } 7995 return ret, nil 7996 // { 7997 // "description": "Creates a new Cloud SQL instance.", 7998 // "flatPath": "sql/v1beta4/projects/{project}/instances", 7999 // "httpMethod": "POST", 8000 // "id": "sql.instances.insert", 8001 // "parameterOrder": [ 8002 // "project" 8003 // ], 8004 // "parameters": { 8005 // "project": { 8006 // "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.", 8007 // "location": "path", 8008 // "required": true, 8009 // "type": "string" 8010 // } 8011 // }, 8012 // "path": "sql/v1beta4/projects/{project}/instances", 8013 // "request": { 8014 // "$ref": "DatabaseInstance" 8015 // }, 8016 // "response": { 8017 // "$ref": "Operation" 8018 // }, 8019 // "scopes": [ 8020 // "https://www.googleapis.com/auth/cloud-platform", 8021 // "https://www.googleapis.com/auth/sqlservice.admin" 8022 // ] 8023 // } 8024 8025} 8026 8027// method id "sql.instances.list": 8028 8029type InstancesListCall struct { 8030 s *Service 8031 project string 8032 urlParams_ gensupport.URLParams 8033 ifNoneMatch_ string 8034 ctx_ context.Context 8035 header_ http.Header 8036} 8037 8038// List: Lists instances under a given project. 8039// 8040// - project: Project ID of the project for which to list Cloud SQL 8041// instances. 8042func (r *InstancesService) List(project string) *InstancesListCall { 8043 c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8044 c.project = project 8045 return c 8046} 8047 8048// Filter sets the optional parameter "filter": A filter expression that 8049// filters resources listed in the response. The expression is in the 8050// form of field:value. For example, 'instanceType:CLOUD_SQL_INSTANCE'. 8051// Fields can be nested as needed as per their JSON representation, such 8052// as 'settings.userLabels.auto_start:true'. Multiple filter queries are 8053// space-separated. For example. 'state:RUNNABLE 8054// instanceType:CLOUD_SQL_INSTANCE'. By default, each expression is an 8055// AND expression. However, you can include AND and OR expressions 8056// explicitly. 8057func (c *InstancesListCall) Filter(filter string) *InstancesListCall { 8058 c.urlParams_.Set("filter", filter) 8059 return c 8060} 8061 8062// MaxResults sets the optional parameter "maxResults": The maximum 8063// number of results to return per response. 8064func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { 8065 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 8066 return c 8067} 8068 8069// PageToken sets the optional parameter "pageToken": A 8070// previously-returned page token representing part of the larger set of 8071// results to view. 8072func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { 8073 c.urlParams_.Set("pageToken", pageToken) 8074 return c 8075} 8076 8077// Fields allows partial responses to be retrieved. See 8078// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8079// for more information. 8080func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall { 8081 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8082 return c 8083} 8084 8085// IfNoneMatch sets the optional parameter which makes the operation 8086// fail if the object's ETag matches the given value. This is useful for 8087// getting updates only after the object has changed since the last 8088// request. Use googleapi.IsNotModified to check whether the response 8089// error from Do is the result of In-None-Match. 8090func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall { 8091 c.ifNoneMatch_ = entityTag 8092 return c 8093} 8094 8095// Context sets the context to be used in this call's Do method. Any 8096// pending HTTP request will be aborted if the provided context is 8097// canceled. 8098func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall { 8099 c.ctx_ = ctx 8100 return c 8101} 8102 8103// Header returns an http.Header that can be modified by the caller to 8104// add HTTP headers to the request. 8105func (c *InstancesListCall) Header() http.Header { 8106 if c.header_ == nil { 8107 c.header_ = make(http.Header) 8108 } 8109 return c.header_ 8110} 8111 8112func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { 8113 reqHeaders := make(http.Header) 8114 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 8115 for k, v := range c.header_ { 8116 reqHeaders[k] = v 8117 } 8118 reqHeaders.Set("User-Agent", c.s.userAgent()) 8119 if c.ifNoneMatch_ != "" { 8120 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8121 } 8122 var body io.Reader = nil 8123 c.urlParams_.Set("alt", alt) 8124 c.urlParams_.Set("prettyPrint", "false") 8125 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances") 8126 urls += "?" + c.urlParams_.Encode() 8127 req, err := http.NewRequest("GET", urls, body) 8128 if err != nil { 8129 return nil, err 8130 } 8131 req.Header = reqHeaders 8132 googleapi.Expand(req.URL, map[string]string{ 8133 "project": c.project, 8134 }) 8135 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8136} 8137 8138// Do executes the "sql.instances.list" call. 8139// Exactly one of *InstancesListResponse or error will be non-nil. Any 8140// non-2xx status code is an error. Response headers are in either 8141// *InstancesListResponse.ServerResponse.Header or (if a response was 8142// returned at all) in error.(*googleapi.Error).Header. Use 8143// googleapi.IsNotModified to check whether the returned error was 8144// because http.StatusNotModified was returned. 8145func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstancesListResponse, error) { 8146 gensupport.SetOptions(c.urlParams_, opts...) 8147 res, err := c.doRequest("json") 8148 if res != nil && res.StatusCode == http.StatusNotModified { 8149 if res.Body != nil { 8150 res.Body.Close() 8151 } 8152 return nil, &googleapi.Error{ 8153 Code: res.StatusCode, 8154 Header: res.Header, 8155 } 8156 } 8157 if err != nil { 8158 return nil, err 8159 } 8160 defer googleapi.CloseBody(res) 8161 if err := googleapi.CheckResponse(res); err != nil { 8162 return nil, err 8163 } 8164 ret := &InstancesListResponse{ 8165 ServerResponse: googleapi.ServerResponse{ 8166 Header: res.Header, 8167 HTTPStatusCode: res.StatusCode, 8168 }, 8169 } 8170 target := &ret 8171 if err := gensupport.DecodeResponse(target, res); err != nil { 8172 return nil, err 8173 } 8174 return ret, nil 8175 // { 8176 // "description": "Lists instances under a given project.", 8177 // "flatPath": "sql/v1beta4/projects/{project}/instances", 8178 // "httpMethod": "GET", 8179 // "id": "sql.instances.list", 8180 // "parameterOrder": [ 8181 // "project" 8182 // ], 8183 // "parameters": { 8184 // "filter": { 8185 // "description": "A filter expression that filters resources listed in the response. The expression is in the form of field:value. For example, 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per their JSON representation, such as 'settings.userLabels.auto_start:true'. Multiple filter queries are space-separated. For example. 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly.", 8186 // "location": "query", 8187 // "type": "string" 8188 // }, 8189 // "maxResults": { 8190 // "description": "The maximum number of results to return per response.", 8191 // "format": "uint32", 8192 // "location": "query", 8193 // "type": "integer" 8194 // }, 8195 // "pageToken": { 8196 // "description": "A previously-returned page token representing part of the larger set of results to view.", 8197 // "location": "query", 8198 // "type": "string" 8199 // }, 8200 // "project": { 8201 // "description": "Project ID of the project for which to list Cloud SQL instances.", 8202 // "location": "path", 8203 // "required": true, 8204 // "type": "string" 8205 // } 8206 // }, 8207 // "path": "sql/v1beta4/projects/{project}/instances", 8208 // "response": { 8209 // "$ref": "InstancesListResponse" 8210 // }, 8211 // "scopes": [ 8212 // "https://www.googleapis.com/auth/cloud-platform", 8213 // "https://www.googleapis.com/auth/sqlservice.admin" 8214 // ] 8215 // } 8216 8217} 8218 8219// Pages invokes f for each page of results. 8220// A non-nil error returned from f will halt the iteration. 8221// The provided context supersedes any context provided to the Context method. 8222func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstancesListResponse) error) error { 8223 c.ctx_ = ctx 8224 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8225 for { 8226 x, err := c.Do() 8227 if err != nil { 8228 return err 8229 } 8230 if err := f(x); err != nil { 8231 return err 8232 } 8233 if x.NextPageToken == "" { 8234 return nil 8235 } 8236 c.PageToken(x.NextPageToken) 8237 } 8238} 8239 8240// method id "sql.instances.listServerCas": 8241 8242type InstancesListServerCasCall struct { 8243 s *Service 8244 project string 8245 instance string 8246 urlParams_ gensupport.URLParams 8247 ifNoneMatch_ string 8248 ctx_ context.Context 8249 header_ http.Header 8250} 8251 8252// ListServerCas: Lists all of the trusted Certificate Authorities (CAs) 8253// for the specified instance. There can be up to three CAs listed: the 8254// CA that was used to sign the certificate that is currently in use, a 8255// CA that has been added but not yet used to sign a certificate, and a 8256// CA used to sign a certificate that has previously rotated out. 8257// 8258// - instance: Cloud SQL instance ID. This does not include the project 8259// ID. 8260// - project: Project ID of the project that contains the instance. 8261func (r *InstancesService) ListServerCas(project string, instance string) *InstancesListServerCasCall { 8262 c := &InstancesListServerCasCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8263 c.project = project 8264 c.instance = instance 8265 return c 8266} 8267 8268// Fields allows partial responses to be retrieved. See 8269// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8270// for more information. 8271func (c *InstancesListServerCasCall) Fields(s ...googleapi.Field) *InstancesListServerCasCall { 8272 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8273 return c 8274} 8275 8276// IfNoneMatch sets the optional parameter which makes the operation 8277// fail if the object's ETag matches the given value. This is useful for 8278// getting updates only after the object has changed since the last 8279// request. Use googleapi.IsNotModified to check whether the response 8280// error from Do is the result of In-None-Match. 8281func (c *InstancesListServerCasCall) IfNoneMatch(entityTag string) *InstancesListServerCasCall { 8282 c.ifNoneMatch_ = entityTag 8283 return c 8284} 8285 8286// Context sets the context to be used in this call's Do method. Any 8287// pending HTTP request will be aborted if the provided context is 8288// canceled. 8289func (c *InstancesListServerCasCall) Context(ctx context.Context) *InstancesListServerCasCall { 8290 c.ctx_ = ctx 8291 return c 8292} 8293 8294// Header returns an http.Header that can be modified by the caller to 8295// add HTTP headers to the request. 8296func (c *InstancesListServerCasCall) Header() http.Header { 8297 if c.header_ == nil { 8298 c.header_ = make(http.Header) 8299 } 8300 return c.header_ 8301} 8302 8303func (c *InstancesListServerCasCall) doRequest(alt string) (*http.Response, error) { 8304 reqHeaders := make(http.Header) 8305 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 8306 for k, v := range c.header_ { 8307 reqHeaders[k] = v 8308 } 8309 reqHeaders.Set("User-Agent", c.s.userAgent()) 8310 if c.ifNoneMatch_ != "" { 8311 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8312 } 8313 var body io.Reader = nil 8314 c.urlParams_.Set("alt", alt) 8315 c.urlParams_.Set("prettyPrint", "false") 8316 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas") 8317 urls += "?" + c.urlParams_.Encode() 8318 req, err := http.NewRequest("GET", urls, body) 8319 if err != nil { 8320 return nil, err 8321 } 8322 req.Header = reqHeaders 8323 googleapi.Expand(req.URL, map[string]string{ 8324 "project": c.project, 8325 "instance": c.instance, 8326 }) 8327 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8328} 8329 8330// Do executes the "sql.instances.listServerCas" call. 8331// Exactly one of *InstancesListServerCasResponse or error will be 8332// non-nil. Any non-2xx status code is an error. Response headers are in 8333// either *InstancesListServerCasResponse.ServerResponse.Header or (if a 8334// response was returned at all) in error.(*googleapi.Error).Header. Use 8335// googleapi.IsNotModified to check whether the returned error was 8336// because http.StatusNotModified was returned. 8337func (c *InstancesListServerCasCall) Do(opts ...googleapi.CallOption) (*InstancesListServerCasResponse, error) { 8338 gensupport.SetOptions(c.urlParams_, opts...) 8339 res, err := c.doRequest("json") 8340 if res != nil && res.StatusCode == http.StatusNotModified { 8341 if res.Body != nil { 8342 res.Body.Close() 8343 } 8344 return nil, &googleapi.Error{ 8345 Code: res.StatusCode, 8346 Header: res.Header, 8347 } 8348 } 8349 if err != nil { 8350 return nil, err 8351 } 8352 defer googleapi.CloseBody(res) 8353 if err := googleapi.CheckResponse(res); err != nil { 8354 return nil, err 8355 } 8356 ret := &InstancesListServerCasResponse{ 8357 ServerResponse: googleapi.ServerResponse{ 8358 Header: res.Header, 8359 HTTPStatusCode: res.StatusCode, 8360 }, 8361 } 8362 target := &ret 8363 if err := gensupport.DecodeResponse(target, res); err != nil { 8364 return nil, err 8365 } 8366 return ret, nil 8367 // { 8368 // "description": "Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out.", 8369 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas", 8370 // "httpMethod": "GET", 8371 // "id": "sql.instances.listServerCas", 8372 // "parameterOrder": [ 8373 // "project", 8374 // "instance" 8375 // ], 8376 // "parameters": { 8377 // "instance": { 8378 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8379 // "location": "path", 8380 // "required": true, 8381 // "type": "string" 8382 // }, 8383 // "project": { 8384 // "description": "Project ID of the project that contains the instance.", 8385 // "location": "path", 8386 // "required": true, 8387 // "type": "string" 8388 // } 8389 // }, 8390 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas", 8391 // "response": { 8392 // "$ref": "InstancesListServerCasResponse" 8393 // }, 8394 // "scopes": [ 8395 // "https://www.googleapis.com/auth/cloud-platform", 8396 // "https://www.googleapis.com/auth/sqlservice.admin" 8397 // ] 8398 // } 8399 8400} 8401 8402// method id "sql.instances.patch": 8403 8404type InstancesPatchCall struct { 8405 s *Service 8406 project string 8407 instance string 8408 databaseinstance *DatabaseInstance 8409 urlParams_ gensupport.URLParams 8410 ctx_ context.Context 8411 header_ http.Header 8412} 8413 8414// Patch: Updates settings of a Cloud SQL instance. This method supports 8415// patch semantics. 8416// 8417// - instance: Cloud SQL instance ID. This does not include the project 8418// ID. 8419// - project: Project ID of the project that contains the instance. 8420func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall { 8421 c := &InstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8422 c.project = project 8423 c.instance = instance 8424 c.databaseinstance = databaseinstance 8425 return c 8426} 8427 8428// Fields allows partial responses to be retrieved. See 8429// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8430// for more information. 8431func (c *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall { 8432 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8433 return c 8434} 8435 8436// Context sets the context to be used in this call's Do method. Any 8437// pending HTTP request will be aborted if the provided context is 8438// canceled. 8439func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall { 8440 c.ctx_ = ctx 8441 return c 8442} 8443 8444// Header returns an http.Header that can be modified by the caller to 8445// add HTTP headers to the request. 8446func (c *InstancesPatchCall) Header() http.Header { 8447 if c.header_ == nil { 8448 c.header_ = make(http.Header) 8449 } 8450 return c.header_ 8451} 8452 8453func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, error) { 8454 reqHeaders := make(http.Header) 8455 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 8456 for k, v := range c.header_ { 8457 reqHeaders[k] = v 8458 } 8459 reqHeaders.Set("User-Agent", c.s.userAgent()) 8460 var body io.Reader = nil 8461 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) 8462 if err != nil { 8463 return nil, err 8464 } 8465 reqHeaders.Set("Content-Type", "application/json") 8466 c.urlParams_.Set("alt", alt) 8467 c.urlParams_.Set("prettyPrint", "false") 8468 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 8469 urls += "?" + c.urlParams_.Encode() 8470 req, err := http.NewRequest("PATCH", urls, body) 8471 if err != nil { 8472 return nil, err 8473 } 8474 req.Header = reqHeaders 8475 googleapi.Expand(req.URL, map[string]string{ 8476 "project": c.project, 8477 "instance": c.instance, 8478 }) 8479 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8480} 8481 8482// Do executes the "sql.instances.patch" call. 8483// Exactly one of *Operation or error will be non-nil. Any non-2xx 8484// status code is an error. Response headers are in either 8485// *Operation.ServerResponse.Header or (if a response was returned at 8486// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8487// to check whether the returned error was because 8488// http.StatusNotModified was returned. 8489func (c *InstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8490 gensupport.SetOptions(c.urlParams_, opts...) 8491 res, err := c.doRequest("json") 8492 if res != nil && res.StatusCode == http.StatusNotModified { 8493 if res.Body != nil { 8494 res.Body.Close() 8495 } 8496 return nil, &googleapi.Error{ 8497 Code: res.StatusCode, 8498 Header: res.Header, 8499 } 8500 } 8501 if err != nil { 8502 return nil, err 8503 } 8504 defer googleapi.CloseBody(res) 8505 if err := googleapi.CheckResponse(res); err != nil { 8506 return nil, err 8507 } 8508 ret := &Operation{ 8509 ServerResponse: googleapi.ServerResponse{ 8510 Header: res.Header, 8511 HTTPStatusCode: res.StatusCode, 8512 }, 8513 } 8514 target := &ret 8515 if err := gensupport.DecodeResponse(target, res); err != nil { 8516 return nil, err 8517 } 8518 return ret, nil 8519 // { 8520 // "description": "Updates settings of a Cloud SQL instance. This method supports patch semantics.", 8521 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 8522 // "httpMethod": "PATCH", 8523 // "id": "sql.instances.patch", 8524 // "parameterOrder": [ 8525 // "project", 8526 // "instance" 8527 // ], 8528 // "parameters": { 8529 // "instance": { 8530 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8531 // "location": "path", 8532 // "required": true, 8533 // "type": "string" 8534 // }, 8535 // "project": { 8536 // "description": "Project ID of the project that contains the instance.", 8537 // "location": "path", 8538 // "required": true, 8539 // "type": "string" 8540 // } 8541 // }, 8542 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 8543 // "request": { 8544 // "$ref": "DatabaseInstance" 8545 // }, 8546 // "response": { 8547 // "$ref": "Operation" 8548 // }, 8549 // "scopes": [ 8550 // "https://www.googleapis.com/auth/cloud-platform", 8551 // "https://www.googleapis.com/auth/sqlservice.admin" 8552 // ] 8553 // } 8554 8555} 8556 8557// method id "sql.instances.promoteReplica": 8558 8559type InstancesPromoteReplicaCall struct { 8560 s *Service 8561 project string 8562 instance string 8563 urlParams_ gensupport.URLParams 8564 ctx_ context.Context 8565 header_ http.Header 8566} 8567 8568// PromoteReplica: Promotes the read replica instance to be a 8569// stand-alone Cloud SQL instance. Using this operation might cause your 8570// instance to restart. 8571// 8572// - instance: Cloud SQL read replica instance name. 8573// - project: ID of the project that contains the read replica. 8574func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall { 8575 c := &InstancesPromoteReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8576 c.project = project 8577 c.instance = instance 8578 return c 8579} 8580 8581// Fields allows partial responses to be retrieved. See 8582// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8583// for more information. 8584func (c *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall { 8585 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8586 return c 8587} 8588 8589// Context sets the context to be used in this call's Do method. Any 8590// pending HTTP request will be aborted if the provided context is 8591// canceled. 8592func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall { 8593 c.ctx_ = ctx 8594 return c 8595} 8596 8597// Header returns an http.Header that can be modified by the caller to 8598// add HTTP headers to the request. 8599func (c *InstancesPromoteReplicaCall) Header() http.Header { 8600 if c.header_ == nil { 8601 c.header_ = make(http.Header) 8602 } 8603 return c.header_ 8604} 8605 8606func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) { 8607 reqHeaders := make(http.Header) 8608 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 8609 for k, v := range c.header_ { 8610 reqHeaders[k] = v 8611 } 8612 reqHeaders.Set("User-Agent", c.s.userAgent()) 8613 var body io.Reader = nil 8614 c.urlParams_.Set("alt", alt) 8615 c.urlParams_.Set("prettyPrint", "false") 8616 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica") 8617 urls += "?" + c.urlParams_.Encode() 8618 req, err := http.NewRequest("POST", urls, body) 8619 if err != nil { 8620 return nil, err 8621 } 8622 req.Header = reqHeaders 8623 googleapi.Expand(req.URL, map[string]string{ 8624 "project": c.project, 8625 "instance": c.instance, 8626 }) 8627 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8628} 8629 8630// Do executes the "sql.instances.promoteReplica" call. 8631// Exactly one of *Operation or error will be non-nil. Any non-2xx 8632// status code is an error. Response headers are in either 8633// *Operation.ServerResponse.Header or (if a response was returned at 8634// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8635// to check whether the returned error was because 8636// http.StatusNotModified was returned. 8637func (c *InstancesPromoteReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8638 gensupport.SetOptions(c.urlParams_, opts...) 8639 res, err := c.doRequest("json") 8640 if res != nil && res.StatusCode == http.StatusNotModified { 8641 if res.Body != nil { 8642 res.Body.Close() 8643 } 8644 return nil, &googleapi.Error{ 8645 Code: res.StatusCode, 8646 Header: res.Header, 8647 } 8648 } 8649 if err != nil { 8650 return nil, err 8651 } 8652 defer googleapi.CloseBody(res) 8653 if err := googleapi.CheckResponse(res); err != nil { 8654 return nil, err 8655 } 8656 ret := &Operation{ 8657 ServerResponse: googleapi.ServerResponse{ 8658 Header: res.Header, 8659 HTTPStatusCode: res.StatusCode, 8660 }, 8661 } 8662 target := &ret 8663 if err := gensupport.DecodeResponse(target, res); err != nil { 8664 return nil, err 8665 } 8666 return ret, nil 8667 // { 8668 // "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance. Using this operation might cause your instance to restart.", 8669 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica", 8670 // "httpMethod": "POST", 8671 // "id": "sql.instances.promoteReplica", 8672 // "parameterOrder": [ 8673 // "project", 8674 // "instance" 8675 // ], 8676 // "parameters": { 8677 // "instance": { 8678 // "description": "Cloud SQL read replica instance name.", 8679 // "location": "path", 8680 // "required": true, 8681 // "type": "string" 8682 // }, 8683 // "project": { 8684 // "description": "ID of the project that contains the read replica.", 8685 // "location": "path", 8686 // "required": true, 8687 // "type": "string" 8688 // } 8689 // }, 8690 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica", 8691 // "response": { 8692 // "$ref": "Operation" 8693 // }, 8694 // "scopes": [ 8695 // "https://www.googleapis.com/auth/cloud-platform", 8696 // "https://www.googleapis.com/auth/sqlservice.admin" 8697 // ] 8698 // } 8699 8700} 8701 8702// method id "sql.instances.resetSslConfig": 8703 8704type InstancesResetSslConfigCall struct { 8705 s *Service 8706 project string 8707 instance string 8708 urlParams_ gensupport.URLParams 8709 ctx_ context.Context 8710 header_ http.Header 8711} 8712 8713// ResetSslConfig: Deletes all client certificates and generates a new 8714// server SSL certificate for the instance. 8715// 8716// - instance: Cloud SQL instance ID. This does not include the project 8717// ID. 8718// - project: Project ID of the project that contains the instance. 8719func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall { 8720 c := &InstancesResetSslConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8721 c.project = project 8722 c.instance = instance 8723 return c 8724} 8725 8726// Fields allows partial responses to be retrieved. See 8727// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8728// for more information. 8729func (c *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall { 8730 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8731 return c 8732} 8733 8734// Context sets the context to be used in this call's Do method. Any 8735// pending HTTP request will be aborted if the provided context is 8736// canceled. 8737func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall { 8738 c.ctx_ = ctx 8739 return c 8740} 8741 8742// Header returns an http.Header that can be modified by the caller to 8743// add HTTP headers to the request. 8744func (c *InstancesResetSslConfigCall) Header() http.Header { 8745 if c.header_ == nil { 8746 c.header_ = make(http.Header) 8747 } 8748 return c.header_ 8749} 8750 8751func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) { 8752 reqHeaders := make(http.Header) 8753 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 8754 for k, v := range c.header_ { 8755 reqHeaders[k] = v 8756 } 8757 reqHeaders.Set("User-Agent", c.s.userAgent()) 8758 var body io.Reader = nil 8759 c.urlParams_.Set("alt", alt) 8760 c.urlParams_.Set("prettyPrint", "false") 8761 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig") 8762 urls += "?" + c.urlParams_.Encode() 8763 req, err := http.NewRequest("POST", urls, body) 8764 if err != nil { 8765 return nil, err 8766 } 8767 req.Header = reqHeaders 8768 googleapi.Expand(req.URL, map[string]string{ 8769 "project": c.project, 8770 "instance": c.instance, 8771 }) 8772 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8773} 8774 8775// Do executes the "sql.instances.resetSslConfig" call. 8776// Exactly one of *Operation or error will be non-nil. Any non-2xx 8777// status code is an error. Response headers are in either 8778// *Operation.ServerResponse.Header or (if a response was returned at 8779// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8780// to check whether the returned error was because 8781// http.StatusNotModified was returned. 8782func (c *InstancesResetSslConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8783 gensupport.SetOptions(c.urlParams_, opts...) 8784 res, err := c.doRequest("json") 8785 if res != nil && res.StatusCode == http.StatusNotModified { 8786 if res.Body != nil { 8787 res.Body.Close() 8788 } 8789 return nil, &googleapi.Error{ 8790 Code: res.StatusCode, 8791 Header: res.Header, 8792 } 8793 } 8794 if err != nil { 8795 return nil, err 8796 } 8797 defer googleapi.CloseBody(res) 8798 if err := googleapi.CheckResponse(res); err != nil { 8799 return nil, err 8800 } 8801 ret := &Operation{ 8802 ServerResponse: googleapi.ServerResponse{ 8803 Header: res.Header, 8804 HTTPStatusCode: res.StatusCode, 8805 }, 8806 } 8807 target := &ret 8808 if err := gensupport.DecodeResponse(target, res); err != nil { 8809 return nil, err 8810 } 8811 return ret, nil 8812 // { 8813 // "description": "Deletes all client certificates and generates a new server SSL certificate for the instance.", 8814 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig", 8815 // "httpMethod": "POST", 8816 // "id": "sql.instances.resetSslConfig", 8817 // "parameterOrder": [ 8818 // "project", 8819 // "instance" 8820 // ], 8821 // "parameters": { 8822 // "instance": { 8823 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8824 // "location": "path", 8825 // "required": true, 8826 // "type": "string" 8827 // }, 8828 // "project": { 8829 // "description": "Project ID of the project that contains the instance.", 8830 // "location": "path", 8831 // "required": true, 8832 // "type": "string" 8833 // } 8834 // }, 8835 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig", 8836 // "response": { 8837 // "$ref": "Operation" 8838 // }, 8839 // "scopes": [ 8840 // "https://www.googleapis.com/auth/cloud-platform", 8841 // "https://www.googleapis.com/auth/sqlservice.admin" 8842 // ] 8843 // } 8844 8845} 8846 8847// method id "sql.instances.restart": 8848 8849type InstancesRestartCall struct { 8850 s *Service 8851 project string 8852 instance string 8853 urlParams_ gensupport.URLParams 8854 ctx_ context.Context 8855 header_ http.Header 8856} 8857 8858// Restart: Restarts a Cloud SQL instance. 8859// 8860// - instance: Cloud SQL instance ID. This does not include the project 8861// ID. 8862// - project: Project ID of the project that contains the instance to be 8863// restarted. 8864func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall { 8865 c := &InstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8866 c.project = project 8867 c.instance = instance 8868 return c 8869} 8870 8871// Fields allows partial responses to be retrieved. See 8872// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8873// for more information. 8874func (c *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall { 8875 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8876 return c 8877} 8878 8879// Context sets the context to be used in this call's Do method. Any 8880// pending HTTP request will be aborted if the provided context is 8881// canceled. 8882func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall { 8883 c.ctx_ = ctx 8884 return c 8885} 8886 8887// Header returns an http.Header that can be modified by the caller to 8888// add HTTP headers to the request. 8889func (c *InstancesRestartCall) Header() http.Header { 8890 if c.header_ == nil { 8891 c.header_ = make(http.Header) 8892 } 8893 return c.header_ 8894} 8895 8896func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) { 8897 reqHeaders := make(http.Header) 8898 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 8899 for k, v := range c.header_ { 8900 reqHeaders[k] = v 8901 } 8902 reqHeaders.Set("User-Agent", c.s.userAgent()) 8903 var body io.Reader = nil 8904 c.urlParams_.Set("alt", alt) 8905 c.urlParams_.Set("prettyPrint", "false") 8906 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/restart") 8907 urls += "?" + c.urlParams_.Encode() 8908 req, err := http.NewRequest("POST", urls, body) 8909 if err != nil { 8910 return nil, err 8911 } 8912 req.Header = reqHeaders 8913 googleapi.Expand(req.URL, map[string]string{ 8914 "project": c.project, 8915 "instance": c.instance, 8916 }) 8917 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8918} 8919 8920// Do executes the "sql.instances.restart" call. 8921// Exactly one of *Operation or error will be non-nil. Any non-2xx 8922// status code is an error. Response headers are in either 8923// *Operation.ServerResponse.Header or (if a response was returned at 8924// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8925// to check whether the returned error was because 8926// http.StatusNotModified was returned. 8927func (c *InstancesRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8928 gensupport.SetOptions(c.urlParams_, opts...) 8929 res, err := c.doRequest("json") 8930 if res != nil && res.StatusCode == http.StatusNotModified { 8931 if res.Body != nil { 8932 res.Body.Close() 8933 } 8934 return nil, &googleapi.Error{ 8935 Code: res.StatusCode, 8936 Header: res.Header, 8937 } 8938 } 8939 if err != nil { 8940 return nil, err 8941 } 8942 defer googleapi.CloseBody(res) 8943 if err := googleapi.CheckResponse(res); err != nil { 8944 return nil, err 8945 } 8946 ret := &Operation{ 8947 ServerResponse: googleapi.ServerResponse{ 8948 Header: res.Header, 8949 HTTPStatusCode: res.StatusCode, 8950 }, 8951 } 8952 target := &ret 8953 if err := gensupport.DecodeResponse(target, res); err != nil { 8954 return nil, err 8955 } 8956 return ret, nil 8957 // { 8958 // "description": "Restarts a Cloud SQL instance.", 8959 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/restart", 8960 // "httpMethod": "POST", 8961 // "id": "sql.instances.restart", 8962 // "parameterOrder": [ 8963 // "project", 8964 // "instance" 8965 // ], 8966 // "parameters": { 8967 // "instance": { 8968 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8969 // "location": "path", 8970 // "required": true, 8971 // "type": "string" 8972 // }, 8973 // "project": { 8974 // "description": "Project ID of the project that contains the instance to be restarted.", 8975 // "location": "path", 8976 // "required": true, 8977 // "type": "string" 8978 // } 8979 // }, 8980 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/restart", 8981 // "response": { 8982 // "$ref": "Operation" 8983 // }, 8984 // "scopes": [ 8985 // "https://www.googleapis.com/auth/cloud-platform", 8986 // "https://www.googleapis.com/auth/sqlservice.admin" 8987 // ] 8988 // } 8989 8990} 8991 8992// method id "sql.instances.restoreBackup": 8993 8994type InstancesRestoreBackupCall struct { 8995 s *Service 8996 project string 8997 instance string 8998 instancesrestorebackuprequest *InstancesRestoreBackupRequest 8999 urlParams_ gensupport.URLParams 9000 ctx_ context.Context 9001 header_ http.Header 9002} 9003 9004// RestoreBackup: Restores a backup of a Cloud SQL instance. Using this 9005// operation might cause your instance to restart. 9006// 9007// - instance: Cloud SQL instance ID. This does not include the project 9008// ID. 9009// - project: Project ID of the project that contains the instance. 9010func (r *InstancesService) RestoreBackup(project string, instance string, instancesrestorebackuprequest *InstancesRestoreBackupRequest) *InstancesRestoreBackupCall { 9011 c := &InstancesRestoreBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9012 c.project = project 9013 c.instance = instance 9014 c.instancesrestorebackuprequest = instancesrestorebackuprequest 9015 return c 9016} 9017 9018// Fields allows partial responses to be retrieved. See 9019// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9020// for more information. 9021func (c *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall { 9022 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9023 return c 9024} 9025 9026// Context sets the context to be used in this call's Do method. Any 9027// pending HTTP request will be aborted if the provided context is 9028// canceled. 9029func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall { 9030 c.ctx_ = ctx 9031 return c 9032} 9033 9034// Header returns an http.Header that can be modified by the caller to 9035// add HTTP headers to the request. 9036func (c *InstancesRestoreBackupCall) Header() http.Header { 9037 if c.header_ == nil { 9038 c.header_ = make(http.Header) 9039 } 9040 return c.header_ 9041} 9042 9043func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) { 9044 reqHeaders := make(http.Header) 9045 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 9046 for k, v := range c.header_ { 9047 reqHeaders[k] = v 9048 } 9049 reqHeaders.Set("User-Agent", c.s.userAgent()) 9050 var body io.Reader = nil 9051 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrestorebackuprequest) 9052 if err != nil { 9053 return nil, err 9054 } 9055 reqHeaders.Set("Content-Type", "application/json") 9056 c.urlParams_.Set("alt", alt) 9057 c.urlParams_.Set("prettyPrint", "false") 9058 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup") 9059 urls += "?" + c.urlParams_.Encode() 9060 req, err := http.NewRequest("POST", urls, body) 9061 if err != nil { 9062 return nil, err 9063 } 9064 req.Header = reqHeaders 9065 googleapi.Expand(req.URL, map[string]string{ 9066 "project": c.project, 9067 "instance": c.instance, 9068 }) 9069 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9070} 9071 9072// Do executes the "sql.instances.restoreBackup" call. 9073// Exactly one of *Operation or error will be non-nil. Any non-2xx 9074// status code is an error. Response headers are in either 9075// *Operation.ServerResponse.Header or (if a response was returned at 9076// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9077// to check whether the returned error was because 9078// http.StatusNotModified was returned. 9079func (c *InstancesRestoreBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9080 gensupport.SetOptions(c.urlParams_, opts...) 9081 res, err := c.doRequest("json") 9082 if res != nil && res.StatusCode == http.StatusNotModified { 9083 if res.Body != nil { 9084 res.Body.Close() 9085 } 9086 return nil, &googleapi.Error{ 9087 Code: res.StatusCode, 9088 Header: res.Header, 9089 } 9090 } 9091 if err != nil { 9092 return nil, err 9093 } 9094 defer googleapi.CloseBody(res) 9095 if err := googleapi.CheckResponse(res); err != nil { 9096 return nil, err 9097 } 9098 ret := &Operation{ 9099 ServerResponse: googleapi.ServerResponse{ 9100 Header: res.Header, 9101 HTTPStatusCode: res.StatusCode, 9102 }, 9103 } 9104 target := &ret 9105 if err := gensupport.DecodeResponse(target, res); err != nil { 9106 return nil, err 9107 } 9108 return ret, nil 9109 // { 9110 // "description": "Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.", 9111 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup", 9112 // "httpMethod": "POST", 9113 // "id": "sql.instances.restoreBackup", 9114 // "parameterOrder": [ 9115 // "project", 9116 // "instance" 9117 // ], 9118 // "parameters": { 9119 // "instance": { 9120 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9121 // "location": "path", 9122 // "required": true, 9123 // "type": "string" 9124 // }, 9125 // "project": { 9126 // "description": "Project ID of the project that contains the instance.", 9127 // "location": "path", 9128 // "required": true, 9129 // "type": "string" 9130 // } 9131 // }, 9132 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup", 9133 // "request": { 9134 // "$ref": "InstancesRestoreBackupRequest" 9135 // }, 9136 // "response": { 9137 // "$ref": "Operation" 9138 // }, 9139 // "scopes": [ 9140 // "https://www.googleapis.com/auth/cloud-platform", 9141 // "https://www.googleapis.com/auth/sqlservice.admin" 9142 // ] 9143 // } 9144 9145} 9146 9147// method id "sql.instances.rotateServerCa": 9148 9149type InstancesRotateServerCaCall struct { 9150 s *Service 9151 project string 9152 instance string 9153 instancesrotateservercarequest *InstancesRotateServerCaRequest 9154 urlParams_ gensupport.URLParams 9155 ctx_ context.Context 9156 header_ http.Header 9157} 9158 9159// RotateServerCa: Rotates the server certificate to one signed by the 9160// Certificate Authority (CA) version previously added with the 9161// addServerCA method. 9162// 9163// - instance: Cloud SQL instance ID. This does not include the project 9164// ID. 9165// - project: Project ID of the project that contains the instance. 9166func (r *InstancesService) RotateServerCa(project string, instance string, instancesrotateservercarequest *InstancesRotateServerCaRequest) *InstancesRotateServerCaCall { 9167 c := &InstancesRotateServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9168 c.project = project 9169 c.instance = instance 9170 c.instancesrotateservercarequest = instancesrotateservercarequest 9171 return c 9172} 9173 9174// Fields allows partial responses to be retrieved. See 9175// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9176// for more information. 9177func (c *InstancesRotateServerCaCall) Fields(s ...googleapi.Field) *InstancesRotateServerCaCall { 9178 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9179 return c 9180} 9181 9182// Context sets the context to be used in this call's Do method. Any 9183// pending HTTP request will be aborted if the provided context is 9184// canceled. 9185func (c *InstancesRotateServerCaCall) Context(ctx context.Context) *InstancesRotateServerCaCall { 9186 c.ctx_ = ctx 9187 return c 9188} 9189 9190// Header returns an http.Header that can be modified by the caller to 9191// add HTTP headers to the request. 9192func (c *InstancesRotateServerCaCall) Header() http.Header { 9193 if c.header_ == nil { 9194 c.header_ = make(http.Header) 9195 } 9196 return c.header_ 9197} 9198 9199func (c *InstancesRotateServerCaCall) doRequest(alt string) (*http.Response, error) { 9200 reqHeaders := make(http.Header) 9201 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 9202 for k, v := range c.header_ { 9203 reqHeaders[k] = v 9204 } 9205 reqHeaders.Set("User-Agent", c.s.userAgent()) 9206 var body io.Reader = nil 9207 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrotateservercarequest) 9208 if err != nil { 9209 return nil, err 9210 } 9211 reqHeaders.Set("Content-Type", "application/json") 9212 c.urlParams_.Set("alt", alt) 9213 c.urlParams_.Set("prettyPrint", "false") 9214 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa") 9215 urls += "?" + c.urlParams_.Encode() 9216 req, err := http.NewRequest("POST", urls, body) 9217 if err != nil { 9218 return nil, err 9219 } 9220 req.Header = reqHeaders 9221 googleapi.Expand(req.URL, map[string]string{ 9222 "project": c.project, 9223 "instance": c.instance, 9224 }) 9225 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9226} 9227 9228// Do executes the "sql.instances.rotateServerCa" call. 9229// Exactly one of *Operation or error will be non-nil. Any non-2xx 9230// status code is an error. Response headers are in either 9231// *Operation.ServerResponse.Header or (if a response was returned at 9232// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9233// to check whether the returned error was because 9234// http.StatusNotModified was returned. 9235func (c *InstancesRotateServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9236 gensupport.SetOptions(c.urlParams_, opts...) 9237 res, err := c.doRequest("json") 9238 if res != nil && res.StatusCode == http.StatusNotModified { 9239 if res.Body != nil { 9240 res.Body.Close() 9241 } 9242 return nil, &googleapi.Error{ 9243 Code: res.StatusCode, 9244 Header: res.Header, 9245 } 9246 } 9247 if err != nil { 9248 return nil, err 9249 } 9250 defer googleapi.CloseBody(res) 9251 if err := googleapi.CheckResponse(res); err != nil { 9252 return nil, err 9253 } 9254 ret := &Operation{ 9255 ServerResponse: googleapi.ServerResponse{ 9256 Header: res.Header, 9257 HTTPStatusCode: res.StatusCode, 9258 }, 9259 } 9260 target := &ret 9261 if err := gensupport.DecodeResponse(target, res); err != nil { 9262 return nil, err 9263 } 9264 return ret, nil 9265 // { 9266 // "description": "Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.", 9267 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa", 9268 // "httpMethod": "POST", 9269 // "id": "sql.instances.rotateServerCa", 9270 // "parameterOrder": [ 9271 // "project", 9272 // "instance" 9273 // ], 9274 // "parameters": { 9275 // "instance": { 9276 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9277 // "location": "path", 9278 // "required": true, 9279 // "type": "string" 9280 // }, 9281 // "project": { 9282 // "description": "Project ID of the project that contains the instance.", 9283 // "location": "path", 9284 // "required": true, 9285 // "type": "string" 9286 // } 9287 // }, 9288 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa", 9289 // "request": { 9290 // "$ref": "InstancesRotateServerCaRequest" 9291 // }, 9292 // "response": { 9293 // "$ref": "Operation" 9294 // }, 9295 // "scopes": [ 9296 // "https://www.googleapis.com/auth/cloud-platform", 9297 // "https://www.googleapis.com/auth/sqlservice.admin" 9298 // ] 9299 // } 9300 9301} 9302 9303// method id "sql.instances.startReplica": 9304 9305type InstancesStartReplicaCall struct { 9306 s *Service 9307 project string 9308 instance string 9309 urlParams_ gensupport.URLParams 9310 ctx_ context.Context 9311 header_ http.Header 9312} 9313 9314// StartReplica: Starts the replication in the read replica instance. 9315// 9316// - instance: Cloud SQL read replica instance name. 9317// - project: ID of the project that contains the read replica. 9318func (r *InstancesService) StartReplica(project string, instance string) *InstancesStartReplicaCall { 9319 c := &InstancesStartReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9320 c.project = project 9321 c.instance = instance 9322 return c 9323} 9324 9325// Fields allows partial responses to be retrieved. See 9326// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9327// for more information. 9328func (c *InstancesStartReplicaCall) Fields(s ...googleapi.Field) *InstancesStartReplicaCall { 9329 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9330 return c 9331} 9332 9333// Context sets the context to be used in this call's Do method. Any 9334// pending HTTP request will be aborted if the provided context is 9335// canceled. 9336func (c *InstancesStartReplicaCall) Context(ctx context.Context) *InstancesStartReplicaCall { 9337 c.ctx_ = ctx 9338 return c 9339} 9340 9341// Header returns an http.Header that can be modified by the caller to 9342// add HTTP headers to the request. 9343func (c *InstancesStartReplicaCall) Header() http.Header { 9344 if c.header_ == nil { 9345 c.header_ = make(http.Header) 9346 } 9347 return c.header_ 9348} 9349 9350func (c *InstancesStartReplicaCall) doRequest(alt string) (*http.Response, error) { 9351 reqHeaders := make(http.Header) 9352 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 9353 for k, v := range c.header_ { 9354 reqHeaders[k] = v 9355 } 9356 reqHeaders.Set("User-Agent", c.s.userAgent()) 9357 var body io.Reader = nil 9358 c.urlParams_.Set("alt", alt) 9359 c.urlParams_.Set("prettyPrint", "false") 9360 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/startReplica") 9361 urls += "?" + c.urlParams_.Encode() 9362 req, err := http.NewRequest("POST", urls, body) 9363 if err != nil { 9364 return nil, err 9365 } 9366 req.Header = reqHeaders 9367 googleapi.Expand(req.URL, map[string]string{ 9368 "project": c.project, 9369 "instance": c.instance, 9370 }) 9371 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9372} 9373 9374// Do executes the "sql.instances.startReplica" call. 9375// Exactly one of *Operation or error will be non-nil. Any non-2xx 9376// status code is an error. Response headers are in either 9377// *Operation.ServerResponse.Header or (if a response was returned at 9378// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9379// to check whether the returned error was because 9380// http.StatusNotModified was returned. 9381func (c *InstancesStartReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9382 gensupport.SetOptions(c.urlParams_, opts...) 9383 res, err := c.doRequest("json") 9384 if res != nil && res.StatusCode == http.StatusNotModified { 9385 if res.Body != nil { 9386 res.Body.Close() 9387 } 9388 return nil, &googleapi.Error{ 9389 Code: res.StatusCode, 9390 Header: res.Header, 9391 } 9392 } 9393 if err != nil { 9394 return nil, err 9395 } 9396 defer googleapi.CloseBody(res) 9397 if err := googleapi.CheckResponse(res); err != nil { 9398 return nil, err 9399 } 9400 ret := &Operation{ 9401 ServerResponse: googleapi.ServerResponse{ 9402 Header: res.Header, 9403 HTTPStatusCode: res.StatusCode, 9404 }, 9405 } 9406 target := &ret 9407 if err := gensupport.DecodeResponse(target, res); err != nil { 9408 return nil, err 9409 } 9410 return ret, nil 9411 // { 9412 // "description": "Starts the replication in the read replica instance.", 9413 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/startReplica", 9414 // "httpMethod": "POST", 9415 // "id": "sql.instances.startReplica", 9416 // "parameterOrder": [ 9417 // "project", 9418 // "instance" 9419 // ], 9420 // "parameters": { 9421 // "instance": { 9422 // "description": "Cloud SQL read replica instance name.", 9423 // "location": "path", 9424 // "required": true, 9425 // "type": "string" 9426 // }, 9427 // "project": { 9428 // "description": "ID of the project that contains the read replica.", 9429 // "location": "path", 9430 // "required": true, 9431 // "type": "string" 9432 // } 9433 // }, 9434 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/startReplica", 9435 // "response": { 9436 // "$ref": "Operation" 9437 // }, 9438 // "scopes": [ 9439 // "https://www.googleapis.com/auth/cloud-platform", 9440 // "https://www.googleapis.com/auth/sqlservice.admin" 9441 // ] 9442 // } 9443 9444} 9445 9446// method id "sql.instances.stopReplica": 9447 9448type InstancesStopReplicaCall struct { 9449 s *Service 9450 project string 9451 instance string 9452 urlParams_ gensupport.URLParams 9453 ctx_ context.Context 9454 header_ http.Header 9455} 9456 9457// StopReplica: Stops the replication in the read replica instance. 9458// 9459// - instance: Cloud SQL read replica instance name. 9460// - project: ID of the project that contains the read replica. 9461func (r *InstancesService) StopReplica(project string, instance string) *InstancesStopReplicaCall { 9462 c := &InstancesStopReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9463 c.project = project 9464 c.instance = instance 9465 return c 9466} 9467 9468// Fields allows partial responses to be retrieved. See 9469// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9470// for more information. 9471func (c *InstancesStopReplicaCall) Fields(s ...googleapi.Field) *InstancesStopReplicaCall { 9472 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9473 return c 9474} 9475 9476// Context sets the context to be used in this call's Do method. Any 9477// pending HTTP request will be aborted if the provided context is 9478// canceled. 9479func (c *InstancesStopReplicaCall) Context(ctx context.Context) *InstancesStopReplicaCall { 9480 c.ctx_ = ctx 9481 return c 9482} 9483 9484// Header returns an http.Header that can be modified by the caller to 9485// add HTTP headers to the request. 9486func (c *InstancesStopReplicaCall) Header() http.Header { 9487 if c.header_ == nil { 9488 c.header_ = make(http.Header) 9489 } 9490 return c.header_ 9491} 9492 9493func (c *InstancesStopReplicaCall) doRequest(alt string) (*http.Response, error) { 9494 reqHeaders := make(http.Header) 9495 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 9496 for k, v := range c.header_ { 9497 reqHeaders[k] = v 9498 } 9499 reqHeaders.Set("User-Agent", c.s.userAgent()) 9500 var body io.Reader = nil 9501 c.urlParams_.Set("alt", alt) 9502 c.urlParams_.Set("prettyPrint", "false") 9503 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica") 9504 urls += "?" + c.urlParams_.Encode() 9505 req, err := http.NewRequest("POST", urls, body) 9506 if err != nil { 9507 return nil, err 9508 } 9509 req.Header = reqHeaders 9510 googleapi.Expand(req.URL, map[string]string{ 9511 "project": c.project, 9512 "instance": c.instance, 9513 }) 9514 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9515} 9516 9517// Do executes the "sql.instances.stopReplica" call. 9518// Exactly one of *Operation or error will be non-nil. Any non-2xx 9519// status code is an error. Response headers are in either 9520// *Operation.ServerResponse.Header or (if a response was returned at 9521// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9522// to check whether the returned error was because 9523// http.StatusNotModified was returned. 9524func (c *InstancesStopReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9525 gensupport.SetOptions(c.urlParams_, opts...) 9526 res, err := c.doRequest("json") 9527 if res != nil && res.StatusCode == http.StatusNotModified { 9528 if res.Body != nil { 9529 res.Body.Close() 9530 } 9531 return nil, &googleapi.Error{ 9532 Code: res.StatusCode, 9533 Header: res.Header, 9534 } 9535 } 9536 if err != nil { 9537 return nil, err 9538 } 9539 defer googleapi.CloseBody(res) 9540 if err := googleapi.CheckResponse(res); err != nil { 9541 return nil, err 9542 } 9543 ret := &Operation{ 9544 ServerResponse: googleapi.ServerResponse{ 9545 Header: res.Header, 9546 HTTPStatusCode: res.StatusCode, 9547 }, 9548 } 9549 target := &ret 9550 if err := gensupport.DecodeResponse(target, res); err != nil { 9551 return nil, err 9552 } 9553 return ret, nil 9554 // { 9555 // "description": "Stops the replication in the read replica instance.", 9556 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica", 9557 // "httpMethod": "POST", 9558 // "id": "sql.instances.stopReplica", 9559 // "parameterOrder": [ 9560 // "project", 9561 // "instance" 9562 // ], 9563 // "parameters": { 9564 // "instance": { 9565 // "description": "Cloud SQL read replica instance name.", 9566 // "location": "path", 9567 // "required": true, 9568 // "type": "string" 9569 // }, 9570 // "project": { 9571 // "description": "ID of the project that contains the read replica.", 9572 // "location": "path", 9573 // "required": true, 9574 // "type": "string" 9575 // } 9576 // }, 9577 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica", 9578 // "response": { 9579 // "$ref": "Operation" 9580 // }, 9581 // "scopes": [ 9582 // "https://www.googleapis.com/auth/cloud-platform", 9583 // "https://www.googleapis.com/auth/sqlservice.admin" 9584 // ] 9585 // } 9586 9587} 9588 9589// method id "sql.instances.truncateLog": 9590 9591type InstancesTruncateLogCall struct { 9592 s *Service 9593 project string 9594 instance string 9595 instancestruncatelogrequest *InstancesTruncateLogRequest 9596 urlParams_ gensupport.URLParams 9597 ctx_ context.Context 9598 header_ http.Header 9599} 9600 9601// TruncateLog: Truncate MySQL general and slow query log tables MySQL 9602// only. 9603// 9604// - instance: Cloud SQL instance ID. This does not include the project 9605// ID. 9606// - project: Project ID of the Cloud SQL project. 9607func (r *InstancesService) TruncateLog(project string, instance string, instancestruncatelogrequest *InstancesTruncateLogRequest) *InstancesTruncateLogCall { 9608 c := &InstancesTruncateLogCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9609 c.project = project 9610 c.instance = instance 9611 c.instancestruncatelogrequest = instancestruncatelogrequest 9612 return c 9613} 9614 9615// Fields allows partial responses to be retrieved. See 9616// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9617// for more information. 9618func (c *InstancesTruncateLogCall) Fields(s ...googleapi.Field) *InstancesTruncateLogCall { 9619 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9620 return c 9621} 9622 9623// Context sets the context to be used in this call's Do method. Any 9624// pending HTTP request will be aborted if the provided context is 9625// canceled. 9626func (c *InstancesTruncateLogCall) Context(ctx context.Context) *InstancesTruncateLogCall { 9627 c.ctx_ = ctx 9628 return c 9629} 9630 9631// Header returns an http.Header that can be modified by the caller to 9632// add HTTP headers to the request. 9633func (c *InstancesTruncateLogCall) Header() http.Header { 9634 if c.header_ == nil { 9635 c.header_ = make(http.Header) 9636 } 9637 return c.header_ 9638} 9639 9640func (c *InstancesTruncateLogCall) doRequest(alt string) (*http.Response, error) { 9641 reqHeaders := make(http.Header) 9642 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 9643 for k, v := range c.header_ { 9644 reqHeaders[k] = v 9645 } 9646 reqHeaders.Set("User-Agent", c.s.userAgent()) 9647 var body io.Reader = nil 9648 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancestruncatelogrequest) 9649 if err != nil { 9650 return nil, err 9651 } 9652 reqHeaders.Set("Content-Type", "application/json") 9653 c.urlParams_.Set("alt", alt) 9654 c.urlParams_.Set("prettyPrint", "false") 9655 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/truncateLog") 9656 urls += "?" + c.urlParams_.Encode() 9657 req, err := http.NewRequest("POST", urls, body) 9658 if err != nil { 9659 return nil, err 9660 } 9661 req.Header = reqHeaders 9662 googleapi.Expand(req.URL, map[string]string{ 9663 "project": c.project, 9664 "instance": c.instance, 9665 }) 9666 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9667} 9668 9669// Do executes the "sql.instances.truncateLog" call. 9670// Exactly one of *Operation or error will be non-nil. Any non-2xx 9671// status code is an error. Response headers are in either 9672// *Operation.ServerResponse.Header or (if a response was returned at 9673// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9674// to check whether the returned error was because 9675// http.StatusNotModified was returned. 9676func (c *InstancesTruncateLogCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9677 gensupport.SetOptions(c.urlParams_, opts...) 9678 res, err := c.doRequest("json") 9679 if res != nil && res.StatusCode == http.StatusNotModified { 9680 if res.Body != nil { 9681 res.Body.Close() 9682 } 9683 return nil, &googleapi.Error{ 9684 Code: res.StatusCode, 9685 Header: res.Header, 9686 } 9687 } 9688 if err != nil { 9689 return nil, err 9690 } 9691 defer googleapi.CloseBody(res) 9692 if err := googleapi.CheckResponse(res); err != nil { 9693 return nil, err 9694 } 9695 ret := &Operation{ 9696 ServerResponse: googleapi.ServerResponse{ 9697 Header: res.Header, 9698 HTTPStatusCode: res.StatusCode, 9699 }, 9700 } 9701 target := &ret 9702 if err := gensupport.DecodeResponse(target, res); err != nil { 9703 return nil, err 9704 } 9705 return ret, nil 9706 // { 9707 // "description": "Truncate MySQL general and slow query log tables MySQL only.", 9708 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/truncateLog", 9709 // "httpMethod": "POST", 9710 // "id": "sql.instances.truncateLog", 9711 // "parameterOrder": [ 9712 // "project", 9713 // "instance" 9714 // ], 9715 // "parameters": { 9716 // "instance": { 9717 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9718 // "location": "path", 9719 // "required": true, 9720 // "type": "string" 9721 // }, 9722 // "project": { 9723 // "description": "Project ID of the Cloud SQL project.", 9724 // "location": "path", 9725 // "required": true, 9726 // "type": "string" 9727 // } 9728 // }, 9729 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/truncateLog", 9730 // "request": { 9731 // "$ref": "InstancesTruncateLogRequest" 9732 // }, 9733 // "response": { 9734 // "$ref": "Operation" 9735 // }, 9736 // "scopes": [ 9737 // "https://www.googleapis.com/auth/cloud-platform", 9738 // "https://www.googleapis.com/auth/sqlservice.admin" 9739 // ] 9740 // } 9741 9742} 9743 9744// method id "sql.instances.update": 9745 9746type InstancesUpdateCall struct { 9747 s *Service 9748 project string 9749 instance string 9750 databaseinstance *DatabaseInstance 9751 urlParams_ gensupport.URLParams 9752 ctx_ context.Context 9753 header_ http.Header 9754} 9755 9756// Update: Updates settings of a Cloud SQL instance. Using this 9757// operation might cause your instance to restart. 9758// 9759// - instance: Cloud SQL instance ID. This does not include the project 9760// ID. 9761// - project: Project ID of the project that contains the instance. 9762func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall { 9763 c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9764 c.project = project 9765 c.instance = instance 9766 c.databaseinstance = databaseinstance 9767 return c 9768} 9769 9770// Fields allows partial responses to be retrieved. See 9771// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9772// for more information. 9773func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall { 9774 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9775 return c 9776} 9777 9778// Context sets the context to be used in this call's Do method. Any 9779// pending HTTP request will be aborted if the provided context is 9780// canceled. 9781func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall { 9782 c.ctx_ = ctx 9783 return c 9784} 9785 9786// Header returns an http.Header that can be modified by the caller to 9787// add HTTP headers to the request. 9788func (c *InstancesUpdateCall) Header() http.Header { 9789 if c.header_ == nil { 9790 c.header_ = make(http.Header) 9791 } 9792 return c.header_ 9793} 9794 9795func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) { 9796 reqHeaders := make(http.Header) 9797 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 9798 for k, v := range c.header_ { 9799 reqHeaders[k] = v 9800 } 9801 reqHeaders.Set("User-Agent", c.s.userAgent()) 9802 var body io.Reader = nil 9803 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) 9804 if err != nil { 9805 return nil, err 9806 } 9807 reqHeaders.Set("Content-Type", "application/json") 9808 c.urlParams_.Set("alt", alt) 9809 c.urlParams_.Set("prettyPrint", "false") 9810 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 9811 urls += "?" + c.urlParams_.Encode() 9812 req, err := http.NewRequest("PUT", urls, body) 9813 if err != nil { 9814 return nil, err 9815 } 9816 req.Header = reqHeaders 9817 googleapi.Expand(req.URL, map[string]string{ 9818 "project": c.project, 9819 "instance": c.instance, 9820 }) 9821 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9822} 9823 9824// Do executes the "sql.instances.update" call. 9825// Exactly one of *Operation or error will be non-nil. Any non-2xx 9826// status code is an error. Response headers are in either 9827// *Operation.ServerResponse.Header or (if a response was returned at 9828// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9829// to check whether the returned error was because 9830// http.StatusNotModified was returned. 9831func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9832 gensupport.SetOptions(c.urlParams_, opts...) 9833 res, err := c.doRequest("json") 9834 if res != nil && res.StatusCode == http.StatusNotModified { 9835 if res.Body != nil { 9836 res.Body.Close() 9837 } 9838 return nil, &googleapi.Error{ 9839 Code: res.StatusCode, 9840 Header: res.Header, 9841 } 9842 } 9843 if err != nil { 9844 return nil, err 9845 } 9846 defer googleapi.CloseBody(res) 9847 if err := googleapi.CheckResponse(res); err != nil { 9848 return nil, err 9849 } 9850 ret := &Operation{ 9851 ServerResponse: googleapi.ServerResponse{ 9852 Header: res.Header, 9853 HTTPStatusCode: res.StatusCode, 9854 }, 9855 } 9856 target := &ret 9857 if err := gensupport.DecodeResponse(target, res); err != nil { 9858 return nil, err 9859 } 9860 return ret, nil 9861 // { 9862 // "description": "Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.", 9863 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 9864 // "httpMethod": "PUT", 9865 // "id": "sql.instances.update", 9866 // "parameterOrder": [ 9867 // "project", 9868 // "instance" 9869 // ], 9870 // "parameters": { 9871 // "instance": { 9872 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9873 // "location": "path", 9874 // "required": true, 9875 // "type": "string" 9876 // }, 9877 // "project": { 9878 // "description": "Project ID of the project that contains the instance.", 9879 // "location": "path", 9880 // "required": true, 9881 // "type": "string" 9882 // } 9883 // }, 9884 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 9885 // "request": { 9886 // "$ref": "DatabaseInstance" 9887 // }, 9888 // "response": { 9889 // "$ref": "Operation" 9890 // }, 9891 // "scopes": [ 9892 // "https://www.googleapis.com/auth/cloud-platform", 9893 // "https://www.googleapis.com/auth/sqlservice.admin" 9894 // ] 9895 // } 9896 9897} 9898 9899// method id "sql.operations.get": 9900 9901type OperationsGetCall struct { 9902 s *Service 9903 project string 9904 operation string 9905 urlParams_ gensupport.URLParams 9906 ifNoneMatch_ string 9907 ctx_ context.Context 9908 header_ http.Header 9909} 9910 9911// Get: Retrieves an instance operation that has been performed on an 9912// instance. 9913// 9914// - operation: Instance operation ID. 9915// - project: Project ID of the project that contains the instance. 9916func (r *OperationsService) Get(project string, operation string) *OperationsGetCall { 9917 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9918 c.project = project 9919 c.operation = operation 9920 return c 9921} 9922 9923// Fields allows partial responses to be retrieved. See 9924// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9925// for more information. 9926func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 9927 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9928 return c 9929} 9930 9931// IfNoneMatch sets the optional parameter which makes the operation 9932// fail if the object's ETag matches the given value. This is useful for 9933// getting updates only after the object has changed since the last 9934// request. Use googleapi.IsNotModified to check whether the response 9935// error from Do is the result of In-None-Match. 9936func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 9937 c.ifNoneMatch_ = entityTag 9938 return c 9939} 9940 9941// Context sets the context to be used in this call's Do method. Any 9942// pending HTTP request will be aborted if the provided context is 9943// canceled. 9944func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 9945 c.ctx_ = ctx 9946 return c 9947} 9948 9949// Header returns an http.Header that can be modified by the caller to 9950// add HTTP headers to the request. 9951func (c *OperationsGetCall) Header() http.Header { 9952 if c.header_ == nil { 9953 c.header_ = make(http.Header) 9954 } 9955 return c.header_ 9956} 9957 9958func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 9959 reqHeaders := make(http.Header) 9960 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 9961 for k, v := range c.header_ { 9962 reqHeaders[k] = v 9963 } 9964 reqHeaders.Set("User-Agent", c.s.userAgent()) 9965 if c.ifNoneMatch_ != "" { 9966 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9967 } 9968 var body io.Reader = nil 9969 c.urlParams_.Set("alt", alt) 9970 c.urlParams_.Set("prettyPrint", "false") 9971 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/operations/{operation}") 9972 urls += "?" + c.urlParams_.Encode() 9973 req, err := http.NewRequest("GET", urls, body) 9974 if err != nil { 9975 return nil, err 9976 } 9977 req.Header = reqHeaders 9978 googleapi.Expand(req.URL, map[string]string{ 9979 "project": c.project, 9980 "operation": c.operation, 9981 }) 9982 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9983} 9984 9985// Do executes the "sql.operations.get" call. 9986// Exactly one of *Operation or error will be non-nil. Any non-2xx 9987// status code is an error. Response headers are in either 9988// *Operation.ServerResponse.Header or (if a response was returned at 9989// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9990// to check whether the returned error was because 9991// http.StatusNotModified was returned. 9992func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9993 gensupport.SetOptions(c.urlParams_, opts...) 9994 res, err := c.doRequest("json") 9995 if res != nil && res.StatusCode == http.StatusNotModified { 9996 if res.Body != nil { 9997 res.Body.Close() 9998 } 9999 return nil, &googleapi.Error{ 10000 Code: res.StatusCode, 10001 Header: res.Header, 10002 } 10003 } 10004 if err != nil { 10005 return nil, err 10006 } 10007 defer googleapi.CloseBody(res) 10008 if err := googleapi.CheckResponse(res); err != nil { 10009 return nil, err 10010 } 10011 ret := &Operation{ 10012 ServerResponse: googleapi.ServerResponse{ 10013 Header: res.Header, 10014 HTTPStatusCode: res.StatusCode, 10015 }, 10016 } 10017 target := &ret 10018 if err := gensupport.DecodeResponse(target, res); err != nil { 10019 return nil, err 10020 } 10021 return ret, nil 10022 // { 10023 // "description": "Retrieves an instance operation that has been performed on an instance.", 10024 // "flatPath": "sql/v1beta4/projects/{project}/operations/{operation}", 10025 // "httpMethod": "GET", 10026 // "id": "sql.operations.get", 10027 // "parameterOrder": [ 10028 // "project", 10029 // "operation" 10030 // ], 10031 // "parameters": { 10032 // "operation": { 10033 // "description": "Instance operation ID.", 10034 // "location": "path", 10035 // "required": true, 10036 // "type": "string" 10037 // }, 10038 // "project": { 10039 // "description": "Project ID of the project that contains the instance.", 10040 // "location": "path", 10041 // "required": true, 10042 // "type": "string" 10043 // } 10044 // }, 10045 // "path": "sql/v1beta4/projects/{project}/operations/{operation}", 10046 // "response": { 10047 // "$ref": "Operation" 10048 // }, 10049 // "scopes": [ 10050 // "https://www.googleapis.com/auth/cloud-platform", 10051 // "https://www.googleapis.com/auth/sqlservice.admin" 10052 // ] 10053 // } 10054 10055} 10056 10057// method id "sql.operations.list": 10058 10059type OperationsListCall struct { 10060 s *Service 10061 project string 10062 urlParams_ gensupport.URLParams 10063 ifNoneMatch_ string 10064 ctx_ context.Context 10065 header_ http.Header 10066} 10067 10068// List: Lists all instance operations that have been performed on the 10069// given Cloud SQL instance in the reverse chronological order of the 10070// start time. 10071// 10072// - project: Project ID of the project that contains the instance. 10073func (r *OperationsService) List(project string) *OperationsListCall { 10074 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10075 c.project = project 10076 return c 10077} 10078 10079// Instance sets the optional parameter "instance": Cloud SQL instance 10080// ID. This does not include the project ID. 10081func (c *OperationsListCall) Instance(instance string) *OperationsListCall { 10082 c.urlParams_.Set("instance", instance) 10083 return c 10084} 10085 10086// MaxResults sets the optional parameter "maxResults": Maximum number 10087// of operations per response. 10088func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall { 10089 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 10090 return c 10091} 10092 10093// PageToken sets the optional parameter "pageToken": A 10094// previously-returned page token representing part of the larger set of 10095// results to view. 10096func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { 10097 c.urlParams_.Set("pageToken", pageToken) 10098 return c 10099} 10100 10101// Fields allows partial responses to be retrieved. See 10102// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10103// for more information. 10104func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { 10105 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10106 return c 10107} 10108 10109// IfNoneMatch sets the optional parameter which makes the operation 10110// fail if the object's ETag matches the given value. This is useful for 10111// getting updates only after the object has changed since the last 10112// request. Use googleapi.IsNotModified to check whether the response 10113// error from Do is the result of In-None-Match. 10114func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { 10115 c.ifNoneMatch_ = entityTag 10116 return c 10117} 10118 10119// Context sets the context to be used in this call's Do method. Any 10120// pending HTTP request will be aborted if the provided context is 10121// canceled. 10122func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { 10123 c.ctx_ = ctx 10124 return c 10125} 10126 10127// Header returns an http.Header that can be modified by the caller to 10128// add HTTP headers to the request. 10129func (c *OperationsListCall) Header() http.Header { 10130 if c.header_ == nil { 10131 c.header_ = make(http.Header) 10132 } 10133 return c.header_ 10134} 10135 10136func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { 10137 reqHeaders := make(http.Header) 10138 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 10139 for k, v := range c.header_ { 10140 reqHeaders[k] = v 10141 } 10142 reqHeaders.Set("User-Agent", c.s.userAgent()) 10143 if c.ifNoneMatch_ != "" { 10144 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10145 } 10146 var body io.Reader = nil 10147 c.urlParams_.Set("alt", alt) 10148 c.urlParams_.Set("prettyPrint", "false") 10149 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/operations") 10150 urls += "?" + c.urlParams_.Encode() 10151 req, err := http.NewRequest("GET", urls, body) 10152 if err != nil { 10153 return nil, err 10154 } 10155 req.Header = reqHeaders 10156 googleapi.Expand(req.URL, map[string]string{ 10157 "project": c.project, 10158 }) 10159 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10160} 10161 10162// Do executes the "sql.operations.list" call. 10163// Exactly one of *OperationsListResponse or error will be non-nil. Any 10164// non-2xx status code is an error. Response headers are in either 10165// *OperationsListResponse.ServerResponse.Header or (if a response was 10166// returned at all) in error.(*googleapi.Error).Header. Use 10167// googleapi.IsNotModified to check whether the returned error was 10168// because http.StatusNotModified was returned. 10169func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) { 10170 gensupport.SetOptions(c.urlParams_, opts...) 10171 res, err := c.doRequest("json") 10172 if res != nil && res.StatusCode == http.StatusNotModified { 10173 if res.Body != nil { 10174 res.Body.Close() 10175 } 10176 return nil, &googleapi.Error{ 10177 Code: res.StatusCode, 10178 Header: res.Header, 10179 } 10180 } 10181 if err != nil { 10182 return nil, err 10183 } 10184 defer googleapi.CloseBody(res) 10185 if err := googleapi.CheckResponse(res); err != nil { 10186 return nil, err 10187 } 10188 ret := &OperationsListResponse{ 10189 ServerResponse: googleapi.ServerResponse{ 10190 Header: res.Header, 10191 HTTPStatusCode: res.StatusCode, 10192 }, 10193 } 10194 target := &ret 10195 if err := gensupport.DecodeResponse(target, res); err != nil { 10196 return nil, err 10197 } 10198 return ret, nil 10199 // { 10200 // "description": "Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.", 10201 // "flatPath": "sql/v1beta4/projects/{project}/operations", 10202 // "httpMethod": "GET", 10203 // "id": "sql.operations.list", 10204 // "parameterOrder": [ 10205 // "project" 10206 // ], 10207 // "parameters": { 10208 // "instance": { 10209 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10210 // "location": "query", 10211 // "type": "string" 10212 // }, 10213 // "maxResults": { 10214 // "description": "Maximum number of operations per response.", 10215 // "format": "uint32", 10216 // "location": "query", 10217 // "type": "integer" 10218 // }, 10219 // "pageToken": { 10220 // "description": "A previously-returned page token representing part of the larger set of results to view.", 10221 // "location": "query", 10222 // "type": "string" 10223 // }, 10224 // "project": { 10225 // "description": "Project ID of the project that contains the instance.", 10226 // "location": "path", 10227 // "required": true, 10228 // "type": "string" 10229 // } 10230 // }, 10231 // "path": "sql/v1beta4/projects/{project}/operations", 10232 // "response": { 10233 // "$ref": "OperationsListResponse" 10234 // }, 10235 // "scopes": [ 10236 // "https://www.googleapis.com/auth/cloud-platform", 10237 // "https://www.googleapis.com/auth/sqlservice.admin" 10238 // ] 10239 // } 10240 10241} 10242 10243// Pages invokes f for each page of results. 10244// A non-nil error returned from f will halt the iteration. 10245// The provided context supersedes any context provided to the Context method. 10246func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error { 10247 c.ctx_ = ctx 10248 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10249 for { 10250 x, err := c.Do() 10251 if err != nil { 10252 return err 10253 } 10254 if err := f(x); err != nil { 10255 return err 10256 } 10257 if x.NextPageToken == "" { 10258 return nil 10259 } 10260 c.PageToken(x.NextPageToken) 10261 } 10262} 10263 10264// method id "sql.projects.instances.rescheduleMaintenance": 10265 10266type ProjectsInstancesRescheduleMaintenanceCall struct { 10267 s *Service 10268 project string 10269 instance string 10270 sqlinstancesreschedulemaintenancerequestbody *SqlInstancesRescheduleMaintenanceRequestBody 10271 urlParams_ gensupport.URLParams 10272 ctx_ context.Context 10273 header_ http.Header 10274} 10275 10276// RescheduleMaintenance: Reschedules the maintenance on the given 10277// instance. 10278// 10279// - instance: Cloud SQL instance ID. This does not include the project 10280// ID. 10281// - project: ID of the project that contains the instance. 10282func (r *ProjectsInstancesService) RescheduleMaintenance(project string, instance string, sqlinstancesreschedulemaintenancerequestbody *SqlInstancesRescheduleMaintenanceRequestBody) *ProjectsInstancesRescheduleMaintenanceCall { 10283 c := &ProjectsInstancesRescheduleMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10284 c.project = project 10285 c.instance = instance 10286 c.sqlinstancesreschedulemaintenancerequestbody = sqlinstancesreschedulemaintenancerequestbody 10287 return c 10288} 10289 10290// Fields allows partial responses to be retrieved. See 10291// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10292// for more information. 10293func (c *ProjectsInstancesRescheduleMaintenanceCall) Fields(s ...googleapi.Field) *ProjectsInstancesRescheduleMaintenanceCall { 10294 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10295 return c 10296} 10297 10298// Context sets the context to be used in this call's Do method. Any 10299// pending HTTP request will be aborted if the provided context is 10300// canceled. 10301func (c *ProjectsInstancesRescheduleMaintenanceCall) Context(ctx context.Context) *ProjectsInstancesRescheduleMaintenanceCall { 10302 c.ctx_ = ctx 10303 return c 10304} 10305 10306// Header returns an http.Header that can be modified by the caller to 10307// add HTTP headers to the request. 10308func (c *ProjectsInstancesRescheduleMaintenanceCall) Header() http.Header { 10309 if c.header_ == nil { 10310 c.header_ = make(http.Header) 10311 } 10312 return c.header_ 10313} 10314 10315func (c *ProjectsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) { 10316 reqHeaders := make(http.Header) 10317 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 10318 for k, v := range c.header_ { 10319 reqHeaders[k] = v 10320 } 10321 reqHeaders.Set("User-Agent", c.s.userAgent()) 10322 var body io.Reader = nil 10323 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesreschedulemaintenancerequestbody) 10324 if err != nil { 10325 return nil, err 10326 } 10327 reqHeaders.Set("Content-Type", "application/json") 10328 c.urlParams_.Set("alt", alt) 10329 c.urlParams_.Set("prettyPrint", "false") 10330 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance") 10331 urls += "?" + c.urlParams_.Encode() 10332 req, err := http.NewRequest("POST", urls, body) 10333 if err != nil { 10334 return nil, err 10335 } 10336 req.Header = reqHeaders 10337 googleapi.Expand(req.URL, map[string]string{ 10338 "project": c.project, 10339 "instance": c.instance, 10340 }) 10341 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10342} 10343 10344// Do executes the "sql.projects.instances.rescheduleMaintenance" call. 10345// Exactly one of *Operation or error will be non-nil. Any non-2xx 10346// status code is an error. Response headers are in either 10347// *Operation.ServerResponse.Header or (if a response was returned at 10348// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10349// to check whether the returned error was because 10350// http.StatusNotModified was returned. 10351func (c *ProjectsInstancesRescheduleMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10352 gensupport.SetOptions(c.urlParams_, opts...) 10353 res, err := c.doRequest("json") 10354 if res != nil && res.StatusCode == http.StatusNotModified { 10355 if res.Body != nil { 10356 res.Body.Close() 10357 } 10358 return nil, &googleapi.Error{ 10359 Code: res.StatusCode, 10360 Header: res.Header, 10361 } 10362 } 10363 if err != nil { 10364 return nil, err 10365 } 10366 defer googleapi.CloseBody(res) 10367 if err := googleapi.CheckResponse(res); err != nil { 10368 return nil, err 10369 } 10370 ret := &Operation{ 10371 ServerResponse: googleapi.ServerResponse{ 10372 Header: res.Header, 10373 HTTPStatusCode: res.StatusCode, 10374 }, 10375 } 10376 target := &ret 10377 if err := gensupport.DecodeResponse(target, res); err != nil { 10378 return nil, err 10379 } 10380 return ret, nil 10381 // { 10382 // "description": "Reschedules the maintenance on the given instance.", 10383 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance", 10384 // "httpMethod": "POST", 10385 // "id": "sql.projects.instances.rescheduleMaintenance", 10386 // "parameterOrder": [ 10387 // "project", 10388 // "instance" 10389 // ], 10390 // "parameters": { 10391 // "instance": { 10392 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10393 // "location": "path", 10394 // "required": true, 10395 // "type": "string" 10396 // }, 10397 // "project": { 10398 // "description": "ID of the project that contains the instance.", 10399 // "location": "path", 10400 // "required": true, 10401 // "type": "string" 10402 // } 10403 // }, 10404 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance", 10405 // "request": { 10406 // "$ref": "SqlInstancesRescheduleMaintenanceRequestBody" 10407 // }, 10408 // "response": { 10409 // "$ref": "Operation" 10410 // }, 10411 // "scopes": [ 10412 // "https://www.googleapis.com/auth/cloud-platform", 10413 // "https://www.googleapis.com/auth/sqlservice.admin" 10414 // ] 10415 // } 10416 10417} 10418 10419// method id "sql.projects.instances.startExternalSync": 10420 10421type ProjectsInstancesStartExternalSyncCall struct { 10422 s *Service 10423 project string 10424 instance string 10425 sqlinstancesstartexternalsyncrequest *SqlInstancesStartExternalSyncRequest 10426 urlParams_ gensupport.URLParams 10427 ctx_ context.Context 10428 header_ http.Header 10429} 10430 10431// StartExternalSync: Start External primary instance migration. 10432// 10433// - instance: Cloud SQL instance ID. This does not include the project 10434// ID. 10435// - project: ID of the project that contains the instance. 10436func (r *ProjectsInstancesService) StartExternalSync(project string, instance string, sqlinstancesstartexternalsyncrequest *SqlInstancesStartExternalSyncRequest) *ProjectsInstancesStartExternalSyncCall { 10437 c := &ProjectsInstancesStartExternalSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10438 c.project = project 10439 c.instance = instance 10440 c.sqlinstancesstartexternalsyncrequest = sqlinstancesstartexternalsyncrequest 10441 return c 10442} 10443 10444// Fields allows partial responses to be retrieved. See 10445// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10446// for more information. 10447func (c *ProjectsInstancesStartExternalSyncCall) Fields(s ...googleapi.Field) *ProjectsInstancesStartExternalSyncCall { 10448 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10449 return c 10450} 10451 10452// Context sets the context to be used in this call's Do method. Any 10453// pending HTTP request will be aborted if the provided context is 10454// canceled. 10455func (c *ProjectsInstancesStartExternalSyncCall) Context(ctx context.Context) *ProjectsInstancesStartExternalSyncCall { 10456 c.ctx_ = ctx 10457 return c 10458} 10459 10460// Header returns an http.Header that can be modified by the caller to 10461// add HTTP headers to the request. 10462func (c *ProjectsInstancesStartExternalSyncCall) Header() http.Header { 10463 if c.header_ == nil { 10464 c.header_ = make(http.Header) 10465 } 10466 return c.header_ 10467} 10468 10469func (c *ProjectsInstancesStartExternalSyncCall) doRequest(alt string) (*http.Response, error) { 10470 reqHeaders := make(http.Header) 10471 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 10472 for k, v := range c.header_ { 10473 reqHeaders[k] = v 10474 } 10475 reqHeaders.Set("User-Agent", c.s.userAgent()) 10476 var body io.Reader = nil 10477 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesstartexternalsyncrequest) 10478 if err != nil { 10479 return nil, err 10480 } 10481 reqHeaders.Set("Content-Type", "application/json") 10482 c.urlParams_.Set("alt", alt) 10483 c.urlParams_.Set("prettyPrint", "false") 10484 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync") 10485 urls += "?" + c.urlParams_.Encode() 10486 req, err := http.NewRequest("POST", urls, body) 10487 if err != nil { 10488 return nil, err 10489 } 10490 req.Header = reqHeaders 10491 googleapi.Expand(req.URL, map[string]string{ 10492 "project": c.project, 10493 "instance": c.instance, 10494 }) 10495 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10496} 10497 10498// Do executes the "sql.projects.instances.startExternalSync" call. 10499// Exactly one of *Operation or error will be non-nil. Any non-2xx 10500// status code is an error. Response headers are in either 10501// *Operation.ServerResponse.Header or (if a response was returned at 10502// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10503// to check whether the returned error was because 10504// http.StatusNotModified was returned. 10505func (c *ProjectsInstancesStartExternalSyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10506 gensupport.SetOptions(c.urlParams_, opts...) 10507 res, err := c.doRequest("json") 10508 if res != nil && res.StatusCode == http.StatusNotModified { 10509 if res.Body != nil { 10510 res.Body.Close() 10511 } 10512 return nil, &googleapi.Error{ 10513 Code: res.StatusCode, 10514 Header: res.Header, 10515 } 10516 } 10517 if err != nil { 10518 return nil, err 10519 } 10520 defer googleapi.CloseBody(res) 10521 if err := googleapi.CheckResponse(res); err != nil { 10522 return nil, err 10523 } 10524 ret := &Operation{ 10525 ServerResponse: googleapi.ServerResponse{ 10526 Header: res.Header, 10527 HTTPStatusCode: res.StatusCode, 10528 }, 10529 } 10530 target := &ret 10531 if err := gensupport.DecodeResponse(target, res); err != nil { 10532 return nil, err 10533 } 10534 return ret, nil 10535 // { 10536 // "description": "Start External primary instance migration.", 10537 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync", 10538 // "httpMethod": "POST", 10539 // "id": "sql.projects.instances.startExternalSync", 10540 // "parameterOrder": [ 10541 // "project", 10542 // "instance" 10543 // ], 10544 // "parameters": { 10545 // "instance": { 10546 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10547 // "location": "path", 10548 // "required": true, 10549 // "type": "string" 10550 // }, 10551 // "project": { 10552 // "description": "ID of the project that contains the instance.", 10553 // "location": "path", 10554 // "required": true, 10555 // "type": "string" 10556 // } 10557 // }, 10558 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync", 10559 // "request": { 10560 // "$ref": "SqlInstancesStartExternalSyncRequest" 10561 // }, 10562 // "response": { 10563 // "$ref": "Operation" 10564 // }, 10565 // "scopes": [ 10566 // "https://www.googleapis.com/auth/cloud-platform", 10567 // "https://www.googleapis.com/auth/sqlservice.admin" 10568 // ] 10569 // } 10570 10571} 10572 10573// method id "sql.projects.instances.verifyExternalSyncSettings": 10574 10575type ProjectsInstancesVerifyExternalSyncSettingsCall struct { 10576 s *Service 10577 project string 10578 instance string 10579 sqlinstancesverifyexternalsyncsettingsrequest *SqlInstancesVerifyExternalSyncSettingsRequest 10580 urlParams_ gensupport.URLParams 10581 ctx_ context.Context 10582 header_ http.Header 10583} 10584 10585// VerifyExternalSyncSettings: Verify External primary instance external 10586// sync settings. 10587// 10588// - instance: Cloud SQL instance ID. This does not include the project 10589// ID. 10590// - project: Project ID of the project that contains the instance. 10591func (r *ProjectsInstancesService) VerifyExternalSyncSettings(project string, instance string, sqlinstancesverifyexternalsyncsettingsrequest *SqlInstancesVerifyExternalSyncSettingsRequest) *ProjectsInstancesVerifyExternalSyncSettingsCall { 10592 c := &ProjectsInstancesVerifyExternalSyncSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10593 c.project = project 10594 c.instance = instance 10595 c.sqlinstancesverifyexternalsyncsettingsrequest = sqlinstancesverifyexternalsyncsettingsrequest 10596 return c 10597} 10598 10599// Fields allows partial responses to be retrieved. See 10600// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10601// for more information. 10602func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Fields(s ...googleapi.Field) *ProjectsInstancesVerifyExternalSyncSettingsCall { 10603 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10604 return c 10605} 10606 10607// Context sets the context to be used in this call's Do method. Any 10608// pending HTTP request will be aborted if the provided context is 10609// canceled. 10610func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Context(ctx context.Context) *ProjectsInstancesVerifyExternalSyncSettingsCall { 10611 c.ctx_ = ctx 10612 return c 10613} 10614 10615// Header returns an http.Header that can be modified by the caller to 10616// add HTTP headers to the request. 10617func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Header() http.Header { 10618 if c.header_ == nil { 10619 c.header_ = make(http.Header) 10620 } 10621 return c.header_ 10622} 10623 10624func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) doRequest(alt string) (*http.Response, error) { 10625 reqHeaders := make(http.Header) 10626 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 10627 for k, v := range c.header_ { 10628 reqHeaders[k] = v 10629 } 10630 reqHeaders.Set("User-Agent", c.s.userAgent()) 10631 var body io.Reader = nil 10632 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesverifyexternalsyncsettingsrequest) 10633 if err != nil { 10634 return nil, err 10635 } 10636 reqHeaders.Set("Content-Type", "application/json") 10637 c.urlParams_.Set("alt", alt) 10638 c.urlParams_.Set("prettyPrint", "false") 10639 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings") 10640 urls += "?" + c.urlParams_.Encode() 10641 req, err := http.NewRequest("POST", urls, body) 10642 if err != nil { 10643 return nil, err 10644 } 10645 req.Header = reqHeaders 10646 googleapi.Expand(req.URL, map[string]string{ 10647 "project": c.project, 10648 "instance": c.instance, 10649 }) 10650 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10651} 10652 10653// Do executes the "sql.projects.instances.verifyExternalSyncSettings" call. 10654// Exactly one of *SqlInstancesVerifyExternalSyncSettingsResponse or 10655// error will be non-nil. Any non-2xx status code is an error. Response 10656// headers are in either 10657// *SqlInstancesVerifyExternalSyncSettingsResponse.ServerResponse.Header 10658// or (if a response was returned at all) in 10659// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10660// whether the returned error was because http.StatusNotModified was 10661// returned. 10662func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Do(opts ...googleapi.CallOption) (*SqlInstancesVerifyExternalSyncSettingsResponse, error) { 10663 gensupport.SetOptions(c.urlParams_, opts...) 10664 res, err := c.doRequest("json") 10665 if res != nil && res.StatusCode == http.StatusNotModified { 10666 if res.Body != nil { 10667 res.Body.Close() 10668 } 10669 return nil, &googleapi.Error{ 10670 Code: res.StatusCode, 10671 Header: res.Header, 10672 } 10673 } 10674 if err != nil { 10675 return nil, err 10676 } 10677 defer googleapi.CloseBody(res) 10678 if err := googleapi.CheckResponse(res); err != nil { 10679 return nil, err 10680 } 10681 ret := &SqlInstancesVerifyExternalSyncSettingsResponse{ 10682 ServerResponse: googleapi.ServerResponse{ 10683 Header: res.Header, 10684 HTTPStatusCode: res.StatusCode, 10685 }, 10686 } 10687 target := &ret 10688 if err := gensupport.DecodeResponse(target, res); err != nil { 10689 return nil, err 10690 } 10691 return ret, nil 10692 // { 10693 // "description": "Verify External primary instance external sync settings.", 10694 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings", 10695 // "httpMethod": "POST", 10696 // "id": "sql.projects.instances.verifyExternalSyncSettings", 10697 // "parameterOrder": [ 10698 // "project", 10699 // "instance" 10700 // ], 10701 // "parameters": { 10702 // "instance": { 10703 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10704 // "location": "path", 10705 // "required": true, 10706 // "type": "string" 10707 // }, 10708 // "project": { 10709 // "description": "Project ID of the project that contains the instance.", 10710 // "location": "path", 10711 // "required": true, 10712 // "type": "string" 10713 // } 10714 // }, 10715 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings", 10716 // "request": { 10717 // "$ref": "SqlInstancesVerifyExternalSyncSettingsRequest" 10718 // }, 10719 // "response": { 10720 // "$ref": "SqlInstancesVerifyExternalSyncSettingsResponse" 10721 // }, 10722 // "scopes": [ 10723 // "https://www.googleapis.com/auth/cloud-platform", 10724 // "https://www.googleapis.com/auth/sqlservice.admin" 10725 // ] 10726 // } 10727 10728} 10729 10730// method id "sql.sslCerts.createEphemeral": 10731 10732type SslCertsCreateEphemeralCall struct { 10733 s *Service 10734 project string 10735 instance string 10736 sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest 10737 urlParams_ gensupport.URLParams 10738 ctx_ context.Context 10739 header_ http.Header 10740} 10741 10742// CreateEphemeral: Generates a short-lived X509 certificate containing 10743// the provided public key and signed by a private key specific to the 10744// target instance. Users may use the certificate to authenticate as 10745// themselves when connecting to the database. 10746// 10747// - instance: Cloud SQL instance ID. This does not include the project 10748// ID. 10749// - project: Project ID of the Cloud SQL project. 10750func (r *SslCertsService) CreateEphemeral(project string, instance string, sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest) *SslCertsCreateEphemeralCall { 10751 c := &SslCertsCreateEphemeralCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10752 c.project = project 10753 c.instance = instance 10754 c.sslcertscreateephemeralrequest = sslcertscreateephemeralrequest 10755 return c 10756} 10757 10758// Fields allows partial responses to be retrieved. See 10759// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10760// for more information. 10761func (c *SslCertsCreateEphemeralCall) Fields(s ...googleapi.Field) *SslCertsCreateEphemeralCall { 10762 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10763 return c 10764} 10765 10766// Context sets the context to be used in this call's Do method. Any 10767// pending HTTP request will be aborted if the provided context is 10768// canceled. 10769func (c *SslCertsCreateEphemeralCall) Context(ctx context.Context) *SslCertsCreateEphemeralCall { 10770 c.ctx_ = ctx 10771 return c 10772} 10773 10774// Header returns an http.Header that can be modified by the caller to 10775// add HTTP headers to the request. 10776func (c *SslCertsCreateEphemeralCall) Header() http.Header { 10777 if c.header_ == nil { 10778 c.header_ = make(http.Header) 10779 } 10780 return c.header_ 10781} 10782 10783func (c *SslCertsCreateEphemeralCall) doRequest(alt string) (*http.Response, error) { 10784 reqHeaders := make(http.Header) 10785 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 10786 for k, v := range c.header_ { 10787 reqHeaders[k] = v 10788 } 10789 reqHeaders.Set("User-Agent", c.s.userAgent()) 10790 var body io.Reader = nil 10791 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertscreateephemeralrequest) 10792 if err != nil { 10793 return nil, err 10794 } 10795 reqHeaders.Set("Content-Type", "application/json") 10796 c.urlParams_.Set("alt", alt) 10797 c.urlParams_.Set("prettyPrint", "false") 10798 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral") 10799 urls += "?" + c.urlParams_.Encode() 10800 req, err := http.NewRequest("POST", urls, body) 10801 if err != nil { 10802 return nil, err 10803 } 10804 req.Header = reqHeaders 10805 googleapi.Expand(req.URL, map[string]string{ 10806 "project": c.project, 10807 "instance": c.instance, 10808 }) 10809 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10810} 10811 10812// Do executes the "sql.sslCerts.createEphemeral" call. 10813// Exactly one of *SslCert or error will be non-nil. Any non-2xx status 10814// code is an error. Response headers are in either 10815// *SslCert.ServerResponse.Header or (if a response was returned at all) 10816// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10817// check whether the returned error was because http.StatusNotModified 10818// was returned. 10819func (c *SslCertsCreateEphemeralCall) Do(opts ...googleapi.CallOption) (*SslCert, error) { 10820 gensupport.SetOptions(c.urlParams_, opts...) 10821 res, err := c.doRequest("json") 10822 if res != nil && res.StatusCode == http.StatusNotModified { 10823 if res.Body != nil { 10824 res.Body.Close() 10825 } 10826 return nil, &googleapi.Error{ 10827 Code: res.StatusCode, 10828 Header: res.Header, 10829 } 10830 } 10831 if err != nil { 10832 return nil, err 10833 } 10834 defer googleapi.CloseBody(res) 10835 if err := googleapi.CheckResponse(res); err != nil { 10836 return nil, err 10837 } 10838 ret := &SslCert{ 10839 ServerResponse: googleapi.ServerResponse{ 10840 Header: res.Header, 10841 HTTPStatusCode: res.StatusCode, 10842 }, 10843 } 10844 target := &ret 10845 if err := gensupport.DecodeResponse(target, res); err != nil { 10846 return nil, err 10847 } 10848 return ret, nil 10849 // { 10850 // "description": "Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.", 10851 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral", 10852 // "httpMethod": "POST", 10853 // "id": "sql.sslCerts.createEphemeral", 10854 // "parameterOrder": [ 10855 // "project", 10856 // "instance" 10857 // ], 10858 // "parameters": { 10859 // "instance": { 10860 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10861 // "location": "path", 10862 // "required": true, 10863 // "type": "string" 10864 // }, 10865 // "project": { 10866 // "description": "Project ID of the Cloud SQL project.", 10867 // "location": "path", 10868 // "required": true, 10869 // "type": "string" 10870 // } 10871 // }, 10872 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral", 10873 // "request": { 10874 // "$ref": "SslCertsCreateEphemeralRequest" 10875 // }, 10876 // "response": { 10877 // "$ref": "SslCert" 10878 // }, 10879 // "scopes": [ 10880 // "https://www.googleapis.com/auth/cloud-platform", 10881 // "https://www.googleapis.com/auth/sqlservice.admin" 10882 // ] 10883 // } 10884 10885} 10886 10887// method id "sql.sslCerts.delete": 10888 10889type SslCertsDeleteCall struct { 10890 s *Service 10891 project string 10892 instance string 10893 sha1Fingerprint string 10894 urlParams_ gensupport.URLParams 10895 ctx_ context.Context 10896 header_ http.Header 10897} 10898 10899// Delete: Deletes the SSL certificate. For First Generation instances, 10900// the certificate remains valid until the instance is restarted. 10901// 10902// - instance: Cloud SQL instance ID. This does not include the project 10903// ID. 10904// - project: Project ID of the project that contains the instance. 10905// - sha1Fingerprint: Sha1 FingerPrint. 10906func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall { 10907 c := &SslCertsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10908 c.project = project 10909 c.instance = instance 10910 c.sha1Fingerprint = sha1Fingerprint 10911 return c 10912} 10913 10914// Fields allows partial responses to be retrieved. See 10915// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10916// for more information. 10917func (c *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall { 10918 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10919 return c 10920} 10921 10922// Context sets the context to be used in this call's Do method. Any 10923// pending HTTP request will be aborted if the provided context is 10924// canceled. 10925func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall { 10926 c.ctx_ = ctx 10927 return c 10928} 10929 10930// Header returns an http.Header that can be modified by the caller to 10931// add HTTP headers to the request. 10932func (c *SslCertsDeleteCall) Header() http.Header { 10933 if c.header_ == nil { 10934 c.header_ = make(http.Header) 10935 } 10936 return c.header_ 10937} 10938 10939func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) { 10940 reqHeaders := make(http.Header) 10941 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 10942 for k, v := range c.header_ { 10943 reqHeaders[k] = v 10944 } 10945 reqHeaders.Set("User-Agent", c.s.userAgent()) 10946 var body io.Reader = nil 10947 c.urlParams_.Set("alt", alt) 10948 c.urlParams_.Set("prettyPrint", "false") 10949 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") 10950 urls += "?" + c.urlParams_.Encode() 10951 req, err := http.NewRequest("DELETE", urls, body) 10952 if err != nil { 10953 return nil, err 10954 } 10955 req.Header = reqHeaders 10956 googleapi.Expand(req.URL, map[string]string{ 10957 "project": c.project, 10958 "instance": c.instance, 10959 "sha1Fingerprint": c.sha1Fingerprint, 10960 }) 10961 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10962} 10963 10964// Do executes the "sql.sslCerts.delete" call. 10965// Exactly one of *Operation or error will be non-nil. Any non-2xx 10966// status code is an error. Response headers are in either 10967// *Operation.ServerResponse.Header or (if a response was returned at 10968// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10969// to check whether the returned error was because 10970// http.StatusNotModified was returned. 10971func (c *SslCertsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10972 gensupport.SetOptions(c.urlParams_, opts...) 10973 res, err := c.doRequest("json") 10974 if res != nil && res.StatusCode == http.StatusNotModified { 10975 if res.Body != nil { 10976 res.Body.Close() 10977 } 10978 return nil, &googleapi.Error{ 10979 Code: res.StatusCode, 10980 Header: res.Header, 10981 } 10982 } 10983 if err != nil { 10984 return nil, err 10985 } 10986 defer googleapi.CloseBody(res) 10987 if err := googleapi.CheckResponse(res); err != nil { 10988 return nil, err 10989 } 10990 ret := &Operation{ 10991 ServerResponse: googleapi.ServerResponse{ 10992 Header: res.Header, 10993 HTTPStatusCode: res.StatusCode, 10994 }, 10995 } 10996 target := &ret 10997 if err := gensupport.DecodeResponse(target, res); err != nil { 10998 return nil, err 10999 } 11000 return ret, nil 11001 // { 11002 // "description": "Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.", 11003 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 11004 // "httpMethod": "DELETE", 11005 // "id": "sql.sslCerts.delete", 11006 // "parameterOrder": [ 11007 // "project", 11008 // "instance", 11009 // "sha1Fingerprint" 11010 // ], 11011 // "parameters": { 11012 // "instance": { 11013 // "description": "Cloud SQL instance ID. This does not include the project ID.", 11014 // "location": "path", 11015 // "required": true, 11016 // "type": "string" 11017 // }, 11018 // "project": { 11019 // "description": "Project ID of the project that contains the instance.", 11020 // "location": "path", 11021 // "required": true, 11022 // "type": "string" 11023 // }, 11024 // "sha1Fingerprint": { 11025 // "description": "Sha1 FingerPrint.", 11026 // "location": "path", 11027 // "required": true, 11028 // "type": "string" 11029 // } 11030 // }, 11031 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 11032 // "response": { 11033 // "$ref": "Operation" 11034 // }, 11035 // "scopes": [ 11036 // "https://www.googleapis.com/auth/cloud-platform", 11037 // "https://www.googleapis.com/auth/sqlservice.admin" 11038 // ] 11039 // } 11040 11041} 11042 11043// method id "sql.sslCerts.get": 11044 11045type SslCertsGetCall struct { 11046 s *Service 11047 project string 11048 instance string 11049 sha1Fingerprint string 11050 urlParams_ gensupport.URLParams 11051 ifNoneMatch_ string 11052 ctx_ context.Context 11053 header_ http.Header 11054} 11055 11056// Get: Retrieves a particular SSL certificate. Does not include the 11057// private key (required for usage). The private key must be saved from 11058// the response to initial creation. 11059// 11060// - instance: Cloud SQL instance ID. This does not include the project 11061// ID. 11062// - project: Project ID of the project that contains the instance. 11063// - sha1Fingerprint: Sha1 FingerPrint. 11064func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall { 11065 c := &SslCertsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11066 c.project = project 11067 c.instance = instance 11068 c.sha1Fingerprint = sha1Fingerprint 11069 return c 11070} 11071 11072// Fields allows partial responses to be retrieved. See 11073// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11074// for more information. 11075func (c *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall { 11076 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11077 return c 11078} 11079 11080// IfNoneMatch sets the optional parameter which makes the operation 11081// fail if the object's ETag matches the given value. This is useful for 11082// getting updates only after the object has changed since the last 11083// request. Use googleapi.IsNotModified to check whether the response 11084// error from Do is the result of In-None-Match. 11085func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall { 11086 c.ifNoneMatch_ = entityTag 11087 return c 11088} 11089 11090// Context sets the context to be used in this call's Do method. Any 11091// pending HTTP request will be aborted if the provided context is 11092// canceled. 11093func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall { 11094 c.ctx_ = ctx 11095 return c 11096} 11097 11098// Header returns an http.Header that can be modified by the caller to 11099// add HTTP headers to the request. 11100func (c *SslCertsGetCall) Header() http.Header { 11101 if c.header_ == nil { 11102 c.header_ = make(http.Header) 11103 } 11104 return c.header_ 11105} 11106 11107func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) { 11108 reqHeaders := make(http.Header) 11109 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 11110 for k, v := range c.header_ { 11111 reqHeaders[k] = v 11112 } 11113 reqHeaders.Set("User-Agent", c.s.userAgent()) 11114 if c.ifNoneMatch_ != "" { 11115 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11116 } 11117 var body io.Reader = nil 11118 c.urlParams_.Set("alt", alt) 11119 c.urlParams_.Set("prettyPrint", "false") 11120 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") 11121 urls += "?" + c.urlParams_.Encode() 11122 req, err := http.NewRequest("GET", urls, body) 11123 if err != nil { 11124 return nil, err 11125 } 11126 req.Header = reqHeaders 11127 googleapi.Expand(req.URL, map[string]string{ 11128 "project": c.project, 11129 "instance": c.instance, 11130 "sha1Fingerprint": c.sha1Fingerprint, 11131 }) 11132 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11133} 11134 11135// Do executes the "sql.sslCerts.get" call. 11136// Exactly one of *SslCert or error will be non-nil. Any non-2xx status 11137// code is an error. Response headers are in either 11138// *SslCert.ServerResponse.Header or (if a response was returned at all) 11139// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11140// check whether the returned error was because http.StatusNotModified 11141// was returned. 11142func (c *SslCertsGetCall) Do(opts ...googleapi.CallOption) (*SslCert, error) { 11143 gensupport.SetOptions(c.urlParams_, opts...) 11144 res, err := c.doRequest("json") 11145 if res != nil && res.StatusCode == http.StatusNotModified { 11146 if res.Body != nil { 11147 res.Body.Close() 11148 } 11149 return nil, &googleapi.Error{ 11150 Code: res.StatusCode, 11151 Header: res.Header, 11152 } 11153 } 11154 if err != nil { 11155 return nil, err 11156 } 11157 defer googleapi.CloseBody(res) 11158 if err := googleapi.CheckResponse(res); err != nil { 11159 return nil, err 11160 } 11161 ret := &SslCert{ 11162 ServerResponse: googleapi.ServerResponse{ 11163 Header: res.Header, 11164 HTTPStatusCode: res.StatusCode, 11165 }, 11166 } 11167 target := &ret 11168 if err := gensupport.DecodeResponse(target, res); err != nil { 11169 return nil, err 11170 } 11171 return ret, nil 11172 // { 11173 // "description": "Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation.", 11174 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 11175 // "httpMethod": "GET", 11176 // "id": "sql.sslCerts.get", 11177 // "parameterOrder": [ 11178 // "project", 11179 // "instance", 11180 // "sha1Fingerprint" 11181 // ], 11182 // "parameters": { 11183 // "instance": { 11184 // "description": "Cloud SQL instance ID. This does not include the project ID.", 11185 // "location": "path", 11186 // "required": true, 11187 // "type": "string" 11188 // }, 11189 // "project": { 11190 // "description": "Project ID of the project that contains the instance.", 11191 // "location": "path", 11192 // "required": true, 11193 // "type": "string" 11194 // }, 11195 // "sha1Fingerprint": { 11196 // "description": "Sha1 FingerPrint.", 11197 // "location": "path", 11198 // "required": true, 11199 // "type": "string" 11200 // } 11201 // }, 11202 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 11203 // "response": { 11204 // "$ref": "SslCert" 11205 // }, 11206 // "scopes": [ 11207 // "https://www.googleapis.com/auth/cloud-platform", 11208 // "https://www.googleapis.com/auth/sqlservice.admin" 11209 // ] 11210 // } 11211 11212} 11213 11214// method id "sql.sslCerts.insert": 11215 11216type SslCertsInsertCall struct { 11217 s *Service 11218 project string 11219 instance string 11220 sslcertsinsertrequest *SslCertsInsertRequest 11221 urlParams_ gensupport.URLParams 11222 ctx_ context.Context 11223 header_ http.Header 11224} 11225 11226// Insert: Creates an SSL certificate and returns it along with the 11227// private key and server certificate authority. The new certificate 11228// will not be usable until the instance is restarted. 11229// 11230// - instance: Cloud SQL instance ID. This does not include the project 11231// ID. 11232// - project: Project ID of the project that contains the instance. 11233func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall { 11234 c := &SslCertsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11235 c.project = project 11236 c.instance = instance 11237 c.sslcertsinsertrequest = sslcertsinsertrequest 11238 return c 11239} 11240 11241// Fields allows partial responses to be retrieved. See 11242// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11243// for more information. 11244func (c *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall { 11245 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11246 return c 11247} 11248 11249// Context sets the context to be used in this call's Do method. Any 11250// pending HTTP request will be aborted if the provided context is 11251// canceled. 11252func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall { 11253 c.ctx_ = ctx 11254 return c 11255} 11256 11257// Header returns an http.Header that can be modified by the caller to 11258// add HTTP headers to the request. 11259func (c *SslCertsInsertCall) Header() http.Header { 11260 if c.header_ == nil { 11261 c.header_ = make(http.Header) 11262 } 11263 return c.header_ 11264} 11265 11266func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, error) { 11267 reqHeaders := make(http.Header) 11268 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 11269 for k, v := range c.header_ { 11270 reqHeaders[k] = v 11271 } 11272 reqHeaders.Set("User-Agent", c.s.userAgent()) 11273 var body io.Reader = nil 11274 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest) 11275 if err != nil { 11276 return nil, err 11277 } 11278 reqHeaders.Set("Content-Type", "application/json") 11279 c.urlParams_.Set("alt", alt) 11280 c.urlParams_.Set("prettyPrint", "false") 11281 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts") 11282 urls += "?" + c.urlParams_.Encode() 11283 req, err := http.NewRequest("POST", urls, body) 11284 if err != nil { 11285 return nil, err 11286 } 11287 req.Header = reqHeaders 11288 googleapi.Expand(req.URL, map[string]string{ 11289 "project": c.project, 11290 "instance": c.instance, 11291 }) 11292 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11293} 11294 11295// Do executes the "sql.sslCerts.insert" call. 11296// Exactly one of *SslCertsInsertResponse or error will be non-nil. Any 11297// non-2xx status code is an error. Response headers are in either 11298// *SslCertsInsertResponse.ServerResponse.Header or (if a response was 11299// returned at all) in error.(*googleapi.Error).Header. Use 11300// googleapi.IsNotModified to check whether the returned error was 11301// because http.StatusNotModified was returned. 11302func (c *SslCertsInsertCall) Do(opts ...googleapi.CallOption) (*SslCertsInsertResponse, error) { 11303 gensupport.SetOptions(c.urlParams_, opts...) 11304 res, err := c.doRequest("json") 11305 if res != nil && res.StatusCode == http.StatusNotModified { 11306 if res.Body != nil { 11307 res.Body.Close() 11308 } 11309 return nil, &googleapi.Error{ 11310 Code: res.StatusCode, 11311 Header: res.Header, 11312 } 11313 } 11314 if err != nil { 11315 return nil, err 11316 } 11317 defer googleapi.CloseBody(res) 11318 if err := googleapi.CheckResponse(res); err != nil { 11319 return nil, err 11320 } 11321 ret := &SslCertsInsertResponse{ 11322 ServerResponse: googleapi.ServerResponse{ 11323 Header: res.Header, 11324 HTTPStatusCode: res.StatusCode, 11325 }, 11326 } 11327 target := &ret 11328 if err := gensupport.DecodeResponse(target, res); err != nil { 11329 return nil, err 11330 } 11331 return ret, nil 11332 // { 11333 // "description": "Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted.", 11334 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 11335 // "httpMethod": "POST", 11336 // "id": "sql.sslCerts.insert", 11337 // "parameterOrder": [ 11338 // "project", 11339 // "instance" 11340 // ], 11341 // "parameters": { 11342 // "instance": { 11343 // "description": "Cloud SQL instance ID. This does not include the project ID.", 11344 // "location": "path", 11345 // "required": true, 11346 // "type": "string" 11347 // }, 11348 // "project": { 11349 // "description": "Project ID of the project that contains the instance.", 11350 // "location": "path", 11351 // "required": true, 11352 // "type": "string" 11353 // } 11354 // }, 11355 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 11356 // "request": { 11357 // "$ref": "SslCertsInsertRequest" 11358 // }, 11359 // "response": { 11360 // "$ref": "SslCertsInsertResponse" 11361 // }, 11362 // "scopes": [ 11363 // "https://www.googleapis.com/auth/cloud-platform", 11364 // "https://www.googleapis.com/auth/sqlservice.admin" 11365 // ] 11366 // } 11367 11368} 11369 11370// method id "sql.sslCerts.list": 11371 11372type SslCertsListCall struct { 11373 s *Service 11374 project string 11375 instance string 11376 urlParams_ gensupport.URLParams 11377 ifNoneMatch_ string 11378 ctx_ context.Context 11379 header_ http.Header 11380} 11381 11382// List: Lists all of the current SSL certificates for the instance. 11383// 11384// - instance: Cloud SQL instance ID. This does not include the project 11385// ID. 11386// - project: Project ID of the project that contains the instance. 11387func (r *SslCertsService) List(project string, instance string) *SslCertsListCall { 11388 c := &SslCertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11389 c.project = project 11390 c.instance = instance 11391 return c 11392} 11393 11394// Fields allows partial responses to be retrieved. See 11395// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11396// for more information. 11397func (c *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall { 11398 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11399 return c 11400} 11401 11402// IfNoneMatch sets the optional parameter which makes the operation 11403// fail if the object's ETag matches the given value. This is useful for 11404// getting updates only after the object has changed since the last 11405// request. Use googleapi.IsNotModified to check whether the response 11406// error from Do is the result of In-None-Match. 11407func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall { 11408 c.ifNoneMatch_ = entityTag 11409 return c 11410} 11411 11412// Context sets the context to be used in this call's Do method. Any 11413// pending HTTP request will be aborted if the provided context is 11414// canceled. 11415func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall { 11416 c.ctx_ = ctx 11417 return c 11418} 11419 11420// Header returns an http.Header that can be modified by the caller to 11421// add HTTP headers to the request. 11422func (c *SslCertsListCall) Header() http.Header { 11423 if c.header_ == nil { 11424 c.header_ = make(http.Header) 11425 } 11426 return c.header_ 11427} 11428 11429func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) { 11430 reqHeaders := make(http.Header) 11431 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 11432 for k, v := range c.header_ { 11433 reqHeaders[k] = v 11434 } 11435 reqHeaders.Set("User-Agent", c.s.userAgent()) 11436 if c.ifNoneMatch_ != "" { 11437 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11438 } 11439 var body io.Reader = nil 11440 c.urlParams_.Set("alt", alt) 11441 c.urlParams_.Set("prettyPrint", "false") 11442 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts") 11443 urls += "?" + c.urlParams_.Encode() 11444 req, err := http.NewRequest("GET", urls, body) 11445 if err != nil { 11446 return nil, err 11447 } 11448 req.Header = reqHeaders 11449 googleapi.Expand(req.URL, map[string]string{ 11450 "project": c.project, 11451 "instance": c.instance, 11452 }) 11453 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11454} 11455 11456// Do executes the "sql.sslCerts.list" call. 11457// Exactly one of *SslCertsListResponse or error will be non-nil. Any 11458// non-2xx status code is an error. Response headers are in either 11459// *SslCertsListResponse.ServerResponse.Header or (if a response was 11460// returned at all) in error.(*googleapi.Error).Header. Use 11461// googleapi.IsNotModified to check whether the returned error was 11462// because http.StatusNotModified was returned. 11463func (c *SslCertsListCall) Do(opts ...googleapi.CallOption) (*SslCertsListResponse, error) { 11464 gensupport.SetOptions(c.urlParams_, opts...) 11465 res, err := c.doRequest("json") 11466 if res != nil && res.StatusCode == http.StatusNotModified { 11467 if res.Body != nil { 11468 res.Body.Close() 11469 } 11470 return nil, &googleapi.Error{ 11471 Code: res.StatusCode, 11472 Header: res.Header, 11473 } 11474 } 11475 if err != nil { 11476 return nil, err 11477 } 11478 defer googleapi.CloseBody(res) 11479 if err := googleapi.CheckResponse(res); err != nil { 11480 return nil, err 11481 } 11482 ret := &SslCertsListResponse{ 11483 ServerResponse: googleapi.ServerResponse{ 11484 Header: res.Header, 11485 HTTPStatusCode: res.StatusCode, 11486 }, 11487 } 11488 target := &ret 11489 if err := gensupport.DecodeResponse(target, res); err != nil { 11490 return nil, err 11491 } 11492 return ret, nil 11493 // { 11494 // "description": "Lists all of the current SSL certificates for the instance.", 11495 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 11496 // "httpMethod": "GET", 11497 // "id": "sql.sslCerts.list", 11498 // "parameterOrder": [ 11499 // "project", 11500 // "instance" 11501 // ], 11502 // "parameters": { 11503 // "instance": { 11504 // "description": "Cloud SQL instance ID. This does not include the project ID.", 11505 // "location": "path", 11506 // "required": true, 11507 // "type": "string" 11508 // }, 11509 // "project": { 11510 // "description": "Project ID of the project that contains the instance.", 11511 // "location": "path", 11512 // "required": true, 11513 // "type": "string" 11514 // } 11515 // }, 11516 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 11517 // "response": { 11518 // "$ref": "SslCertsListResponse" 11519 // }, 11520 // "scopes": [ 11521 // "https://www.googleapis.com/auth/cloud-platform", 11522 // "https://www.googleapis.com/auth/sqlservice.admin" 11523 // ] 11524 // } 11525 11526} 11527 11528// method id "sql.tiers.list": 11529 11530type TiersListCall struct { 11531 s *Service 11532 project string 11533 urlParams_ gensupport.URLParams 11534 ifNoneMatch_ string 11535 ctx_ context.Context 11536 header_ http.Header 11537} 11538 11539// List: Lists all available machine types (tiers) for Cloud SQL, for 11540// example, db-custom-1-3840. For related information, see Pricing. 11541// 11542// - project: Project ID of the project for which to list tiers. 11543func (r *TiersService) List(project string) *TiersListCall { 11544 c := &TiersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11545 c.project = project 11546 return c 11547} 11548 11549// Fields allows partial responses to be retrieved. See 11550// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11551// for more information. 11552func (c *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall { 11553 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11554 return c 11555} 11556 11557// IfNoneMatch sets the optional parameter which makes the operation 11558// fail if the object's ETag matches the given value. This is useful for 11559// getting updates only after the object has changed since the last 11560// request. Use googleapi.IsNotModified to check whether the response 11561// error from Do is the result of In-None-Match. 11562func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall { 11563 c.ifNoneMatch_ = entityTag 11564 return c 11565} 11566 11567// Context sets the context to be used in this call's Do method. Any 11568// pending HTTP request will be aborted if the provided context is 11569// canceled. 11570func (c *TiersListCall) Context(ctx context.Context) *TiersListCall { 11571 c.ctx_ = ctx 11572 return c 11573} 11574 11575// Header returns an http.Header that can be modified by the caller to 11576// add HTTP headers to the request. 11577func (c *TiersListCall) Header() http.Header { 11578 if c.header_ == nil { 11579 c.header_ = make(http.Header) 11580 } 11581 return c.header_ 11582} 11583 11584func (c *TiersListCall) doRequest(alt string) (*http.Response, error) { 11585 reqHeaders := make(http.Header) 11586 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 11587 for k, v := range c.header_ { 11588 reqHeaders[k] = v 11589 } 11590 reqHeaders.Set("User-Agent", c.s.userAgent()) 11591 if c.ifNoneMatch_ != "" { 11592 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11593 } 11594 var body io.Reader = nil 11595 c.urlParams_.Set("alt", alt) 11596 c.urlParams_.Set("prettyPrint", "false") 11597 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/tiers") 11598 urls += "?" + c.urlParams_.Encode() 11599 req, err := http.NewRequest("GET", urls, body) 11600 if err != nil { 11601 return nil, err 11602 } 11603 req.Header = reqHeaders 11604 googleapi.Expand(req.URL, map[string]string{ 11605 "project": c.project, 11606 }) 11607 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11608} 11609 11610// Do executes the "sql.tiers.list" call. 11611// Exactly one of *TiersListResponse or error will be non-nil. Any 11612// non-2xx status code is an error. Response headers are in either 11613// *TiersListResponse.ServerResponse.Header or (if a response was 11614// returned at all) in error.(*googleapi.Error).Header. Use 11615// googleapi.IsNotModified to check whether the returned error was 11616// because http.StatusNotModified was returned. 11617func (c *TiersListCall) Do(opts ...googleapi.CallOption) (*TiersListResponse, error) { 11618 gensupport.SetOptions(c.urlParams_, opts...) 11619 res, err := c.doRequest("json") 11620 if res != nil && res.StatusCode == http.StatusNotModified { 11621 if res.Body != nil { 11622 res.Body.Close() 11623 } 11624 return nil, &googleapi.Error{ 11625 Code: res.StatusCode, 11626 Header: res.Header, 11627 } 11628 } 11629 if err != nil { 11630 return nil, err 11631 } 11632 defer googleapi.CloseBody(res) 11633 if err := googleapi.CheckResponse(res); err != nil { 11634 return nil, err 11635 } 11636 ret := &TiersListResponse{ 11637 ServerResponse: googleapi.ServerResponse{ 11638 Header: res.Header, 11639 HTTPStatusCode: res.StatusCode, 11640 }, 11641 } 11642 target := &ret 11643 if err := gensupport.DecodeResponse(target, res); err != nil { 11644 return nil, err 11645 } 11646 return ret, nil 11647 // { 11648 // "description": "Lists all available machine types (tiers) for Cloud SQL, for example, db-custom-1-3840. For related information, see Pricing.", 11649 // "flatPath": "sql/v1beta4/projects/{project}/tiers", 11650 // "httpMethod": "GET", 11651 // "id": "sql.tiers.list", 11652 // "parameterOrder": [ 11653 // "project" 11654 // ], 11655 // "parameters": { 11656 // "project": { 11657 // "description": "Project ID of the project for which to list tiers.", 11658 // "location": "path", 11659 // "required": true, 11660 // "type": "string" 11661 // } 11662 // }, 11663 // "path": "sql/v1beta4/projects/{project}/tiers", 11664 // "response": { 11665 // "$ref": "TiersListResponse" 11666 // }, 11667 // "scopes": [ 11668 // "https://www.googleapis.com/auth/cloud-platform", 11669 // "https://www.googleapis.com/auth/sqlservice.admin" 11670 // ] 11671 // } 11672 11673} 11674 11675// method id "sql.users.delete": 11676 11677type UsersDeleteCall struct { 11678 s *Service 11679 project string 11680 instance string 11681 urlParams_ gensupport.URLParams 11682 ctx_ context.Context 11683 header_ http.Header 11684} 11685 11686// Delete: Deletes a user from a Cloud SQL instance. 11687// 11688// - instance: Database instance ID. This does not include the project 11689// ID. 11690// - project: Project ID of the project that contains the instance. 11691func (r *UsersService) Delete(project string, instance string) *UsersDeleteCall { 11692 c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11693 c.project = project 11694 c.instance = instance 11695 return c 11696} 11697 11698// Host sets the optional parameter "host": Host of the user in the 11699// instance. 11700func (c *UsersDeleteCall) Host(host string) *UsersDeleteCall { 11701 c.urlParams_.Set("host", host) 11702 return c 11703} 11704 11705// Name sets the optional parameter "name": Name of the user in the 11706// instance. 11707func (c *UsersDeleteCall) Name(name string) *UsersDeleteCall { 11708 c.urlParams_.Set("name", name) 11709 return c 11710} 11711 11712// Fields allows partial responses to be retrieved. See 11713// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11714// for more information. 11715func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { 11716 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11717 return c 11718} 11719 11720// Context sets the context to be used in this call's Do method. Any 11721// pending HTTP request will be aborted if the provided context is 11722// canceled. 11723func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { 11724 c.ctx_ = ctx 11725 return c 11726} 11727 11728// Header returns an http.Header that can be modified by the caller to 11729// add HTTP headers to the request. 11730func (c *UsersDeleteCall) Header() http.Header { 11731 if c.header_ == nil { 11732 c.header_ = make(http.Header) 11733 } 11734 return c.header_ 11735} 11736 11737func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { 11738 reqHeaders := make(http.Header) 11739 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 11740 for k, v := range c.header_ { 11741 reqHeaders[k] = v 11742 } 11743 reqHeaders.Set("User-Agent", c.s.userAgent()) 11744 var body io.Reader = nil 11745 c.urlParams_.Set("alt", alt) 11746 c.urlParams_.Set("prettyPrint", "false") 11747 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 11748 urls += "?" + c.urlParams_.Encode() 11749 req, err := http.NewRequest("DELETE", urls, body) 11750 if err != nil { 11751 return nil, err 11752 } 11753 req.Header = reqHeaders 11754 googleapi.Expand(req.URL, map[string]string{ 11755 "project": c.project, 11756 "instance": c.instance, 11757 }) 11758 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11759} 11760 11761// Do executes the "sql.users.delete" call. 11762// Exactly one of *Operation or error will be non-nil. Any non-2xx 11763// status code is an error. Response headers are in either 11764// *Operation.ServerResponse.Header or (if a response was returned at 11765// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11766// to check whether the returned error was because 11767// http.StatusNotModified was returned. 11768func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 11769 gensupport.SetOptions(c.urlParams_, opts...) 11770 res, err := c.doRequest("json") 11771 if res != nil && res.StatusCode == http.StatusNotModified { 11772 if res.Body != nil { 11773 res.Body.Close() 11774 } 11775 return nil, &googleapi.Error{ 11776 Code: res.StatusCode, 11777 Header: res.Header, 11778 } 11779 } 11780 if err != nil { 11781 return nil, err 11782 } 11783 defer googleapi.CloseBody(res) 11784 if err := googleapi.CheckResponse(res); err != nil { 11785 return nil, err 11786 } 11787 ret := &Operation{ 11788 ServerResponse: googleapi.ServerResponse{ 11789 Header: res.Header, 11790 HTTPStatusCode: res.StatusCode, 11791 }, 11792 } 11793 target := &ret 11794 if err := gensupport.DecodeResponse(target, res); err != nil { 11795 return nil, err 11796 } 11797 return ret, nil 11798 // { 11799 // "description": "Deletes a user from a Cloud SQL instance.", 11800 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11801 // "httpMethod": "DELETE", 11802 // "id": "sql.users.delete", 11803 // "parameterOrder": [ 11804 // "project", 11805 // "instance" 11806 // ], 11807 // "parameters": { 11808 // "host": { 11809 // "description": "Host of the user in the instance.", 11810 // "location": "query", 11811 // "type": "string" 11812 // }, 11813 // "instance": { 11814 // "description": "Database instance ID. This does not include the project ID.", 11815 // "location": "path", 11816 // "required": true, 11817 // "type": "string" 11818 // }, 11819 // "name": { 11820 // "description": "Name of the user in the instance.", 11821 // "location": "query", 11822 // "type": "string" 11823 // }, 11824 // "project": { 11825 // "description": "Project ID of the project that contains the instance.", 11826 // "location": "path", 11827 // "required": true, 11828 // "type": "string" 11829 // } 11830 // }, 11831 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11832 // "response": { 11833 // "$ref": "Operation" 11834 // }, 11835 // "scopes": [ 11836 // "https://www.googleapis.com/auth/cloud-platform", 11837 // "https://www.googleapis.com/auth/sqlservice.admin" 11838 // ] 11839 // } 11840 11841} 11842 11843// method id "sql.users.insert": 11844 11845type UsersInsertCall struct { 11846 s *Service 11847 project string 11848 instance string 11849 user *User 11850 urlParams_ gensupport.URLParams 11851 ctx_ context.Context 11852 header_ http.Header 11853} 11854 11855// Insert: Creates a new user in a Cloud SQL instance. 11856// 11857// - instance: Database instance ID. This does not include the project 11858// ID. 11859// - project: Project ID of the project that contains the instance. 11860func (r *UsersService) Insert(project string, instance string, user *User) *UsersInsertCall { 11861 c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11862 c.project = project 11863 c.instance = instance 11864 c.user = user 11865 return c 11866} 11867 11868// Fields allows partial responses to be retrieved. See 11869// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11870// for more information. 11871func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { 11872 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11873 return c 11874} 11875 11876// Context sets the context to be used in this call's Do method. Any 11877// pending HTTP request will be aborted if the provided context is 11878// canceled. 11879func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { 11880 c.ctx_ = ctx 11881 return c 11882} 11883 11884// Header returns an http.Header that can be modified by the caller to 11885// add HTTP headers to the request. 11886func (c *UsersInsertCall) Header() http.Header { 11887 if c.header_ == nil { 11888 c.header_ = make(http.Header) 11889 } 11890 return c.header_ 11891} 11892 11893func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) { 11894 reqHeaders := make(http.Header) 11895 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 11896 for k, v := range c.header_ { 11897 reqHeaders[k] = v 11898 } 11899 reqHeaders.Set("User-Agent", c.s.userAgent()) 11900 var body io.Reader = nil 11901 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 11902 if err != nil { 11903 return nil, err 11904 } 11905 reqHeaders.Set("Content-Type", "application/json") 11906 c.urlParams_.Set("alt", alt) 11907 c.urlParams_.Set("prettyPrint", "false") 11908 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 11909 urls += "?" + c.urlParams_.Encode() 11910 req, err := http.NewRequest("POST", urls, body) 11911 if err != nil { 11912 return nil, err 11913 } 11914 req.Header = reqHeaders 11915 googleapi.Expand(req.URL, map[string]string{ 11916 "project": c.project, 11917 "instance": c.instance, 11918 }) 11919 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11920} 11921 11922// Do executes the "sql.users.insert" call. 11923// Exactly one of *Operation or error will be non-nil. Any non-2xx 11924// status code is an error. Response headers are in either 11925// *Operation.ServerResponse.Header or (if a response was returned at 11926// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11927// to check whether the returned error was because 11928// http.StatusNotModified was returned. 11929func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 11930 gensupport.SetOptions(c.urlParams_, opts...) 11931 res, err := c.doRequest("json") 11932 if res != nil && res.StatusCode == http.StatusNotModified { 11933 if res.Body != nil { 11934 res.Body.Close() 11935 } 11936 return nil, &googleapi.Error{ 11937 Code: res.StatusCode, 11938 Header: res.Header, 11939 } 11940 } 11941 if err != nil { 11942 return nil, err 11943 } 11944 defer googleapi.CloseBody(res) 11945 if err := googleapi.CheckResponse(res); err != nil { 11946 return nil, err 11947 } 11948 ret := &Operation{ 11949 ServerResponse: googleapi.ServerResponse{ 11950 Header: res.Header, 11951 HTTPStatusCode: res.StatusCode, 11952 }, 11953 } 11954 target := &ret 11955 if err := gensupport.DecodeResponse(target, res); err != nil { 11956 return nil, err 11957 } 11958 return ret, nil 11959 // { 11960 // "description": "Creates a new user in a Cloud SQL instance.", 11961 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11962 // "httpMethod": "POST", 11963 // "id": "sql.users.insert", 11964 // "parameterOrder": [ 11965 // "project", 11966 // "instance" 11967 // ], 11968 // "parameters": { 11969 // "instance": { 11970 // "description": "Database instance ID. This does not include the project ID.", 11971 // "location": "path", 11972 // "required": true, 11973 // "type": "string" 11974 // }, 11975 // "project": { 11976 // "description": "Project ID of the project that contains the instance.", 11977 // "location": "path", 11978 // "required": true, 11979 // "type": "string" 11980 // } 11981 // }, 11982 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11983 // "request": { 11984 // "$ref": "User" 11985 // }, 11986 // "response": { 11987 // "$ref": "Operation" 11988 // }, 11989 // "scopes": [ 11990 // "https://www.googleapis.com/auth/cloud-platform", 11991 // "https://www.googleapis.com/auth/sqlservice.admin" 11992 // ] 11993 // } 11994 11995} 11996 11997// method id "sql.users.list": 11998 11999type UsersListCall struct { 12000 s *Service 12001 project string 12002 instance string 12003 urlParams_ gensupport.URLParams 12004 ifNoneMatch_ string 12005 ctx_ context.Context 12006 header_ http.Header 12007} 12008 12009// List: Lists users in the specified Cloud SQL instance. 12010// 12011// - instance: Database instance ID. This does not include the project 12012// ID. 12013// - project: Project ID of the project that contains the instance. 12014func (r *UsersService) List(project string, instance string) *UsersListCall { 12015 c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12016 c.project = project 12017 c.instance = instance 12018 return c 12019} 12020 12021// Fields allows partial responses to be retrieved. See 12022// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12023// for more information. 12024func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { 12025 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12026 return c 12027} 12028 12029// IfNoneMatch sets the optional parameter which makes the operation 12030// fail if the object's ETag matches the given value. This is useful for 12031// getting updates only after the object has changed since the last 12032// request. Use googleapi.IsNotModified to check whether the response 12033// error from Do is the result of In-None-Match. 12034func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { 12035 c.ifNoneMatch_ = entityTag 12036 return c 12037} 12038 12039// Context sets the context to be used in this call's Do method. Any 12040// pending HTTP request will be aborted if the provided context is 12041// canceled. 12042func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { 12043 c.ctx_ = ctx 12044 return c 12045} 12046 12047// Header returns an http.Header that can be modified by the caller to 12048// add HTTP headers to the request. 12049func (c *UsersListCall) Header() http.Header { 12050 if c.header_ == nil { 12051 c.header_ = make(http.Header) 12052 } 12053 return c.header_ 12054} 12055 12056func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { 12057 reqHeaders := make(http.Header) 12058 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 12059 for k, v := range c.header_ { 12060 reqHeaders[k] = v 12061 } 12062 reqHeaders.Set("User-Agent", c.s.userAgent()) 12063 if c.ifNoneMatch_ != "" { 12064 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12065 } 12066 var body io.Reader = nil 12067 c.urlParams_.Set("alt", alt) 12068 c.urlParams_.Set("prettyPrint", "false") 12069 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 12070 urls += "?" + c.urlParams_.Encode() 12071 req, err := http.NewRequest("GET", urls, body) 12072 if err != nil { 12073 return nil, err 12074 } 12075 req.Header = reqHeaders 12076 googleapi.Expand(req.URL, map[string]string{ 12077 "project": c.project, 12078 "instance": c.instance, 12079 }) 12080 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12081} 12082 12083// Do executes the "sql.users.list" call. 12084// Exactly one of *UsersListResponse or error will be non-nil. Any 12085// non-2xx status code is an error. Response headers are in either 12086// *UsersListResponse.ServerResponse.Header or (if a response was 12087// returned at all) in error.(*googleapi.Error).Header. Use 12088// googleapi.IsNotModified to check whether the returned error was 12089// because http.StatusNotModified was returned. 12090func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) { 12091 gensupport.SetOptions(c.urlParams_, opts...) 12092 res, err := c.doRequest("json") 12093 if res != nil && res.StatusCode == http.StatusNotModified { 12094 if res.Body != nil { 12095 res.Body.Close() 12096 } 12097 return nil, &googleapi.Error{ 12098 Code: res.StatusCode, 12099 Header: res.Header, 12100 } 12101 } 12102 if err != nil { 12103 return nil, err 12104 } 12105 defer googleapi.CloseBody(res) 12106 if err := googleapi.CheckResponse(res); err != nil { 12107 return nil, err 12108 } 12109 ret := &UsersListResponse{ 12110 ServerResponse: googleapi.ServerResponse{ 12111 Header: res.Header, 12112 HTTPStatusCode: res.StatusCode, 12113 }, 12114 } 12115 target := &ret 12116 if err := gensupport.DecodeResponse(target, res); err != nil { 12117 return nil, err 12118 } 12119 return ret, nil 12120 // { 12121 // "description": "Lists users in the specified Cloud SQL instance.", 12122 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 12123 // "httpMethod": "GET", 12124 // "id": "sql.users.list", 12125 // "parameterOrder": [ 12126 // "project", 12127 // "instance" 12128 // ], 12129 // "parameters": { 12130 // "instance": { 12131 // "description": "Database instance ID. This does not include the project ID.", 12132 // "location": "path", 12133 // "required": true, 12134 // "type": "string" 12135 // }, 12136 // "project": { 12137 // "description": "Project ID of the project that contains the instance.", 12138 // "location": "path", 12139 // "required": true, 12140 // "type": "string" 12141 // } 12142 // }, 12143 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 12144 // "response": { 12145 // "$ref": "UsersListResponse" 12146 // }, 12147 // "scopes": [ 12148 // "https://www.googleapis.com/auth/cloud-platform", 12149 // "https://www.googleapis.com/auth/sqlservice.admin" 12150 // ] 12151 // } 12152 12153} 12154 12155// method id "sql.users.update": 12156 12157type UsersUpdateCall struct { 12158 s *Service 12159 project string 12160 instance string 12161 user *User 12162 urlParams_ gensupport.URLParams 12163 ctx_ context.Context 12164 header_ http.Header 12165} 12166 12167// Update: Updates an existing user in a Cloud SQL instance. 12168// 12169// - instance: Database instance ID. This does not include the project 12170// ID. 12171// - project: Project ID of the project that contains the instance. 12172func (r *UsersService) Update(project string, instance string, user *User) *UsersUpdateCall { 12173 c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12174 c.project = project 12175 c.instance = instance 12176 c.user = user 12177 return c 12178} 12179 12180// Host sets the optional parameter "host": Host of the user in the 12181// instance. 12182func (c *UsersUpdateCall) Host(host string) *UsersUpdateCall { 12183 c.urlParams_.Set("host", host) 12184 return c 12185} 12186 12187// Name sets the optional parameter "name": Name of the user in the 12188// instance. 12189func (c *UsersUpdateCall) Name(name string) *UsersUpdateCall { 12190 c.urlParams_.Set("name", name) 12191 return c 12192} 12193 12194// Fields allows partial responses to be retrieved. See 12195// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12196// for more information. 12197func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall { 12198 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12199 return c 12200} 12201 12202// Context sets the context to be used in this call's Do method. Any 12203// pending HTTP request will be aborted if the provided context is 12204// canceled. 12205func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall { 12206 c.ctx_ = ctx 12207 return c 12208} 12209 12210// Header returns an http.Header that can be modified by the caller to 12211// add HTTP headers to the request. 12212func (c *UsersUpdateCall) Header() http.Header { 12213 if c.header_ == nil { 12214 c.header_ = make(http.Header) 12215 } 12216 return c.header_ 12217} 12218 12219func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) { 12220 reqHeaders := make(http.Header) 12221 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 12222 for k, v := range c.header_ { 12223 reqHeaders[k] = v 12224 } 12225 reqHeaders.Set("User-Agent", c.s.userAgent()) 12226 var body io.Reader = nil 12227 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 12228 if err != nil { 12229 return nil, err 12230 } 12231 reqHeaders.Set("Content-Type", "application/json") 12232 c.urlParams_.Set("alt", alt) 12233 c.urlParams_.Set("prettyPrint", "false") 12234 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 12235 urls += "?" + c.urlParams_.Encode() 12236 req, err := http.NewRequest("PUT", urls, body) 12237 if err != nil { 12238 return nil, err 12239 } 12240 req.Header = reqHeaders 12241 googleapi.Expand(req.URL, map[string]string{ 12242 "project": c.project, 12243 "instance": c.instance, 12244 }) 12245 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12246} 12247 12248// Do executes the "sql.users.update" call. 12249// Exactly one of *Operation or error will be non-nil. Any non-2xx 12250// status code is an error. Response headers are in either 12251// *Operation.ServerResponse.Header or (if a response was returned at 12252// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12253// to check whether the returned error was because 12254// http.StatusNotModified was returned. 12255func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 12256 gensupport.SetOptions(c.urlParams_, opts...) 12257 res, err := c.doRequest("json") 12258 if res != nil && res.StatusCode == http.StatusNotModified { 12259 if res.Body != nil { 12260 res.Body.Close() 12261 } 12262 return nil, &googleapi.Error{ 12263 Code: res.StatusCode, 12264 Header: res.Header, 12265 } 12266 } 12267 if err != nil { 12268 return nil, err 12269 } 12270 defer googleapi.CloseBody(res) 12271 if err := googleapi.CheckResponse(res); err != nil { 12272 return nil, err 12273 } 12274 ret := &Operation{ 12275 ServerResponse: googleapi.ServerResponse{ 12276 Header: res.Header, 12277 HTTPStatusCode: res.StatusCode, 12278 }, 12279 } 12280 target := &ret 12281 if err := gensupport.DecodeResponse(target, res); err != nil { 12282 return nil, err 12283 } 12284 return ret, nil 12285 // { 12286 // "description": "Updates an existing user in a Cloud SQL instance.", 12287 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 12288 // "httpMethod": "PUT", 12289 // "id": "sql.users.update", 12290 // "parameterOrder": [ 12291 // "project", 12292 // "instance" 12293 // ], 12294 // "parameters": { 12295 // "host": { 12296 // "description": "Optional. Host of the user in the instance.", 12297 // "location": "query", 12298 // "type": "string" 12299 // }, 12300 // "instance": { 12301 // "description": "Database instance ID. This does not include the project ID.", 12302 // "location": "path", 12303 // "required": true, 12304 // "type": "string" 12305 // }, 12306 // "name": { 12307 // "description": "Name of the user in the instance.", 12308 // "location": "query", 12309 // "type": "string" 12310 // }, 12311 // "project": { 12312 // "description": "Project ID of the project that contains the instance.", 12313 // "location": "path", 12314 // "required": true, 12315 // "type": "string" 12316 // } 12317 // }, 12318 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 12319 // "request": { 12320 // "$ref": "User" 12321 // }, 12322 // "response": { 12323 // "$ref": "Operation" 12324 // }, 12325 // "scopes": [ 12326 // "https://www.googleapis.com/auth/cloud-platform", 12327 // "https://www.googleapis.com/auth/sqlservice.admin" 12328 // ] 12329 // } 12330 12331} 12332