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 Platform data 87 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 88 89 // Manage your Google SQL Service instances 90 SqlserviceAdminScope = "https://www.googleapis.com/auth/sqlservice.admin" 91) 92 93// NewService creates a new Service. 94func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 95 scopesOption := option.WithScopes( 96 "https://www.googleapis.com/auth/cloud-platform", 97 "https://www.googleapis.com/auth/sqlservice.admin", 98 ) 99 // NOTE: prepend, so we don't override user-specified scopes. 100 opts = append([]option.ClientOption{scopesOption}, opts...) 101 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 102 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 103 client, endpoint, err := htransport.NewClient(ctx, opts...) 104 if err != nil { 105 return nil, err 106 } 107 s, err := New(client) 108 if err != nil { 109 return nil, err 110 } 111 if endpoint != "" { 112 s.BasePath = endpoint 113 } 114 return s, nil 115} 116 117// New creates a new Service. It uses the provided http.Client for requests. 118// 119// Deprecated: please use NewService instead. 120// To provide a custom HTTP client, use option.WithHTTPClient. 121// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 122func New(client *http.Client) (*Service, error) { 123 if client == nil { 124 return nil, errors.New("client is nil") 125 } 126 s := &Service{client: client, BasePath: basePath} 127 s.BackupRuns = NewBackupRunsService(s) 128 s.Databases = NewDatabasesService(s) 129 s.Flags = NewFlagsService(s) 130 s.Instances = NewInstancesService(s) 131 s.Operations = NewOperationsService(s) 132 s.Projects = NewProjectsService(s) 133 s.SslCerts = NewSslCertsService(s) 134 s.Tiers = NewTiersService(s) 135 s.Users = NewUsersService(s) 136 return s, nil 137} 138 139type Service struct { 140 client *http.Client 141 BasePath string // API endpoint base URL 142 UserAgent string // optional additional User-Agent fragment 143 144 BackupRuns *BackupRunsService 145 146 Databases *DatabasesService 147 148 Flags *FlagsService 149 150 Instances *InstancesService 151 152 Operations *OperationsService 153 154 Projects *ProjectsService 155 156 SslCerts *SslCertsService 157 158 Tiers *TiersService 159 160 Users *UsersService 161} 162 163func (s *Service) userAgent() string { 164 if s.UserAgent == "" { 165 return googleapi.UserAgent 166 } 167 return googleapi.UserAgent + " " + s.UserAgent 168} 169 170func NewBackupRunsService(s *Service) *BackupRunsService { 171 rs := &BackupRunsService{s: s} 172 return rs 173} 174 175type BackupRunsService struct { 176 s *Service 177} 178 179func NewDatabasesService(s *Service) *DatabasesService { 180 rs := &DatabasesService{s: s} 181 return rs 182} 183 184type DatabasesService struct { 185 s *Service 186} 187 188func NewFlagsService(s *Service) *FlagsService { 189 rs := &FlagsService{s: s} 190 return rs 191} 192 193type FlagsService struct { 194 s *Service 195} 196 197func NewInstancesService(s *Service) *InstancesService { 198 rs := &InstancesService{s: s} 199 return rs 200} 201 202type InstancesService struct { 203 s *Service 204} 205 206func NewOperationsService(s *Service) *OperationsService { 207 rs := &OperationsService{s: s} 208 return rs 209} 210 211type OperationsService struct { 212 s *Service 213} 214 215func NewProjectsService(s *Service) *ProjectsService { 216 rs := &ProjectsService{s: s} 217 rs.Instances = NewProjectsInstancesService(s) 218 return rs 219} 220 221type ProjectsService struct { 222 s *Service 223 224 Instances *ProjectsInstancesService 225} 226 227func NewProjectsInstancesService(s *Service) *ProjectsInstancesService { 228 rs := &ProjectsInstancesService{s: s} 229 return rs 230} 231 232type ProjectsInstancesService struct { 233 s *Service 234} 235 236func NewSslCertsService(s *Service) *SslCertsService { 237 rs := &SslCertsService{s: s} 238 return rs 239} 240 241type SslCertsService struct { 242 s *Service 243} 244 245func NewTiersService(s *Service) *TiersService { 246 rs := &TiersService{s: s} 247 return rs 248} 249 250type TiersService struct { 251 s *Service 252} 253 254func NewUsersService(s *Service) *UsersService { 255 rs := &UsersService{s: s} 256 return rs 257} 258 259type UsersService struct { 260 s *Service 261} 262 263// AclEntry: An entry for an Access Control list. 264type AclEntry struct { 265 // ExpirationTime: The time when this access control entry expires in 266 // RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. 267 ExpirationTime string `json:"expirationTime,omitempty"` 268 269 // Kind: This is always *sql#aclEntry*. 270 Kind string `json:"kind,omitempty"` 271 272 // Name: Optional. A label to identify this entry. 273 Name string `json:"name,omitempty"` 274 275 // Value: The allowlisted value for the access control list. 276 Value string `json:"value,omitempty"` 277 278 // ForceSendFields is a list of field names (e.g. "ExpirationTime") to 279 // unconditionally include in API requests. By default, fields with 280 // empty values are omitted from API requests. However, any non-pointer, 281 // non-interface field appearing in ForceSendFields will be sent to the 282 // server regardless of whether the field is empty or not. This may be 283 // used to include empty fields in Patch requests. 284 ForceSendFields []string `json:"-"` 285 286 // NullFields is a list of field names (e.g. "ExpirationTime") to 287 // include in API requests with the JSON null value. By default, fields 288 // with empty values are omitted from API requests. However, any field 289 // with an empty value appearing in NullFields will be sent to the 290 // server as null. It is an error if a field in this list has a 291 // non-empty value. This may be used to include null fields in Patch 292 // requests. 293 NullFields []string `json:"-"` 294} 295 296func (s *AclEntry) MarshalJSON() ([]byte, error) { 297 type NoMethod AclEntry 298 raw := NoMethod(*s) 299 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 300} 301 302// ApiWarning: An Admin API warning message. 303type ApiWarning struct { 304 // Code: Code to uniquely identify the warning type. 305 // 306 // Possible values: 307 // "SQL_API_WARNING_CODE_UNSPECIFIED" - An unknown or unset warning 308 // type from Cloud SQL API. 309 // "REGION_UNREACHABLE" - Warning when one or more regions are not 310 // reachable. The returned result set may be incomplete. 311 Code string `json:"code,omitempty"` 312 313 // Message: The warning message. 314 Message string `json:"message,omitempty"` 315 316 // Region: The region name for REGION_UNREACHABLE warning. 317 Region string `json:"region,omitempty"` 318 319 // ForceSendFields is a list of field names (e.g. "Code") to 320 // unconditionally include in API requests. By default, fields with 321 // empty values are omitted from API requests. However, any non-pointer, 322 // non-interface field appearing in ForceSendFields will be sent to the 323 // server regardless of whether the field is empty or not. This may be 324 // used to include empty fields in Patch requests. 325 ForceSendFields []string `json:"-"` 326 327 // NullFields is a list of field names (e.g. "Code") to include in API 328 // requests with the JSON null value. By default, fields with empty 329 // values are omitted from API requests. However, any field with an 330 // empty value appearing in NullFields will be sent to the server as 331 // null. It is an error if a field in this list has a non-empty value. 332 // This may be used to include null fields in Patch requests. 333 NullFields []string `json:"-"` 334} 335 336func (s *ApiWarning) MarshalJSON() ([]byte, error) { 337 type NoMethod ApiWarning 338 raw := NoMethod(*s) 339 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 340} 341 342// BackupConfiguration: Database instance backup configuration. 343type BackupConfiguration struct { 344 // BackupRetentionSettings: Backup retention settings. 345 BackupRetentionSettings *BackupRetentionSettings `json:"backupRetentionSettings,omitempty"` 346 347 // BinaryLogEnabled: (MySQL only) Whether binary log is enabled. If 348 // backup configuration is disabled, binarylog must be disabled as well. 349 BinaryLogEnabled bool `json:"binaryLogEnabled,omitempty"` 350 351 // Enabled: Whether this configuration is enabled. 352 Enabled bool `json:"enabled,omitempty"` 353 354 // Kind: This is always *sql#backupConfiguration*. 355 Kind string `json:"kind,omitempty"` 356 357 // Location: Location of the backup 358 Location string `json:"location,omitempty"` 359 360 // PointInTimeRecoveryEnabled: Reserved for future use. 361 PointInTimeRecoveryEnabled bool `json:"pointInTimeRecoveryEnabled,omitempty"` 362 363 // ReplicationLogArchivingEnabled: Reserved for future use. 364 ReplicationLogArchivingEnabled bool `json:"replicationLogArchivingEnabled,omitempty"` 365 366 // StartTime: Start time for the daily backup configuration in UTC 367 // timezone in the 24 hour format - *HH:MM*. 368 StartTime string `json:"startTime,omitempty"` 369 370 // TransactionLogRetentionDays: The number of days of transaction logs 371 // we retain for point in time restore, from 1-7. 372 TransactionLogRetentionDays int64 `json:"transactionLogRetentionDays,omitempty"` 373 374 // ForceSendFields is a list of field names (e.g. 375 // "BackupRetentionSettings") to unconditionally include in API 376 // requests. By default, fields with empty values are omitted from API 377 // requests. However, any non-pointer, non-interface field appearing in 378 // ForceSendFields will be sent to the server regardless of whether the 379 // field is empty or not. This may be used to include empty fields in 380 // Patch requests. 381 ForceSendFields []string `json:"-"` 382 383 // NullFields is a list of field names (e.g. "BackupRetentionSettings") 384 // to include in API requests with the JSON null value. By default, 385 // fields with empty values are omitted from API requests. However, any 386 // field with an empty value appearing in NullFields will be sent to the 387 // server as null. It is an error if a field in this list has a 388 // non-empty value. This may be used to include null fields in Patch 389 // requests. 390 NullFields []string `json:"-"` 391} 392 393func (s *BackupConfiguration) MarshalJSON() ([]byte, error) { 394 type NoMethod BackupConfiguration 395 raw := NoMethod(*s) 396 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 397} 398 399// BackupContext: Backup context. 400type BackupContext struct { 401 // BackupId: The identifier of the backup. 402 BackupId int64 `json:"backupId,omitempty,string"` 403 404 // Kind: This is always *sql#backupContext*. 405 Kind string `json:"kind,omitempty"` 406 407 // ForceSendFields is a list of field names (e.g. "BackupId") to 408 // unconditionally include in API requests. By default, fields with 409 // empty values are omitted from API requests. However, any non-pointer, 410 // non-interface field appearing in ForceSendFields will be sent to the 411 // server regardless of whether the field is empty or not. This may be 412 // used to include empty fields in Patch requests. 413 ForceSendFields []string `json:"-"` 414 415 // NullFields is a list of field names (e.g. "BackupId") to include in 416 // API requests with the JSON null value. By default, fields with empty 417 // values are omitted from API requests. However, any field with an 418 // empty value appearing in NullFields will be sent to the server as 419 // null. It is an error if a field in this list has a non-empty value. 420 // This may be used to include null fields in Patch requests. 421 NullFields []string `json:"-"` 422} 423 424func (s *BackupContext) MarshalJSON() ([]byte, error) { 425 type NoMethod BackupContext 426 raw := NoMethod(*s) 427 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 428} 429 430// BackupRetentionSettings: We currently only support backup retention 431// by specifying the number of backups we will retain. 432type BackupRetentionSettings struct { 433 // RetainedBackups: Depending on the value of retention_unit, this is 434 // used to determine if a backup needs to be deleted. If retention_unit 435 // is 'COUNT', we will retain this many backups. 436 RetainedBackups int64 `json:"retainedBackups,omitempty"` 437 438 // RetentionUnit: The unit that 'retained_backups' represents. 439 // 440 // Possible values: 441 // "RETENTION_UNIT_UNSPECIFIED" - Backup retention unit is 442 // unspecified, will be treated as COUNT. 443 // "COUNT" - Retention will be by count, eg. "retain the most recent 7 444 // backups". 445 RetentionUnit string `json:"retentionUnit,omitempty"` 446 447 // ForceSendFields is a list of field names (e.g. "RetainedBackups") to 448 // unconditionally include in API requests. By default, fields with 449 // empty values are omitted from API requests. However, any non-pointer, 450 // non-interface field appearing in ForceSendFields will be sent to the 451 // server regardless of whether the field is empty or not. This may be 452 // used to include empty fields in Patch requests. 453 ForceSendFields []string `json:"-"` 454 455 // NullFields is a list of field names (e.g. "RetainedBackups") to 456 // include in API requests with the JSON null value. By default, fields 457 // with empty values are omitted from API requests. However, any field 458 // with an empty value appearing in NullFields will be sent to the 459 // server as null. It is an error if a field in this list has a 460 // non-empty value. This may be used to include null fields in Patch 461 // requests. 462 NullFields []string `json:"-"` 463} 464 465func (s *BackupRetentionSettings) MarshalJSON() ([]byte, error) { 466 type NoMethod BackupRetentionSettings 467 raw := NoMethod(*s) 468 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 469} 470 471// BackupRun: A BackupRun resource. 472type BackupRun struct { 473 // BackupKind: Specifies the kind of backup, PHYSICAL or 474 // DEFAULT_SNAPSHOT. 475 // 476 // Possible values: 477 // "SQL_BACKUP_KIND_UNSPECIFIED" - This is an unknown BackupKind. 478 // "SNAPSHOT" - The snapshot based backups 479 // "PHYSICAL" - Physical backups 480 BackupKind string `json:"backupKind,omitempty"` 481 482 // Description: The description of this run, only applicable to 483 // on-demand backups. 484 Description string `json:"description,omitempty"` 485 486 // DiskEncryptionConfiguration: Encryption configuration specific to a 487 // backup. Applies only to Second Generation instances. 488 DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"` 489 490 // DiskEncryptionStatus: Encryption status specific to a backup. Applies 491 // only to Second Generation instances. 492 DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"` 493 494 // EndTime: The time the backup operation completed in UTC timezone in 495 // RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. 496 EndTime string `json:"endTime,omitempty"` 497 498 // EnqueuedTime: The time the run was enqueued in UTC timezone in RFC 499 // 3339 format, for example *2012-11-15T16:19:00.094Z*. 500 EnqueuedTime string `json:"enqueuedTime,omitempty"` 501 502 // Error: Information about why the backup operation failed. This is 503 // only present if the run has the FAILED status. 504 Error *OperationError `json:"error,omitempty"` 505 506 // Id: The identifier for this backup run. Unique only for a specific 507 // Cloud SQL instance. 508 Id int64 `json:"id,omitempty,string"` 509 510 // Instance: Name of the database instance. 511 Instance string `json:"instance,omitempty"` 512 513 // Kind: This is always *sql#backupRun*. 514 Kind string `json:"kind,omitempty"` 515 516 // Location: Location of the backups. 517 Location string `json:"location,omitempty"` 518 519 // SelfLink: The URI of this resource. 520 SelfLink string `json:"selfLink,omitempty"` 521 522 // StartTime: The time the backup operation actually started in UTC 523 // timezone in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. 524 StartTime string `json:"startTime,omitempty"` 525 526 // Status: The status of this run. 527 // 528 // Possible values: 529 // "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" - The status of the run is 530 // unknown. 531 // "ENQUEUED" - The backup operation was enqueued. 532 // "OVERDUE" - The backup is overdue across a given backup window. 533 // Indicates a problem. Example: Long-running operation in progress 534 // during the whole window. 535 // "RUNNING" - The backup is in progress. 536 // "FAILED" - The backup failed. 537 // "SUCCESSFUL" - The backup was successful. 538 // "SKIPPED" - The backup was skipped (without problems) for a given 539 // backup window. Example: Instance was idle. 540 // "DELETION_PENDING" - The backup is about to be deleted. 541 // "DELETION_FAILED" - The backup deletion failed. 542 // "DELETED" - The backup has been deleted. 543 Status string `json:"status,omitempty"` 544 545 // Type: The type of this run; can be either "AUTOMATED" or "ON_DEMAND". 546 // This field defaults to "ON_DEMAND" and is ignored, when specified for 547 // insert requests. 548 // 549 // Possible values: 550 // "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" - This is an unknown BackupRun 551 // type. 552 // "AUTOMATED" - The backup schedule automatically triggers a backup. 553 // "ON_DEMAND" - The user manually triggers a backup. 554 Type string `json:"type,omitempty"` 555 556 // WindowStartTime: The start time of the backup window during which 557 // this the backup was attempted in RFC 3339 format, for example 558 // *2012-11-15T16:19:00.094Z*. 559 WindowStartTime string `json:"windowStartTime,omitempty"` 560 561 // ServerResponse contains the HTTP response code and headers from the 562 // server. 563 googleapi.ServerResponse `json:"-"` 564 565 // ForceSendFields is a list of field names (e.g. "BackupKind") to 566 // unconditionally include in API requests. By default, fields with 567 // empty values are omitted from API requests. However, any non-pointer, 568 // non-interface field appearing in ForceSendFields will be sent to the 569 // server regardless of whether the field is empty or not. This may be 570 // used to include empty fields in Patch requests. 571 ForceSendFields []string `json:"-"` 572 573 // NullFields is a list of field names (e.g. "BackupKind") to include in 574 // API requests with the JSON null value. By default, fields with empty 575 // values are omitted from API requests. However, any field with an 576 // empty value appearing in NullFields will be sent to the server as 577 // null. It is an error if a field in this list has a non-empty value. 578 // This may be used to include null fields in Patch requests. 579 NullFields []string `json:"-"` 580} 581 582func (s *BackupRun) MarshalJSON() ([]byte, error) { 583 type NoMethod BackupRun 584 raw := NoMethod(*s) 585 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 586} 587 588// BackupRunsListResponse: Backup run list results. 589type BackupRunsListResponse struct { 590 // Items: A list of backup runs in reverse chronological order of the 591 // enqueued time. 592 Items []*BackupRun `json:"items,omitempty"` 593 594 // Kind: This is always *sql#backupRunsList*. 595 Kind string `json:"kind,omitempty"` 596 597 // NextPageToken: The continuation token, used to page through large 598 // result sets. Provide this value in a subsequent request to return the 599 // next page of results. 600 NextPageToken string `json:"nextPageToken,omitempty"` 601 602 // ServerResponse contains the HTTP response code and headers from the 603 // server. 604 googleapi.ServerResponse `json:"-"` 605 606 // ForceSendFields is a list of field names (e.g. "Items") to 607 // unconditionally include in API requests. By default, fields with 608 // empty values are omitted from API requests. However, any non-pointer, 609 // non-interface field appearing in ForceSendFields will be sent to the 610 // server regardless of whether the field is empty or not. This may be 611 // used to include empty fields in Patch requests. 612 ForceSendFields []string `json:"-"` 613 614 // NullFields is a list of field names (e.g. "Items") to include in API 615 // requests with the JSON null value. By default, fields with empty 616 // values are omitted from API requests. However, any field with an 617 // empty value appearing in NullFields will be sent to the server as 618 // null. It is an error if a field in this list has a non-empty value. 619 // This may be used to include null fields in Patch requests. 620 NullFields []string `json:"-"` 621} 622 623func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) { 624 type NoMethod BackupRunsListResponse 625 raw := NoMethod(*s) 626 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 627} 628 629// BinLogCoordinates: Binary log coordinates. 630type BinLogCoordinates struct { 631 // BinLogFileName: Name of the binary log file for a Cloud SQL instance. 632 BinLogFileName string `json:"binLogFileName,omitempty"` 633 634 // BinLogPosition: Position (offset) within the binary log file. 635 BinLogPosition int64 `json:"binLogPosition,omitempty,string"` 636 637 // Kind: This is always *sql#binLogCoordinates*. 638 Kind string `json:"kind,omitempty"` 639 640 // ForceSendFields is a list of field names (e.g. "BinLogFileName") to 641 // unconditionally include in API requests. By default, fields with 642 // empty values are omitted from API requests. However, any non-pointer, 643 // non-interface field appearing in ForceSendFields will be sent to the 644 // server regardless of whether the field is empty or not. This may be 645 // used to include empty fields in Patch requests. 646 ForceSendFields []string `json:"-"` 647 648 // NullFields is a list of field names (e.g. "BinLogFileName") to 649 // include in API requests with the JSON null value. By default, fields 650 // with empty values are omitted from API requests. However, any field 651 // with an empty value appearing in NullFields will be sent to the 652 // server as null. It is an error if a field in this list has a 653 // non-empty value. This may be used to include null fields in Patch 654 // requests. 655 NullFields []string `json:"-"` 656} 657 658func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) { 659 type NoMethod BinLogCoordinates 660 raw := NoMethod(*s) 661 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 662} 663 664// CloneContext: Database instance clone context. 665type CloneContext struct { 666 // BinLogCoordinates: Binary log coordinates, if specified, identify the 667 // position up to which the source instance is cloned. If not specified, 668 // the source instance is cloned up to the most recent binary log 669 // coordinates. 670 BinLogCoordinates *BinLogCoordinates `json:"binLogCoordinates,omitempty"` 671 672 // DestinationInstanceName: Name of the Cloud SQL instance to be created 673 // as a clone. 674 DestinationInstanceName string `json:"destinationInstanceName,omitempty"` 675 676 // Kind: This is always *sql#cloneContext*. 677 Kind string `json:"kind,omitempty"` 678 679 // PitrTimestampMs: Reserved for future use. 680 PitrTimestampMs int64 `json:"pitrTimestampMs,omitempty,string"` 681 682 // PointInTime: Reserved for future use. 683 PointInTime string `json:"pointInTime,omitempty"` 684 685 // ForceSendFields is a list of field names (e.g. "BinLogCoordinates") 686 // to unconditionally include in API requests. By default, fields with 687 // empty values are omitted from API requests. However, any non-pointer, 688 // non-interface field appearing in ForceSendFields will be sent to the 689 // server regardless of whether the field is empty or not. This may be 690 // used to include empty fields in Patch requests. 691 ForceSendFields []string `json:"-"` 692 693 // NullFields is a list of field names (e.g. "BinLogCoordinates") to 694 // include in API requests with the JSON null value. By default, fields 695 // with empty values are omitted from API requests. However, any field 696 // with an empty value appearing in NullFields will be sent to the 697 // server as null. It is an error if a field in this list has a 698 // non-empty value. This may be used to include null fields in Patch 699 // requests. 700 NullFields []string `json:"-"` 701} 702 703func (s *CloneContext) MarshalJSON() ([]byte, error) { 704 type NoMethod CloneContext 705 raw := NoMethod(*s) 706 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 707} 708 709// Database: Represents a SQL database on the Cloud SQL instance. 710type Database struct { 711 // Charset: The Cloud SQL charset value. 712 Charset string `json:"charset,omitempty"` 713 714 // Collation: The Cloud SQL collation value. 715 Collation string `json:"collation,omitempty"` 716 717 // Etag: This field is deprecated and will be removed from a future 718 // version of the API. 719 Etag string `json:"etag,omitempty"` 720 721 // Instance: The name of the Cloud SQL instance. This does not include 722 // the project ID. 723 Instance string `json:"instance,omitempty"` 724 725 // Kind: This is always *sql#database*. 726 Kind string `json:"kind,omitempty"` 727 728 // Name: The name of the database in the Cloud SQL instance. This does 729 // not include the project ID or instance name. 730 Name string `json:"name,omitempty"` 731 732 // Project: The project ID of the project containing the Cloud SQL 733 // database. The Google apps domain is prefixed if applicable. 734 Project string `json:"project,omitempty"` 735 736 // SelfLink: The URI of this resource. 737 SelfLink string `json:"selfLink,omitempty"` 738 739 SqlserverDatabaseDetails *SqlServerDatabaseDetails `json:"sqlserverDatabaseDetails,omitempty"` 740 741 // ServerResponse contains the HTTP response code and headers from the 742 // server. 743 googleapi.ServerResponse `json:"-"` 744 745 // ForceSendFields is a list of field names (e.g. "Charset") to 746 // unconditionally include in API requests. By default, fields with 747 // empty values are omitted from API requests. However, any non-pointer, 748 // non-interface field appearing in ForceSendFields will be sent to the 749 // server regardless of whether the field is empty or not. This may be 750 // used to include empty fields in Patch requests. 751 ForceSendFields []string `json:"-"` 752 753 // NullFields is a list of field names (e.g. "Charset") to include in 754 // API requests with the JSON null value. By default, fields with empty 755 // values are omitted from API requests. However, any field with an 756 // empty value appearing in NullFields will be sent to the server as 757 // null. It is an error if a field in this list has a non-empty value. 758 // This may be used to include null fields in Patch requests. 759 NullFields []string `json:"-"` 760} 761 762func (s *Database) MarshalJSON() ([]byte, error) { 763 type NoMethod Database 764 raw := NoMethod(*s) 765 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 766} 767 768// DatabaseFlags: Database flags for Cloud SQL instances. 769type DatabaseFlags struct { 770 // Name: The name of the flag. These flags are passed at instance 771 // startup, so include both server options and system variables for 772 // MySQL. Flags are specified with underscores, not hyphens. For more 773 // information, see Configuring Database Flags in the Cloud SQL 774 // documentation. 775 Name string `json:"name,omitempty"` 776 777 // Value: The value of the flag. Booleans are set to *on* for true and 778 // *off* for false. This field must be omitted if the flag doesn't take 779 // a value. 780 Value string `json:"value,omitempty"` 781 782 // ForceSendFields is a list of field names (e.g. "Name") to 783 // unconditionally include in API requests. By default, fields with 784 // empty values are omitted from API requests. However, any non-pointer, 785 // non-interface field appearing in ForceSendFields will be sent to the 786 // server regardless of whether the field is empty or not. This may be 787 // used to include empty fields in Patch requests. 788 ForceSendFields []string `json:"-"` 789 790 // NullFields is a list of field names (e.g. "Name") to include in API 791 // requests with the JSON null value. By default, fields with empty 792 // values are omitted from API requests. However, any field with an 793 // empty value appearing in NullFields will be sent to the server as 794 // null. It is an error if a field in this list has a non-empty value. 795 // This may be used to include null fields in Patch requests. 796 NullFields []string `json:"-"` 797} 798 799func (s *DatabaseFlags) MarshalJSON() ([]byte, error) { 800 type NoMethod DatabaseFlags 801 raw := NoMethod(*s) 802 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 803} 804 805// DatabaseInstance: A Cloud SQL instance resource. 806type DatabaseInstance struct { 807 // BackendType: *SECOND_GEN*: Cloud SQL database instance. *EXTERNAL*: 808 // A database server that is not managed by Google. This property is 809 // read-only; use the *tier* property in the *settings* object to 810 // determine the database type. 811 // 812 // Possible values: 813 // "SQL_BACKEND_TYPE_UNSPECIFIED" - This is an unknown backend type 814 // for instance. 815 // "FIRST_GEN" - V1 speckle instance. 816 // "SECOND_GEN" - V2 speckle instance. 817 // "EXTERNAL" - On premises instance. 818 BackendType string `json:"backendType,omitempty"` 819 820 // ConnectionName: Connection name of the Cloud SQL instance used in 821 // connection strings. 822 ConnectionName string `json:"connectionName,omitempty"` 823 824 // CurrentDiskSize: The current disk usage of the instance in bytes. 825 // This property has been deprecated. Use the 826 // "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud 827 // Monitoring API instead. Please see this announcement for details. 828 CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"` 829 830 // DatabaseVersion: The database engine type and version. The 831 // *databaseVersion* field cannot be changed after instance creation. 832 // MySQL instances: *MYSQL_8_0*, *MYSQL_5_7* (default), or *MYSQL_5_6*. 833 // PostgreSQL instances: *POSTGRES_9_6*, *POSTGRES_10*, *POSTGRES_11*, 834 // *POSTGRES_12*, or *POSTGRES_13* (default). SQL Server instances: 835 // *SQLSERVER_2017_STANDARD* (default), *SQLSERVER_2017_ENTERPRISE*, 836 // *SQLSERVER_2017_EXPRESS*, or *SQLSERVER_2017_WEB*. 837 // 838 // Possible values: 839 // "SQL_DATABASE_VERSION_UNSPECIFIED" - This is an unknown database 840 // version. 841 // "MYSQL_5_1" - The database version is MySQL 5.1. 842 // "MYSQL_5_5" - The database version is MySQL 5.5. 843 // "MYSQL_5_6" - The database version is MySQL 5.6. 844 // "MYSQL_5_7" - The database version is MySQL 5.7. 845 // "POSTGRES_9_6" - The database version is PostgreSQL 9.6. 846 // "POSTGRES_11" - The database version is PostgreSQL 11. 847 // "SQLSERVER_2017_STANDARD" - The database version is SQL Server 2017 848 // Standard. 849 // "SQLSERVER_2017_ENTERPRISE" - The database version is SQL Server 850 // 2017 Enterprise. 851 // "SQLSERVER_2017_EXPRESS" - The database version is SQL Server 2017 852 // Express. 853 // "SQLSERVER_2017_WEB" - The database version is SQL Server 2017 Web. 854 // "POSTGRES_10" - The database version is PostgreSQL 10. 855 // "POSTGRES_12" - The database version is PostgreSQL 12. 856 // "MYSQL_8_0" - The database version is MySQL 8. 857 // "POSTGRES_13" - The database version is PostgreSQL 13. 858 DatabaseVersion string `json:"databaseVersion,omitempty"` 859 860 // DiskEncryptionConfiguration: Disk encryption configuration specific 861 // to an instance. Applies only to Second Generation instances. 862 DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"` 863 864 // DiskEncryptionStatus: Disk encryption status specific to an instance. 865 // Applies only to Second Generation instances. 866 DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"` 867 868 // Etag: This field is deprecated and will be removed from a future 869 // version of the API. Use the *settings.settingsVersion* field instead. 870 Etag string `json:"etag,omitempty"` 871 872 // FailoverReplica: The name and status of the failover replica. This 873 // property is applicable only to Second Generation instances. 874 FailoverReplica *DatabaseInstanceFailoverReplica `json:"failoverReplica,omitempty"` 875 876 // GceZone: The Compute Engine zone that the instance is currently 877 // serving from. This value could be different from the zone that was 878 // specified when the instance was created if the instance has failed 879 // over to its secondary zone. 880 GceZone string `json:"gceZone,omitempty"` 881 882 // InstanceType: The instance type. This can be one of the following. 883 // *CLOUD_SQL_INSTANCE*: A Cloud SQL instance that is not replicating 884 // from a primary instance. *ON_PREMISES_INSTANCE*: An instance running 885 // on the customer's premises. *READ_REPLICA_INSTANCE*: A Cloud SQL 886 // instance configured as a read-replica. 887 // 888 // Possible values: 889 // "SQL_INSTANCE_TYPE_UNSPECIFIED" - This is an unknown Cloud SQL 890 // instance type. 891 // "CLOUD_SQL_INSTANCE" - A regular Cloud SQL instance. 892 // "ON_PREMISES_INSTANCE" - An instance running on the customer's 893 // premises that is not managed by Cloud SQL. 894 // "READ_REPLICA_INSTANCE" - A Cloud SQL instance acting as a 895 // read-replica. 896 InstanceType string `json:"instanceType,omitempty"` 897 898 // IpAddresses: The assigned IP addresses for the instance. 899 IpAddresses []*IpMapping `json:"ipAddresses,omitempty"` 900 901 // Ipv6Address: The IPv6 address assigned to the instance. (Deprecated) 902 // This property was applicable only to First Generation instances. 903 Ipv6Address string `json:"ipv6Address,omitempty"` 904 905 // Kind: This is always *sql#instance*. 906 Kind string `json:"kind,omitempty"` 907 908 // MasterInstanceName: The name of the instance which will act as 909 // primary in the replication setup. 910 MasterInstanceName string `json:"masterInstanceName,omitempty"` 911 912 // MaxDiskSize: The maximum disk size of the instance in bytes. 913 MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"` 914 915 // Name: Name of the Cloud SQL instance. This does not include the 916 // project ID. 917 Name string `json:"name,omitempty"` 918 919 // OnPremisesConfiguration: Configuration specific to on-premises 920 // instances. 921 OnPremisesConfiguration *OnPremisesConfiguration `json:"onPremisesConfiguration,omitempty"` 922 923 // Project: The project ID of the project containing the Cloud SQL 924 // instance. The Google apps domain is prefixed if applicable. 925 Project string `json:"project,omitempty"` 926 927 // Region: The geographical region. Can be *us-central* (*FIRST_GEN* 928 // instances only) *us-central1* (*SECOND_GEN* instances only) 929 // *asia-east1* or *europe-west1*. Defaults to *us-central* or 930 // *us-central1* depending on the instance type. The region cannot be 931 // changed after instance creation. 932 Region string `json:"region,omitempty"` 933 934 // ReplicaConfiguration: Configuration specific to failover replicas and 935 // read replicas. 936 ReplicaConfiguration *ReplicaConfiguration `json:"replicaConfiguration,omitempty"` 937 938 // ReplicaNames: The replicas of the instance. 939 ReplicaNames []string `json:"replicaNames,omitempty"` 940 941 // RootPassword: Initial root password. Use only on creation. 942 RootPassword string `json:"rootPassword,omitempty"` 943 944 // SatisfiesPzs: The status indicating if instance satisfiesPzs. 945 // Reserved for future use. 946 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"` 947 948 // ScheduledMaintenance: The start time of any upcoming scheduled 949 // maintenance for this instance. 950 ScheduledMaintenance *SqlScheduledMaintenance `json:"scheduledMaintenance,omitempty"` 951 952 // SecondaryGceZone: The Compute Engine zone that the failover instance 953 // is currently serving from for a regional instance. This value could 954 // be different from the zone that was specified when the instance was 955 // created if the instance has failed over to its secondary/failover 956 // zone. Reserved for future use. 957 SecondaryGceZone string `json:"secondaryGceZone,omitempty"` 958 959 // SelfLink: The URI of this resource. 960 SelfLink string `json:"selfLink,omitempty"` 961 962 // ServerCaCert: SSL configuration. 963 ServerCaCert *SslCert `json:"serverCaCert,omitempty"` 964 965 // ServiceAccountEmailAddress: The service account email address 966 // assigned to the instance. This property is applicable only to Second 967 // Generation instances. 968 ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,omitempty"` 969 970 // Settings: The user settings. 971 Settings *Settings `json:"settings,omitempty"` 972 973 // State: The current serving state of the Cloud SQL instance. This can 974 // be one of the following. *SQL_INSTANCE_STATE_UNSPECIFIED*: The state 975 // of the instance is unknown. *RUNNABLE*: The instance is running, or 976 // has been stopped by owner. *SUSPENDED*: The instance is not 977 // available, for example due to problems with billing. 978 // *PENDING_DELETE*: The instance is being deleted. *PENDING_CREATE*: 979 // The instance is being created. *MAINTENANCE*: The instance is down 980 // for maintenance. *FAILED*: The instance creation failed. 981 // 982 // Possible values: 983 // "SQL_INSTANCE_STATE_UNSPECIFIED" - The state of the instance is 984 // unknown. 985 // "RUNNABLE" - The instance is running, or has been stopped by owner. 986 // "SUSPENDED" - The instance is not available, for example due to 987 // problems with billing. 988 // "PENDING_DELETE" - The instance is being deleted. 989 // "PENDING_CREATE" - The instance is being created. 990 // "MAINTENANCE" - The instance is down for maintenance. 991 // "FAILED" - The creation of the instance failed or a fatal error 992 // occurred during maintenance. 993 State string `json:"state,omitempty"` 994 995 // SuspensionReason: If the instance state is SUSPENDED, the reason for 996 // the suspension. 997 // 998 // Possible values: 999 // "SQL_SUSPENSION_REASON_UNSPECIFIED" - This is an unknown suspension 1000 // reason. 1001 // "BILLING_ISSUE" - The instance is suspended due to billing issues 1002 // (for example:, GCP account issue) 1003 // "LEGAL_ISSUE" - The instance is suspended due to illegal content 1004 // (for example:, child pornography, copyrighted material, etc.). 1005 // "OPERATIONAL_ISSUE" - The instance is causing operational issues 1006 // (for example:, causing the database to crash). 1007 // "KMS_KEY_ISSUE" - The KMS key used by the instance is either 1008 // revoked or denied access to 1009 SuspensionReason []string `json:"suspensionReason,omitempty"` 1010 1011 // ServerResponse contains the HTTP response code and headers from the 1012 // server. 1013 googleapi.ServerResponse `json:"-"` 1014 1015 // ForceSendFields is a list of field names (e.g. "BackendType") to 1016 // unconditionally include in API requests. By default, fields with 1017 // empty values are omitted from API requests. However, any non-pointer, 1018 // non-interface field appearing in ForceSendFields will be sent to the 1019 // server regardless of whether the field is empty or not. This may be 1020 // used to include empty fields in Patch requests. 1021 ForceSendFields []string `json:"-"` 1022 1023 // NullFields is a list of field names (e.g. "BackendType") to include 1024 // in API requests with the JSON null value. By default, fields with 1025 // empty values are omitted from API requests. However, any field with 1026 // an empty value appearing in NullFields will be sent to the server as 1027 // null. It is an error if a field in this list has a non-empty value. 1028 // This may be used to include null fields in Patch requests. 1029 NullFields []string `json:"-"` 1030} 1031 1032func (s *DatabaseInstance) MarshalJSON() ([]byte, error) { 1033 type NoMethod DatabaseInstance 1034 raw := NoMethod(*s) 1035 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1036} 1037 1038// DatabaseInstanceFailoverReplica: The name and status of the failover 1039// replica. This property is applicable only to Second Generation 1040// instances. 1041type DatabaseInstanceFailoverReplica struct { 1042 // Available: The availability status of the failover replica. A false 1043 // status indicates that the failover replica is out of sync. The 1044 // primary instance can only failover to the failover replica when the 1045 // status is true. 1046 Available bool `json:"available,omitempty"` 1047 1048 // Name: The name of the failover replica. If specified at instance 1049 // creation, a failover replica is created for the instance. The name 1050 // doesn't include the project ID. This property is applicable only to 1051 // Second Generation instances. 1052 Name string `json:"name,omitempty"` 1053 1054 // ForceSendFields is a list of field names (e.g. "Available") to 1055 // unconditionally include in API requests. By default, fields with 1056 // empty values are omitted from API requests. However, any non-pointer, 1057 // non-interface field appearing in ForceSendFields will be sent to the 1058 // server regardless of whether the field is empty or not. This may be 1059 // used to include empty fields in Patch requests. 1060 ForceSendFields []string `json:"-"` 1061 1062 // NullFields is a list of field names (e.g. "Available") to include in 1063 // API requests with the JSON null value. By default, fields with empty 1064 // values are omitted from API requests. However, any field with an 1065 // empty value appearing in NullFields will be sent to the server as 1066 // null. It is an error if a field in this list has a non-empty value. 1067 // This may be used to include null fields in Patch requests. 1068 NullFields []string `json:"-"` 1069} 1070 1071func (s *DatabaseInstanceFailoverReplica) MarshalJSON() ([]byte, error) { 1072 type NoMethod DatabaseInstanceFailoverReplica 1073 raw := NoMethod(*s) 1074 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1075} 1076 1077// DatabasesListResponse: Database list response. 1078type DatabasesListResponse struct { 1079 // Items: List of database resources in the instance. 1080 Items []*Database `json:"items,omitempty"` 1081 1082 // Kind: This is always *sql#databasesList*. 1083 Kind string `json:"kind,omitempty"` 1084 1085 // ServerResponse contains the HTTP response code and headers from the 1086 // server. 1087 googleapi.ServerResponse `json:"-"` 1088 1089 // ForceSendFields is a list of field names (e.g. "Items") to 1090 // unconditionally include in API requests. By default, fields with 1091 // empty values are omitted from API requests. However, any non-pointer, 1092 // non-interface field appearing in ForceSendFields will be sent to the 1093 // server regardless of whether the field is empty or not. This may be 1094 // used to include empty fields in Patch requests. 1095 ForceSendFields []string `json:"-"` 1096 1097 // NullFields is a list of field names (e.g. "Items") to include in API 1098 // requests with the JSON null value. By default, fields with empty 1099 // values are omitted from API requests. However, any field with an 1100 // empty value appearing in NullFields will be sent to the server as 1101 // null. It is an error if a field in this list has a non-empty value. 1102 // This may be used to include null fields in Patch requests. 1103 NullFields []string `json:"-"` 1104} 1105 1106func (s *DatabasesListResponse) MarshalJSON() ([]byte, error) { 1107 type NoMethod DatabasesListResponse 1108 raw := NoMethod(*s) 1109 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1110} 1111 1112// DemoteMasterConfiguration: Read-replica configuration for connecting 1113// to the on-premises primary instance. 1114type DemoteMasterConfiguration struct { 1115 // Kind: This is always *sql#demoteMasterConfiguration*. 1116 Kind string `json:"kind,omitempty"` 1117 1118 // MysqlReplicaConfiguration: MySQL specific configuration when 1119 // replicating from a MySQL on-premises primary instance. Replication 1120 // configuration information such as the username, password, 1121 // certificates, and keys are not stored in the instance metadata. The 1122 // configuration information is used only to set up the replication 1123 // connection and is stored by MySQL in a file named *master.info* in 1124 // the data directory. 1125 MysqlReplicaConfiguration *DemoteMasterMySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"` 1126 1127 // ForceSendFields is a list of field names (e.g. "Kind") to 1128 // unconditionally include in API requests. By default, fields with 1129 // empty values are omitted from API requests. However, any non-pointer, 1130 // non-interface field appearing in ForceSendFields will be sent to the 1131 // server regardless of whether the field is empty or not. This may be 1132 // used to include empty fields in Patch requests. 1133 ForceSendFields []string `json:"-"` 1134 1135 // NullFields is a list of field names (e.g. "Kind") to include in API 1136 // requests with the JSON null value. By default, fields with empty 1137 // values are omitted from API requests. However, any field with an 1138 // empty value appearing in NullFields will be sent to the server as 1139 // null. It is an error if a field in this list has a non-empty value. 1140 // This may be used to include null fields in Patch requests. 1141 NullFields []string `json:"-"` 1142} 1143 1144func (s *DemoteMasterConfiguration) MarshalJSON() ([]byte, error) { 1145 type NoMethod DemoteMasterConfiguration 1146 raw := NoMethod(*s) 1147 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1148} 1149 1150// DemoteMasterContext: Database instance demote primary instance 1151// context. 1152type DemoteMasterContext struct { 1153 // Kind: This is always *sql#demoteMasterContext*. 1154 Kind string `json:"kind,omitempty"` 1155 1156 // MasterInstanceName: The name of the instance which will act as 1157 // on-premises primary instance in the replication setup. 1158 MasterInstanceName string `json:"masterInstanceName,omitempty"` 1159 1160 // ReplicaConfiguration: Configuration specific to read-replicas 1161 // replicating from the on-premises primary instance. 1162 ReplicaConfiguration *DemoteMasterConfiguration `json:"replicaConfiguration,omitempty"` 1163 1164 // VerifyGtidConsistency: Verify GTID consistency for demote operation. 1165 // Default value: *True*. Second Generation instances only. Setting this 1166 // flag to false enables you to bypass GTID consistency check between 1167 // on-premises primary instance and Cloud SQL instance during the 1168 // demotion operation but also exposes you to the risk of future 1169 // replication failures. Change the value only if you know the reason 1170 // for the GTID divergence and are confident that doing so will not 1171 // cause any replication issues. 1172 VerifyGtidConsistency bool `json:"verifyGtidConsistency,omitempty"` 1173 1174 // ForceSendFields is a list of field names (e.g. "Kind") to 1175 // unconditionally include in API requests. By default, fields with 1176 // empty values are omitted from API requests. However, any non-pointer, 1177 // non-interface field appearing in ForceSendFields will be sent to the 1178 // server regardless of whether the field is empty or not. This may be 1179 // used to include empty fields in Patch requests. 1180 ForceSendFields []string `json:"-"` 1181 1182 // NullFields is a list of field names (e.g. "Kind") to include in API 1183 // requests with the JSON null value. By default, fields with empty 1184 // values are omitted from API requests. However, any field with an 1185 // empty value appearing in NullFields will be sent to the server as 1186 // null. It is an error if a field in this list has a non-empty value. 1187 // This may be used to include null fields in Patch requests. 1188 NullFields []string `json:"-"` 1189} 1190 1191func (s *DemoteMasterContext) MarshalJSON() ([]byte, error) { 1192 type NoMethod DemoteMasterContext 1193 raw := NoMethod(*s) 1194 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1195} 1196 1197// DemoteMasterMySqlReplicaConfiguration: Read-replica configuration 1198// specific to MySQL databases. 1199type DemoteMasterMySqlReplicaConfiguration struct { 1200 // CaCertificate: PEM representation of the trusted CA's x509 1201 // certificate. 1202 CaCertificate string `json:"caCertificate,omitempty"` 1203 1204 // ClientCertificate: PEM representation of the replica's x509 1205 // certificate. 1206 ClientCertificate string `json:"clientCertificate,omitempty"` 1207 1208 // ClientKey: PEM representation of the replica's private key. The 1209 // corresponsing public key is encoded in the client's certificate. The 1210 // format of the replica's private key can be either PKCS #1 or PKCS #8. 1211 ClientKey string `json:"clientKey,omitempty"` 1212 1213 // Kind: This is always *sql#demoteMasterMysqlReplicaConfiguration*. 1214 Kind string `json:"kind,omitempty"` 1215 1216 // Password: The password for the replication connection. 1217 Password string `json:"password,omitempty"` 1218 1219 // Username: The username for the replication connection. 1220 Username string `json:"username,omitempty"` 1221 1222 // ForceSendFields is a list of field names (e.g. "CaCertificate") to 1223 // unconditionally include in API requests. By default, fields with 1224 // empty values are omitted from API requests. However, any non-pointer, 1225 // non-interface field appearing in ForceSendFields will be sent to the 1226 // server regardless of whether the field is empty or not. This may be 1227 // used to include empty fields in Patch requests. 1228 ForceSendFields []string `json:"-"` 1229 1230 // NullFields is a list of field names (e.g. "CaCertificate") to include 1231 // in API requests with the JSON null value. By default, fields with 1232 // empty values are omitted from API requests. However, any field with 1233 // an empty value appearing in NullFields will be sent to the server as 1234 // null. It is an error if a field in this list has a non-empty value. 1235 // This may be used to include null fields in Patch requests. 1236 NullFields []string `json:"-"` 1237} 1238 1239func (s *DemoteMasterMySqlReplicaConfiguration) MarshalJSON() ([]byte, error) { 1240 type NoMethod DemoteMasterMySqlReplicaConfiguration 1241 raw := NoMethod(*s) 1242 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1243} 1244 1245// DenyMaintenancePeriod: Deny Maintenance Periods. This specifies a 1246// date range during when all CSA rollout will be denied. 1247type DenyMaintenancePeriod struct { 1248 // EndDate: "deny maintenance period" end date. If the year of the end 1249 // date is empty, the year of the start date also must be empty. In this 1250 // case, it means the deny maintenance period recurs every year. The 1251 // date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01 1252 EndDate string `json:"endDate,omitempty"` 1253 1254 // StartDate: "deny maintenance period" start date. If the year of the 1255 // start date is empty, the year of the end date also must be empty. In 1256 // this case, it means the deny maintenance period recurs every year. 1257 // The date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 1258 // 11-01 1259 StartDate string `json:"startDate,omitempty"` 1260 1261 // Time: Time in UTC when the "deny maintenance period" starts on 1262 // start_date and ends on end_date. The time is in format: HH:mm:SS, 1263 // i.e., 00:00:00 1264 Time string `json:"time,omitempty"` 1265 1266 // ForceSendFields is a list of field names (e.g. "EndDate") to 1267 // unconditionally include in API requests. By default, fields with 1268 // empty values are omitted from API requests. However, any non-pointer, 1269 // non-interface field appearing in ForceSendFields will be sent to the 1270 // server regardless of whether the field is empty or not. This may be 1271 // used to include empty fields in Patch requests. 1272 ForceSendFields []string `json:"-"` 1273 1274 // NullFields is a list of field names (e.g. "EndDate") to include in 1275 // API requests with the JSON null value. By default, fields with empty 1276 // values are omitted from API requests. However, any field with an 1277 // empty value appearing in NullFields will be sent to the server as 1278 // null. It is an error if a field in this list has a non-empty value. 1279 // This may be used to include null fields in Patch requests. 1280 NullFields []string `json:"-"` 1281} 1282 1283func (s *DenyMaintenancePeriod) MarshalJSON() ([]byte, error) { 1284 type NoMethod DenyMaintenancePeriod 1285 raw := NoMethod(*s) 1286 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1287} 1288 1289// DiskEncryptionConfiguration: Disk encryption configuration for an 1290// instance. 1291type DiskEncryptionConfiguration struct { 1292 // Kind: This is always *sql#diskEncryptionConfiguration*. 1293 Kind string `json:"kind,omitempty"` 1294 1295 // KmsKeyName: Resource name of KMS key for disk encryption 1296 KmsKeyName string `json:"kmsKeyName,omitempty"` 1297 1298 // ForceSendFields is a list of field names (e.g. "Kind") to 1299 // unconditionally include in API requests. By default, fields with 1300 // empty values are omitted from API requests. However, any non-pointer, 1301 // non-interface field appearing in ForceSendFields will be sent to the 1302 // server regardless of whether the field is empty or not. This may be 1303 // used to include empty fields in Patch requests. 1304 ForceSendFields []string `json:"-"` 1305 1306 // NullFields is a list of field names (e.g. "Kind") to include in API 1307 // requests with the JSON null value. By default, fields with empty 1308 // values are omitted from API requests. However, any field with an 1309 // empty value appearing in NullFields will be sent to the server as 1310 // null. It is an error if a field in this list has a non-empty value. 1311 // This may be used to include null fields in Patch requests. 1312 NullFields []string `json:"-"` 1313} 1314 1315func (s *DiskEncryptionConfiguration) MarshalJSON() ([]byte, error) { 1316 type NoMethod DiskEncryptionConfiguration 1317 raw := NoMethod(*s) 1318 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1319} 1320 1321// DiskEncryptionStatus: Disk encryption status for an instance. 1322type DiskEncryptionStatus struct { 1323 // Kind: This is always *sql#diskEncryptionStatus*. 1324 Kind string `json:"kind,omitempty"` 1325 1326 // KmsKeyVersionName: KMS key version used to encrypt the Cloud SQL 1327 // instance resource 1328 KmsKeyVersionName string `json:"kmsKeyVersionName,omitempty"` 1329 1330 // ForceSendFields is a list of field names (e.g. "Kind") to 1331 // unconditionally include in API requests. By default, fields with 1332 // empty values are omitted from API requests. However, any non-pointer, 1333 // non-interface field appearing in ForceSendFields will be sent to the 1334 // server regardless of whether the field is empty or not. This may be 1335 // used to include empty fields in Patch requests. 1336 ForceSendFields []string `json:"-"` 1337 1338 // NullFields is a list of field names (e.g. "Kind") to include in API 1339 // requests with the JSON null value. By default, fields with empty 1340 // values are omitted from API requests. However, any field with an 1341 // empty value appearing in NullFields will be sent to the server as 1342 // null. It is an error if a field in this list has a non-empty value. 1343 // This may be used to include null fields in Patch requests. 1344 NullFields []string `json:"-"` 1345} 1346 1347func (s *DiskEncryptionStatus) MarshalJSON() ([]byte, error) { 1348 type NoMethod DiskEncryptionStatus 1349 raw := NoMethod(*s) 1350 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1351} 1352 1353// ExportContext: Database instance export context. 1354type ExportContext struct { 1355 // CsvExportOptions: Options for exporting data as CSV. *MySQL* and 1356 // *PostgreSQL* instances only. 1357 CsvExportOptions *ExportContextCsvExportOptions `json:"csvExportOptions,omitempty"` 1358 1359 // Databases: Databases to be exported. *MySQL instances:* If *fileType* 1360 // is *SQL* and no database is specified, all databases are exported, 1361 // except for the *mysql* system database. If *fileType* is *CSV*, you 1362 // can specify one database, either by using this property or by using 1363 // the *csvExportOptions.selectQuery* property, which takes precedence 1364 // over this property. *PostgreSQL instances:* You must specify one 1365 // database to be exported. If *fileType* is *CSV*, this database must 1366 // match the one specified in the *csvExportOptions.selectQuery* 1367 // property. *SQL Server instances:* You must specify one database to be 1368 // exported, and the *fileType* must be *BAK*. 1369 Databases []string `json:"databases,omitempty"` 1370 1371 // FileType: The file type for the specified uri. *SQL*: The file 1372 // contains SQL statements. *CSV*: The file contains CSV data. *BAK*: 1373 // The file contains backup data for a SQL Server instance. 1374 // 1375 // Possible values: 1376 // "SQL_FILE_TYPE_UNSPECIFIED" - Unknown file type. 1377 // "SQL" - File containing SQL statements. 1378 // "CSV" - File in CSV format. 1379 // "BAK" 1380 FileType string `json:"fileType,omitempty"` 1381 1382 // Kind: This is always *sql#exportContext*. 1383 Kind string `json:"kind,omitempty"` 1384 1385 // Offload: Option for export offload. 1386 Offload bool `json:"offload,omitempty"` 1387 1388 // SqlExportOptions: Options for exporting data as SQL statements. 1389 SqlExportOptions *ExportContextSqlExportOptions `json:"sqlExportOptions,omitempty"` 1390 1391 // Uri: The path to the file in Google Cloud Storage where the export 1392 // will be stored. The URI is in the form *gs://bucketName/fileName*. If 1393 // the file already exists, the request succeeds, but the operation 1394 // fails. If *fileType* is *SQL* and the filename ends with .gz, the 1395 // contents are compressed. 1396 Uri string `json:"uri,omitempty"` 1397 1398 // ForceSendFields is a list of field names (e.g. "CsvExportOptions") to 1399 // unconditionally include in API requests. By default, fields with 1400 // empty values are omitted from API requests. However, any non-pointer, 1401 // non-interface field appearing in ForceSendFields will be sent to the 1402 // server regardless of whether the field is empty or not. This may be 1403 // used to include empty fields in Patch requests. 1404 ForceSendFields []string `json:"-"` 1405 1406 // NullFields is a list of field names (e.g. "CsvExportOptions") to 1407 // include in API requests with the JSON null value. By default, fields 1408 // with empty values are omitted from API requests. However, any field 1409 // with an empty value appearing in NullFields will be sent to the 1410 // server as null. It is an error if a field in this list has a 1411 // non-empty value. This may be used to include null fields in Patch 1412 // requests. 1413 NullFields []string `json:"-"` 1414} 1415 1416func (s *ExportContext) MarshalJSON() ([]byte, error) { 1417 type NoMethod ExportContext 1418 raw := NoMethod(*s) 1419 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1420} 1421 1422// ExportContextCsvExportOptions: Options for exporting data as CSV. 1423// *MySQL* and *PostgreSQL* instances only. 1424type ExportContextCsvExportOptions struct { 1425 // SelectQuery: The select query used to extract the data. 1426 SelectQuery string `json:"selectQuery,omitempty"` 1427 1428 // ForceSendFields is a list of field names (e.g. "SelectQuery") to 1429 // unconditionally include in API requests. By default, fields with 1430 // empty values are omitted from API requests. However, any non-pointer, 1431 // non-interface field appearing in ForceSendFields will be sent to the 1432 // server regardless of whether the field is empty or not. This may be 1433 // used to include empty fields in Patch requests. 1434 ForceSendFields []string `json:"-"` 1435 1436 // NullFields is a list of field names (e.g. "SelectQuery") to include 1437 // in API requests with the JSON null value. By default, fields with 1438 // empty values are omitted from API requests. However, any field with 1439 // an empty value appearing in NullFields will be sent to the server as 1440 // null. It is an error if a field in this list has a non-empty value. 1441 // This may be used to include null fields in Patch requests. 1442 NullFields []string `json:"-"` 1443} 1444 1445func (s *ExportContextCsvExportOptions) MarshalJSON() ([]byte, error) { 1446 type NoMethod ExportContextCsvExportOptions 1447 raw := NoMethod(*s) 1448 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1449} 1450 1451// ExportContextSqlExportOptions: Options for exporting data as SQL 1452// statements. 1453type ExportContextSqlExportOptions struct { 1454 // MysqlExportOptions: Options for exporting from MySQL. 1455 MysqlExportOptions *ExportContextSqlExportOptionsMysqlExportOptions `json:"mysqlExportOptions,omitempty"` 1456 1457 // SchemaOnly: Export only schemas. 1458 SchemaOnly bool `json:"schemaOnly,omitempty"` 1459 1460 // Tables: Tables to export, or that were exported, from the specified 1461 // database. If you specify tables, specify one and only one database. 1462 // For PostgreSQL instances, you can specify only one table. 1463 Tables []string `json:"tables,omitempty"` 1464 1465 // ForceSendFields is a list of field names (e.g. "MysqlExportOptions") 1466 // to unconditionally include in API requests. By default, fields with 1467 // empty values are omitted from API requests. However, any non-pointer, 1468 // non-interface field appearing in ForceSendFields will be sent to the 1469 // server regardless of whether the field is empty or not. This may be 1470 // used to include empty fields in Patch requests. 1471 ForceSendFields []string `json:"-"` 1472 1473 // NullFields is a list of field names (e.g. "MysqlExportOptions") to 1474 // include in API requests with the JSON null value. By default, fields 1475 // with empty values are omitted from API requests. However, any field 1476 // with an empty value appearing in NullFields will be sent to the 1477 // server as null. It is an error if a field in this list has a 1478 // non-empty value. This may be used to include null fields in Patch 1479 // requests. 1480 NullFields []string `json:"-"` 1481} 1482 1483func (s *ExportContextSqlExportOptions) MarshalJSON() ([]byte, error) { 1484 type NoMethod ExportContextSqlExportOptions 1485 raw := NoMethod(*s) 1486 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1487} 1488 1489// ExportContextSqlExportOptionsMysqlExportOptions: Options for 1490// exporting from MySQL. 1491type ExportContextSqlExportOptionsMysqlExportOptions struct { 1492 // MasterData: Option to include SQL statement required to set up 1493 // replication. If set to *1*, the dump file includes a CHANGE MASTER TO 1494 // statement with the binary log coordinates, and --set-gtid-purged is 1495 // set to ON. If set to *2*, the CHANGE MASTER TO statement is written 1496 // as a SQL comment and has no effect. If set to any value other than 1497 // *1*, --set-gtid-purged is set to OFF. 1498 MasterData int64 `json:"masterData,omitempty"` 1499 1500 // ForceSendFields is a list of field names (e.g. "MasterData") to 1501 // unconditionally include in API requests. By default, fields with 1502 // empty values are omitted from API requests. However, any non-pointer, 1503 // non-interface field appearing in ForceSendFields will be sent to the 1504 // server regardless of whether the field is empty or not. This may be 1505 // used to include empty fields in Patch requests. 1506 ForceSendFields []string `json:"-"` 1507 1508 // NullFields is a list of field names (e.g. "MasterData") to include in 1509 // API requests with the JSON null value. By default, fields with empty 1510 // values are omitted from API requests. However, any field with an 1511 // empty value appearing in NullFields will be sent to the server as 1512 // null. It is an error if a field in this list has a non-empty value. 1513 // This may be used to include null fields in Patch requests. 1514 NullFields []string `json:"-"` 1515} 1516 1517func (s *ExportContextSqlExportOptionsMysqlExportOptions) MarshalJSON() ([]byte, error) { 1518 type NoMethod ExportContextSqlExportOptionsMysqlExportOptions 1519 raw := NoMethod(*s) 1520 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1521} 1522 1523// FailoverContext: Database instance failover context. 1524type FailoverContext struct { 1525 // Kind: This is always *sql#failoverContext*. 1526 Kind string `json:"kind,omitempty"` 1527 1528 // SettingsVersion: The current settings version of this instance. 1529 // Request will be rejected if this version doesn't match the current 1530 // settings version. 1531 SettingsVersion int64 `json:"settingsVersion,omitempty,string"` 1532 1533 // ForceSendFields is a list of field names (e.g. "Kind") to 1534 // unconditionally include in API requests. By default, fields with 1535 // empty values are omitted from API requests. However, any non-pointer, 1536 // non-interface field appearing in ForceSendFields will be sent to the 1537 // server regardless of whether the field is empty or not. This may be 1538 // used to include empty fields in Patch requests. 1539 ForceSendFields []string `json:"-"` 1540 1541 // NullFields is a list of field names (e.g. "Kind") to include in API 1542 // requests with the JSON null value. By default, fields with empty 1543 // values are omitted from API requests. However, any field with an 1544 // empty value appearing in NullFields will be sent to the server as 1545 // null. It is an error if a field in this list has a non-empty value. 1546 // This may be used to include null fields in Patch requests. 1547 NullFields []string `json:"-"` 1548} 1549 1550func (s *FailoverContext) MarshalJSON() ([]byte, error) { 1551 type NoMethod FailoverContext 1552 raw := NoMethod(*s) 1553 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1554} 1555 1556// Flag: A flag resource. 1557type Flag struct { 1558 // AllowedIntValues: Use this field if only certain integers are 1559 // accepted. Can be combined with min_value and max_value to add 1560 // additional values. 1561 AllowedIntValues googleapi.Int64s `json:"allowedIntValues,omitempty"` 1562 1563 // AllowedStringValues: For *STRING* flags, a list of strings that the 1564 // value can be set to. 1565 AllowedStringValues []string `json:"allowedStringValues,omitempty"` 1566 1567 // AppliesTo: The database version this flag applies to. Can be 1568 // *MYSQL_8_0*, *MYSQL_5_6*, or *MYSQL_5_7*. 1569 // 1570 // Possible values: 1571 // "SQL_DATABASE_VERSION_UNSPECIFIED" - This is an unknown database 1572 // version. 1573 // "MYSQL_5_1" - The database version is MySQL 5.1. 1574 // "MYSQL_5_5" - The database version is MySQL 5.5. 1575 // "MYSQL_5_6" - The database version is MySQL 5.6. 1576 // "MYSQL_5_7" - The database version is MySQL 5.7. 1577 // "POSTGRES_9_6" - The database version is PostgreSQL 9.6. 1578 // "POSTGRES_11" - The database version is PostgreSQL 11. 1579 // "SQLSERVER_2017_STANDARD" - The database version is SQL Server 2017 1580 // Standard. 1581 // "SQLSERVER_2017_ENTERPRISE" - The database version is SQL Server 1582 // 2017 Enterprise. 1583 // "SQLSERVER_2017_EXPRESS" - The database version is SQL Server 2017 1584 // Express. 1585 // "SQLSERVER_2017_WEB" - The database version is SQL Server 2017 Web. 1586 // "POSTGRES_10" - The database version is PostgreSQL 10. 1587 // "POSTGRES_12" - The database version is PostgreSQL 12. 1588 // "MYSQL_8_0" - The database version is MySQL 8. 1589 // "POSTGRES_13" - The database version is PostgreSQL 13. 1590 AppliesTo []string `json:"appliesTo,omitempty"` 1591 1592 // InBeta: Whether or not the flag is considered in beta. 1593 InBeta bool `json:"inBeta,omitempty"` 1594 1595 // Kind: This is always *sql#flag*. 1596 Kind string `json:"kind,omitempty"` 1597 1598 // MaxValue: For *INTEGER* flags, the maximum allowed value. 1599 MaxValue int64 `json:"maxValue,omitempty,string"` 1600 1601 // MinValue: For *INTEGER* flags, the minimum allowed value. 1602 MinValue int64 `json:"minValue,omitempty,string"` 1603 1604 // Name: This is the name of the flag. Flag names always use 1605 // underscores, not hyphens, for example: *max_allowed_packet* 1606 Name string `json:"name,omitempty"` 1607 1608 // RequiresRestart: Indicates whether changing this flag will trigger a 1609 // database restart. Only applicable to Second Generation instances. 1610 RequiresRestart bool `json:"requiresRestart,omitempty"` 1611 1612 // Type: The type of the flag. Flags are typed to being *BOOLEAN*, 1613 // *STRING*, *INTEGER* or *NONE*. *NONE* is used for flags which do not 1614 // take a value, such as *skip_grant_tables*. 1615 // 1616 // Possible values: 1617 // "SQL_FLAG_TYPE_UNSPECIFIED" - This is an unknown flag type. 1618 // "BOOLEAN" - Boolean type flag. 1619 // "STRING" - String type flag. 1620 // "INTEGER" - Integer type flag. 1621 // "NONE" - Flag type used for a server startup option. 1622 // "MYSQL_TIMEZONE_OFFSET" - Type introduced specially for MySQL 1623 // TimeZone offset. Accept a string value with the format [-12:59, 1624 // 13:00]. 1625 // "FLOAT" - Float type flag. 1626 // "REPEATED_STRING" - Comma-separated list of the strings in a 1627 // SqlFlagType enum. 1628 Type string `json:"type,omitempty"` 1629 1630 // ForceSendFields is a list of field names (e.g. "AllowedIntValues") to 1631 // unconditionally include in API requests. By default, fields with 1632 // empty values are omitted from API requests. However, any non-pointer, 1633 // non-interface field appearing in ForceSendFields will be sent to the 1634 // server regardless of whether the field is empty or not. This may be 1635 // used to include empty fields in Patch requests. 1636 ForceSendFields []string `json:"-"` 1637 1638 // NullFields is a list of field names (e.g. "AllowedIntValues") to 1639 // include in API requests with the JSON null value. By default, fields 1640 // with empty values are omitted from API requests. However, any field 1641 // with an empty value appearing in NullFields will be sent to the 1642 // server as null. It is an error if a field in this list has a 1643 // non-empty value. This may be used to include null fields in Patch 1644 // requests. 1645 NullFields []string `json:"-"` 1646} 1647 1648func (s *Flag) MarshalJSON() ([]byte, error) { 1649 type NoMethod Flag 1650 raw := NoMethod(*s) 1651 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1652} 1653 1654// FlagsListResponse: Flags list response. 1655type FlagsListResponse struct { 1656 // Items: List of flags. 1657 Items []*Flag `json:"items,omitempty"` 1658 1659 // Kind: This is always *sql#flagsList*. 1660 Kind string `json:"kind,omitempty"` 1661 1662 // ServerResponse contains the HTTP response code and headers from the 1663 // server. 1664 googleapi.ServerResponse `json:"-"` 1665 1666 // ForceSendFields is a list of field names (e.g. "Items") to 1667 // unconditionally include in API requests. By default, fields with 1668 // empty values are omitted from API requests. However, any non-pointer, 1669 // non-interface field appearing in ForceSendFields will be sent to the 1670 // server regardless of whether the field is empty or not. This may be 1671 // used to include empty fields in Patch requests. 1672 ForceSendFields []string `json:"-"` 1673 1674 // NullFields is a list of field names (e.g. "Items") to include in API 1675 // requests with the JSON null value. By default, fields with empty 1676 // values are omitted from API requests. However, any field with an 1677 // empty value appearing in NullFields will be sent to the server as 1678 // null. It is an error if a field in this list has a non-empty value. 1679 // This may be used to include null fields in Patch requests. 1680 NullFields []string `json:"-"` 1681} 1682 1683func (s *FlagsListResponse) MarshalJSON() ([]byte, error) { 1684 type NoMethod FlagsListResponse 1685 raw := NoMethod(*s) 1686 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1687} 1688 1689// ImportContext: Database instance import context. 1690type ImportContext struct { 1691 // BakImportOptions: Import parameters specific to SQL Server .BAK files 1692 BakImportOptions *ImportContextBakImportOptions `json:"bakImportOptions,omitempty"` 1693 1694 // CsvImportOptions: Options for importing data as CSV. 1695 CsvImportOptions *ImportContextCsvImportOptions `json:"csvImportOptions,omitempty"` 1696 1697 // Database: The target database for the import. If *fileType* is *SQL*, 1698 // this field is required only if the import file does not specify a 1699 // database, and is overridden by any database specification in the 1700 // import file. If *fileType* is *CSV*, one database must be specified. 1701 Database string `json:"database,omitempty"` 1702 1703 // FileType: The file type for the specified uri. *SQL*: The file 1704 // contains SQL statements. *CSV*: The file contains CSV data. 1705 // 1706 // Possible values: 1707 // "SQL_FILE_TYPE_UNSPECIFIED" - Unknown file type. 1708 // "SQL" - File containing SQL statements. 1709 // "CSV" - File in CSV format. 1710 // "BAK" 1711 FileType string `json:"fileType,omitempty"` 1712 1713 // ImportUser: The PostgreSQL user for this import operation. PostgreSQL 1714 // instances only. 1715 ImportUser string `json:"importUser,omitempty"` 1716 1717 // Kind: This is always *sql#importContext*. 1718 Kind string `json:"kind,omitempty"` 1719 1720 // Uri: Path to the import file in Cloud Storage, in the form 1721 // *gs://bucketName/fileName*. Compressed gzip files (.gz) are supported 1722 // when *fileType* is *SQL*. The instance must have write permissions to 1723 // the bucket and read access to the file. 1724 Uri string `json:"uri,omitempty"` 1725 1726 // ForceSendFields is a list of field names (e.g. "BakImportOptions") to 1727 // unconditionally include in API requests. By default, fields with 1728 // empty values are omitted from API requests. However, any non-pointer, 1729 // non-interface field appearing in ForceSendFields will be sent to the 1730 // server regardless of whether the field is empty or not. This may be 1731 // used to include empty fields in Patch requests. 1732 ForceSendFields []string `json:"-"` 1733 1734 // NullFields is a list of field names (e.g. "BakImportOptions") to 1735 // include in API requests with the JSON null value. By default, fields 1736 // with empty values are omitted from API requests. However, any field 1737 // with an empty value appearing in NullFields will be sent to the 1738 // server as null. It is an error if a field in this list has a 1739 // non-empty value. This may be used to include null fields in Patch 1740 // requests. 1741 NullFields []string `json:"-"` 1742} 1743 1744func (s *ImportContext) MarshalJSON() ([]byte, error) { 1745 type NoMethod ImportContext 1746 raw := NoMethod(*s) 1747 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1748} 1749 1750// ImportContextBakImportOptions: Import parameters specific to SQL 1751// Server .BAK files 1752type ImportContextBakImportOptions struct { 1753 EncryptionOptions *ImportContextBakImportOptionsEncryptionOptions `json:"encryptionOptions,omitempty"` 1754 1755 // ForceSendFields is a list of field names (e.g. "EncryptionOptions") 1756 // to unconditionally include in API requests. By default, fields with 1757 // empty values are omitted from API requests. However, any non-pointer, 1758 // non-interface field appearing in ForceSendFields will be sent to the 1759 // server regardless of whether the field is empty or not. This may be 1760 // used to include empty fields in Patch requests. 1761 ForceSendFields []string `json:"-"` 1762 1763 // NullFields is a list of field names (e.g. "EncryptionOptions") to 1764 // include in API requests with the JSON null value. By default, fields 1765 // with empty values are omitted from API requests. However, any field 1766 // with an empty value appearing in NullFields will be sent to the 1767 // server as null. It is an error if a field in this list has a 1768 // non-empty value. This may be used to include null fields in Patch 1769 // requests. 1770 NullFields []string `json:"-"` 1771} 1772 1773func (s *ImportContextBakImportOptions) MarshalJSON() ([]byte, error) { 1774 type NoMethod ImportContextBakImportOptions 1775 raw := NoMethod(*s) 1776 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1777} 1778 1779type ImportContextBakImportOptionsEncryptionOptions struct { 1780 // CertPath: Path to the Certificate (.cer) in Cloud Storage, in the 1781 // form *gs://bucketName/fileName*. The instance must have write 1782 // permissions to the bucket and read access to the file. 1783 CertPath string `json:"certPath,omitempty"` 1784 1785 // PvkPassword: Password that encrypts the private key 1786 PvkPassword string `json:"pvkPassword,omitempty"` 1787 1788 // PvkPath: Path to the Certificate Private Key (.pvk) in Cloud Storage, 1789 // in the form *gs://bucketName/fileName*. The instance must have write 1790 // permissions to the bucket and read access to the file. 1791 PvkPath string `json:"pvkPath,omitempty"` 1792 1793 // ForceSendFields is a list of field names (e.g. "CertPath") to 1794 // unconditionally include in API requests. By default, fields with 1795 // empty values are omitted from API requests. However, any non-pointer, 1796 // non-interface field appearing in ForceSendFields will be sent to the 1797 // server regardless of whether the field is empty or not. This may be 1798 // used to include empty fields in Patch requests. 1799 ForceSendFields []string `json:"-"` 1800 1801 // NullFields is a list of field names (e.g. "CertPath") to include in 1802 // API requests with the JSON null value. By default, fields with empty 1803 // values are omitted from API requests. However, any field with an 1804 // empty value appearing in NullFields will be sent to the server as 1805 // null. It is an error if a field in this list has a non-empty value. 1806 // This may be used to include null fields in Patch requests. 1807 NullFields []string `json:"-"` 1808} 1809 1810func (s *ImportContextBakImportOptionsEncryptionOptions) MarshalJSON() ([]byte, error) { 1811 type NoMethod ImportContextBakImportOptionsEncryptionOptions 1812 raw := NoMethod(*s) 1813 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1814} 1815 1816// ImportContextCsvImportOptions: Options for importing data as CSV. 1817type ImportContextCsvImportOptions struct { 1818 // Columns: The columns to which CSV data is imported. If not specified, 1819 // all columns of the database table are loaded with CSV data. 1820 Columns []string `json:"columns,omitempty"` 1821 1822 // Table: The table to which CSV data is imported. 1823 Table string `json:"table,omitempty"` 1824 1825 // ForceSendFields is a list of field names (e.g. "Columns") to 1826 // unconditionally include in API requests. By default, fields with 1827 // empty values are omitted from API requests. However, any non-pointer, 1828 // non-interface field appearing in ForceSendFields will be sent to the 1829 // server regardless of whether the field is empty or not. This may be 1830 // used to include empty fields in Patch requests. 1831 ForceSendFields []string `json:"-"` 1832 1833 // NullFields is a list of field names (e.g. "Columns") to include in 1834 // API requests with the JSON null value. By default, fields with empty 1835 // values are omitted from API requests. However, any field with an 1836 // empty value appearing in NullFields will be sent to the server as 1837 // null. It is an error if a field in this list has a non-empty value. 1838 // This may be used to include null fields in Patch requests. 1839 NullFields []string `json:"-"` 1840} 1841 1842func (s *ImportContextCsvImportOptions) MarshalJSON() ([]byte, error) { 1843 type NoMethod ImportContextCsvImportOptions 1844 raw := NoMethod(*s) 1845 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1846} 1847 1848// InsightsConfig: Insights configuration. This specifies when Cloud SQL 1849// Insights feature is enabled and optional configuration. 1850type InsightsConfig struct { 1851 // QueryInsightsEnabled: Whether Query Insights feature is enabled. 1852 QueryInsightsEnabled bool `json:"queryInsightsEnabled,omitempty"` 1853 1854 // QueryStringLength: Maximum query length stored in bytes. Default 1855 // value: 1024 bytes. Range: 256-4500 bytes. Query length more than this 1856 // field value will be truncated to this value. When unset, query length 1857 // will be the default value. Changing query length will restart the 1858 // database. 1859 QueryStringLength int64 `json:"queryStringLength,omitempty"` 1860 1861 // RecordApplicationTags: Whether Query Insights will record application 1862 // tags from query when enabled. 1863 RecordApplicationTags bool `json:"recordApplicationTags,omitempty"` 1864 1865 // RecordClientAddress: Whether Query Insights will record client 1866 // address when enabled. 1867 RecordClientAddress bool `json:"recordClientAddress,omitempty"` 1868 1869 // ForceSendFields is a list of field names (e.g. 1870 // "QueryInsightsEnabled") to unconditionally include in API requests. 1871 // By default, fields with empty values are omitted from API requests. 1872 // However, any non-pointer, non-interface field appearing in 1873 // ForceSendFields will be sent to the server regardless of whether the 1874 // field is empty or not. This may be used to include empty fields in 1875 // Patch requests. 1876 ForceSendFields []string `json:"-"` 1877 1878 // NullFields is a list of field names (e.g. "QueryInsightsEnabled") to 1879 // include in API requests with the JSON null value. By default, fields 1880 // with empty values are omitted from API requests. However, any field 1881 // with an empty value appearing in NullFields will be sent to the 1882 // server as null. It is an error if a field in this list has a 1883 // non-empty value. This may be used to include null fields in Patch 1884 // requests. 1885 NullFields []string `json:"-"` 1886} 1887 1888func (s *InsightsConfig) MarshalJSON() ([]byte, error) { 1889 type NoMethod InsightsConfig 1890 raw := NoMethod(*s) 1891 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1892} 1893 1894// InstancesCloneRequest: Database instance clone request. 1895type InstancesCloneRequest struct { 1896 // CloneContext: Contains details about the clone operation. 1897 CloneContext *CloneContext `json:"cloneContext,omitempty"` 1898 1899 // ForceSendFields is a list of field names (e.g. "CloneContext") to 1900 // unconditionally include in API requests. By default, fields with 1901 // empty values are omitted from API requests. However, any non-pointer, 1902 // non-interface field appearing in ForceSendFields will be sent to the 1903 // server regardless of whether the field is empty or not. This may be 1904 // used to include empty fields in Patch requests. 1905 ForceSendFields []string `json:"-"` 1906 1907 // NullFields is a list of field names (e.g. "CloneContext") to include 1908 // in API requests with the JSON null value. By default, fields with 1909 // empty values are omitted from API requests. However, any field with 1910 // an empty value appearing in NullFields will be sent to the server as 1911 // null. It is an error if a field in this list has a non-empty value. 1912 // This may be used to include null fields in Patch requests. 1913 NullFields []string `json:"-"` 1914} 1915 1916func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error) { 1917 type NoMethod InstancesCloneRequest 1918 raw := NoMethod(*s) 1919 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1920} 1921 1922// InstancesDemoteMasterRequest: Database demote primary instance 1923// request. 1924type InstancesDemoteMasterRequest struct { 1925 // DemoteMasterContext: Contains details about the demoteMaster 1926 // operation. 1927 DemoteMasterContext *DemoteMasterContext `json:"demoteMasterContext,omitempty"` 1928 1929 // ForceSendFields is a list of field names (e.g. "DemoteMasterContext") 1930 // to unconditionally include in API requests. By default, fields with 1931 // empty values are omitted from API requests. However, any non-pointer, 1932 // non-interface field appearing in ForceSendFields will be sent to the 1933 // server regardless of whether the field is empty or not. This may be 1934 // used to include empty fields in Patch requests. 1935 ForceSendFields []string `json:"-"` 1936 1937 // NullFields is a list of field names (e.g. "DemoteMasterContext") to 1938 // include in API requests with the JSON null value. By default, fields 1939 // with empty values are omitted from API requests. However, any field 1940 // with an empty value appearing in NullFields will be sent to the 1941 // server as null. It is an error if a field in this list has a 1942 // non-empty value. This may be used to include null fields in Patch 1943 // requests. 1944 NullFields []string `json:"-"` 1945} 1946 1947func (s *InstancesDemoteMasterRequest) MarshalJSON() ([]byte, error) { 1948 type NoMethod InstancesDemoteMasterRequest 1949 raw := NoMethod(*s) 1950 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1951} 1952 1953// InstancesExportRequest: Database instance export request. 1954type InstancesExportRequest struct { 1955 // ExportContext: Contains details about the export operation. 1956 ExportContext *ExportContext `json:"exportContext,omitempty"` 1957 1958 // ForceSendFields is a list of field names (e.g. "ExportContext") to 1959 // unconditionally include in API requests. By default, fields with 1960 // empty values are omitted from API requests. However, any non-pointer, 1961 // non-interface field appearing in ForceSendFields will be sent to the 1962 // server regardless of whether the field is empty or not. This may be 1963 // used to include empty fields in Patch requests. 1964 ForceSendFields []string `json:"-"` 1965 1966 // NullFields is a list of field names (e.g. "ExportContext") to include 1967 // in API requests with the JSON null value. By default, fields with 1968 // empty values are omitted from API requests. However, any field with 1969 // an empty value appearing in NullFields will be sent to the server as 1970 // null. It is an error if a field in this list has a non-empty value. 1971 // This may be used to include null fields in Patch requests. 1972 NullFields []string `json:"-"` 1973} 1974 1975func (s *InstancesExportRequest) MarshalJSON() ([]byte, error) { 1976 type NoMethod InstancesExportRequest 1977 raw := NoMethod(*s) 1978 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1979} 1980 1981// InstancesFailoverRequest: Instance failover request. 1982type InstancesFailoverRequest struct { 1983 // FailoverContext: Failover Context. 1984 FailoverContext *FailoverContext `json:"failoverContext,omitempty"` 1985 1986 // ForceSendFields is a list of field names (e.g. "FailoverContext") to 1987 // unconditionally include in API requests. By default, fields with 1988 // empty values are omitted from API requests. However, any non-pointer, 1989 // non-interface field appearing in ForceSendFields will be sent to the 1990 // server regardless of whether the field is empty or not. This may be 1991 // used to include empty fields in Patch requests. 1992 ForceSendFields []string `json:"-"` 1993 1994 // NullFields is a list of field names (e.g. "FailoverContext") to 1995 // include in API requests with the JSON null value. By default, fields 1996 // with empty values are omitted from API requests. However, any field 1997 // with an empty value appearing in NullFields will be sent to the 1998 // server as null. It is an error if a field in this list has a 1999 // non-empty value. This may be used to include null fields in Patch 2000 // requests. 2001 NullFields []string `json:"-"` 2002} 2003 2004func (s *InstancesFailoverRequest) MarshalJSON() ([]byte, error) { 2005 type NoMethod InstancesFailoverRequest 2006 raw := NoMethod(*s) 2007 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2008} 2009 2010// InstancesImportRequest: Database instance import request. 2011type InstancesImportRequest struct { 2012 // ImportContext: Contains details about the import operation. 2013 ImportContext *ImportContext `json:"importContext,omitempty"` 2014 2015 // ForceSendFields is a list of field names (e.g. "ImportContext") to 2016 // unconditionally include in API requests. By default, fields with 2017 // empty values are omitted from API requests. However, any non-pointer, 2018 // non-interface field appearing in ForceSendFields will be sent to the 2019 // server regardless of whether the field is empty or not. This may be 2020 // used to include empty fields in Patch requests. 2021 ForceSendFields []string `json:"-"` 2022 2023 // NullFields is a list of field names (e.g. "ImportContext") to include 2024 // in API requests with the JSON null value. By default, fields with 2025 // empty values are omitted from API requests. However, any field with 2026 // an empty value appearing in NullFields will be sent to the server as 2027 // null. It is an error if a field in this list has a non-empty value. 2028 // This may be used to include null fields in Patch requests. 2029 NullFields []string `json:"-"` 2030} 2031 2032func (s *InstancesImportRequest) MarshalJSON() ([]byte, error) { 2033 type NoMethod InstancesImportRequest 2034 raw := NoMethod(*s) 2035 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2036} 2037 2038// InstancesListResponse: Database instances list response. 2039type InstancesListResponse struct { 2040 // Items: List of database instance resources. 2041 Items []*DatabaseInstance `json:"items,omitempty"` 2042 2043 // Kind: This is always *sql#instancesList*. 2044 Kind string `json:"kind,omitempty"` 2045 2046 // NextPageToken: The continuation token, used to page through large 2047 // result sets. Provide this value in a subsequent request to return the 2048 // next page of results. 2049 NextPageToken string `json:"nextPageToken,omitempty"` 2050 2051 // Warnings: List of warnings that occurred while handling the request. 2052 Warnings []*ApiWarning `json:"warnings,omitempty"` 2053 2054 // ServerResponse contains the HTTP response code and headers from the 2055 // server. 2056 googleapi.ServerResponse `json:"-"` 2057 2058 // ForceSendFields is a list of field names (e.g. "Items") to 2059 // unconditionally include in API requests. By default, fields with 2060 // empty values are omitted from API requests. However, any non-pointer, 2061 // non-interface field appearing in ForceSendFields will be sent to the 2062 // server regardless of whether the field is empty or not. This may be 2063 // used to include empty fields in Patch requests. 2064 ForceSendFields []string `json:"-"` 2065 2066 // NullFields is a list of field names (e.g. "Items") to include in API 2067 // requests with the JSON null value. By default, fields with empty 2068 // values are omitted from API requests. However, any field with an 2069 // empty value appearing in NullFields will be sent to the server as 2070 // null. It is an error if a field in this list has a non-empty value. 2071 // This may be used to include null fields in Patch requests. 2072 NullFields []string `json:"-"` 2073} 2074 2075func (s *InstancesListResponse) MarshalJSON() ([]byte, error) { 2076 type NoMethod InstancesListResponse 2077 raw := NoMethod(*s) 2078 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2079} 2080 2081// InstancesListServerCasResponse: Instances ListServerCas response. 2082type InstancesListServerCasResponse struct { 2083 ActiveVersion string `json:"activeVersion,omitempty"` 2084 2085 // Certs: List of server CA certificates for the instance. 2086 Certs []*SslCert `json:"certs,omitempty"` 2087 2088 // Kind: This is always *sql#instancesListServerCas*. 2089 Kind string `json:"kind,omitempty"` 2090 2091 // ServerResponse contains the HTTP response code and headers from the 2092 // server. 2093 googleapi.ServerResponse `json:"-"` 2094 2095 // ForceSendFields is a list of field names (e.g. "ActiveVersion") to 2096 // unconditionally include in API requests. By default, fields with 2097 // empty values are omitted from API requests. However, any non-pointer, 2098 // non-interface field appearing in ForceSendFields will be sent to the 2099 // server regardless of whether the field is empty or not. This may be 2100 // used to include empty fields in Patch requests. 2101 ForceSendFields []string `json:"-"` 2102 2103 // NullFields is a list of field names (e.g. "ActiveVersion") to include 2104 // in API requests with the JSON null value. By default, fields with 2105 // empty values are omitted from API requests. However, any field with 2106 // an empty value appearing in NullFields will be sent to the server as 2107 // null. It is an error if a field in this list has a non-empty value. 2108 // This may be used to include null fields in Patch requests. 2109 NullFields []string `json:"-"` 2110} 2111 2112func (s *InstancesListServerCasResponse) MarshalJSON() ([]byte, error) { 2113 type NoMethod InstancesListServerCasResponse 2114 raw := NoMethod(*s) 2115 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2116} 2117 2118// InstancesRestoreBackupRequest: Database instance restore backup 2119// request. 2120type InstancesRestoreBackupRequest struct { 2121 // RestoreBackupContext: Parameters required to perform the restore 2122 // backup operation. 2123 RestoreBackupContext *RestoreBackupContext `json:"restoreBackupContext,omitempty"` 2124 2125 // ForceSendFields is a list of field names (e.g. 2126 // "RestoreBackupContext") to unconditionally include in API requests. 2127 // By default, fields with empty values are omitted from API requests. 2128 // However, any non-pointer, non-interface field appearing in 2129 // ForceSendFields will be sent to the server regardless of whether the 2130 // field is empty or not. This may be used to include empty fields in 2131 // Patch requests. 2132 ForceSendFields []string `json:"-"` 2133 2134 // NullFields is a list of field names (e.g. "RestoreBackupContext") to 2135 // include in API requests with the JSON null value. By default, fields 2136 // with empty values are omitted from API requests. However, any field 2137 // with an empty value appearing in NullFields will be sent to the 2138 // server as null. It is an error if a field in this list has a 2139 // non-empty value. This may be used to include null fields in Patch 2140 // requests. 2141 NullFields []string `json:"-"` 2142} 2143 2144func (s *InstancesRestoreBackupRequest) MarshalJSON() ([]byte, error) { 2145 type NoMethod InstancesRestoreBackupRequest 2146 raw := NoMethod(*s) 2147 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2148} 2149 2150// InstancesRotateServerCaRequest: Rotate Server CA request. 2151type InstancesRotateServerCaRequest struct { 2152 // RotateServerCaContext: Contains details about the rotate server CA 2153 // operation. 2154 RotateServerCaContext *RotateServerCaContext `json:"rotateServerCaContext,omitempty"` 2155 2156 // ForceSendFields is a list of field names (e.g. 2157 // "RotateServerCaContext") to unconditionally include in API requests. 2158 // By default, fields with empty values are omitted from API requests. 2159 // However, any non-pointer, non-interface field appearing in 2160 // ForceSendFields will be sent to the server regardless of whether the 2161 // field is empty or not. This may be used to include empty fields in 2162 // Patch requests. 2163 ForceSendFields []string `json:"-"` 2164 2165 // NullFields is a list of field names (e.g. "RotateServerCaContext") to 2166 // include in API requests with the JSON null value. By default, fields 2167 // with empty values are omitted from API requests. However, any field 2168 // with an empty value appearing in NullFields will be sent to the 2169 // server as null. It is an error if a field in this list has a 2170 // non-empty value. This may be used to include null fields in Patch 2171 // requests. 2172 NullFields []string `json:"-"` 2173} 2174 2175func (s *InstancesRotateServerCaRequest) MarshalJSON() ([]byte, error) { 2176 type NoMethod InstancesRotateServerCaRequest 2177 raw := NoMethod(*s) 2178 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2179} 2180 2181// InstancesTruncateLogRequest: Instance truncate log request. 2182type InstancesTruncateLogRequest struct { 2183 // TruncateLogContext: Contains details about the truncate log 2184 // operation. 2185 TruncateLogContext *TruncateLogContext `json:"truncateLogContext,omitempty"` 2186 2187 // ForceSendFields is a list of field names (e.g. "TruncateLogContext") 2188 // to unconditionally include in API requests. By default, fields with 2189 // empty values are omitted from API requests. However, any non-pointer, 2190 // non-interface field appearing in ForceSendFields will be sent to the 2191 // server regardless of whether the field is empty or not. This may be 2192 // used to include empty fields in Patch requests. 2193 ForceSendFields []string `json:"-"` 2194 2195 // NullFields is a list of field names (e.g. "TruncateLogContext") to 2196 // include in API requests with the JSON null value. By default, fields 2197 // with empty values are omitted from API requests. However, any field 2198 // with an empty value appearing in NullFields will be sent to the 2199 // server as null. It is an error if a field in this list has a 2200 // non-empty value. This may be used to include null fields in Patch 2201 // requests. 2202 NullFields []string `json:"-"` 2203} 2204 2205func (s *InstancesTruncateLogRequest) MarshalJSON() ([]byte, error) { 2206 type NoMethod InstancesTruncateLogRequest 2207 raw := NoMethod(*s) 2208 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2209} 2210 2211// IpConfiguration: IP Management configuration. 2212type IpConfiguration struct { 2213 // AuthorizedNetworks: The list of external networks that are allowed to 2214 // connect to the instance using the IP. In 'CIDR' notation, also known 2215 // as 'slash' notation (for example: *192.168.100.0/24*). 2216 AuthorizedNetworks []*AclEntry `json:"authorizedNetworks,omitempty"` 2217 2218 // Ipv4Enabled: Whether the instance is assigned a public IP address or 2219 // not. 2220 Ipv4Enabled bool `json:"ipv4Enabled,omitempty"` 2221 2222 // PrivateNetwork: The resource link for the VPC network from which the 2223 // Cloud SQL instance is accessible for private IP. For example, 2224 // */projects/myProject/global/networks/default*. This setting can be 2225 // updated, but it cannot be removed after it is set. 2226 PrivateNetwork string `json:"privateNetwork,omitempty"` 2227 2228 // RequireSsl: Whether SSL connections over IP are enforced or not. 2229 RequireSsl bool `json:"requireSsl,omitempty"` 2230 2231 // ForceSendFields is a list of field names (e.g. "AuthorizedNetworks") 2232 // to unconditionally include in API requests. By default, fields with 2233 // empty values are omitted from API requests. However, any non-pointer, 2234 // non-interface field appearing in ForceSendFields will be sent to the 2235 // server regardless of whether the field is empty or not. This may be 2236 // used to include empty fields in Patch requests. 2237 ForceSendFields []string `json:"-"` 2238 2239 // NullFields is a list of field names (e.g. "AuthorizedNetworks") to 2240 // include in API requests with the JSON null value. By default, fields 2241 // with empty values are omitted from API requests. However, any field 2242 // with an empty value appearing in NullFields will be sent to the 2243 // server as null. It is an error if a field in this list has a 2244 // non-empty value. This may be used to include null fields in Patch 2245 // requests. 2246 NullFields []string `json:"-"` 2247} 2248 2249func (s *IpConfiguration) MarshalJSON() ([]byte, error) { 2250 type NoMethod IpConfiguration 2251 raw := NoMethod(*s) 2252 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2253} 2254 2255// IpMapping: Database instance IP Mapping. 2256type IpMapping struct { 2257 // IpAddress: The IP address assigned. 2258 IpAddress string `json:"ipAddress,omitempty"` 2259 2260 // TimeToRetire: The due time for this IP to be retired in RFC 3339 2261 // format, for example *2012-11-15T16:19:00.094Z*. This field is only 2262 // available when the IP is scheduled to be retired. 2263 TimeToRetire string `json:"timeToRetire,omitempty"` 2264 2265 // Type: The type of this IP address. A *PRIMARY* address is a public 2266 // address that can accept incoming connections. A *PRIVATE* address is 2267 // a private address that can accept incoming connections. An *OUTGOING* 2268 // address is the source address of connections originating from the 2269 // instance, if supported. 2270 // 2271 // Possible values: 2272 // "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" - This is an unknown IP address 2273 // type. 2274 // "PRIMARY" - IP address the customer is supposed to connect to. 2275 // Usually this is the load balancer's IP address 2276 // "OUTGOING" - Source IP address of the connection a read replica 2277 // establishes to its external primary instance. This IP address can be 2278 // allowlisted by the customer in case it has a firewall that filters 2279 // incoming connection to its on premises primary instance. 2280 // "PRIVATE" - Private IP used when using private IPs and network 2281 // peering. 2282 // "MIGRATED_1ST_GEN" - V1 IP of a migrated instance. We want the user 2283 // to decommission this IP as soon as the migration is complete. Note: 2284 // V1 instances with V1 ip addresses will be counted as PRIMARY. 2285 Type string `json:"type,omitempty"` 2286 2287 // ForceSendFields is a list of field names (e.g. "IpAddress") to 2288 // unconditionally include in API requests. By default, fields with 2289 // empty values are omitted from API requests. However, any non-pointer, 2290 // non-interface field appearing in ForceSendFields will be sent to the 2291 // server regardless of whether the field is empty or not. This may be 2292 // used to include empty fields in Patch requests. 2293 ForceSendFields []string `json:"-"` 2294 2295 // NullFields is a list of field names (e.g. "IpAddress") to include in 2296 // API requests with the JSON null value. By default, fields with empty 2297 // values are omitted from API requests. However, any field with an 2298 // empty value appearing in NullFields will be sent to the server as 2299 // null. It is an error if a field in this list has a non-empty value. 2300 // This may be used to include null fields in Patch requests. 2301 NullFields []string `json:"-"` 2302} 2303 2304func (s *IpMapping) MarshalJSON() ([]byte, error) { 2305 type NoMethod IpMapping 2306 raw := NoMethod(*s) 2307 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2308} 2309 2310// LocationPreference: Preferred location. This specifies where a Cloud 2311// SQL instance is located, either in a specific Compute Engine zone, or 2312// co-located with an App Engine application. Note that if the preferred 2313// location is not available, the instance will be located as close as 2314// possible within the region. Only one location may be specified. 2315type LocationPreference struct { 2316 // FollowGaeApplication: The App Engine application to follow, it must 2317 // be in the same region as the Cloud SQL instance. 2318 FollowGaeApplication string `json:"followGaeApplication,omitempty"` 2319 2320 // Kind: This is always *sql#locationPreference*. 2321 Kind string `json:"kind,omitempty"` 2322 2323 // SecondaryZone: The preferred Compute Engine zone for the 2324 // secondary/failover (for example: us-central1-a, us-central1-b, etc.). 2325 // Reserved for future use. 2326 SecondaryZone string `json:"secondaryZone,omitempty"` 2327 2328 // Zone: The preferred Compute Engine zone (for example: us-central1-a, 2329 // us-central1-b, etc.). 2330 Zone string `json:"zone,omitempty"` 2331 2332 // ForceSendFields is a list of field names (e.g. 2333 // "FollowGaeApplication") to unconditionally include in API requests. 2334 // By default, fields with empty values are omitted from API requests. 2335 // However, any non-pointer, non-interface field appearing in 2336 // ForceSendFields will be sent to the server regardless of whether the 2337 // field is empty or not. This may be used to include empty fields in 2338 // Patch requests. 2339 ForceSendFields []string `json:"-"` 2340 2341 // NullFields is a list of field names (e.g. "FollowGaeApplication") to 2342 // include in API requests with the JSON null value. By default, fields 2343 // with empty values are omitted from API requests. However, any field 2344 // with an empty value appearing in NullFields will be sent to the 2345 // server as null. It is an error if a field in this list has a 2346 // non-empty value. This may be used to include null fields in Patch 2347 // requests. 2348 NullFields []string `json:"-"` 2349} 2350 2351func (s *LocationPreference) MarshalJSON() ([]byte, error) { 2352 type NoMethod LocationPreference 2353 raw := NoMethod(*s) 2354 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2355} 2356 2357// MaintenanceWindow: Maintenance window. This specifies when a Cloud 2358// SQL instance is restarted for system maintenance purposes. 2359type MaintenanceWindow struct { 2360 // Day: day of week (1-7), starting on Monday. 2361 Day int64 `json:"day,omitempty"` 2362 2363 // Hour: hour of day - 0 to 23. 2364 Hour int64 `json:"hour,omitempty"` 2365 2366 // Kind: This is always *sql#maintenanceWindow*. 2367 Kind string `json:"kind,omitempty"` 2368 2369 // UpdateTrack: Maintenance timing setting: *canary* (Earlier) or 2370 // *stable* (Later). Learn more. 2371 // 2372 // Possible values: 2373 // "SQL_UPDATE_TRACK_UNSPECIFIED" - This is an unknown maintenance 2374 // timing preference. 2375 // "canary" - For instance update that requires a restart, this update 2376 // track indicates your instance prefer to restart for new version early 2377 // in maintenance window. 2378 // "stable" - For instance update that requires a restart, this update 2379 // track indicates your instance prefer to let Cloud SQL choose the 2380 // timing of restart (within its Maintenance window, if applicable). 2381 UpdateTrack string `json:"updateTrack,omitempty"` 2382 2383 // ForceSendFields is a list of field names (e.g. "Day") to 2384 // unconditionally include in API requests. By default, fields with 2385 // empty values are omitted from API requests. However, any non-pointer, 2386 // non-interface field appearing in ForceSendFields will be sent to the 2387 // server regardless of whether the field is empty or not. This may be 2388 // used to include empty fields in Patch requests. 2389 ForceSendFields []string `json:"-"` 2390 2391 // NullFields is a list of field names (e.g. "Day") to include in API 2392 // requests with the JSON null value. By default, fields with empty 2393 // values are omitted from API requests. However, any field with an 2394 // empty value appearing in NullFields will be sent to the server as 2395 // null. It is an error if a field in this list has a non-empty value. 2396 // This may be used to include null fields in Patch requests. 2397 NullFields []string `json:"-"` 2398} 2399 2400func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) { 2401 type NoMethod MaintenanceWindow 2402 raw := NoMethod(*s) 2403 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2404} 2405 2406// MySqlReplicaConfiguration: Read-replica configuration specific to 2407// MySQL databases. 2408type MySqlReplicaConfiguration struct { 2409 // CaCertificate: PEM representation of the trusted CA's x509 2410 // certificate. 2411 CaCertificate string `json:"caCertificate,omitempty"` 2412 2413 // ClientCertificate: PEM representation of the replica's x509 2414 // certificate. 2415 ClientCertificate string `json:"clientCertificate,omitempty"` 2416 2417 // ClientKey: PEM representation of the replica's private key. The 2418 // corresponsing public key is encoded in the client's certificate. 2419 ClientKey string `json:"clientKey,omitempty"` 2420 2421 // ConnectRetryInterval: Seconds to wait between connect retries. 2422 // MySQL's default is 60 seconds. 2423 ConnectRetryInterval int64 `json:"connectRetryInterval,omitempty"` 2424 2425 // DumpFilePath: Path to a SQL dump file in Google Cloud Storage from 2426 // which the replica instance is to be created. The URI is in the form 2427 // gs://bucketName/fileName. Compressed gzip files (.gz) are also 2428 // supported. Dumps have the binlog co-ordinates from which replication 2429 // begins. This can be accomplished by setting --master-data to 1 when 2430 // using mysqldump. 2431 DumpFilePath string `json:"dumpFilePath,omitempty"` 2432 2433 // Kind: This is always *sql#mysqlReplicaConfiguration*. 2434 Kind string `json:"kind,omitempty"` 2435 2436 // MasterHeartbeatPeriod: Interval in milliseconds between replication 2437 // heartbeats. 2438 MasterHeartbeatPeriod int64 `json:"masterHeartbeatPeriod,omitempty,string"` 2439 2440 // Password: The password for the replication connection. 2441 Password string `json:"password,omitempty"` 2442 2443 // SslCipher: A list of permissible ciphers to use for SSL encryption. 2444 SslCipher string `json:"sslCipher,omitempty"` 2445 2446 // Username: The username for the replication connection. 2447 Username string `json:"username,omitempty"` 2448 2449 // VerifyServerCertificate: Whether or not to check the primary 2450 // instance's Common Name value in the certificate that it sends during 2451 // the SSL handshake. 2452 VerifyServerCertificate bool `json:"verifyServerCertificate,omitempty"` 2453 2454 // ForceSendFields is a list of field names (e.g. "CaCertificate") to 2455 // unconditionally include in API requests. By default, fields with 2456 // empty values are omitted from API requests. However, any non-pointer, 2457 // non-interface field appearing in ForceSendFields will be sent to the 2458 // server regardless of whether the field is empty or not. This may be 2459 // used to include empty fields in Patch requests. 2460 ForceSendFields []string `json:"-"` 2461 2462 // NullFields is a list of field names (e.g. "CaCertificate") to include 2463 // in API requests with the JSON null value. By default, fields with 2464 // empty values are omitted from API requests. However, any field with 2465 // an empty value appearing in NullFields will be sent to the server as 2466 // null. It is an error if a field in this list has a non-empty value. 2467 // This may be used to include null fields in Patch requests. 2468 NullFields []string `json:"-"` 2469} 2470 2471func (s *MySqlReplicaConfiguration) MarshalJSON() ([]byte, error) { 2472 type NoMethod MySqlReplicaConfiguration 2473 raw := NoMethod(*s) 2474 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2475} 2476 2477// OnPremisesConfiguration: On-premises instance configuration. 2478type OnPremisesConfiguration struct { 2479 // CaCertificate: PEM representation of the trusted CA's x509 2480 // certificate. 2481 CaCertificate string `json:"caCertificate,omitempty"` 2482 2483 // ClientCertificate: PEM representation of the replica's x509 2484 // certificate. 2485 ClientCertificate string `json:"clientCertificate,omitempty"` 2486 2487 // ClientKey: PEM representation of the replica's private key. The 2488 // corresponsing public key is encoded in the client's certificate. 2489 ClientKey string `json:"clientKey,omitempty"` 2490 2491 // DumpFilePath: The dump file to create the Cloud SQL replica. 2492 DumpFilePath string `json:"dumpFilePath,omitempty"` 2493 2494 // HostPort: The host and port of the on-premises instance in host:port 2495 // format 2496 HostPort string `json:"hostPort,omitempty"` 2497 2498 // Kind: This is always *sql#onPremisesConfiguration*. 2499 Kind string `json:"kind,omitempty"` 2500 2501 // Password: The password for connecting to on-premises instance. 2502 Password string `json:"password,omitempty"` 2503 2504 // Username: The username for connecting to on-premises instance. 2505 Username string `json:"username,omitempty"` 2506 2507 // ForceSendFields is a list of field names (e.g. "CaCertificate") to 2508 // unconditionally include in API requests. By default, fields with 2509 // empty values are omitted from API requests. However, any non-pointer, 2510 // non-interface field appearing in ForceSendFields will be sent to the 2511 // server regardless of whether the field is empty or not. This may be 2512 // used to include empty fields in Patch requests. 2513 ForceSendFields []string `json:"-"` 2514 2515 // NullFields is a list of field names (e.g. "CaCertificate") to include 2516 // in API requests with the JSON null value. By default, fields with 2517 // empty values are omitted from API requests. However, any field with 2518 // an empty value appearing in NullFields will be sent to the server as 2519 // null. It is an error if a field in this list has a non-empty value. 2520 // This may be used to include null fields in Patch requests. 2521 NullFields []string `json:"-"` 2522} 2523 2524func (s *OnPremisesConfiguration) MarshalJSON() ([]byte, error) { 2525 type NoMethod OnPremisesConfiguration 2526 raw := NoMethod(*s) 2527 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2528} 2529 2530// Operation: An Operation resource. For successful operations that 2531// return an Operation resource, only the fields relevant to the 2532// operation are populated in the resource. 2533type Operation struct { 2534 // BackupContext: The context for backup operation, if applicable. 2535 BackupContext *BackupContext `json:"backupContext,omitempty"` 2536 2537 // EndTime: The time this operation finished in UTC timezone in RFC 3339 2538 // format, for example *2012-11-15T16:19:00.094Z*. 2539 EndTime string `json:"endTime,omitempty"` 2540 2541 // Error: If errors occurred during processing of this operation, this 2542 // field will be populated. 2543 Error *OperationErrors `json:"error,omitempty"` 2544 2545 // ExportContext: The context for export operation, if applicable. 2546 ExportContext *ExportContext `json:"exportContext,omitempty"` 2547 2548 // ImportContext: The context for import operation, if applicable. 2549 ImportContext *ImportContext `json:"importContext,omitempty"` 2550 2551 // InsertTime: The time this operation was enqueued in UTC timezone in 2552 // RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. 2553 InsertTime string `json:"insertTime,omitempty"` 2554 2555 // Kind: This is always *sql#operation*. 2556 Kind string `json:"kind,omitempty"` 2557 2558 // Name: An identifier that uniquely identifies the operation. You can 2559 // use this identifier to retrieve the Operations resource that has 2560 // information about the operation. 2561 Name string `json:"name,omitempty"` 2562 2563 // OperationType: The type of the operation. Valid values are: *CREATE* 2564 // *DELETE* *UPDATE* *RESTART* *IMPORT* *EXPORT* *BACKUP_VOLUME* 2565 // *RESTORE_VOLUME* *CREATE_USER* *DELETE_USER* *CREATE_DATABASE* 2566 // *DELETE_DATABASE* 2567 // 2568 // Possible values: 2569 // "SQL_OPERATION_TYPE_UNSPECIFIED" - Unknown operation type. 2570 // "IMPORT" - Imports data into a Cloud SQL instance. 2571 // "EXPORT" - Exports data from a Cloud SQL instance to a Cloud 2572 // Storage bucket. 2573 // "CREATE" - Creates a new Cloud SQL instance. 2574 // "UPDATE" - Updates the settings of a Cloud SQL instance. 2575 // "DELETE" - Deletes a Cloud SQL instance. 2576 // "RESTART" - Restarts the Cloud SQL instance. 2577 // "BACKUP" 2578 // "SNAPSHOT" 2579 // "BACKUP_VOLUME" - Performs instance backup. 2580 // "DELETE_VOLUME" - Deletes an instance backup. 2581 // "RESTORE_VOLUME" - Restores an instance backup. 2582 // "INJECT_USER" - Injects a privileged user in mysql for MOB 2583 // instances. 2584 // "CLONE" - Clones a Cloud SQL instance. 2585 // "STOP_REPLICA" - Stops replication on a Cloud SQL read replica 2586 // instance. 2587 // "START_REPLICA" - Starts replication on a Cloud SQL read replica 2588 // instance. 2589 // "PROMOTE_REPLICA" - Promotes a Cloud SQL replica instance. 2590 // "CREATE_REPLICA" - Creates a Cloud SQL replica instance. 2591 // "CREATE_USER" - Creates a new user in a Cloud SQL instance. 2592 // "DELETE_USER" - Deletes a user from a Cloud SQL instance. 2593 // "UPDATE_USER" - Updates an existing user in a Cloud SQL instance. 2594 // "CREATE_DATABASE" - Creates a database in the Cloud SQL instance. 2595 // "DELETE_DATABASE" - Deletes a database in the Cloud SQL instance. 2596 // "UPDATE_DATABASE" - Updates a database in the Cloud SQL instance. 2597 // "FAILOVER" - Performs failover of an HA-enabled Cloud SQL failover 2598 // replica. 2599 // "DELETE_BACKUP" - Deletes the backup taken by a backup run. 2600 // "RECREATE_REPLICA" 2601 // "TRUNCATE_LOG" - Truncates a general or slow log table in MySQL. 2602 // "DEMOTE_MASTER" - Demotes the stand-alone instance to be a Cloud 2603 // SQL read replica for an external database server. 2604 // "MAINTENANCE" - Indicates that the instance is currently in 2605 // maintenance. Maintenance typically causes the instance to be 2606 // unavailable for 1-3 minutes. 2607 // "ENABLE_PRIVATE_IP" - This field is deprecated, and will be removed 2608 // in future version of API. 2609 // "DEFER_MAINTENANCE" 2610 // "CREATE_CLONE" - Creates clone instance. 2611 // "RESCHEDULE_MAINTENANCE" - Reschedule maintenance to another time. 2612 // "START_EXTERNAL_SYNC" - Starts external sync of a Cloud SQL EM 2613 // replica to an external primary instance. 2614 OperationType string `json:"operationType,omitempty"` 2615 2616 // SelfLink: The URI of this resource. 2617 SelfLink string `json:"selfLink,omitempty"` 2618 2619 // StartTime: The time this operation actually started in UTC timezone 2620 // in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. 2621 StartTime string `json:"startTime,omitempty"` 2622 2623 // Status: The status of an operation. Valid values are: *PENDING* 2624 // *RUNNING* *DONE* *SQL_OPERATION_STATUS_UNSPECIFIED* 2625 // 2626 // Possible values: 2627 // "SQL_OPERATION_STATUS_UNSPECIFIED" - The state of the operation is 2628 // unknown. 2629 // "PENDING" - The operation has been queued, but has not started yet. 2630 // "RUNNING" - The operation is running. 2631 // "DONE" - The operation completed. 2632 Status string `json:"status,omitempty"` 2633 2634 // TargetId: Name of the database instance related to this operation. 2635 TargetId string `json:"targetId,omitempty"` 2636 2637 TargetLink string `json:"targetLink,omitempty"` 2638 2639 // TargetProject: The project ID of the target instance related to this 2640 // operation. 2641 TargetProject string `json:"targetProject,omitempty"` 2642 2643 // User: The email address of the user who initiated this operation. 2644 User string `json:"user,omitempty"` 2645 2646 // ServerResponse contains the HTTP response code and headers from the 2647 // server. 2648 googleapi.ServerResponse `json:"-"` 2649 2650 // ForceSendFields is a list of field names (e.g. "BackupContext") to 2651 // unconditionally include in API requests. By default, fields with 2652 // empty values are omitted from API requests. However, any non-pointer, 2653 // non-interface field appearing in ForceSendFields will be sent to the 2654 // server regardless of whether the field is empty or not. This may be 2655 // used to include empty fields in Patch requests. 2656 ForceSendFields []string `json:"-"` 2657 2658 // NullFields is a list of field names (e.g. "BackupContext") to include 2659 // in API requests with the JSON null value. By default, fields with 2660 // empty values are omitted from API requests. However, any field with 2661 // an empty value appearing in NullFields will be sent to the server as 2662 // null. It is an error if a field in this list has a non-empty value. 2663 // This may be used to include null fields in Patch requests. 2664 NullFields []string `json:"-"` 2665} 2666 2667func (s *Operation) MarshalJSON() ([]byte, error) { 2668 type NoMethod Operation 2669 raw := NoMethod(*s) 2670 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2671} 2672 2673// OperationError: Database instance operation error. 2674type OperationError struct { 2675 // Code: Identifies the specific error that occurred. 2676 Code string `json:"code,omitempty"` 2677 2678 // Kind: This is always *sql#operationError*. 2679 Kind string `json:"kind,omitempty"` 2680 2681 // Message: Additional information about the error encountered. 2682 Message string `json:"message,omitempty"` 2683 2684 // ForceSendFields is a list of field names (e.g. "Code") to 2685 // unconditionally include in API requests. By default, fields with 2686 // empty values are omitted from API requests. However, any non-pointer, 2687 // non-interface field appearing in ForceSendFields will be sent to the 2688 // server regardless of whether the field is empty or not. This may be 2689 // used to include empty fields in Patch requests. 2690 ForceSendFields []string `json:"-"` 2691 2692 // NullFields is a list of field names (e.g. "Code") to include in API 2693 // requests with the JSON null value. By default, fields with empty 2694 // values are omitted from API requests. However, any field with an 2695 // empty value appearing in NullFields will be sent to the server as 2696 // null. It is an error if a field in this list has a non-empty value. 2697 // This may be used to include null fields in Patch requests. 2698 NullFields []string `json:"-"` 2699} 2700 2701func (s *OperationError) MarshalJSON() ([]byte, error) { 2702 type NoMethod OperationError 2703 raw := NoMethod(*s) 2704 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2705} 2706 2707// OperationErrors: Database instance operation errors list wrapper. 2708type OperationErrors struct { 2709 // Errors: The list of errors encountered while processing this 2710 // operation. 2711 Errors []*OperationError `json:"errors,omitempty"` 2712 2713 // Kind: This is always *sql#operationErrors*. 2714 Kind string `json:"kind,omitempty"` 2715 2716 // ForceSendFields is a list of field names (e.g. "Errors") to 2717 // unconditionally include in API requests. By default, fields with 2718 // empty values are omitted from API requests. However, any non-pointer, 2719 // non-interface field appearing in ForceSendFields will be sent to the 2720 // server regardless of whether the field is empty or not. This may be 2721 // used to include empty fields in Patch requests. 2722 ForceSendFields []string `json:"-"` 2723 2724 // NullFields is a list of field names (e.g. "Errors") to include in API 2725 // requests with the JSON null value. By default, fields with empty 2726 // values are omitted from API requests. However, any field with an 2727 // empty value appearing in NullFields will be sent to the server as 2728 // null. It is an error if a field in this list has a non-empty value. 2729 // This may be used to include null fields in Patch requests. 2730 NullFields []string `json:"-"` 2731} 2732 2733func (s *OperationErrors) MarshalJSON() ([]byte, error) { 2734 type NoMethod OperationErrors 2735 raw := NoMethod(*s) 2736 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2737} 2738 2739// OperationsListResponse: Database instance list operations response. 2740type OperationsListResponse struct { 2741 // Items: List of operation resources. 2742 Items []*Operation `json:"items,omitempty"` 2743 2744 // Kind: This is always *sql#operationsList*. 2745 Kind string `json:"kind,omitempty"` 2746 2747 // NextPageToken: The continuation token, used to page through large 2748 // result sets. Provide this value in a subsequent request to return the 2749 // next page of results. 2750 NextPageToken string `json:"nextPageToken,omitempty"` 2751 2752 // ServerResponse contains the HTTP response code and headers from the 2753 // server. 2754 googleapi.ServerResponse `json:"-"` 2755 2756 // ForceSendFields is a list of field names (e.g. "Items") to 2757 // unconditionally include in API requests. By default, fields with 2758 // empty values are omitted from API requests. However, any non-pointer, 2759 // non-interface field appearing in ForceSendFields will be sent to the 2760 // server regardless of whether the field is empty or not. This may be 2761 // used to include empty fields in Patch requests. 2762 ForceSendFields []string `json:"-"` 2763 2764 // NullFields is a list of field names (e.g. "Items") to include in API 2765 // requests with the JSON null value. By default, fields with empty 2766 // values are omitted from API requests. However, any field with an 2767 // empty value appearing in NullFields will be sent to the server as 2768 // null. It is an error if a field in this list has a non-empty value. 2769 // This may be used to include null fields in Patch requests. 2770 NullFields []string `json:"-"` 2771} 2772 2773func (s *OperationsListResponse) MarshalJSON() ([]byte, error) { 2774 type NoMethod OperationsListResponse 2775 raw := NoMethod(*s) 2776 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2777} 2778 2779// ReplicaConfiguration: Read-replica configuration for connecting to 2780// the primary instance. 2781type ReplicaConfiguration struct { 2782 // FailoverTarget: Specifies if the replica is the failover target. If 2783 // the field is set to *true* the replica will be designated as a 2784 // failover replica. In case the primary instance fails, the replica 2785 // instance will be promoted as the new primary instance. Only one 2786 // replica can be specified as failover target, and the replica has to 2787 // be in different zone with the primary instance. 2788 FailoverTarget bool `json:"failoverTarget,omitempty"` 2789 2790 // Kind: This is always *sql#replicaConfiguration*. 2791 Kind string `json:"kind,omitempty"` 2792 2793 // MysqlReplicaConfiguration: MySQL specific configuration when 2794 // replicating from a MySQL on-premises primary instance. Replication 2795 // configuration information such as the username, password, 2796 // certificates, and keys are not stored in the instance metadata. The 2797 // configuration information is used only to set up the replication 2798 // connection and is stored by MySQL in a file named *master.info* in 2799 // the data directory. 2800 MysqlReplicaConfiguration *MySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"` 2801 2802 // ForceSendFields is a list of field names (e.g. "FailoverTarget") to 2803 // unconditionally include in API requests. By default, fields with 2804 // empty values are omitted from API requests. However, any non-pointer, 2805 // non-interface field appearing in ForceSendFields will be sent to the 2806 // server regardless of whether the field is empty or not. This may be 2807 // used to include empty fields in Patch requests. 2808 ForceSendFields []string `json:"-"` 2809 2810 // NullFields is a list of field names (e.g. "FailoverTarget") to 2811 // include in API requests with the JSON null value. By default, fields 2812 // with empty values are omitted from API requests. However, any field 2813 // with an empty value appearing in NullFields will be sent to the 2814 // server as null. It is an error if a field in this list has a 2815 // non-empty value. This may be used to include null fields in Patch 2816 // requests. 2817 NullFields []string `json:"-"` 2818} 2819 2820func (s *ReplicaConfiguration) MarshalJSON() ([]byte, error) { 2821 type NoMethod ReplicaConfiguration 2822 raw := NoMethod(*s) 2823 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2824} 2825 2826type Reschedule struct { 2827 // RescheduleType: Required. The type of the reschedule. 2828 // 2829 // Possible values: 2830 // "RESCHEDULE_TYPE_UNSPECIFIED" 2831 // "IMMEDIATE" - If the user wants to schedule the maintenance to 2832 // happen now. 2833 // "NEXT_AVAILABLE_WINDOW" - If the user wants to use the existing 2834 // maintenance policy to find the next available window. 2835 // "SPECIFIC_TIME" - If the user wants to reschedule the maintenance 2836 // to a specific time. 2837 RescheduleType string `json:"rescheduleType,omitempty"` 2838 2839 // ScheduleTime: Optional. Timestamp when the maintenance shall be 2840 // rescheduled to if reschedule_type=SPECIFIC_TIME, in RFC 3339 format, 2841 // for example *2012-11-15T16:19:00.094Z*. 2842 ScheduleTime string `json:"scheduleTime,omitempty"` 2843 2844 // ForceSendFields is a list of field names (e.g. "RescheduleType") to 2845 // unconditionally include in API requests. By default, fields with 2846 // empty values are omitted from API requests. However, any non-pointer, 2847 // non-interface field appearing in ForceSendFields will be sent to the 2848 // server regardless of whether the field is empty or not. This may be 2849 // used to include empty fields in Patch requests. 2850 ForceSendFields []string `json:"-"` 2851 2852 // NullFields is a list of field names (e.g. "RescheduleType") to 2853 // include in API requests with the JSON null value. By default, fields 2854 // with empty values are omitted from API requests. However, any field 2855 // with an empty value appearing in NullFields will be sent to the 2856 // server as null. It is an error if a field in this list has a 2857 // non-empty value. This may be used to include null fields in Patch 2858 // requests. 2859 NullFields []string `json:"-"` 2860} 2861 2862func (s *Reschedule) MarshalJSON() ([]byte, error) { 2863 type NoMethod Reschedule 2864 raw := NoMethod(*s) 2865 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2866} 2867 2868// RestoreBackupContext: Database instance restore from backup context. 2869// Backup context contains source instance id and project id. 2870type RestoreBackupContext struct { 2871 // BackupRunId: The ID of the backup run to restore from. 2872 BackupRunId int64 `json:"backupRunId,omitempty,string"` 2873 2874 // InstanceId: The ID of the instance that the backup was taken from. 2875 InstanceId string `json:"instanceId,omitempty"` 2876 2877 // Kind: This is always *sql#restoreBackupContext*. 2878 Kind string `json:"kind,omitempty"` 2879 2880 // Project: The full project ID of the source instance. 2881 Project string `json:"project,omitempty"` 2882 2883 // ForceSendFields is a list of field names (e.g. "BackupRunId") to 2884 // unconditionally include in API requests. By default, fields with 2885 // empty values are omitted from API requests. However, any non-pointer, 2886 // non-interface field appearing in ForceSendFields will be sent to the 2887 // server regardless of whether the field is empty or not. This may be 2888 // used to include empty fields in Patch requests. 2889 ForceSendFields []string `json:"-"` 2890 2891 // NullFields is a list of field names (e.g. "BackupRunId") to include 2892 // in API requests with the JSON null value. By default, fields with 2893 // empty values are omitted from API requests. However, any field with 2894 // an empty value appearing in NullFields will be sent to the server as 2895 // null. It is an error if a field in this list has a non-empty value. 2896 // This may be used to include null fields in Patch requests. 2897 NullFields []string `json:"-"` 2898} 2899 2900func (s *RestoreBackupContext) MarshalJSON() ([]byte, error) { 2901 type NoMethod RestoreBackupContext 2902 raw := NoMethod(*s) 2903 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2904} 2905 2906// RotateServerCaContext: Instance rotate server CA context. 2907type RotateServerCaContext struct { 2908 // Kind: This is always *sql#rotateServerCaContext*. 2909 Kind string `json:"kind,omitempty"` 2910 2911 // NextVersion: The fingerprint of the next version to be rotated to. If 2912 // left unspecified, will be rotated to the most recently added server 2913 // CA version. 2914 NextVersion string `json:"nextVersion,omitempty"` 2915 2916 // ForceSendFields is a list of field names (e.g. "Kind") to 2917 // unconditionally include in API requests. By default, fields with 2918 // empty values are omitted from API requests. However, any non-pointer, 2919 // non-interface field appearing in ForceSendFields will be sent to the 2920 // server regardless of whether the field is empty or not. This may be 2921 // used to include empty fields in Patch requests. 2922 ForceSendFields []string `json:"-"` 2923 2924 // NullFields is a list of field names (e.g. "Kind") to include in API 2925 // requests with the JSON null value. By default, fields with empty 2926 // values are omitted from API requests. However, any field with an 2927 // empty value appearing in NullFields will be sent to the server as 2928 // null. It is an error if a field in this list has a non-empty value. 2929 // This may be used to include null fields in Patch requests. 2930 NullFields []string `json:"-"` 2931} 2932 2933func (s *RotateServerCaContext) MarshalJSON() ([]byte, error) { 2934 type NoMethod RotateServerCaContext 2935 raw := NoMethod(*s) 2936 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2937} 2938 2939// Settings: Database instance settings. 2940type Settings struct { 2941 // ActivationPolicy: The activation policy specifies when the instance 2942 // is activated; it is applicable only when the instance state is 2943 // RUNNABLE. Valid values: *ALWAYS*: The instance is on, and remains so 2944 // even in the absence of connection requests. *NEVER*: The instance is 2945 // off; it is not activated, even if a connection request arrives. 2946 // 2947 // Possible values: 2948 // "SQL_ACTIVATION_POLICY_UNSPECIFIED" - Unknown activation plan. 2949 // "ALWAYS" - The instance is always up and running. 2950 // "NEVER" - The instance never starts. 2951 // "ON_DEMAND" - The instance starts upon receiving requests. 2952 ActivationPolicy string `json:"activationPolicy,omitempty"` 2953 2954 // ActiveDirectoryConfig: Active Directory configuration, relevant only 2955 // for Cloud SQL for SQL Server. 2956 ActiveDirectoryConfig *SqlActiveDirectoryConfig `json:"activeDirectoryConfig,omitempty"` 2957 2958 // AuthorizedGaeApplications: The App Engine app IDs that can access 2959 // this instance. (Deprecated) Applied to First Generation instances 2960 // only. 2961 AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"` 2962 2963 // AvailabilityType: Availability type. Potential values: *ZONAL*: The 2964 // instance serves data from only one zone. Outages in that zone affect 2965 // data accessibility. *REGIONAL*: The instance can serve data from more 2966 // than one zone in a region (it is highly available). For more 2967 // information, see Overview of the High Availability Configuration. 2968 // 2969 // Possible values: 2970 // "SQL_AVAILABILITY_TYPE_UNSPECIFIED" - This is an unknown 2971 // Availability type. 2972 // "ZONAL" - Zonal available instance. 2973 // "REGIONAL" - Regional available instance. 2974 AvailabilityType string `json:"availabilityType,omitempty"` 2975 2976 // BackupConfiguration: The daily backup configuration for the instance. 2977 BackupConfiguration *BackupConfiguration `json:"backupConfiguration,omitempty"` 2978 2979 // Collation: The name of server Instance collation. 2980 Collation string `json:"collation,omitempty"` 2981 2982 // CrashSafeReplicationEnabled: Configuration specific to read replica 2983 // instances. Indicates whether database flags for crash-safe 2984 // replication are enabled. This property was only applicable to First 2985 // Generation instances. 2986 CrashSafeReplicationEnabled bool `json:"crashSafeReplicationEnabled,omitempty"` 2987 2988 // DataDiskSizeGb: The size of data disk, in GB. The data disk size 2989 // minimum is 10GB. 2990 DataDiskSizeGb int64 `json:"dataDiskSizeGb,omitempty,string"` 2991 2992 // DataDiskType: The type of data disk: PD_SSD (default) or PD_HDD. Not 2993 // used for First Generation instances. 2994 // 2995 // Possible values: 2996 // "SQL_DATA_DISK_TYPE_UNSPECIFIED" - This is an unknown data disk 2997 // type. 2998 // "PD_SSD" - An SSD data disk. 2999 // "PD_HDD" - An HDD data disk. 3000 // "OBSOLETE_LOCAL_SSD" - This field is deprecated and will be removed 3001 // from a future version of the API. 3002 DataDiskType string `json:"dataDiskType,omitempty"` 3003 3004 // DatabaseFlags: The database flags passed to the instance at startup. 3005 DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"` 3006 3007 // DatabaseReplicationEnabled: Configuration specific to read replica 3008 // instances. Indicates whether replication is enabled or not. 3009 DatabaseReplicationEnabled bool `json:"databaseReplicationEnabled,omitempty"` 3010 3011 // DenyMaintenancePeriods: Deny maintenance periods 3012 DenyMaintenancePeriods []*DenyMaintenancePeriod `json:"denyMaintenancePeriods,omitempty"` 3013 3014 // InsightsConfig: Insights configuration, for now relevant only for 3015 // Postgres. 3016 InsightsConfig *InsightsConfig `json:"insightsConfig,omitempty"` 3017 3018 // IpConfiguration: The settings for IP Management. This allows to 3019 // enable or disable the instance IP and manage which external networks 3020 // can connect to the instance. The IPv4 address cannot be disabled for 3021 // Second Generation instances. 3022 IpConfiguration *IpConfiguration `json:"ipConfiguration,omitempty"` 3023 3024 // Kind: This is always *sql#settings*. 3025 Kind string `json:"kind,omitempty"` 3026 3027 // LocationPreference: The location preference settings. This allows the 3028 // instance to be located as near as possible to either an App Engine 3029 // app or Compute Engine zone for better performance. App Engine 3030 // co-location was only applicable to First Generation instances. 3031 LocationPreference *LocationPreference `json:"locationPreference,omitempty"` 3032 3033 // MaintenanceWindow: The maintenance window for this instance. This 3034 // specifies when the instance can be restarted for maintenance 3035 // purposes. 3036 MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` 3037 3038 // PricingPlan: The pricing plan for this instance. This can be either 3039 // *PER_USE* or *PACKAGE*. Only *PER_USE* is supported for Second 3040 // Generation instances. 3041 // 3042 // Possible values: 3043 // "SQL_PRICING_PLAN_UNSPECIFIED" - This is an unknown pricing plan 3044 // for this instance. 3045 // "PACKAGE" - The instance is billed at a monthly flat rate. 3046 // "PER_USE" - The instance is billed per usage. 3047 PricingPlan string `json:"pricingPlan,omitempty"` 3048 3049 // ReplicationType: The type of replication this instance uses. This can 3050 // be either *ASYNCHRONOUS* or *SYNCHRONOUS*. (Deprecated_ This property 3051 // was only applicable to First Generation instances. 3052 // 3053 // Possible values: 3054 // "SQL_REPLICATION_TYPE_UNSPECIFIED" - This is an unknown replication 3055 // type for a Cloud SQL instance. 3056 // "SYNCHRONOUS" - The synchronous replication mode for First 3057 // Generation instances. It is the default value. 3058 // "ASYNCHRONOUS" - The asynchronous replication mode for First 3059 // Generation instances. It provides a slight performance gain, but if 3060 // an outage occurs while this option is set to asynchronous, you can 3061 // lose up to a few seconds of updates to your data. 3062 ReplicationType string `json:"replicationType,omitempty"` 3063 3064 // SettingsVersion: The version of instance settings. This is a required 3065 // field for update method to make sure concurrent updates are handled 3066 // properly. During update, use the most recent settingsVersion value 3067 // for this instance and do not try to update this value. 3068 SettingsVersion int64 `json:"settingsVersion,omitempty,string"` 3069 3070 // StorageAutoResize: Configuration to increase storage size 3071 // automatically. The default value is true. 3072 StorageAutoResize *bool `json:"storageAutoResize,omitempty"` 3073 3074 // StorageAutoResizeLimit: The maximum size to which storage capacity 3075 // can be automatically increased. The default value is 0, which 3076 // specifies that there is no limit. 3077 StorageAutoResizeLimit int64 `json:"storageAutoResizeLimit,omitempty,string"` 3078 3079 // Tier: The tier (or machine type) for this instance, for example 3080 // *db-custom-1-3840* . 3081 Tier string `json:"tier,omitempty"` 3082 3083 // UserLabels: User-provided labels, represented as a dictionary where 3084 // each label is a single key value pair. 3085 UserLabels map[string]string `json:"userLabels,omitempty"` 3086 3087 // ForceSendFields is a list of field names (e.g. "ActivationPolicy") to 3088 // unconditionally include in API requests. By default, fields with 3089 // empty values are omitted from API requests. However, any non-pointer, 3090 // non-interface field appearing in ForceSendFields will be sent to the 3091 // server regardless of whether the field is empty or not. This may be 3092 // used to include empty fields in Patch requests. 3093 ForceSendFields []string `json:"-"` 3094 3095 // NullFields is a list of field names (e.g. "ActivationPolicy") to 3096 // include in API requests with the JSON null value. By default, fields 3097 // with empty values are omitted from API requests. However, any field 3098 // with an empty value appearing in NullFields will be sent to the 3099 // server as null. It is an error if a field in this list has a 3100 // non-empty value. This may be used to include null fields in Patch 3101 // requests. 3102 NullFields []string `json:"-"` 3103} 3104 3105func (s *Settings) MarshalJSON() ([]byte, error) { 3106 type NoMethod Settings 3107 raw := NoMethod(*s) 3108 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3109} 3110 3111// SqlActiveDirectoryConfig: Active Directory configuration, relevant 3112// only for Cloud SQL for SQL Server. 3113type SqlActiveDirectoryConfig struct { 3114 // Domain: The name of the domain (e.g., mydomain.com). 3115 Domain string `json:"domain,omitempty"` 3116 3117 // Kind: This is always sql#activeDirectoryConfig. 3118 Kind string `json:"kind,omitempty"` 3119 3120 // ForceSendFields is a list of field names (e.g. "Domain") to 3121 // unconditionally include in API requests. By default, fields with 3122 // empty values are omitted from API requests. However, any non-pointer, 3123 // non-interface field appearing in ForceSendFields will be sent to the 3124 // server regardless of whether the field is empty or not. This may be 3125 // used to include empty fields in Patch requests. 3126 ForceSendFields []string `json:"-"` 3127 3128 // NullFields is a list of field names (e.g. "Domain") to include in API 3129 // requests with the JSON null value. By default, fields with empty 3130 // values are omitted from API requests. However, any field with an 3131 // empty value appearing in NullFields will be sent to the server as 3132 // null. It is an error if a field in this list has a non-empty value. 3133 // This may be used to include null fields in Patch requests. 3134 NullFields []string `json:"-"` 3135} 3136 3137func (s *SqlActiveDirectoryConfig) MarshalJSON() ([]byte, error) { 3138 type NoMethod SqlActiveDirectoryConfig 3139 raw := NoMethod(*s) 3140 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3141} 3142 3143// SqlExternalSyncSettingError: External primary instance migration 3144// setting error/warning. 3145type SqlExternalSyncSettingError struct { 3146 // Detail: Additional information about the error encountered. 3147 Detail string `json:"detail,omitempty"` 3148 3149 // Kind: Can be *sql#externalSyncSettingError* or 3150 // *sql#externalSyncSettingWarning*. 3151 Kind string `json:"kind,omitempty"` 3152 3153 // Type: Identifies the specific error that occurred. 3154 // 3155 // Possible values: 3156 // "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" 3157 // "CONNECTION_FAILURE" 3158 // "BINLOG_NOT_ENABLED" 3159 // "INCOMPATIBLE_DATABASE_VERSION" 3160 // "REPLICA_ALREADY_SETUP" 3161 // "INSUFFICIENT_PRIVILEGE" 3162 // "UNSUPPORTED_MIGRATION_TYPE" - Unsupported migration type. 3163 // "NO_PGLOGICAL_INSTALLED" - No pglogical extension installed on 3164 // databases, applicable for postgres. 3165 // "PGLOGICAL_NODE_ALREADY_EXISTS" - pglogical node already exists on 3166 // databases, applicable for postgres. 3167 // "INVALID_WAL_LEVEL" - The value of parameter wal_level is not set 3168 // to logical. 3169 // "INVALID_SHARED_PRELOAD_LIBRARY" - The value of parameter 3170 // shared_preload_libraries does not include pglogical. 3171 // "INSUFFICIENT_MAX_REPLICATION_SLOTS" - The value of parameter 3172 // max_replication_slots is not sufficient. 3173 // "INSUFFICIENT_MAX_WAL_SENDERS" - The value of parameter 3174 // max_wal_senders is not sufficient. 3175 // "INSUFFICIENT_MAX_WORKER_PROCESSES" - The value of parameter 3176 // max_worker_processes is not sufficient. 3177 // "UNSUPPORTED_EXTENSIONS" - Extensions installed are either not 3178 // supported or having unsupported versions 3179 // "INVALID_RDS_LOGICAL_REPLICATION" - The value of parameter 3180 // rds.logical_replication is not set to 1. 3181 // "INVALID_LOGGING_SETUP" - The primary instance logging setup 3182 // doesn't allow EM sync. 3183 // "INVALID_DB_PARAM" - The primary instance database parameter setup 3184 // doesn't allow EM sync. 3185 // "UNSUPPORTED_GTID_MODE" - The gtid_mode is not supported, 3186 // applicable for MySQL. 3187 // "SQLSERVER_AGENT_NOT_RUNNING" - SQL Server Agent is not running. 3188 // "UNSUPPORTED_TABLE_DEFINITION" - The table definition is not 3189 // support due to missing primary key or replica identity, applicable 3190 // for postgres. 3191 // "UNSUPPORTED_DEFINER" - The customer has a definer that will break 3192 // EM setup. 3193 Type string `json:"type,omitempty"` 3194 3195 // ForceSendFields is a list of field names (e.g. "Detail") to 3196 // unconditionally include in API requests. By default, fields with 3197 // empty values are omitted from API requests. However, any non-pointer, 3198 // non-interface field appearing in ForceSendFields will be sent to the 3199 // server regardless of whether the field is empty or not. This may be 3200 // used to include empty fields in Patch requests. 3201 ForceSendFields []string `json:"-"` 3202 3203 // NullFields is a list of field names (e.g. "Detail") to include in API 3204 // requests with the JSON null value. By default, fields with empty 3205 // values are omitted from API requests. However, any field with an 3206 // empty value appearing in NullFields will be sent to the server as 3207 // null. It is an error if a field in this list has a non-empty value. 3208 // This may be used to include null fields in Patch requests. 3209 NullFields []string `json:"-"` 3210} 3211 3212func (s *SqlExternalSyncSettingError) MarshalJSON() ([]byte, error) { 3213 type NoMethod SqlExternalSyncSettingError 3214 raw := NoMethod(*s) 3215 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3216} 3217 3218// SqlInstancesRescheduleMaintenanceRequestBody: Reschedule options for 3219// maintenance windows. 3220type SqlInstancesRescheduleMaintenanceRequestBody struct { 3221 // Reschedule: Required. The type of the reschedule the user wants. 3222 Reschedule *Reschedule `json:"reschedule,omitempty"` 3223 3224 // ForceSendFields is a list of field names (e.g. "Reschedule") to 3225 // unconditionally include in API requests. By default, fields with 3226 // empty values are omitted from API requests. However, any non-pointer, 3227 // non-interface field appearing in ForceSendFields will be sent to the 3228 // server regardless of whether the field is empty or not. This may be 3229 // used to include empty fields in Patch requests. 3230 ForceSendFields []string `json:"-"` 3231 3232 // NullFields is a list of field names (e.g. "Reschedule") to include in 3233 // API requests with the JSON null value. By default, fields with empty 3234 // values are omitted from API requests. However, any field with an 3235 // empty value appearing in NullFields will be sent to the server as 3236 // null. It is an error if a field in this list has a non-empty value. 3237 // This may be used to include null fields in Patch requests. 3238 NullFields []string `json:"-"` 3239} 3240 3241func (s *SqlInstancesRescheduleMaintenanceRequestBody) MarshalJSON() ([]byte, error) { 3242 type NoMethod SqlInstancesRescheduleMaintenanceRequestBody 3243 raw := NoMethod(*s) 3244 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3245} 3246 3247// SqlInstancesVerifyExternalSyncSettingsResponse: Instance verify 3248// external sync settings response. 3249type SqlInstancesVerifyExternalSyncSettingsResponse struct { 3250 // Errors: List of migration violations. 3251 Errors []*SqlExternalSyncSettingError `json:"errors,omitempty"` 3252 3253 // Kind: This is always *sql#migrationSettingErrorList*. 3254 Kind string `json:"kind,omitempty"` 3255 3256 // Warnings: List of migration warnings. 3257 Warnings []*SqlExternalSyncSettingError `json:"warnings,omitempty"` 3258 3259 // ServerResponse contains the HTTP response code and headers from the 3260 // server. 3261 googleapi.ServerResponse `json:"-"` 3262 3263 // ForceSendFields is a list of field names (e.g. "Errors") to 3264 // unconditionally include in API requests. By default, fields with 3265 // empty values are omitted from API requests. However, any non-pointer, 3266 // non-interface field appearing in ForceSendFields will be sent to the 3267 // server regardless of whether the field is empty or not. This may be 3268 // used to include empty fields in Patch requests. 3269 ForceSendFields []string `json:"-"` 3270 3271 // NullFields is a list of field names (e.g. "Errors") to include in API 3272 // requests with the JSON null value. By default, fields with empty 3273 // values are omitted from API requests. However, any field with an 3274 // empty value appearing in NullFields will be sent to the server as 3275 // null. It is an error if a field in this list has a non-empty value. 3276 // This may be used to include null fields in Patch requests. 3277 NullFields []string `json:"-"` 3278} 3279 3280func (s *SqlInstancesVerifyExternalSyncSettingsResponse) MarshalJSON() ([]byte, error) { 3281 type NoMethod SqlInstancesVerifyExternalSyncSettingsResponse 3282 raw := NoMethod(*s) 3283 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3284} 3285 3286// SqlScheduledMaintenance: Any scheduled maintenancce for this 3287// instance. 3288type SqlScheduledMaintenance struct { 3289 CanDefer bool `json:"canDefer,omitempty"` 3290 3291 // CanReschedule: If the scheduled maintenance can be rescheduled. 3292 CanReschedule bool `json:"canReschedule,omitempty"` 3293 3294 // StartTime: The start time of any upcoming scheduled maintenance for 3295 // this instance. 3296 StartTime string `json:"startTime,omitempty"` 3297 3298 // ForceSendFields is a list of field names (e.g. "CanDefer") to 3299 // unconditionally include in API requests. By default, fields with 3300 // empty values are omitted from API requests. However, any non-pointer, 3301 // non-interface field appearing in ForceSendFields will be sent to the 3302 // server regardless of whether the field is empty or not. This may be 3303 // used to include empty fields in Patch requests. 3304 ForceSendFields []string `json:"-"` 3305 3306 // NullFields is a list of field names (e.g. "CanDefer") to include in 3307 // API requests with the JSON null value. By default, fields with empty 3308 // values are omitted from API requests. However, any field with an 3309 // empty value appearing in NullFields will be sent to the server as 3310 // null. It is an error if a field in this list has a non-empty value. 3311 // This may be used to include null fields in Patch requests. 3312 NullFields []string `json:"-"` 3313} 3314 3315func (s *SqlScheduledMaintenance) MarshalJSON() ([]byte, error) { 3316 type NoMethod SqlScheduledMaintenance 3317 raw := NoMethod(*s) 3318 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3319} 3320 3321// SqlServerDatabaseDetails: Represents a Sql Server database on the 3322// Cloud SQL instance. 3323type SqlServerDatabaseDetails struct { 3324 // CompatibilityLevel: The version of SQL Server with which the database 3325 // is to be made compatible 3326 CompatibilityLevel int64 `json:"compatibilityLevel,omitempty"` 3327 3328 // RecoveryModel: The recovery model of a SQL Server database 3329 RecoveryModel string `json:"recoveryModel,omitempty"` 3330 3331 // ForceSendFields is a list of field names (e.g. "CompatibilityLevel") 3332 // to unconditionally include in API requests. By default, fields with 3333 // empty values are omitted from API requests. However, any non-pointer, 3334 // non-interface field appearing in ForceSendFields will be sent to the 3335 // server regardless of whether the field is empty or not. This may be 3336 // used to include empty fields in Patch requests. 3337 ForceSendFields []string `json:"-"` 3338 3339 // NullFields is a list of field names (e.g. "CompatibilityLevel") to 3340 // include in API requests with the JSON null value. By default, fields 3341 // with empty values are omitted from API requests. However, any field 3342 // with an empty value appearing in NullFields will be sent to the 3343 // server as null. It is an error if a field in this list has a 3344 // non-empty value. This may be used to include null fields in Patch 3345 // requests. 3346 NullFields []string `json:"-"` 3347} 3348 3349func (s *SqlServerDatabaseDetails) MarshalJSON() ([]byte, error) { 3350 type NoMethod SqlServerDatabaseDetails 3351 raw := NoMethod(*s) 3352 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3353} 3354 3355// SqlServerUserDetails: Represents a Sql Server user on the Cloud SQL 3356// instance. 3357type SqlServerUserDetails struct { 3358 // Disabled: If the user has been disabled 3359 Disabled bool `json:"disabled,omitempty"` 3360 3361 // ServerRoles: The server roles for this user 3362 ServerRoles []string `json:"serverRoles,omitempty"` 3363 3364 // ForceSendFields is a list of field names (e.g. "Disabled") to 3365 // unconditionally include in API requests. By default, fields with 3366 // empty values are omitted from API requests. However, any non-pointer, 3367 // non-interface field appearing in ForceSendFields will be sent to the 3368 // server regardless of whether the field is empty or not. This may be 3369 // used to include empty fields in Patch requests. 3370 ForceSendFields []string `json:"-"` 3371 3372 // NullFields is a list of field names (e.g. "Disabled") to include in 3373 // API requests with the JSON null value. By default, fields with empty 3374 // values are omitted from API requests. However, any field with an 3375 // empty value appearing in NullFields will be sent to the server as 3376 // null. It is an error if a field in this list has a non-empty value. 3377 // This may be used to include null fields in Patch requests. 3378 NullFields []string `json:"-"` 3379} 3380 3381func (s *SqlServerUserDetails) MarshalJSON() ([]byte, error) { 3382 type NoMethod SqlServerUserDetails 3383 raw := NoMethod(*s) 3384 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3385} 3386 3387// SslCert: SslCerts Resource 3388type SslCert struct { 3389 // Cert: PEM representation. 3390 Cert string `json:"cert,omitempty"` 3391 3392 // CertSerialNumber: Serial number, as extracted from the certificate. 3393 CertSerialNumber string `json:"certSerialNumber,omitempty"` 3394 3395 // CommonName: User supplied name. Constrained to [a-zA-Z.-_ ]+. 3396 CommonName string `json:"commonName,omitempty"` 3397 3398 // CreateTime: The time when the certificate was created in RFC 3339 3399 // format, for example *2012-11-15T16:19:00.094Z* 3400 CreateTime string `json:"createTime,omitempty"` 3401 3402 // ExpirationTime: The time when the certificate expires in RFC 3339 3403 // format, for example *2012-11-15T16:19:00.094Z*. 3404 ExpirationTime string `json:"expirationTime,omitempty"` 3405 3406 // Instance: Name of the database instance. 3407 Instance string `json:"instance,omitempty"` 3408 3409 // Kind: This is always *sql#sslCert*. 3410 Kind string `json:"kind,omitempty"` 3411 3412 // SelfLink: The URI of this resource. 3413 SelfLink string `json:"selfLink,omitempty"` 3414 3415 // Sha1Fingerprint: Sha1 Fingerprint. 3416 Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"` 3417 3418 // ServerResponse contains the HTTP response code and headers from the 3419 // server. 3420 googleapi.ServerResponse `json:"-"` 3421 3422 // ForceSendFields is a list of field names (e.g. "Cert") to 3423 // unconditionally include in API requests. By default, fields with 3424 // empty values are omitted from API requests. However, any non-pointer, 3425 // non-interface field appearing in ForceSendFields will be sent to the 3426 // server regardless of whether the field is empty or not. This may be 3427 // used to include empty fields in Patch requests. 3428 ForceSendFields []string `json:"-"` 3429 3430 // NullFields is a list of field names (e.g. "Cert") to include in API 3431 // requests with the JSON null value. By default, fields with empty 3432 // values are omitted from API requests. However, any field with an 3433 // empty value appearing in NullFields will be sent to the server as 3434 // null. It is an error if a field in this list has a non-empty value. 3435 // This may be used to include null fields in Patch requests. 3436 NullFields []string `json:"-"` 3437} 3438 3439func (s *SslCert) MarshalJSON() ([]byte, error) { 3440 type NoMethod SslCert 3441 raw := NoMethod(*s) 3442 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3443} 3444 3445// SslCertDetail: SslCertDetail. 3446type SslCertDetail struct { 3447 // CertInfo: The public information about the cert. 3448 CertInfo *SslCert `json:"certInfo,omitempty"` 3449 3450 // CertPrivateKey: The private key for the client cert, in pem format. 3451 // Keep private in order to protect your security. 3452 CertPrivateKey string `json:"certPrivateKey,omitempty"` 3453 3454 // ForceSendFields is a list of field names (e.g. "CertInfo") to 3455 // unconditionally include in API requests. By default, fields with 3456 // empty values are omitted from API requests. However, any non-pointer, 3457 // non-interface field appearing in ForceSendFields will be sent to the 3458 // server regardless of whether the field is empty or not. This may be 3459 // used to include empty fields in Patch requests. 3460 ForceSendFields []string `json:"-"` 3461 3462 // NullFields is a list of field names (e.g. "CertInfo") to include in 3463 // API requests with the JSON null value. By default, fields with empty 3464 // values are omitted from API requests. However, any field with an 3465 // empty value appearing in NullFields will be sent to the server as 3466 // null. It is an error if a field in this list has a non-empty value. 3467 // This may be used to include null fields in Patch requests. 3468 NullFields []string `json:"-"` 3469} 3470 3471func (s *SslCertDetail) MarshalJSON() ([]byte, error) { 3472 type NoMethod SslCertDetail 3473 raw := NoMethod(*s) 3474 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3475} 3476 3477// SslCertsCreateEphemeralRequest: SslCerts create ephemeral certificate 3478// request. 3479type SslCertsCreateEphemeralRequest struct { 3480 // AccessToken: Access token to include in the signed certificate. 3481 AccessToken string `json:"access_token,omitempty"` 3482 3483 // PublicKey: PEM encoded public key to include in the signed 3484 // certificate. 3485 PublicKey string `json:"public_key,omitempty"` 3486 3487 // ForceSendFields is a list of field names (e.g. "AccessToken") to 3488 // unconditionally include in API requests. By default, fields with 3489 // empty values are omitted from API requests. However, any non-pointer, 3490 // non-interface field appearing in ForceSendFields will be sent to the 3491 // server regardless of whether the field is empty or not. This may be 3492 // used to include empty fields in Patch requests. 3493 ForceSendFields []string `json:"-"` 3494 3495 // NullFields is a list of field names (e.g. "AccessToken") to include 3496 // in API requests with the JSON null value. By default, fields with 3497 // empty values are omitted from API requests. However, any field with 3498 // an empty value appearing in NullFields will be sent to the server as 3499 // null. It is an error if a field in this list has a non-empty value. 3500 // This may be used to include null fields in Patch requests. 3501 NullFields []string `json:"-"` 3502} 3503 3504func (s *SslCertsCreateEphemeralRequest) MarshalJSON() ([]byte, error) { 3505 type NoMethod SslCertsCreateEphemeralRequest 3506 raw := NoMethod(*s) 3507 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3508} 3509 3510// SslCertsInsertRequest: SslCerts insert request. 3511type SslCertsInsertRequest struct { 3512 // CommonName: User supplied name. Must be a distinct name from the 3513 // other certificates for this instance. 3514 CommonName string `json:"commonName,omitempty"` 3515 3516 // ForceSendFields is a list of field names (e.g. "CommonName") to 3517 // unconditionally include in API requests. By default, fields with 3518 // empty values are omitted from API requests. However, any non-pointer, 3519 // non-interface field appearing in ForceSendFields will be sent to the 3520 // server regardless of whether the field is empty or not. This may be 3521 // used to include empty fields in Patch requests. 3522 ForceSendFields []string `json:"-"` 3523 3524 // NullFields is a list of field names (e.g. "CommonName") to include in 3525 // API requests with the JSON null value. By default, fields with empty 3526 // values are omitted from API requests. However, any field with an 3527 // empty value appearing in NullFields will be sent to the server as 3528 // null. It is an error if a field in this list has a non-empty value. 3529 // This may be used to include null fields in Patch requests. 3530 NullFields []string `json:"-"` 3531} 3532 3533func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error) { 3534 type NoMethod SslCertsInsertRequest 3535 raw := NoMethod(*s) 3536 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3537} 3538 3539// SslCertsInsertResponse: SslCert insert response. 3540type SslCertsInsertResponse struct { 3541 // ClientCert: The new client certificate and private key. 3542 ClientCert *SslCertDetail `json:"clientCert,omitempty"` 3543 3544 // Kind: This is always *sql#sslCertsInsert*. 3545 Kind string `json:"kind,omitempty"` 3546 3547 // Operation: The operation to track the ssl certs insert request. 3548 Operation *Operation `json:"operation,omitempty"` 3549 3550 // ServerCaCert: The server Certificate Authority's certificate. If this 3551 // is missing you can force a new one to be generated by calling 3552 // resetSslConfig method on instances resource. 3553 ServerCaCert *SslCert `json:"serverCaCert,omitempty"` 3554 3555 // ServerResponse contains the HTTP response code and headers from the 3556 // server. 3557 googleapi.ServerResponse `json:"-"` 3558 3559 // ForceSendFields is a list of field names (e.g. "ClientCert") to 3560 // unconditionally include in API requests. By default, fields with 3561 // empty values are omitted from API requests. However, any non-pointer, 3562 // non-interface field appearing in ForceSendFields will be sent to the 3563 // server regardless of whether the field is empty or not. This may be 3564 // used to include empty fields in Patch requests. 3565 ForceSendFields []string `json:"-"` 3566 3567 // NullFields is a list of field names (e.g. "ClientCert") to include in 3568 // API requests with the JSON null value. By default, fields with empty 3569 // values are omitted from API requests. However, any field with an 3570 // empty value appearing in NullFields will be sent to the server as 3571 // null. It is an error if a field in this list has a non-empty value. 3572 // This may be used to include null fields in Patch requests. 3573 NullFields []string `json:"-"` 3574} 3575 3576func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error) { 3577 type NoMethod SslCertsInsertResponse 3578 raw := NoMethod(*s) 3579 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3580} 3581 3582// SslCertsListResponse: SslCerts list response. 3583type SslCertsListResponse struct { 3584 // Items: List of client certificates for the instance. 3585 Items []*SslCert `json:"items,omitempty"` 3586 3587 // Kind: This is always *sql#sslCertsList*. 3588 Kind string `json:"kind,omitempty"` 3589 3590 // ServerResponse contains the HTTP response code and headers from the 3591 // server. 3592 googleapi.ServerResponse `json:"-"` 3593 3594 // ForceSendFields is a list of field names (e.g. "Items") to 3595 // unconditionally include in API requests. By default, fields with 3596 // empty values are omitted from API requests. However, any non-pointer, 3597 // non-interface field appearing in ForceSendFields will be sent to the 3598 // server regardless of whether the field is empty or not. This may be 3599 // used to include empty fields in Patch requests. 3600 ForceSendFields []string `json:"-"` 3601 3602 // NullFields is a list of field names (e.g. "Items") to include in API 3603 // requests with the JSON null value. By default, fields with empty 3604 // values are omitted from API requests. However, any field with an 3605 // empty value appearing in NullFields will be sent to the server as 3606 // null. It is an error if a field in this list has a non-empty value. 3607 // This may be used to include null fields in Patch requests. 3608 NullFields []string `json:"-"` 3609} 3610 3611func (s *SslCertsListResponse) MarshalJSON() ([]byte, error) { 3612 type NoMethod SslCertsListResponse 3613 raw := NoMethod(*s) 3614 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3615} 3616 3617// Tier: A Google Cloud SQL service tier resource. 3618type Tier struct { 3619 // DiskQuota: The maximum disk size of this tier in bytes. 3620 DiskQuota int64 `json:"DiskQuota,omitempty,string"` 3621 3622 // RAM: The maximum RAM usage of this tier in bytes. 3623 RAM int64 `json:"RAM,omitempty,string"` 3624 3625 // Kind: This is always *sql#tier*. 3626 Kind string `json:"kind,omitempty"` 3627 3628 // Region: The applicable regions for this tier. 3629 Region []string `json:"region,omitempty"` 3630 3631 // Tier: An identifier for the machine type, for example, 3632 // db-custom-1-3840. For related information, see Pricing. 3633 Tier string `json:"tier,omitempty"` 3634 3635 // ForceSendFields is a list of field names (e.g. "DiskQuota") to 3636 // unconditionally include in API requests. By default, fields with 3637 // empty values are omitted from API requests. However, any non-pointer, 3638 // non-interface field appearing in ForceSendFields will be sent to the 3639 // server regardless of whether the field is empty or not. This may be 3640 // used to include empty fields in Patch requests. 3641 ForceSendFields []string `json:"-"` 3642 3643 // NullFields is a list of field names (e.g. "DiskQuota") to include in 3644 // API requests with the JSON null value. By default, fields with empty 3645 // values are omitted from API requests. However, any field with an 3646 // empty value appearing in NullFields will be sent to the server as 3647 // null. It is an error if a field in this list has a non-empty value. 3648 // This may be used to include null fields in Patch requests. 3649 NullFields []string `json:"-"` 3650} 3651 3652func (s *Tier) MarshalJSON() ([]byte, error) { 3653 type NoMethod Tier 3654 raw := NoMethod(*s) 3655 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3656} 3657 3658// TiersListResponse: Tiers list response. 3659type TiersListResponse struct { 3660 // Items: List of tiers. 3661 Items []*Tier `json:"items,omitempty"` 3662 3663 // Kind: This is always *sql#tiersList*. 3664 Kind string `json:"kind,omitempty"` 3665 3666 // ServerResponse contains the HTTP response code and headers from the 3667 // server. 3668 googleapi.ServerResponse `json:"-"` 3669 3670 // ForceSendFields is a list of field names (e.g. "Items") to 3671 // unconditionally include in API requests. By default, fields with 3672 // empty values are omitted from API requests. However, any non-pointer, 3673 // non-interface field appearing in ForceSendFields will be sent to the 3674 // server regardless of whether the field is empty or not. This may be 3675 // used to include empty fields in Patch requests. 3676 ForceSendFields []string `json:"-"` 3677 3678 // NullFields is a list of field names (e.g. "Items") to include in API 3679 // requests with the JSON null value. By default, fields with empty 3680 // values are omitted from API requests. However, any field with an 3681 // empty value appearing in NullFields will be sent to the server as 3682 // null. It is an error if a field in this list has a non-empty value. 3683 // This may be used to include null fields in Patch requests. 3684 NullFields []string `json:"-"` 3685} 3686 3687func (s *TiersListResponse) MarshalJSON() ([]byte, error) { 3688 type NoMethod TiersListResponse 3689 raw := NoMethod(*s) 3690 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3691} 3692 3693// TruncateLogContext: Database Instance truncate log context. 3694type TruncateLogContext struct { 3695 // Kind: This is always *sql#truncateLogContext*. 3696 Kind string `json:"kind,omitempty"` 3697 3698 // LogType: The type of log to truncate. Valid values are 3699 // *MYSQL_GENERAL_TABLE* and *MYSQL_SLOW_TABLE*. 3700 LogType string `json:"logType,omitempty"` 3701 3702 // ForceSendFields is a list of field names (e.g. "Kind") to 3703 // unconditionally include in API requests. By default, fields with 3704 // empty values are omitted from API requests. However, any non-pointer, 3705 // non-interface field appearing in ForceSendFields will be sent to the 3706 // server regardless of whether the field is empty or not. This may be 3707 // used to include empty fields in Patch requests. 3708 ForceSendFields []string `json:"-"` 3709 3710 // NullFields is a list of field names (e.g. "Kind") to include in API 3711 // requests with the JSON null value. By default, fields with empty 3712 // values are omitted from API requests. However, any field with an 3713 // empty value appearing in NullFields will be sent to the server as 3714 // null. It is an error if a field in this list has a non-empty value. 3715 // This may be used to include null fields in Patch requests. 3716 NullFields []string `json:"-"` 3717} 3718 3719func (s *TruncateLogContext) MarshalJSON() ([]byte, error) { 3720 type NoMethod TruncateLogContext 3721 raw := NoMethod(*s) 3722 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3723} 3724 3725// User: A Cloud SQL user resource. 3726type User struct { 3727 // Etag: This field is deprecated and will be removed from a future 3728 // version of the API. 3729 Etag string `json:"etag,omitempty"` 3730 3731 // Host: The host name from which the user can connect. For *insert* 3732 // operations, host defaults to an empty string. For *update* 3733 // operations, host is specified as part of the request URL. The host 3734 // name cannot be updated after insertion. 3735 Host string `json:"host,omitempty"` 3736 3737 // Instance: The name of the Cloud SQL instance. This does not include 3738 // the project ID. Can be omitted for *update* since it is already 3739 // specified on the URL. 3740 Instance string `json:"instance,omitempty"` 3741 3742 // Kind: This is always *sql#user*. 3743 Kind string `json:"kind,omitempty"` 3744 3745 // Name: The name of the user in the Cloud SQL instance. Can be omitted 3746 // for *update* since it is already specified in the URL. 3747 Name string `json:"name,omitempty"` 3748 3749 // Password: The password for the user. 3750 Password string `json:"password,omitempty"` 3751 3752 // Project: The project ID of the project containing the Cloud SQL 3753 // database. The Google apps domain is prefixed if applicable. Can be 3754 // omitted for *update* since it is already specified on the URL. 3755 Project string `json:"project,omitempty"` 3756 3757 SqlserverUserDetails *SqlServerUserDetails `json:"sqlserverUserDetails,omitempty"` 3758 3759 // Type: The user type. It determines the method to authenticate the 3760 // user during login. The default is the database's built-in user type. 3761 // 3762 // Possible values: 3763 // "BUILT_IN" - The database's built-in user type. 3764 // "CLOUD_IAM_USER" - Cloud IAM user. 3765 // "CLOUD_IAM_SERVICE_ACCOUNT" - Cloud IAM service account. 3766 Type string `json:"type,omitempty"` 3767 3768 // ForceSendFields is a list of field names (e.g. "Etag") to 3769 // unconditionally include in API requests. By default, fields with 3770 // empty values are omitted from API requests. However, any non-pointer, 3771 // non-interface field appearing in ForceSendFields will be sent to the 3772 // server regardless of whether the field is empty or not. This may be 3773 // used to include empty fields in Patch requests. 3774 ForceSendFields []string `json:"-"` 3775 3776 // NullFields is a list of field names (e.g. "Etag") to include in API 3777 // requests with the JSON null value. By default, fields with empty 3778 // values are omitted from API requests. However, any field with an 3779 // empty value appearing in NullFields will be sent to the server as 3780 // null. It is an error if a field in this list has a non-empty value. 3781 // This may be used to include null fields in Patch requests. 3782 NullFields []string `json:"-"` 3783} 3784 3785func (s *User) MarshalJSON() ([]byte, error) { 3786 type NoMethod User 3787 raw := NoMethod(*s) 3788 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3789} 3790 3791// UsersListResponse: User list response. 3792type UsersListResponse struct { 3793 // Items: List of user resources in the instance. 3794 Items []*User `json:"items,omitempty"` 3795 3796 // Kind: This is always *sql#usersList*. 3797 Kind string `json:"kind,omitempty"` 3798 3799 // NextPageToken: An identifier that uniquely identifies the operation. 3800 // You can use this identifier to retrieve the Operations resource that 3801 // has information about the operation. 3802 NextPageToken string `json:"nextPageToken,omitempty"` 3803 3804 // ServerResponse contains the HTTP response code and headers from the 3805 // server. 3806 googleapi.ServerResponse `json:"-"` 3807 3808 // ForceSendFields is a list of field names (e.g. "Items") to 3809 // unconditionally include in API requests. By default, fields with 3810 // empty values are omitted from API requests. However, any non-pointer, 3811 // non-interface field appearing in ForceSendFields will be sent to the 3812 // server regardless of whether the field is empty or not. This may be 3813 // used to include empty fields in Patch requests. 3814 ForceSendFields []string `json:"-"` 3815 3816 // NullFields is a list of field names (e.g. "Items") to include in API 3817 // requests with the JSON null value. By default, fields with empty 3818 // values are omitted from API requests. However, any field with an 3819 // empty value appearing in NullFields will be sent to the server as 3820 // null. It is an error if a field in this list has a non-empty value. 3821 // This may be used to include null fields in Patch requests. 3822 NullFields []string `json:"-"` 3823} 3824 3825func (s *UsersListResponse) MarshalJSON() ([]byte, error) { 3826 type NoMethod UsersListResponse 3827 raw := NoMethod(*s) 3828 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3829} 3830 3831// method id "sql.backupRuns.delete": 3832 3833type BackupRunsDeleteCall struct { 3834 s *Service 3835 project string 3836 instance string 3837 id int64 3838 urlParams_ gensupport.URLParams 3839 ctx_ context.Context 3840 header_ http.Header 3841} 3842 3843// Delete: Deletes the backup taken by a backup run. 3844// 3845// - id: The ID of the Backup Run to delete. To find a Backup Run ID, 3846// use the list method. 3847// - instance: Cloud SQL instance ID. This does not include the project 3848// ID. 3849// - project: Project ID of the project that contains the instance. 3850func (r *BackupRunsService) Delete(project string, instance string, id int64) *BackupRunsDeleteCall { 3851 c := &BackupRunsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3852 c.project = project 3853 c.instance = instance 3854 c.id = id 3855 return c 3856} 3857 3858// Fields allows partial responses to be retrieved. See 3859// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3860// for more information. 3861func (c *BackupRunsDeleteCall) Fields(s ...googleapi.Field) *BackupRunsDeleteCall { 3862 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3863 return c 3864} 3865 3866// Context sets the context to be used in this call's Do method. Any 3867// pending HTTP request will be aborted if the provided context is 3868// canceled. 3869func (c *BackupRunsDeleteCall) Context(ctx context.Context) *BackupRunsDeleteCall { 3870 c.ctx_ = ctx 3871 return c 3872} 3873 3874// Header returns an http.Header that can be modified by the caller to 3875// add HTTP headers to the request. 3876func (c *BackupRunsDeleteCall) Header() http.Header { 3877 if c.header_ == nil { 3878 c.header_ = make(http.Header) 3879 } 3880 return c.header_ 3881} 3882 3883func (c *BackupRunsDeleteCall) doRequest(alt string) (*http.Response, error) { 3884 reqHeaders := make(http.Header) 3885 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3886 for k, v := range c.header_ { 3887 reqHeaders[k] = v 3888 } 3889 reqHeaders.Set("User-Agent", c.s.userAgent()) 3890 var body io.Reader = nil 3891 c.urlParams_.Set("alt", alt) 3892 c.urlParams_.Set("prettyPrint", "false") 3893 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}") 3894 urls += "?" + c.urlParams_.Encode() 3895 req, err := http.NewRequest("DELETE", urls, body) 3896 if err != nil { 3897 return nil, err 3898 } 3899 req.Header = reqHeaders 3900 googleapi.Expand(req.URL, map[string]string{ 3901 "project": c.project, 3902 "instance": c.instance, 3903 "id": strconv.FormatInt(c.id, 10), 3904 }) 3905 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3906} 3907 3908// Do executes the "sql.backupRuns.delete" call. 3909// Exactly one of *Operation or error will be non-nil. Any non-2xx 3910// status code is an error. Response headers are in either 3911// *Operation.ServerResponse.Header or (if a response was returned at 3912// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3913// to check whether the returned error was because 3914// http.StatusNotModified was returned. 3915func (c *BackupRunsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3916 gensupport.SetOptions(c.urlParams_, opts...) 3917 res, err := c.doRequest("json") 3918 if res != nil && res.StatusCode == http.StatusNotModified { 3919 if res.Body != nil { 3920 res.Body.Close() 3921 } 3922 return nil, &googleapi.Error{ 3923 Code: res.StatusCode, 3924 Header: res.Header, 3925 } 3926 } 3927 if err != nil { 3928 return nil, err 3929 } 3930 defer googleapi.CloseBody(res) 3931 if err := googleapi.CheckResponse(res); err != nil { 3932 return nil, err 3933 } 3934 ret := &Operation{ 3935 ServerResponse: googleapi.ServerResponse{ 3936 Header: res.Header, 3937 HTTPStatusCode: res.StatusCode, 3938 }, 3939 } 3940 target := &ret 3941 if err := gensupport.DecodeResponse(target, res); err != nil { 3942 return nil, err 3943 } 3944 return ret, nil 3945 // { 3946 // "description": "Deletes the backup taken by a backup run.", 3947 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 3948 // "httpMethod": "DELETE", 3949 // "id": "sql.backupRuns.delete", 3950 // "parameterOrder": [ 3951 // "project", 3952 // "instance", 3953 // "id" 3954 // ], 3955 // "parameters": { 3956 // "id": { 3957 // "description": "The ID of the Backup Run to delete. To find a Backup Run ID, use the list method.", 3958 // "format": "int64", 3959 // "location": "path", 3960 // "required": true, 3961 // "type": "string" 3962 // }, 3963 // "instance": { 3964 // "description": "Cloud SQL instance ID. This does not include the project ID.", 3965 // "location": "path", 3966 // "required": true, 3967 // "type": "string" 3968 // }, 3969 // "project": { 3970 // "description": "Project ID of the project that contains the instance.", 3971 // "location": "path", 3972 // "required": true, 3973 // "type": "string" 3974 // } 3975 // }, 3976 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 3977 // "response": { 3978 // "$ref": "Operation" 3979 // }, 3980 // "scopes": [ 3981 // "https://www.googleapis.com/auth/cloud-platform", 3982 // "https://www.googleapis.com/auth/sqlservice.admin" 3983 // ] 3984 // } 3985 3986} 3987 3988// method id "sql.backupRuns.get": 3989 3990type BackupRunsGetCall struct { 3991 s *Service 3992 project string 3993 instance string 3994 id int64 3995 urlParams_ gensupport.URLParams 3996 ifNoneMatch_ string 3997 ctx_ context.Context 3998 header_ http.Header 3999} 4000 4001// Get: Retrieves a resource containing information about a backup run. 4002// 4003// - id: The ID of this Backup Run. 4004// - instance: Cloud SQL instance ID. This does not include the project 4005// ID. 4006// - project: Project ID of the project that contains the instance. 4007func (r *BackupRunsService) Get(project string, instance string, id int64) *BackupRunsGetCall { 4008 c := &BackupRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4009 c.project = project 4010 c.instance = instance 4011 c.id = id 4012 return c 4013} 4014 4015// Fields allows partial responses to be retrieved. See 4016// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4017// for more information. 4018func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall { 4019 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4020 return c 4021} 4022 4023// IfNoneMatch sets the optional parameter which makes the operation 4024// fail if the object's ETag matches the given value. This is useful for 4025// getting updates only after the object has changed since the last 4026// request. Use googleapi.IsNotModified to check whether the response 4027// error from Do is the result of In-None-Match. 4028func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall { 4029 c.ifNoneMatch_ = entityTag 4030 return c 4031} 4032 4033// Context sets the context to be used in this call's Do method. Any 4034// pending HTTP request will be aborted if the provided context is 4035// canceled. 4036func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall { 4037 c.ctx_ = ctx 4038 return c 4039} 4040 4041// Header returns an http.Header that can be modified by the caller to 4042// add HTTP headers to the request. 4043func (c *BackupRunsGetCall) Header() http.Header { 4044 if c.header_ == nil { 4045 c.header_ = make(http.Header) 4046 } 4047 return c.header_ 4048} 4049 4050func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) { 4051 reqHeaders := make(http.Header) 4052 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4053 for k, v := range c.header_ { 4054 reqHeaders[k] = v 4055 } 4056 reqHeaders.Set("User-Agent", c.s.userAgent()) 4057 if c.ifNoneMatch_ != "" { 4058 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4059 } 4060 var body io.Reader = nil 4061 c.urlParams_.Set("alt", alt) 4062 c.urlParams_.Set("prettyPrint", "false") 4063 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}") 4064 urls += "?" + c.urlParams_.Encode() 4065 req, err := http.NewRequest("GET", urls, body) 4066 if err != nil { 4067 return nil, err 4068 } 4069 req.Header = reqHeaders 4070 googleapi.Expand(req.URL, map[string]string{ 4071 "project": c.project, 4072 "instance": c.instance, 4073 "id": strconv.FormatInt(c.id, 10), 4074 }) 4075 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4076} 4077 4078// Do executes the "sql.backupRuns.get" call. 4079// Exactly one of *BackupRun or error will be non-nil. Any non-2xx 4080// status code is an error. Response headers are in either 4081// *BackupRun.ServerResponse.Header or (if a response was returned at 4082// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4083// to check whether the returned error was because 4084// http.StatusNotModified was returned. 4085func (c *BackupRunsGetCall) Do(opts ...googleapi.CallOption) (*BackupRun, error) { 4086 gensupport.SetOptions(c.urlParams_, opts...) 4087 res, err := c.doRequest("json") 4088 if res != nil && res.StatusCode == http.StatusNotModified { 4089 if res.Body != nil { 4090 res.Body.Close() 4091 } 4092 return nil, &googleapi.Error{ 4093 Code: res.StatusCode, 4094 Header: res.Header, 4095 } 4096 } 4097 if err != nil { 4098 return nil, err 4099 } 4100 defer googleapi.CloseBody(res) 4101 if err := googleapi.CheckResponse(res); err != nil { 4102 return nil, err 4103 } 4104 ret := &BackupRun{ 4105 ServerResponse: googleapi.ServerResponse{ 4106 Header: res.Header, 4107 HTTPStatusCode: res.StatusCode, 4108 }, 4109 } 4110 target := &ret 4111 if err := gensupport.DecodeResponse(target, res); err != nil { 4112 return nil, err 4113 } 4114 return ret, nil 4115 // { 4116 // "description": "Retrieves a resource containing information about a backup run.", 4117 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4118 // "httpMethod": "GET", 4119 // "id": "sql.backupRuns.get", 4120 // "parameterOrder": [ 4121 // "project", 4122 // "instance", 4123 // "id" 4124 // ], 4125 // "parameters": { 4126 // "id": { 4127 // "description": "The ID of this Backup Run.", 4128 // "format": "int64", 4129 // "location": "path", 4130 // "required": true, 4131 // "type": "string" 4132 // }, 4133 // "instance": { 4134 // "description": "Cloud SQL instance ID. This does not include the project ID.", 4135 // "location": "path", 4136 // "required": true, 4137 // "type": "string" 4138 // }, 4139 // "project": { 4140 // "description": "Project ID of the project that contains the instance.", 4141 // "location": "path", 4142 // "required": true, 4143 // "type": "string" 4144 // } 4145 // }, 4146 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4147 // "response": { 4148 // "$ref": "BackupRun" 4149 // }, 4150 // "scopes": [ 4151 // "https://www.googleapis.com/auth/cloud-platform", 4152 // "https://www.googleapis.com/auth/sqlservice.admin" 4153 // ] 4154 // } 4155 4156} 4157 4158// method id "sql.backupRuns.insert": 4159 4160type BackupRunsInsertCall struct { 4161 s *Service 4162 project string 4163 instance string 4164 backuprun *BackupRun 4165 urlParams_ gensupport.URLParams 4166 ctx_ context.Context 4167 header_ http.Header 4168} 4169 4170// Insert: Creates a new backup run on demand. This method is applicable 4171// only to Second Generation instances. 4172// 4173// - instance: Cloud SQL instance ID. This does not include the project 4174// ID. 4175// - project: Project ID of the project that contains the instance. 4176func (r *BackupRunsService) Insert(project string, instance string, backuprun *BackupRun) *BackupRunsInsertCall { 4177 c := &BackupRunsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4178 c.project = project 4179 c.instance = instance 4180 c.backuprun = backuprun 4181 return c 4182} 4183 4184// Fields allows partial responses to be retrieved. See 4185// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4186// for more information. 4187func (c *BackupRunsInsertCall) Fields(s ...googleapi.Field) *BackupRunsInsertCall { 4188 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4189 return c 4190} 4191 4192// Context sets the context to be used in this call's Do method. Any 4193// pending HTTP request will be aborted if the provided context is 4194// canceled. 4195func (c *BackupRunsInsertCall) Context(ctx context.Context) *BackupRunsInsertCall { 4196 c.ctx_ = ctx 4197 return c 4198} 4199 4200// Header returns an http.Header that can be modified by the caller to 4201// add HTTP headers to the request. 4202func (c *BackupRunsInsertCall) Header() http.Header { 4203 if c.header_ == nil { 4204 c.header_ = make(http.Header) 4205 } 4206 return c.header_ 4207} 4208 4209func (c *BackupRunsInsertCall) doRequest(alt string) (*http.Response, error) { 4210 reqHeaders := make(http.Header) 4211 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4212 for k, v := range c.header_ { 4213 reqHeaders[k] = v 4214 } 4215 reqHeaders.Set("User-Agent", c.s.userAgent()) 4216 var body io.Reader = nil 4217 body, err := googleapi.WithoutDataWrapper.JSONReader(c.backuprun) 4218 if err != nil { 4219 return nil, err 4220 } 4221 reqHeaders.Set("Content-Type", "application/json") 4222 c.urlParams_.Set("alt", alt) 4223 c.urlParams_.Set("prettyPrint", "false") 4224 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns") 4225 urls += "?" + c.urlParams_.Encode() 4226 req, err := http.NewRequest("POST", urls, body) 4227 if err != nil { 4228 return nil, err 4229 } 4230 req.Header = reqHeaders 4231 googleapi.Expand(req.URL, map[string]string{ 4232 "project": c.project, 4233 "instance": c.instance, 4234 }) 4235 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4236} 4237 4238// Do executes the "sql.backupRuns.insert" call. 4239// Exactly one of *Operation or error will be non-nil. Any non-2xx 4240// status code is an error. Response headers are in either 4241// *Operation.ServerResponse.Header or (if a response was returned at 4242// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4243// to check whether the returned error was because 4244// http.StatusNotModified was returned. 4245func (c *BackupRunsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4246 gensupport.SetOptions(c.urlParams_, opts...) 4247 res, err := c.doRequest("json") 4248 if res != nil && res.StatusCode == http.StatusNotModified { 4249 if res.Body != nil { 4250 res.Body.Close() 4251 } 4252 return nil, &googleapi.Error{ 4253 Code: res.StatusCode, 4254 Header: res.Header, 4255 } 4256 } 4257 if err != nil { 4258 return nil, err 4259 } 4260 defer googleapi.CloseBody(res) 4261 if err := googleapi.CheckResponse(res); err != nil { 4262 return nil, err 4263 } 4264 ret := &Operation{ 4265 ServerResponse: googleapi.ServerResponse{ 4266 Header: res.Header, 4267 HTTPStatusCode: res.StatusCode, 4268 }, 4269 } 4270 target := &ret 4271 if err := gensupport.DecodeResponse(target, res); err != nil { 4272 return nil, err 4273 } 4274 return ret, nil 4275 // { 4276 // "description": "Creates a new backup run on demand. This method is applicable only to Second Generation instances.", 4277 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 4278 // "httpMethod": "POST", 4279 // "id": "sql.backupRuns.insert", 4280 // "parameterOrder": [ 4281 // "project", 4282 // "instance" 4283 // ], 4284 // "parameters": { 4285 // "instance": { 4286 // "description": "Cloud SQL instance ID. This does not include the project ID.", 4287 // "location": "path", 4288 // "required": true, 4289 // "type": "string" 4290 // }, 4291 // "project": { 4292 // "description": "Project ID of the project that contains the instance.", 4293 // "location": "path", 4294 // "required": true, 4295 // "type": "string" 4296 // } 4297 // }, 4298 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 4299 // "request": { 4300 // "$ref": "BackupRun" 4301 // }, 4302 // "response": { 4303 // "$ref": "Operation" 4304 // }, 4305 // "scopes": [ 4306 // "https://www.googleapis.com/auth/cloud-platform", 4307 // "https://www.googleapis.com/auth/sqlservice.admin" 4308 // ] 4309 // } 4310 4311} 4312 4313// method id "sql.backupRuns.list": 4314 4315type BackupRunsListCall struct { 4316 s *Service 4317 project string 4318 instance string 4319 urlParams_ gensupport.URLParams 4320 ifNoneMatch_ string 4321 ctx_ context.Context 4322 header_ http.Header 4323} 4324 4325// List: Lists all backup runs associated with a given instance and 4326// configuration in the reverse chronological order of the backup 4327// initiation time. 4328// 4329// - instance: Cloud SQL instance ID. This does not include the project 4330// ID. 4331// - project: Project ID of the project that contains the instance. 4332func (r *BackupRunsService) List(project string, instance string) *BackupRunsListCall { 4333 c := &BackupRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4334 c.project = project 4335 c.instance = instance 4336 return c 4337} 4338 4339// MaxResults sets the optional parameter "maxResults": Maximum number 4340// of backup runs per response. 4341func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall { 4342 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 4343 return c 4344} 4345 4346// PageToken sets the optional parameter "pageToken": A 4347// previously-returned page token representing part of the larger set of 4348// results to view. 4349func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall { 4350 c.urlParams_.Set("pageToken", pageToken) 4351 return c 4352} 4353 4354// Fields allows partial responses to be retrieved. See 4355// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4356// for more information. 4357func (c *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall { 4358 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4359 return c 4360} 4361 4362// IfNoneMatch sets the optional parameter which makes the operation 4363// fail if the object's ETag matches the given value. This is useful for 4364// getting updates only after the object has changed since the last 4365// request. Use googleapi.IsNotModified to check whether the response 4366// error from Do is the result of In-None-Match. 4367func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall { 4368 c.ifNoneMatch_ = entityTag 4369 return c 4370} 4371 4372// Context sets the context to be used in this call's Do method. Any 4373// pending HTTP request will be aborted if the provided context is 4374// canceled. 4375func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall { 4376 c.ctx_ = ctx 4377 return c 4378} 4379 4380// Header returns an http.Header that can be modified by the caller to 4381// add HTTP headers to the request. 4382func (c *BackupRunsListCall) Header() http.Header { 4383 if c.header_ == nil { 4384 c.header_ = make(http.Header) 4385 } 4386 return c.header_ 4387} 4388 4389func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) { 4390 reqHeaders := make(http.Header) 4391 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4392 for k, v := range c.header_ { 4393 reqHeaders[k] = v 4394 } 4395 reqHeaders.Set("User-Agent", c.s.userAgent()) 4396 if c.ifNoneMatch_ != "" { 4397 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4398 } 4399 var body io.Reader = nil 4400 c.urlParams_.Set("alt", alt) 4401 c.urlParams_.Set("prettyPrint", "false") 4402 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns") 4403 urls += "?" + c.urlParams_.Encode() 4404 req, err := http.NewRequest("GET", urls, body) 4405 if err != nil { 4406 return nil, err 4407 } 4408 req.Header = reqHeaders 4409 googleapi.Expand(req.URL, map[string]string{ 4410 "project": c.project, 4411 "instance": c.instance, 4412 }) 4413 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4414} 4415 4416// Do executes the "sql.backupRuns.list" call. 4417// Exactly one of *BackupRunsListResponse or error will be non-nil. Any 4418// non-2xx status code is an error. Response headers are in either 4419// *BackupRunsListResponse.ServerResponse.Header or (if a response was 4420// returned at all) in error.(*googleapi.Error).Header. Use 4421// googleapi.IsNotModified to check whether the returned error was 4422// because http.StatusNotModified was returned. 4423func (c *BackupRunsListCall) Do(opts ...googleapi.CallOption) (*BackupRunsListResponse, error) { 4424 gensupport.SetOptions(c.urlParams_, opts...) 4425 res, err := c.doRequest("json") 4426 if res != nil && res.StatusCode == http.StatusNotModified { 4427 if res.Body != nil { 4428 res.Body.Close() 4429 } 4430 return nil, &googleapi.Error{ 4431 Code: res.StatusCode, 4432 Header: res.Header, 4433 } 4434 } 4435 if err != nil { 4436 return nil, err 4437 } 4438 defer googleapi.CloseBody(res) 4439 if err := googleapi.CheckResponse(res); err != nil { 4440 return nil, err 4441 } 4442 ret := &BackupRunsListResponse{ 4443 ServerResponse: googleapi.ServerResponse{ 4444 Header: res.Header, 4445 HTTPStatusCode: res.StatusCode, 4446 }, 4447 } 4448 target := &ret 4449 if err := gensupport.DecodeResponse(target, res); err != nil { 4450 return nil, err 4451 } 4452 return ret, nil 4453 // { 4454 // "description": "Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the backup initiation time.", 4455 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 4456 // "httpMethod": "GET", 4457 // "id": "sql.backupRuns.list", 4458 // "parameterOrder": [ 4459 // "project", 4460 // "instance" 4461 // ], 4462 // "parameters": { 4463 // "instance": { 4464 // "description": "Cloud SQL instance ID. This does not include the project ID.", 4465 // "location": "path", 4466 // "required": true, 4467 // "type": "string" 4468 // }, 4469 // "maxResults": { 4470 // "description": "Maximum number of backup runs per response.", 4471 // "format": "int32", 4472 // "location": "query", 4473 // "type": "integer" 4474 // }, 4475 // "pageToken": { 4476 // "description": "A previously-returned page token representing part of the larger set of results to view.", 4477 // "location": "query", 4478 // "type": "string" 4479 // }, 4480 // "project": { 4481 // "description": "Project ID of the project that contains the instance.", 4482 // "location": "path", 4483 // "required": true, 4484 // "type": "string" 4485 // } 4486 // }, 4487 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 4488 // "response": { 4489 // "$ref": "BackupRunsListResponse" 4490 // }, 4491 // "scopes": [ 4492 // "https://www.googleapis.com/auth/cloud-platform", 4493 // "https://www.googleapis.com/auth/sqlservice.admin" 4494 // ] 4495 // } 4496 4497} 4498 4499// Pages invokes f for each page of results. 4500// A non-nil error returned from f will halt the iteration. 4501// The provided context supersedes any context provided to the Context method. 4502func (c *BackupRunsListCall) Pages(ctx context.Context, f func(*BackupRunsListResponse) error) error { 4503 c.ctx_ = ctx 4504 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4505 for { 4506 x, err := c.Do() 4507 if err != nil { 4508 return err 4509 } 4510 if err := f(x); err != nil { 4511 return err 4512 } 4513 if x.NextPageToken == "" { 4514 return nil 4515 } 4516 c.PageToken(x.NextPageToken) 4517 } 4518} 4519 4520// method id "sql.databases.delete": 4521 4522type DatabasesDeleteCall struct { 4523 s *Service 4524 project string 4525 instance string 4526 database string 4527 urlParams_ gensupport.URLParams 4528 ctx_ context.Context 4529 header_ http.Header 4530} 4531 4532// Delete: Deletes a database from a Cloud SQL instance. 4533// 4534// - database: Name of the database to be deleted in the instance. 4535// - instance: Database instance ID. This does not include the project 4536// ID. 4537// - project: Project ID of the project that contains the instance. 4538func (r *DatabasesService) Delete(project string, instance string, database string) *DatabasesDeleteCall { 4539 c := &DatabasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4540 c.project = project 4541 c.instance = instance 4542 c.database = database 4543 return c 4544} 4545 4546// Fields allows partial responses to be retrieved. See 4547// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4548// for more information. 4549func (c *DatabasesDeleteCall) Fields(s ...googleapi.Field) *DatabasesDeleteCall { 4550 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4551 return c 4552} 4553 4554// Context sets the context to be used in this call's Do method. Any 4555// pending HTTP request will be aborted if the provided context is 4556// canceled. 4557func (c *DatabasesDeleteCall) Context(ctx context.Context) *DatabasesDeleteCall { 4558 c.ctx_ = ctx 4559 return c 4560} 4561 4562// Header returns an http.Header that can be modified by the caller to 4563// add HTTP headers to the request. 4564func (c *DatabasesDeleteCall) Header() http.Header { 4565 if c.header_ == nil { 4566 c.header_ = make(http.Header) 4567 } 4568 return c.header_ 4569} 4570 4571func (c *DatabasesDeleteCall) doRequest(alt string) (*http.Response, error) { 4572 reqHeaders := make(http.Header) 4573 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4574 for k, v := range c.header_ { 4575 reqHeaders[k] = v 4576 } 4577 reqHeaders.Set("User-Agent", c.s.userAgent()) 4578 var body io.Reader = nil 4579 c.urlParams_.Set("alt", alt) 4580 c.urlParams_.Set("prettyPrint", "false") 4581 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 4582 urls += "?" + c.urlParams_.Encode() 4583 req, err := http.NewRequest("DELETE", urls, body) 4584 if err != nil { 4585 return nil, err 4586 } 4587 req.Header = reqHeaders 4588 googleapi.Expand(req.URL, map[string]string{ 4589 "project": c.project, 4590 "instance": c.instance, 4591 "database": c.database, 4592 }) 4593 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4594} 4595 4596// Do executes the "sql.databases.delete" call. 4597// Exactly one of *Operation or error will be non-nil. Any non-2xx 4598// status code is an error. Response headers are in either 4599// *Operation.ServerResponse.Header or (if a response was returned at 4600// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4601// to check whether the returned error was because 4602// http.StatusNotModified was returned. 4603func (c *DatabasesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4604 gensupport.SetOptions(c.urlParams_, opts...) 4605 res, err := c.doRequest("json") 4606 if res != nil && res.StatusCode == http.StatusNotModified { 4607 if res.Body != nil { 4608 res.Body.Close() 4609 } 4610 return nil, &googleapi.Error{ 4611 Code: res.StatusCode, 4612 Header: res.Header, 4613 } 4614 } 4615 if err != nil { 4616 return nil, err 4617 } 4618 defer googleapi.CloseBody(res) 4619 if err := googleapi.CheckResponse(res); err != nil { 4620 return nil, err 4621 } 4622 ret := &Operation{ 4623 ServerResponse: googleapi.ServerResponse{ 4624 Header: res.Header, 4625 HTTPStatusCode: res.StatusCode, 4626 }, 4627 } 4628 target := &ret 4629 if err := gensupport.DecodeResponse(target, res); err != nil { 4630 return nil, err 4631 } 4632 return ret, nil 4633 // { 4634 // "description": "Deletes a database from a Cloud SQL instance.", 4635 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 4636 // "httpMethod": "DELETE", 4637 // "id": "sql.databases.delete", 4638 // "parameterOrder": [ 4639 // "project", 4640 // "instance", 4641 // "database" 4642 // ], 4643 // "parameters": { 4644 // "database": { 4645 // "description": "Name of the database to be deleted in the instance.", 4646 // "location": "path", 4647 // "required": true, 4648 // "type": "string" 4649 // }, 4650 // "instance": { 4651 // "description": "Database instance ID. This does not include the project ID.", 4652 // "location": "path", 4653 // "required": true, 4654 // "type": "string" 4655 // }, 4656 // "project": { 4657 // "description": "Project ID of the project that contains the instance.", 4658 // "location": "path", 4659 // "required": true, 4660 // "type": "string" 4661 // } 4662 // }, 4663 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 4664 // "response": { 4665 // "$ref": "Operation" 4666 // }, 4667 // "scopes": [ 4668 // "https://www.googleapis.com/auth/cloud-platform", 4669 // "https://www.googleapis.com/auth/sqlservice.admin" 4670 // ] 4671 // } 4672 4673} 4674 4675// method id "sql.databases.get": 4676 4677type DatabasesGetCall struct { 4678 s *Service 4679 project string 4680 instance string 4681 database string 4682 urlParams_ gensupport.URLParams 4683 ifNoneMatch_ string 4684 ctx_ context.Context 4685 header_ http.Header 4686} 4687 4688// Get: Retrieves a resource containing information about a database 4689// inside a Cloud SQL instance. 4690// 4691// - database: Name of the database in the instance. 4692// - instance: Database instance ID. This does not include the project 4693// ID. 4694// - project: Project ID of the project that contains the instance. 4695func (r *DatabasesService) Get(project string, instance string, database string) *DatabasesGetCall { 4696 c := &DatabasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4697 c.project = project 4698 c.instance = instance 4699 c.database = database 4700 return c 4701} 4702 4703// Fields allows partial responses to be retrieved. See 4704// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4705// for more information. 4706func (c *DatabasesGetCall) Fields(s ...googleapi.Field) *DatabasesGetCall { 4707 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4708 return c 4709} 4710 4711// IfNoneMatch sets the optional parameter which makes the operation 4712// fail if the object's ETag matches the given value. This is useful for 4713// getting updates only after the object has changed since the last 4714// request. Use googleapi.IsNotModified to check whether the response 4715// error from Do is the result of In-None-Match. 4716func (c *DatabasesGetCall) IfNoneMatch(entityTag string) *DatabasesGetCall { 4717 c.ifNoneMatch_ = entityTag 4718 return c 4719} 4720 4721// Context sets the context to be used in this call's Do method. Any 4722// pending HTTP request will be aborted if the provided context is 4723// canceled. 4724func (c *DatabasesGetCall) Context(ctx context.Context) *DatabasesGetCall { 4725 c.ctx_ = ctx 4726 return c 4727} 4728 4729// Header returns an http.Header that can be modified by the caller to 4730// add HTTP headers to the request. 4731func (c *DatabasesGetCall) Header() http.Header { 4732 if c.header_ == nil { 4733 c.header_ = make(http.Header) 4734 } 4735 return c.header_ 4736} 4737 4738func (c *DatabasesGetCall) doRequest(alt string) (*http.Response, error) { 4739 reqHeaders := make(http.Header) 4740 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4741 for k, v := range c.header_ { 4742 reqHeaders[k] = v 4743 } 4744 reqHeaders.Set("User-Agent", c.s.userAgent()) 4745 if c.ifNoneMatch_ != "" { 4746 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4747 } 4748 var body io.Reader = nil 4749 c.urlParams_.Set("alt", alt) 4750 c.urlParams_.Set("prettyPrint", "false") 4751 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 4752 urls += "?" + c.urlParams_.Encode() 4753 req, err := http.NewRequest("GET", urls, body) 4754 if err != nil { 4755 return nil, err 4756 } 4757 req.Header = reqHeaders 4758 googleapi.Expand(req.URL, map[string]string{ 4759 "project": c.project, 4760 "instance": c.instance, 4761 "database": c.database, 4762 }) 4763 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4764} 4765 4766// Do executes the "sql.databases.get" call. 4767// Exactly one of *Database or error will be non-nil. Any non-2xx status 4768// code is an error. Response headers are in either 4769// *Database.ServerResponse.Header or (if a response was returned at 4770// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4771// to check whether the returned error was because 4772// http.StatusNotModified was returned. 4773func (c *DatabasesGetCall) Do(opts ...googleapi.CallOption) (*Database, error) { 4774 gensupport.SetOptions(c.urlParams_, opts...) 4775 res, err := c.doRequest("json") 4776 if res != nil && res.StatusCode == http.StatusNotModified { 4777 if res.Body != nil { 4778 res.Body.Close() 4779 } 4780 return nil, &googleapi.Error{ 4781 Code: res.StatusCode, 4782 Header: res.Header, 4783 } 4784 } 4785 if err != nil { 4786 return nil, err 4787 } 4788 defer googleapi.CloseBody(res) 4789 if err := googleapi.CheckResponse(res); err != nil { 4790 return nil, err 4791 } 4792 ret := &Database{ 4793 ServerResponse: googleapi.ServerResponse{ 4794 Header: res.Header, 4795 HTTPStatusCode: res.StatusCode, 4796 }, 4797 } 4798 target := &ret 4799 if err := gensupport.DecodeResponse(target, res); err != nil { 4800 return nil, err 4801 } 4802 return ret, nil 4803 // { 4804 // "description": "Retrieves a resource containing information about a database inside a Cloud SQL instance.", 4805 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 4806 // "httpMethod": "GET", 4807 // "id": "sql.databases.get", 4808 // "parameterOrder": [ 4809 // "project", 4810 // "instance", 4811 // "database" 4812 // ], 4813 // "parameters": { 4814 // "database": { 4815 // "description": "Name of the database in the instance.", 4816 // "location": "path", 4817 // "required": true, 4818 // "type": "string" 4819 // }, 4820 // "instance": { 4821 // "description": "Database instance ID. This does not include the project ID.", 4822 // "location": "path", 4823 // "required": true, 4824 // "type": "string" 4825 // }, 4826 // "project": { 4827 // "description": "Project ID of the project that contains the instance.", 4828 // "location": "path", 4829 // "required": true, 4830 // "type": "string" 4831 // } 4832 // }, 4833 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 4834 // "response": { 4835 // "$ref": "Database" 4836 // }, 4837 // "scopes": [ 4838 // "https://www.googleapis.com/auth/cloud-platform", 4839 // "https://www.googleapis.com/auth/sqlservice.admin" 4840 // ] 4841 // } 4842 4843} 4844 4845// method id "sql.databases.insert": 4846 4847type DatabasesInsertCall struct { 4848 s *Service 4849 project string 4850 instance string 4851 database *Database 4852 urlParams_ gensupport.URLParams 4853 ctx_ context.Context 4854 header_ http.Header 4855} 4856 4857// Insert: Inserts a resource containing information about a database 4858// inside a Cloud SQL instance. 4859// 4860// - instance: Database instance ID. This does not include the project 4861// ID. 4862// - project: Project ID of the project that contains the instance. 4863func (r *DatabasesService) Insert(project string, instance string, database *Database) *DatabasesInsertCall { 4864 c := &DatabasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4865 c.project = project 4866 c.instance = instance 4867 c.database = database 4868 return c 4869} 4870 4871// Fields allows partial responses to be retrieved. See 4872// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4873// for more information. 4874func (c *DatabasesInsertCall) Fields(s ...googleapi.Field) *DatabasesInsertCall { 4875 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4876 return c 4877} 4878 4879// Context sets the context to be used in this call's Do method. Any 4880// pending HTTP request will be aborted if the provided context is 4881// canceled. 4882func (c *DatabasesInsertCall) Context(ctx context.Context) *DatabasesInsertCall { 4883 c.ctx_ = ctx 4884 return c 4885} 4886 4887// Header returns an http.Header that can be modified by the caller to 4888// add HTTP headers to the request. 4889func (c *DatabasesInsertCall) Header() http.Header { 4890 if c.header_ == nil { 4891 c.header_ = make(http.Header) 4892 } 4893 return c.header_ 4894} 4895 4896func (c *DatabasesInsertCall) doRequest(alt string) (*http.Response, error) { 4897 reqHeaders := make(http.Header) 4898 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4899 for k, v := range c.header_ { 4900 reqHeaders[k] = v 4901 } 4902 reqHeaders.Set("User-Agent", c.s.userAgent()) 4903 var body io.Reader = nil 4904 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database) 4905 if err != nil { 4906 return nil, err 4907 } 4908 reqHeaders.Set("Content-Type", "application/json") 4909 c.urlParams_.Set("alt", alt) 4910 c.urlParams_.Set("prettyPrint", "false") 4911 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases") 4912 urls += "?" + c.urlParams_.Encode() 4913 req, err := http.NewRequest("POST", urls, body) 4914 if err != nil { 4915 return nil, err 4916 } 4917 req.Header = reqHeaders 4918 googleapi.Expand(req.URL, map[string]string{ 4919 "project": c.project, 4920 "instance": c.instance, 4921 }) 4922 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4923} 4924 4925// Do executes the "sql.databases.insert" call. 4926// Exactly one of *Operation or error will be non-nil. Any non-2xx 4927// status code is an error. Response headers are in either 4928// *Operation.ServerResponse.Header or (if a response was returned at 4929// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4930// to check whether the returned error was because 4931// http.StatusNotModified was returned. 4932func (c *DatabasesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4933 gensupport.SetOptions(c.urlParams_, opts...) 4934 res, err := c.doRequest("json") 4935 if res != nil && res.StatusCode == http.StatusNotModified { 4936 if res.Body != nil { 4937 res.Body.Close() 4938 } 4939 return nil, &googleapi.Error{ 4940 Code: res.StatusCode, 4941 Header: res.Header, 4942 } 4943 } 4944 if err != nil { 4945 return nil, err 4946 } 4947 defer googleapi.CloseBody(res) 4948 if err := googleapi.CheckResponse(res); err != nil { 4949 return nil, err 4950 } 4951 ret := &Operation{ 4952 ServerResponse: googleapi.ServerResponse{ 4953 Header: res.Header, 4954 HTTPStatusCode: res.StatusCode, 4955 }, 4956 } 4957 target := &ret 4958 if err := gensupport.DecodeResponse(target, res); err != nil { 4959 return nil, err 4960 } 4961 return ret, nil 4962 // { 4963 // "description": "Inserts a resource containing information about a database inside a Cloud SQL instance.", 4964 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 4965 // "httpMethod": "POST", 4966 // "id": "sql.databases.insert", 4967 // "parameterOrder": [ 4968 // "project", 4969 // "instance" 4970 // ], 4971 // "parameters": { 4972 // "instance": { 4973 // "description": "Database instance ID. This does not include the project ID.", 4974 // "location": "path", 4975 // "required": true, 4976 // "type": "string" 4977 // }, 4978 // "project": { 4979 // "description": "Project ID of the project that contains the instance.", 4980 // "location": "path", 4981 // "required": true, 4982 // "type": "string" 4983 // } 4984 // }, 4985 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 4986 // "request": { 4987 // "$ref": "Database" 4988 // }, 4989 // "response": { 4990 // "$ref": "Operation" 4991 // }, 4992 // "scopes": [ 4993 // "https://www.googleapis.com/auth/cloud-platform", 4994 // "https://www.googleapis.com/auth/sqlservice.admin" 4995 // ] 4996 // } 4997 4998} 4999 5000// method id "sql.databases.list": 5001 5002type DatabasesListCall struct { 5003 s *Service 5004 project string 5005 instance string 5006 urlParams_ gensupport.URLParams 5007 ifNoneMatch_ string 5008 ctx_ context.Context 5009 header_ http.Header 5010} 5011 5012// List: Lists databases in the specified Cloud SQL instance. 5013// 5014// - instance: Cloud SQL instance ID. This does not include the project 5015// ID. 5016// - project: Project ID of the project that contains the instance. 5017func (r *DatabasesService) List(project string, instance string) *DatabasesListCall { 5018 c := &DatabasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5019 c.project = project 5020 c.instance = instance 5021 return c 5022} 5023 5024// Fields allows partial responses to be retrieved. See 5025// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5026// for more information. 5027func (c *DatabasesListCall) Fields(s ...googleapi.Field) *DatabasesListCall { 5028 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5029 return c 5030} 5031 5032// IfNoneMatch sets the optional parameter which makes the operation 5033// fail if the object's ETag matches the given value. This is useful for 5034// getting updates only after the object has changed since the last 5035// request. Use googleapi.IsNotModified to check whether the response 5036// error from Do is the result of In-None-Match. 5037func (c *DatabasesListCall) IfNoneMatch(entityTag string) *DatabasesListCall { 5038 c.ifNoneMatch_ = entityTag 5039 return c 5040} 5041 5042// Context sets the context to be used in this call's Do method. Any 5043// pending HTTP request will be aborted if the provided context is 5044// canceled. 5045func (c *DatabasesListCall) Context(ctx context.Context) *DatabasesListCall { 5046 c.ctx_ = ctx 5047 return c 5048} 5049 5050// Header returns an http.Header that can be modified by the caller to 5051// add HTTP headers to the request. 5052func (c *DatabasesListCall) Header() http.Header { 5053 if c.header_ == nil { 5054 c.header_ = make(http.Header) 5055 } 5056 return c.header_ 5057} 5058 5059func (c *DatabasesListCall) doRequest(alt string) (*http.Response, error) { 5060 reqHeaders := make(http.Header) 5061 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5062 for k, v := range c.header_ { 5063 reqHeaders[k] = v 5064 } 5065 reqHeaders.Set("User-Agent", c.s.userAgent()) 5066 if c.ifNoneMatch_ != "" { 5067 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5068 } 5069 var body io.Reader = nil 5070 c.urlParams_.Set("alt", alt) 5071 c.urlParams_.Set("prettyPrint", "false") 5072 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases") 5073 urls += "?" + c.urlParams_.Encode() 5074 req, err := http.NewRequest("GET", urls, body) 5075 if err != nil { 5076 return nil, err 5077 } 5078 req.Header = reqHeaders 5079 googleapi.Expand(req.URL, map[string]string{ 5080 "project": c.project, 5081 "instance": c.instance, 5082 }) 5083 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5084} 5085 5086// Do executes the "sql.databases.list" call. 5087// Exactly one of *DatabasesListResponse or error will be non-nil. Any 5088// non-2xx status code is an error. Response headers are in either 5089// *DatabasesListResponse.ServerResponse.Header or (if a response was 5090// returned at all) in error.(*googleapi.Error).Header. Use 5091// googleapi.IsNotModified to check whether the returned error was 5092// because http.StatusNotModified was returned. 5093func (c *DatabasesListCall) Do(opts ...googleapi.CallOption) (*DatabasesListResponse, error) { 5094 gensupport.SetOptions(c.urlParams_, opts...) 5095 res, err := c.doRequest("json") 5096 if res != nil && res.StatusCode == http.StatusNotModified { 5097 if res.Body != nil { 5098 res.Body.Close() 5099 } 5100 return nil, &googleapi.Error{ 5101 Code: res.StatusCode, 5102 Header: res.Header, 5103 } 5104 } 5105 if err != nil { 5106 return nil, err 5107 } 5108 defer googleapi.CloseBody(res) 5109 if err := googleapi.CheckResponse(res); err != nil { 5110 return nil, err 5111 } 5112 ret := &DatabasesListResponse{ 5113 ServerResponse: googleapi.ServerResponse{ 5114 Header: res.Header, 5115 HTTPStatusCode: res.StatusCode, 5116 }, 5117 } 5118 target := &ret 5119 if err := gensupport.DecodeResponse(target, res); err != nil { 5120 return nil, err 5121 } 5122 return ret, nil 5123 // { 5124 // "description": "Lists databases in the specified Cloud SQL instance.", 5125 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 5126 // "httpMethod": "GET", 5127 // "id": "sql.databases.list", 5128 // "parameterOrder": [ 5129 // "project", 5130 // "instance" 5131 // ], 5132 // "parameters": { 5133 // "instance": { 5134 // "description": "Cloud SQL instance ID. This does not include the project ID.", 5135 // "location": "path", 5136 // "required": true, 5137 // "type": "string" 5138 // }, 5139 // "project": { 5140 // "description": "Project ID of the project that contains the instance.", 5141 // "location": "path", 5142 // "required": true, 5143 // "type": "string" 5144 // } 5145 // }, 5146 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 5147 // "response": { 5148 // "$ref": "DatabasesListResponse" 5149 // }, 5150 // "scopes": [ 5151 // "https://www.googleapis.com/auth/cloud-platform", 5152 // "https://www.googleapis.com/auth/sqlservice.admin" 5153 // ] 5154 // } 5155 5156} 5157 5158// method id "sql.databases.patch": 5159 5160type DatabasesPatchCall struct { 5161 s *Service 5162 project string 5163 instance string 5164 database string 5165 database2 *Database 5166 urlParams_ gensupport.URLParams 5167 ctx_ context.Context 5168 header_ http.Header 5169} 5170 5171// Patch: Partially updates a resource containing information about a 5172// database inside a Cloud SQL instance. This method supports patch 5173// semantics. 5174// 5175// - database: Name of the database to be updated in the instance. 5176// - instance: Database instance ID. This does not include the project 5177// ID. 5178// - project: Project ID of the project that contains the instance. 5179func (r *DatabasesService) Patch(project string, instance string, database string, database2 *Database) *DatabasesPatchCall { 5180 c := &DatabasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5181 c.project = project 5182 c.instance = instance 5183 c.database = database 5184 c.database2 = database2 5185 return c 5186} 5187 5188// Fields allows partial responses to be retrieved. See 5189// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5190// for more information. 5191func (c *DatabasesPatchCall) Fields(s ...googleapi.Field) *DatabasesPatchCall { 5192 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5193 return c 5194} 5195 5196// Context sets the context to be used in this call's Do method. Any 5197// pending HTTP request will be aborted if the provided context is 5198// canceled. 5199func (c *DatabasesPatchCall) Context(ctx context.Context) *DatabasesPatchCall { 5200 c.ctx_ = ctx 5201 return c 5202} 5203 5204// Header returns an http.Header that can be modified by the caller to 5205// add HTTP headers to the request. 5206func (c *DatabasesPatchCall) Header() http.Header { 5207 if c.header_ == nil { 5208 c.header_ = make(http.Header) 5209 } 5210 return c.header_ 5211} 5212 5213func (c *DatabasesPatchCall) doRequest(alt string) (*http.Response, error) { 5214 reqHeaders := make(http.Header) 5215 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5216 for k, v := range c.header_ { 5217 reqHeaders[k] = v 5218 } 5219 reqHeaders.Set("User-Agent", c.s.userAgent()) 5220 var body io.Reader = nil 5221 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) 5222 if err != nil { 5223 return nil, err 5224 } 5225 reqHeaders.Set("Content-Type", "application/json") 5226 c.urlParams_.Set("alt", alt) 5227 c.urlParams_.Set("prettyPrint", "false") 5228 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 5229 urls += "?" + c.urlParams_.Encode() 5230 req, err := http.NewRequest("PATCH", urls, body) 5231 if err != nil { 5232 return nil, err 5233 } 5234 req.Header = reqHeaders 5235 googleapi.Expand(req.URL, map[string]string{ 5236 "project": c.project, 5237 "instance": c.instance, 5238 "database": c.database, 5239 }) 5240 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5241} 5242 5243// Do executes the "sql.databases.patch" call. 5244// Exactly one of *Operation or error will be non-nil. Any non-2xx 5245// status code is an error. Response headers are in either 5246// *Operation.ServerResponse.Header or (if a response was returned at 5247// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5248// to check whether the returned error was because 5249// http.StatusNotModified was returned. 5250func (c *DatabasesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5251 gensupport.SetOptions(c.urlParams_, opts...) 5252 res, err := c.doRequest("json") 5253 if res != nil && res.StatusCode == http.StatusNotModified { 5254 if res.Body != nil { 5255 res.Body.Close() 5256 } 5257 return nil, &googleapi.Error{ 5258 Code: res.StatusCode, 5259 Header: res.Header, 5260 } 5261 } 5262 if err != nil { 5263 return nil, err 5264 } 5265 defer googleapi.CloseBody(res) 5266 if err := googleapi.CheckResponse(res); err != nil { 5267 return nil, err 5268 } 5269 ret := &Operation{ 5270 ServerResponse: googleapi.ServerResponse{ 5271 Header: res.Header, 5272 HTTPStatusCode: res.StatusCode, 5273 }, 5274 } 5275 target := &ret 5276 if err := gensupport.DecodeResponse(target, res); err != nil { 5277 return nil, err 5278 } 5279 return ret, nil 5280 // { 5281 // "description": "Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.", 5282 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5283 // "httpMethod": "PATCH", 5284 // "id": "sql.databases.patch", 5285 // "parameterOrder": [ 5286 // "project", 5287 // "instance", 5288 // "database" 5289 // ], 5290 // "parameters": { 5291 // "database": { 5292 // "description": "Name of the database to be updated in the instance.", 5293 // "location": "path", 5294 // "required": true, 5295 // "type": "string" 5296 // }, 5297 // "instance": { 5298 // "description": "Database instance ID. This does not include the project ID.", 5299 // "location": "path", 5300 // "required": true, 5301 // "type": "string" 5302 // }, 5303 // "project": { 5304 // "description": "Project ID of the project that contains the instance.", 5305 // "location": "path", 5306 // "required": true, 5307 // "type": "string" 5308 // } 5309 // }, 5310 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5311 // "request": { 5312 // "$ref": "Database" 5313 // }, 5314 // "response": { 5315 // "$ref": "Operation" 5316 // }, 5317 // "scopes": [ 5318 // "https://www.googleapis.com/auth/cloud-platform", 5319 // "https://www.googleapis.com/auth/sqlservice.admin" 5320 // ] 5321 // } 5322 5323} 5324 5325// method id "sql.databases.update": 5326 5327type DatabasesUpdateCall struct { 5328 s *Service 5329 project string 5330 instance string 5331 database string 5332 database2 *Database 5333 urlParams_ gensupport.URLParams 5334 ctx_ context.Context 5335 header_ http.Header 5336} 5337 5338// Update: Updates a resource containing information about a database 5339// inside a Cloud SQL instance. 5340// 5341// - database: Name of the database to be updated in the instance. 5342// - instance: Database instance ID. This does not include the project 5343// ID. 5344// - project: Project ID of the project that contains the instance. 5345func (r *DatabasesService) Update(project string, instance string, database string, database2 *Database) *DatabasesUpdateCall { 5346 c := &DatabasesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5347 c.project = project 5348 c.instance = instance 5349 c.database = database 5350 c.database2 = database2 5351 return c 5352} 5353 5354// Fields allows partial responses to be retrieved. See 5355// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5356// for more information. 5357func (c *DatabasesUpdateCall) Fields(s ...googleapi.Field) *DatabasesUpdateCall { 5358 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5359 return c 5360} 5361 5362// Context sets the context to be used in this call's Do method. Any 5363// pending HTTP request will be aborted if the provided context is 5364// canceled. 5365func (c *DatabasesUpdateCall) Context(ctx context.Context) *DatabasesUpdateCall { 5366 c.ctx_ = ctx 5367 return c 5368} 5369 5370// Header returns an http.Header that can be modified by the caller to 5371// add HTTP headers to the request. 5372func (c *DatabasesUpdateCall) Header() http.Header { 5373 if c.header_ == nil { 5374 c.header_ = make(http.Header) 5375 } 5376 return c.header_ 5377} 5378 5379func (c *DatabasesUpdateCall) doRequest(alt string) (*http.Response, error) { 5380 reqHeaders := make(http.Header) 5381 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5382 for k, v := range c.header_ { 5383 reqHeaders[k] = v 5384 } 5385 reqHeaders.Set("User-Agent", c.s.userAgent()) 5386 var body io.Reader = nil 5387 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) 5388 if err != nil { 5389 return nil, err 5390 } 5391 reqHeaders.Set("Content-Type", "application/json") 5392 c.urlParams_.Set("alt", alt) 5393 c.urlParams_.Set("prettyPrint", "false") 5394 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 5395 urls += "?" + c.urlParams_.Encode() 5396 req, err := http.NewRequest("PUT", urls, body) 5397 if err != nil { 5398 return nil, err 5399 } 5400 req.Header = reqHeaders 5401 googleapi.Expand(req.URL, map[string]string{ 5402 "project": c.project, 5403 "instance": c.instance, 5404 "database": c.database, 5405 }) 5406 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5407} 5408 5409// Do executes the "sql.databases.update" call. 5410// Exactly one of *Operation or error will be non-nil. Any non-2xx 5411// status code is an error. Response headers are in either 5412// *Operation.ServerResponse.Header or (if a response was returned at 5413// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5414// to check whether the returned error was because 5415// http.StatusNotModified was returned. 5416func (c *DatabasesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5417 gensupport.SetOptions(c.urlParams_, opts...) 5418 res, err := c.doRequest("json") 5419 if res != nil && res.StatusCode == http.StatusNotModified { 5420 if res.Body != nil { 5421 res.Body.Close() 5422 } 5423 return nil, &googleapi.Error{ 5424 Code: res.StatusCode, 5425 Header: res.Header, 5426 } 5427 } 5428 if err != nil { 5429 return nil, err 5430 } 5431 defer googleapi.CloseBody(res) 5432 if err := googleapi.CheckResponse(res); err != nil { 5433 return nil, err 5434 } 5435 ret := &Operation{ 5436 ServerResponse: googleapi.ServerResponse{ 5437 Header: res.Header, 5438 HTTPStatusCode: res.StatusCode, 5439 }, 5440 } 5441 target := &ret 5442 if err := gensupport.DecodeResponse(target, res); err != nil { 5443 return nil, err 5444 } 5445 return ret, nil 5446 // { 5447 // "description": "Updates a resource containing information about a database inside a Cloud SQL instance.", 5448 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5449 // "httpMethod": "PUT", 5450 // "id": "sql.databases.update", 5451 // "parameterOrder": [ 5452 // "project", 5453 // "instance", 5454 // "database" 5455 // ], 5456 // "parameters": { 5457 // "database": { 5458 // "description": "Name of the database to be updated in the instance.", 5459 // "location": "path", 5460 // "required": true, 5461 // "type": "string" 5462 // }, 5463 // "instance": { 5464 // "description": "Database instance ID. This does not include the project ID.", 5465 // "location": "path", 5466 // "required": true, 5467 // "type": "string" 5468 // }, 5469 // "project": { 5470 // "description": "Project ID of the project that contains the instance.", 5471 // "location": "path", 5472 // "required": true, 5473 // "type": "string" 5474 // } 5475 // }, 5476 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5477 // "request": { 5478 // "$ref": "Database" 5479 // }, 5480 // "response": { 5481 // "$ref": "Operation" 5482 // }, 5483 // "scopes": [ 5484 // "https://www.googleapis.com/auth/cloud-platform", 5485 // "https://www.googleapis.com/auth/sqlservice.admin" 5486 // ] 5487 // } 5488 5489} 5490 5491// method id "sql.flags.list": 5492 5493type FlagsListCall struct { 5494 s *Service 5495 urlParams_ gensupport.URLParams 5496 ifNoneMatch_ string 5497 ctx_ context.Context 5498 header_ http.Header 5499} 5500 5501// List: List all available database flags for Cloud SQL instances. 5502func (r *FlagsService) List() *FlagsListCall { 5503 c := &FlagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5504 return c 5505} 5506 5507// DatabaseVersion sets the optional parameter "databaseVersion": 5508// Database type and version you want to retrieve flags for. By default, 5509// this method returns flags for all database types and versions. 5510func (c *FlagsListCall) DatabaseVersion(databaseVersion string) *FlagsListCall { 5511 c.urlParams_.Set("databaseVersion", databaseVersion) 5512 return c 5513} 5514 5515// Fields allows partial responses to be retrieved. See 5516// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5517// for more information. 5518func (c *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall { 5519 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5520 return c 5521} 5522 5523// IfNoneMatch sets the optional parameter which makes the operation 5524// fail if the object's ETag matches the given value. This is useful for 5525// getting updates only after the object has changed since the last 5526// request. Use googleapi.IsNotModified to check whether the response 5527// error from Do is the result of In-None-Match. 5528func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall { 5529 c.ifNoneMatch_ = entityTag 5530 return c 5531} 5532 5533// Context sets the context to be used in this call's Do method. Any 5534// pending HTTP request will be aborted if the provided context is 5535// canceled. 5536func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall { 5537 c.ctx_ = ctx 5538 return c 5539} 5540 5541// Header returns an http.Header that can be modified by the caller to 5542// add HTTP headers to the request. 5543func (c *FlagsListCall) Header() http.Header { 5544 if c.header_ == nil { 5545 c.header_ = make(http.Header) 5546 } 5547 return c.header_ 5548} 5549 5550func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) { 5551 reqHeaders := make(http.Header) 5552 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5553 for k, v := range c.header_ { 5554 reqHeaders[k] = v 5555 } 5556 reqHeaders.Set("User-Agent", c.s.userAgent()) 5557 if c.ifNoneMatch_ != "" { 5558 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5559 } 5560 var body io.Reader = nil 5561 c.urlParams_.Set("alt", alt) 5562 c.urlParams_.Set("prettyPrint", "false") 5563 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/flags") 5564 urls += "?" + c.urlParams_.Encode() 5565 req, err := http.NewRequest("GET", urls, body) 5566 if err != nil { 5567 return nil, err 5568 } 5569 req.Header = reqHeaders 5570 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5571} 5572 5573// Do executes the "sql.flags.list" call. 5574// Exactly one of *FlagsListResponse or error will be non-nil. Any 5575// non-2xx status code is an error. Response headers are in either 5576// *FlagsListResponse.ServerResponse.Header or (if a response was 5577// returned at all) in error.(*googleapi.Error).Header. Use 5578// googleapi.IsNotModified to check whether the returned error was 5579// because http.StatusNotModified was returned. 5580func (c *FlagsListCall) Do(opts ...googleapi.CallOption) (*FlagsListResponse, error) { 5581 gensupport.SetOptions(c.urlParams_, opts...) 5582 res, err := c.doRequest("json") 5583 if res != nil && res.StatusCode == http.StatusNotModified { 5584 if res.Body != nil { 5585 res.Body.Close() 5586 } 5587 return nil, &googleapi.Error{ 5588 Code: res.StatusCode, 5589 Header: res.Header, 5590 } 5591 } 5592 if err != nil { 5593 return nil, err 5594 } 5595 defer googleapi.CloseBody(res) 5596 if err := googleapi.CheckResponse(res); err != nil { 5597 return nil, err 5598 } 5599 ret := &FlagsListResponse{ 5600 ServerResponse: googleapi.ServerResponse{ 5601 Header: res.Header, 5602 HTTPStatusCode: res.StatusCode, 5603 }, 5604 } 5605 target := &ret 5606 if err := gensupport.DecodeResponse(target, res); err != nil { 5607 return nil, err 5608 } 5609 return ret, nil 5610 // { 5611 // "description": "List all available database flags for Cloud SQL instances.", 5612 // "flatPath": "sql/v1beta4/flags", 5613 // "httpMethod": "GET", 5614 // "id": "sql.flags.list", 5615 // "parameterOrder": [], 5616 // "parameters": { 5617 // "databaseVersion": { 5618 // "description": "Database type and version you want to retrieve flags for. By default, this method returns flags for all database types and versions.", 5619 // "location": "query", 5620 // "type": "string" 5621 // } 5622 // }, 5623 // "path": "sql/v1beta4/flags", 5624 // "response": { 5625 // "$ref": "FlagsListResponse" 5626 // }, 5627 // "scopes": [ 5628 // "https://www.googleapis.com/auth/cloud-platform", 5629 // "https://www.googleapis.com/auth/sqlservice.admin" 5630 // ] 5631 // } 5632 5633} 5634 5635// method id "sql.instances.addServerCa": 5636 5637type InstancesAddServerCaCall struct { 5638 s *Service 5639 project string 5640 instance string 5641 urlParams_ gensupport.URLParams 5642 ctx_ context.Context 5643 header_ http.Header 5644} 5645 5646// AddServerCa: Add a new trusted Certificate Authority (CA) version for 5647// the specified instance. Required to prepare for a certificate 5648// rotation. If a CA version was previously added but never used in a 5649// certificate rotation, this operation replaces that version. There 5650// cannot be more than one CA version waiting to be rotated in. 5651// 5652// - instance: Cloud SQL instance ID. This does not include the project 5653// ID. 5654// - project: Project ID of the project that contains the instance. 5655func (r *InstancesService) AddServerCa(project string, instance string) *InstancesAddServerCaCall { 5656 c := &InstancesAddServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5657 c.project = project 5658 c.instance = instance 5659 return c 5660} 5661 5662// Fields allows partial responses to be retrieved. See 5663// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5664// for more information. 5665func (c *InstancesAddServerCaCall) Fields(s ...googleapi.Field) *InstancesAddServerCaCall { 5666 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5667 return c 5668} 5669 5670// Context sets the context to be used in this call's Do method. Any 5671// pending HTTP request will be aborted if the provided context is 5672// canceled. 5673func (c *InstancesAddServerCaCall) Context(ctx context.Context) *InstancesAddServerCaCall { 5674 c.ctx_ = ctx 5675 return c 5676} 5677 5678// Header returns an http.Header that can be modified by the caller to 5679// add HTTP headers to the request. 5680func (c *InstancesAddServerCaCall) Header() http.Header { 5681 if c.header_ == nil { 5682 c.header_ = make(http.Header) 5683 } 5684 return c.header_ 5685} 5686 5687func (c *InstancesAddServerCaCall) doRequest(alt string) (*http.Response, error) { 5688 reqHeaders := make(http.Header) 5689 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5690 for k, v := range c.header_ { 5691 reqHeaders[k] = v 5692 } 5693 reqHeaders.Set("User-Agent", c.s.userAgent()) 5694 var body io.Reader = nil 5695 c.urlParams_.Set("alt", alt) 5696 c.urlParams_.Set("prettyPrint", "false") 5697 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa") 5698 urls += "?" + c.urlParams_.Encode() 5699 req, err := http.NewRequest("POST", urls, body) 5700 if err != nil { 5701 return nil, err 5702 } 5703 req.Header = reqHeaders 5704 googleapi.Expand(req.URL, map[string]string{ 5705 "project": c.project, 5706 "instance": c.instance, 5707 }) 5708 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5709} 5710 5711// Do executes the "sql.instances.addServerCa" call. 5712// Exactly one of *Operation or error will be non-nil. Any non-2xx 5713// status code is an error. Response headers are in either 5714// *Operation.ServerResponse.Header or (if a response was returned at 5715// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5716// to check whether the returned error was because 5717// http.StatusNotModified was returned. 5718func (c *InstancesAddServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5719 gensupport.SetOptions(c.urlParams_, opts...) 5720 res, err := c.doRequest("json") 5721 if res != nil && res.StatusCode == http.StatusNotModified { 5722 if res.Body != nil { 5723 res.Body.Close() 5724 } 5725 return nil, &googleapi.Error{ 5726 Code: res.StatusCode, 5727 Header: res.Header, 5728 } 5729 } 5730 if err != nil { 5731 return nil, err 5732 } 5733 defer googleapi.CloseBody(res) 5734 if err := googleapi.CheckResponse(res); err != nil { 5735 return nil, err 5736 } 5737 ret := &Operation{ 5738 ServerResponse: googleapi.ServerResponse{ 5739 Header: res.Header, 5740 HTTPStatusCode: res.StatusCode, 5741 }, 5742 } 5743 target := &ret 5744 if err := gensupport.DecodeResponse(target, res); err != nil { 5745 return nil, err 5746 } 5747 return ret, nil 5748 // { 5749 // "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.", 5750 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa", 5751 // "httpMethod": "POST", 5752 // "id": "sql.instances.addServerCa", 5753 // "parameterOrder": [ 5754 // "project", 5755 // "instance" 5756 // ], 5757 // "parameters": { 5758 // "instance": { 5759 // "description": "Cloud SQL instance ID. This does not include the project ID.", 5760 // "location": "path", 5761 // "required": true, 5762 // "type": "string" 5763 // }, 5764 // "project": { 5765 // "description": "Project ID of the project that contains the instance.", 5766 // "location": "path", 5767 // "required": true, 5768 // "type": "string" 5769 // } 5770 // }, 5771 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa", 5772 // "response": { 5773 // "$ref": "Operation" 5774 // }, 5775 // "scopes": [ 5776 // "https://www.googleapis.com/auth/cloud-platform", 5777 // "https://www.googleapis.com/auth/sqlservice.admin" 5778 // ] 5779 // } 5780 5781} 5782 5783// method id "sql.instances.clone": 5784 5785type InstancesCloneCall struct { 5786 s *Service 5787 project string 5788 instance string 5789 instancesclonerequest *InstancesCloneRequest 5790 urlParams_ gensupport.URLParams 5791 ctx_ context.Context 5792 header_ http.Header 5793} 5794 5795// Clone: Creates a Cloud SQL instance as a clone of the source 5796// instance. Using this operation might cause your instance to restart. 5797// 5798// - instance: The ID of the Cloud SQL instance to be cloned (source). 5799// This does not include the project ID. 5800// - project: Project ID of the source as well as the clone Cloud SQL 5801// instance. 5802func (r *InstancesService) Clone(project string, instance string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall { 5803 c := &InstancesCloneCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5804 c.project = project 5805 c.instance = instance 5806 c.instancesclonerequest = instancesclonerequest 5807 return c 5808} 5809 5810// Fields allows partial responses to be retrieved. See 5811// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5812// for more information. 5813func (c *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall { 5814 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5815 return c 5816} 5817 5818// Context sets the context to be used in this call's Do method. Any 5819// pending HTTP request will be aborted if the provided context is 5820// canceled. 5821func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall { 5822 c.ctx_ = ctx 5823 return c 5824} 5825 5826// Header returns an http.Header that can be modified by the caller to 5827// add HTTP headers to the request. 5828func (c *InstancesCloneCall) Header() http.Header { 5829 if c.header_ == nil { 5830 c.header_ = make(http.Header) 5831 } 5832 return c.header_ 5833} 5834 5835func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, error) { 5836 reqHeaders := make(http.Header) 5837 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5838 for k, v := range c.header_ { 5839 reqHeaders[k] = v 5840 } 5841 reqHeaders.Set("User-Agent", c.s.userAgent()) 5842 var body io.Reader = nil 5843 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest) 5844 if err != nil { 5845 return nil, err 5846 } 5847 reqHeaders.Set("Content-Type", "application/json") 5848 c.urlParams_.Set("alt", alt) 5849 c.urlParams_.Set("prettyPrint", "false") 5850 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/clone") 5851 urls += "?" + c.urlParams_.Encode() 5852 req, err := http.NewRequest("POST", urls, body) 5853 if err != nil { 5854 return nil, err 5855 } 5856 req.Header = reqHeaders 5857 googleapi.Expand(req.URL, map[string]string{ 5858 "project": c.project, 5859 "instance": c.instance, 5860 }) 5861 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5862} 5863 5864// Do executes the "sql.instances.clone" call. 5865// Exactly one of *Operation or error will be non-nil. Any non-2xx 5866// status code is an error. Response headers are in either 5867// *Operation.ServerResponse.Header or (if a response was returned at 5868// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5869// to check whether the returned error was because 5870// http.StatusNotModified was returned. 5871func (c *InstancesCloneCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5872 gensupport.SetOptions(c.urlParams_, opts...) 5873 res, err := c.doRequest("json") 5874 if res != nil && res.StatusCode == http.StatusNotModified { 5875 if res.Body != nil { 5876 res.Body.Close() 5877 } 5878 return nil, &googleapi.Error{ 5879 Code: res.StatusCode, 5880 Header: res.Header, 5881 } 5882 } 5883 if err != nil { 5884 return nil, err 5885 } 5886 defer googleapi.CloseBody(res) 5887 if err := googleapi.CheckResponse(res); err != nil { 5888 return nil, err 5889 } 5890 ret := &Operation{ 5891 ServerResponse: googleapi.ServerResponse{ 5892 Header: res.Header, 5893 HTTPStatusCode: res.StatusCode, 5894 }, 5895 } 5896 target := &ret 5897 if err := gensupport.DecodeResponse(target, res); err != nil { 5898 return nil, err 5899 } 5900 return ret, nil 5901 // { 5902 // "description": "Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.", 5903 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/clone", 5904 // "httpMethod": "POST", 5905 // "id": "sql.instances.clone", 5906 // "parameterOrder": [ 5907 // "project", 5908 // "instance" 5909 // ], 5910 // "parameters": { 5911 // "instance": { 5912 // "description": "The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID.", 5913 // "location": "path", 5914 // "required": true, 5915 // "type": "string" 5916 // }, 5917 // "project": { 5918 // "description": "Project ID of the source as well as the clone Cloud SQL instance.", 5919 // "location": "path", 5920 // "required": true, 5921 // "type": "string" 5922 // } 5923 // }, 5924 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/clone", 5925 // "request": { 5926 // "$ref": "InstancesCloneRequest" 5927 // }, 5928 // "response": { 5929 // "$ref": "Operation" 5930 // }, 5931 // "scopes": [ 5932 // "https://www.googleapis.com/auth/cloud-platform", 5933 // "https://www.googleapis.com/auth/sqlservice.admin" 5934 // ] 5935 // } 5936 5937} 5938 5939// method id "sql.instances.delete": 5940 5941type InstancesDeleteCall struct { 5942 s *Service 5943 project string 5944 instance string 5945 urlParams_ gensupport.URLParams 5946 ctx_ context.Context 5947 header_ http.Header 5948} 5949 5950// Delete: Deletes a Cloud SQL instance. 5951// 5952// - instance: Cloud SQL instance ID. This does not include the project 5953// ID. 5954// - project: Project ID of the project that contains the instance to be 5955// deleted. 5956func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall { 5957 c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5958 c.project = project 5959 c.instance = instance 5960 return c 5961} 5962 5963// Fields allows partial responses to be retrieved. See 5964// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5965// for more information. 5966func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall { 5967 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5968 return c 5969} 5970 5971// Context sets the context to be used in this call's Do method. Any 5972// pending HTTP request will be aborted if the provided context is 5973// canceled. 5974func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall { 5975 c.ctx_ = ctx 5976 return c 5977} 5978 5979// Header returns an http.Header that can be modified by the caller to 5980// add HTTP headers to the request. 5981func (c *InstancesDeleteCall) Header() http.Header { 5982 if c.header_ == nil { 5983 c.header_ = make(http.Header) 5984 } 5985 return c.header_ 5986} 5987 5988func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { 5989 reqHeaders := make(http.Header) 5990 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5991 for k, v := range c.header_ { 5992 reqHeaders[k] = v 5993 } 5994 reqHeaders.Set("User-Agent", c.s.userAgent()) 5995 var body io.Reader = nil 5996 c.urlParams_.Set("alt", alt) 5997 c.urlParams_.Set("prettyPrint", "false") 5998 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 5999 urls += "?" + c.urlParams_.Encode() 6000 req, err := http.NewRequest("DELETE", urls, body) 6001 if err != nil { 6002 return nil, err 6003 } 6004 req.Header = reqHeaders 6005 googleapi.Expand(req.URL, map[string]string{ 6006 "project": c.project, 6007 "instance": c.instance, 6008 }) 6009 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6010} 6011 6012// Do executes the "sql.instances.delete" call. 6013// Exactly one of *Operation or error will be non-nil. Any non-2xx 6014// status code is an error. Response headers are in either 6015// *Operation.ServerResponse.Header or (if a response was returned at 6016// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6017// to check whether the returned error was because 6018// http.StatusNotModified was returned. 6019func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6020 gensupport.SetOptions(c.urlParams_, opts...) 6021 res, err := c.doRequest("json") 6022 if res != nil && res.StatusCode == http.StatusNotModified { 6023 if res.Body != nil { 6024 res.Body.Close() 6025 } 6026 return nil, &googleapi.Error{ 6027 Code: res.StatusCode, 6028 Header: res.Header, 6029 } 6030 } 6031 if err != nil { 6032 return nil, err 6033 } 6034 defer googleapi.CloseBody(res) 6035 if err := googleapi.CheckResponse(res); err != nil { 6036 return nil, err 6037 } 6038 ret := &Operation{ 6039 ServerResponse: googleapi.ServerResponse{ 6040 Header: res.Header, 6041 HTTPStatusCode: res.StatusCode, 6042 }, 6043 } 6044 target := &ret 6045 if err := gensupport.DecodeResponse(target, res); err != nil { 6046 return nil, err 6047 } 6048 return ret, nil 6049 // { 6050 // "description": "Deletes a Cloud SQL instance.", 6051 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 6052 // "httpMethod": "DELETE", 6053 // "id": "sql.instances.delete", 6054 // "parameterOrder": [ 6055 // "project", 6056 // "instance" 6057 // ], 6058 // "parameters": { 6059 // "instance": { 6060 // "description": "Cloud SQL instance ID. This does not include the project ID.", 6061 // "location": "path", 6062 // "required": true, 6063 // "type": "string" 6064 // }, 6065 // "project": { 6066 // "description": "Project ID of the project that contains the instance to be deleted.", 6067 // "location": "path", 6068 // "required": true, 6069 // "type": "string" 6070 // } 6071 // }, 6072 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 6073 // "response": { 6074 // "$ref": "Operation" 6075 // }, 6076 // "scopes": [ 6077 // "https://www.googleapis.com/auth/cloud-platform", 6078 // "https://www.googleapis.com/auth/sqlservice.admin" 6079 // ] 6080 // } 6081 6082} 6083 6084// method id "sql.instances.demoteMaster": 6085 6086type InstancesDemoteMasterCall struct { 6087 s *Service 6088 project string 6089 instance string 6090 instancesdemotemasterrequest *InstancesDemoteMasterRequest 6091 urlParams_ gensupport.URLParams 6092 ctx_ context.Context 6093 header_ http.Header 6094} 6095 6096// DemoteMaster: Demotes the stand-alone instance to be a Cloud SQL read 6097// replica for an external database server. 6098// 6099// - instance: Cloud SQL instance name. 6100// - project: ID of the project that contains the instance. 6101func (r *InstancesService) DemoteMaster(project string, instance string, instancesdemotemasterrequest *InstancesDemoteMasterRequest) *InstancesDemoteMasterCall { 6102 c := &InstancesDemoteMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6103 c.project = project 6104 c.instance = instance 6105 c.instancesdemotemasterrequest = instancesdemotemasterrequest 6106 return c 6107} 6108 6109// Fields allows partial responses to be retrieved. See 6110// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6111// for more information. 6112func (c *InstancesDemoteMasterCall) Fields(s ...googleapi.Field) *InstancesDemoteMasterCall { 6113 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6114 return c 6115} 6116 6117// Context sets the context to be used in this call's Do method. Any 6118// pending HTTP request will be aborted if the provided context is 6119// canceled. 6120func (c *InstancesDemoteMasterCall) Context(ctx context.Context) *InstancesDemoteMasterCall { 6121 c.ctx_ = ctx 6122 return c 6123} 6124 6125// Header returns an http.Header that can be modified by the caller to 6126// add HTTP headers to the request. 6127func (c *InstancesDemoteMasterCall) Header() http.Header { 6128 if c.header_ == nil { 6129 c.header_ = make(http.Header) 6130 } 6131 return c.header_ 6132} 6133 6134func (c *InstancesDemoteMasterCall) doRequest(alt string) (*http.Response, error) { 6135 reqHeaders := make(http.Header) 6136 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6137 for k, v := range c.header_ { 6138 reqHeaders[k] = v 6139 } 6140 reqHeaders.Set("User-Agent", c.s.userAgent()) 6141 var body io.Reader = nil 6142 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesdemotemasterrequest) 6143 if err != nil { 6144 return nil, err 6145 } 6146 reqHeaders.Set("Content-Type", "application/json") 6147 c.urlParams_.Set("alt", alt) 6148 c.urlParams_.Set("prettyPrint", "false") 6149 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster") 6150 urls += "?" + c.urlParams_.Encode() 6151 req, err := http.NewRequest("POST", urls, body) 6152 if err != nil { 6153 return nil, err 6154 } 6155 req.Header = reqHeaders 6156 googleapi.Expand(req.URL, map[string]string{ 6157 "project": c.project, 6158 "instance": c.instance, 6159 }) 6160 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6161} 6162 6163// Do executes the "sql.instances.demoteMaster" call. 6164// Exactly one of *Operation or error will be non-nil. Any non-2xx 6165// status code is an error. Response headers are in either 6166// *Operation.ServerResponse.Header or (if a response was returned at 6167// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6168// to check whether the returned error was because 6169// http.StatusNotModified was returned. 6170func (c *InstancesDemoteMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6171 gensupport.SetOptions(c.urlParams_, opts...) 6172 res, err := c.doRequest("json") 6173 if res != nil && res.StatusCode == http.StatusNotModified { 6174 if res.Body != nil { 6175 res.Body.Close() 6176 } 6177 return nil, &googleapi.Error{ 6178 Code: res.StatusCode, 6179 Header: res.Header, 6180 } 6181 } 6182 if err != nil { 6183 return nil, err 6184 } 6185 defer googleapi.CloseBody(res) 6186 if err := googleapi.CheckResponse(res); err != nil { 6187 return nil, err 6188 } 6189 ret := &Operation{ 6190 ServerResponse: googleapi.ServerResponse{ 6191 Header: res.Header, 6192 HTTPStatusCode: res.StatusCode, 6193 }, 6194 } 6195 target := &ret 6196 if err := gensupport.DecodeResponse(target, res); err != nil { 6197 return nil, err 6198 } 6199 return ret, nil 6200 // { 6201 // "description": "Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.", 6202 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster", 6203 // "httpMethod": "POST", 6204 // "id": "sql.instances.demoteMaster", 6205 // "parameterOrder": [ 6206 // "project", 6207 // "instance" 6208 // ], 6209 // "parameters": { 6210 // "instance": { 6211 // "description": "Cloud SQL instance name.", 6212 // "location": "path", 6213 // "required": true, 6214 // "type": "string" 6215 // }, 6216 // "project": { 6217 // "description": "ID of the project that contains the instance.", 6218 // "location": "path", 6219 // "required": true, 6220 // "type": "string" 6221 // } 6222 // }, 6223 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster", 6224 // "request": { 6225 // "$ref": "InstancesDemoteMasterRequest" 6226 // }, 6227 // "response": { 6228 // "$ref": "Operation" 6229 // }, 6230 // "scopes": [ 6231 // "https://www.googleapis.com/auth/cloud-platform", 6232 // "https://www.googleapis.com/auth/sqlservice.admin" 6233 // ] 6234 // } 6235 6236} 6237 6238// method id "sql.instances.export": 6239 6240type InstancesExportCall struct { 6241 s *Service 6242 project string 6243 instance string 6244 instancesexportrequest *InstancesExportRequest 6245 urlParams_ gensupport.URLParams 6246 ctx_ context.Context 6247 header_ http.Header 6248} 6249 6250// Export: Exports data from a Cloud SQL instance to a Cloud Storage 6251// bucket as a SQL dump or CSV file. 6252// 6253// - instance: Cloud SQL instance ID. This does not include the project 6254// ID. 6255// - project: Project ID of the project that contains the instance to be 6256// exported. 6257func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall { 6258 c := &InstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6259 c.project = project 6260 c.instance = instance 6261 c.instancesexportrequest = instancesexportrequest 6262 return c 6263} 6264 6265// Fields allows partial responses to be retrieved. See 6266// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6267// for more information. 6268func (c *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall { 6269 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6270 return c 6271} 6272 6273// Context sets the context to be used in this call's Do method. Any 6274// pending HTTP request will be aborted if the provided context is 6275// canceled. 6276func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall { 6277 c.ctx_ = ctx 6278 return c 6279} 6280 6281// Header returns an http.Header that can be modified by the caller to 6282// add HTTP headers to the request. 6283func (c *InstancesExportCall) Header() http.Header { 6284 if c.header_ == nil { 6285 c.header_ = make(http.Header) 6286 } 6287 return c.header_ 6288} 6289 6290func (c *InstancesExportCall) doRequest(alt string) (*http.Response, error) { 6291 reqHeaders := make(http.Header) 6292 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6293 for k, v := range c.header_ { 6294 reqHeaders[k] = v 6295 } 6296 reqHeaders.Set("User-Agent", c.s.userAgent()) 6297 var body io.Reader = nil 6298 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest) 6299 if err != nil { 6300 return nil, err 6301 } 6302 reqHeaders.Set("Content-Type", "application/json") 6303 c.urlParams_.Set("alt", alt) 6304 c.urlParams_.Set("prettyPrint", "false") 6305 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/export") 6306 urls += "?" + c.urlParams_.Encode() 6307 req, err := http.NewRequest("POST", urls, body) 6308 if err != nil { 6309 return nil, err 6310 } 6311 req.Header = reqHeaders 6312 googleapi.Expand(req.URL, map[string]string{ 6313 "project": c.project, 6314 "instance": c.instance, 6315 }) 6316 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6317} 6318 6319// Do executes the "sql.instances.export" call. 6320// Exactly one of *Operation or error will be non-nil. Any non-2xx 6321// status code is an error. Response headers are in either 6322// *Operation.ServerResponse.Header or (if a response was returned at 6323// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6324// to check whether the returned error was because 6325// http.StatusNotModified was returned. 6326func (c *InstancesExportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6327 gensupport.SetOptions(c.urlParams_, opts...) 6328 res, err := c.doRequest("json") 6329 if res != nil && res.StatusCode == http.StatusNotModified { 6330 if res.Body != nil { 6331 res.Body.Close() 6332 } 6333 return nil, &googleapi.Error{ 6334 Code: res.StatusCode, 6335 Header: res.Header, 6336 } 6337 } 6338 if err != nil { 6339 return nil, err 6340 } 6341 defer googleapi.CloseBody(res) 6342 if err := googleapi.CheckResponse(res); err != nil { 6343 return nil, err 6344 } 6345 ret := &Operation{ 6346 ServerResponse: googleapi.ServerResponse{ 6347 Header: res.Header, 6348 HTTPStatusCode: res.StatusCode, 6349 }, 6350 } 6351 target := &ret 6352 if err := gensupport.DecodeResponse(target, res); err != nil { 6353 return nil, err 6354 } 6355 return ret, nil 6356 // { 6357 // "description": "Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.", 6358 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/export", 6359 // "httpMethod": "POST", 6360 // "id": "sql.instances.export", 6361 // "parameterOrder": [ 6362 // "project", 6363 // "instance" 6364 // ], 6365 // "parameters": { 6366 // "instance": { 6367 // "description": "Cloud SQL instance ID. This does not include the project ID.", 6368 // "location": "path", 6369 // "required": true, 6370 // "type": "string" 6371 // }, 6372 // "project": { 6373 // "description": "Project ID of the project that contains the instance to be exported.", 6374 // "location": "path", 6375 // "required": true, 6376 // "type": "string" 6377 // } 6378 // }, 6379 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/export", 6380 // "request": { 6381 // "$ref": "InstancesExportRequest" 6382 // }, 6383 // "response": { 6384 // "$ref": "Operation" 6385 // }, 6386 // "scopes": [ 6387 // "https://www.googleapis.com/auth/cloud-platform" 6388 // ] 6389 // } 6390 6391} 6392 6393// method id "sql.instances.failover": 6394 6395type InstancesFailoverCall struct { 6396 s *Service 6397 project string 6398 instance string 6399 instancesfailoverrequest *InstancesFailoverRequest 6400 urlParams_ gensupport.URLParams 6401 ctx_ context.Context 6402 header_ http.Header 6403} 6404 6405// Failover: Failover the instance to its failover replica instance. 6406// Using this operation might cause your instance to restart. 6407// 6408// - instance: Cloud SQL instance ID. This does not include the project 6409// ID. 6410// - project: ID of the project that contains the read replica. 6411func (r *InstancesService) Failover(project string, instance string, instancesfailoverrequest *InstancesFailoverRequest) *InstancesFailoverCall { 6412 c := &InstancesFailoverCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6413 c.project = project 6414 c.instance = instance 6415 c.instancesfailoverrequest = instancesfailoverrequest 6416 return c 6417} 6418 6419// Fields allows partial responses to be retrieved. See 6420// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6421// for more information. 6422func (c *InstancesFailoverCall) Fields(s ...googleapi.Field) *InstancesFailoverCall { 6423 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6424 return c 6425} 6426 6427// Context sets the context to be used in this call's Do method. Any 6428// pending HTTP request will be aborted if the provided context is 6429// canceled. 6430func (c *InstancesFailoverCall) Context(ctx context.Context) *InstancesFailoverCall { 6431 c.ctx_ = ctx 6432 return c 6433} 6434 6435// Header returns an http.Header that can be modified by the caller to 6436// add HTTP headers to the request. 6437func (c *InstancesFailoverCall) Header() http.Header { 6438 if c.header_ == nil { 6439 c.header_ = make(http.Header) 6440 } 6441 return c.header_ 6442} 6443 6444func (c *InstancesFailoverCall) doRequest(alt string) (*http.Response, error) { 6445 reqHeaders := make(http.Header) 6446 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6447 for k, v := range c.header_ { 6448 reqHeaders[k] = v 6449 } 6450 reqHeaders.Set("User-Agent", c.s.userAgent()) 6451 var body io.Reader = nil 6452 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesfailoverrequest) 6453 if err != nil { 6454 return nil, err 6455 } 6456 reqHeaders.Set("Content-Type", "application/json") 6457 c.urlParams_.Set("alt", alt) 6458 c.urlParams_.Set("prettyPrint", "false") 6459 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/failover") 6460 urls += "?" + c.urlParams_.Encode() 6461 req, err := http.NewRequest("POST", urls, body) 6462 if err != nil { 6463 return nil, err 6464 } 6465 req.Header = reqHeaders 6466 googleapi.Expand(req.URL, map[string]string{ 6467 "project": c.project, 6468 "instance": c.instance, 6469 }) 6470 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6471} 6472 6473// Do executes the "sql.instances.failover" call. 6474// Exactly one of *Operation or error will be non-nil. Any non-2xx 6475// status code is an error. Response headers are in either 6476// *Operation.ServerResponse.Header or (if a response was returned at 6477// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6478// to check whether the returned error was because 6479// http.StatusNotModified was returned. 6480func (c *InstancesFailoverCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6481 gensupport.SetOptions(c.urlParams_, opts...) 6482 res, err := c.doRequest("json") 6483 if res != nil && res.StatusCode == http.StatusNotModified { 6484 if res.Body != nil { 6485 res.Body.Close() 6486 } 6487 return nil, &googleapi.Error{ 6488 Code: res.StatusCode, 6489 Header: res.Header, 6490 } 6491 } 6492 if err != nil { 6493 return nil, err 6494 } 6495 defer googleapi.CloseBody(res) 6496 if err := googleapi.CheckResponse(res); err != nil { 6497 return nil, err 6498 } 6499 ret := &Operation{ 6500 ServerResponse: googleapi.ServerResponse{ 6501 Header: res.Header, 6502 HTTPStatusCode: res.StatusCode, 6503 }, 6504 } 6505 target := &ret 6506 if err := gensupport.DecodeResponse(target, res); err != nil { 6507 return nil, err 6508 } 6509 return ret, nil 6510 // { 6511 // "description": "Failover the instance to its failover replica instance. Using this operation might cause your instance to restart.", 6512 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/failover", 6513 // "httpMethod": "POST", 6514 // "id": "sql.instances.failover", 6515 // "parameterOrder": [ 6516 // "project", 6517 // "instance" 6518 // ], 6519 // "parameters": { 6520 // "instance": { 6521 // "description": "Cloud SQL instance ID. This does not include the project ID.", 6522 // "location": "path", 6523 // "required": true, 6524 // "type": "string" 6525 // }, 6526 // "project": { 6527 // "description": "ID of the project that contains the read replica.", 6528 // "location": "path", 6529 // "required": true, 6530 // "type": "string" 6531 // } 6532 // }, 6533 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/failover", 6534 // "request": { 6535 // "$ref": "InstancesFailoverRequest" 6536 // }, 6537 // "response": { 6538 // "$ref": "Operation" 6539 // }, 6540 // "scopes": [ 6541 // "https://www.googleapis.com/auth/cloud-platform", 6542 // "https://www.googleapis.com/auth/sqlservice.admin" 6543 // ] 6544 // } 6545 6546} 6547 6548// method id "sql.instances.get": 6549 6550type InstancesGetCall struct { 6551 s *Service 6552 project string 6553 instance string 6554 urlParams_ gensupport.URLParams 6555 ifNoneMatch_ string 6556 ctx_ context.Context 6557 header_ http.Header 6558} 6559 6560// Get: Retrieves a resource containing information about a Cloud SQL 6561// instance. 6562// 6563// - instance: Database instance ID. This does not include the project 6564// ID. 6565// - project: Project ID of the project that contains the instance. 6566func (r *InstancesService) Get(project string, instance string) *InstancesGetCall { 6567 c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6568 c.project = project 6569 c.instance = instance 6570 return c 6571} 6572 6573// Fields allows partial responses to be retrieved. See 6574// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6575// for more information. 6576func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall { 6577 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6578 return c 6579} 6580 6581// IfNoneMatch sets the optional parameter which makes the operation 6582// fail if the object's ETag matches the given value. This is useful for 6583// getting updates only after the object has changed since the last 6584// request. Use googleapi.IsNotModified to check whether the response 6585// error from Do is the result of In-None-Match. 6586func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall { 6587 c.ifNoneMatch_ = entityTag 6588 return c 6589} 6590 6591// Context sets the context to be used in this call's Do method. Any 6592// pending HTTP request will be aborted if the provided context is 6593// canceled. 6594func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall { 6595 c.ctx_ = ctx 6596 return c 6597} 6598 6599// Header returns an http.Header that can be modified by the caller to 6600// add HTTP headers to the request. 6601func (c *InstancesGetCall) Header() http.Header { 6602 if c.header_ == nil { 6603 c.header_ = make(http.Header) 6604 } 6605 return c.header_ 6606} 6607 6608func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { 6609 reqHeaders := make(http.Header) 6610 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6611 for k, v := range c.header_ { 6612 reqHeaders[k] = v 6613 } 6614 reqHeaders.Set("User-Agent", c.s.userAgent()) 6615 if c.ifNoneMatch_ != "" { 6616 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6617 } 6618 var body io.Reader = nil 6619 c.urlParams_.Set("alt", alt) 6620 c.urlParams_.Set("prettyPrint", "false") 6621 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 6622 urls += "?" + c.urlParams_.Encode() 6623 req, err := http.NewRequest("GET", urls, body) 6624 if err != nil { 6625 return nil, err 6626 } 6627 req.Header = reqHeaders 6628 googleapi.Expand(req.URL, map[string]string{ 6629 "project": c.project, 6630 "instance": c.instance, 6631 }) 6632 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6633} 6634 6635// Do executes the "sql.instances.get" call. 6636// Exactly one of *DatabaseInstance or error will be non-nil. Any 6637// non-2xx status code is an error. Response headers are in either 6638// *DatabaseInstance.ServerResponse.Header or (if a response was 6639// returned at all) in error.(*googleapi.Error).Header. Use 6640// googleapi.IsNotModified to check whether the returned error was 6641// because http.StatusNotModified was returned. 6642func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*DatabaseInstance, error) { 6643 gensupport.SetOptions(c.urlParams_, opts...) 6644 res, err := c.doRequest("json") 6645 if res != nil && res.StatusCode == http.StatusNotModified { 6646 if res.Body != nil { 6647 res.Body.Close() 6648 } 6649 return nil, &googleapi.Error{ 6650 Code: res.StatusCode, 6651 Header: res.Header, 6652 } 6653 } 6654 if err != nil { 6655 return nil, err 6656 } 6657 defer googleapi.CloseBody(res) 6658 if err := googleapi.CheckResponse(res); err != nil { 6659 return nil, err 6660 } 6661 ret := &DatabaseInstance{ 6662 ServerResponse: googleapi.ServerResponse{ 6663 Header: res.Header, 6664 HTTPStatusCode: res.StatusCode, 6665 }, 6666 } 6667 target := &ret 6668 if err := gensupport.DecodeResponse(target, res); err != nil { 6669 return nil, err 6670 } 6671 return ret, nil 6672 // { 6673 // "description": "Retrieves a resource containing information about a Cloud SQL instance.", 6674 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 6675 // "httpMethod": "GET", 6676 // "id": "sql.instances.get", 6677 // "parameterOrder": [ 6678 // "project", 6679 // "instance" 6680 // ], 6681 // "parameters": { 6682 // "instance": { 6683 // "description": "Database instance ID. This does not include the project ID.", 6684 // "location": "path", 6685 // "required": true, 6686 // "type": "string" 6687 // }, 6688 // "project": { 6689 // "description": "Project ID of the project that contains the instance.", 6690 // "location": "path", 6691 // "required": true, 6692 // "type": "string" 6693 // } 6694 // }, 6695 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 6696 // "response": { 6697 // "$ref": "DatabaseInstance" 6698 // }, 6699 // "scopes": [ 6700 // "https://www.googleapis.com/auth/cloud-platform", 6701 // "https://www.googleapis.com/auth/sqlservice.admin" 6702 // ] 6703 // } 6704 6705} 6706 6707// method id "sql.instances.import": 6708 6709type InstancesImportCall struct { 6710 s *Service 6711 project string 6712 instance string 6713 instancesimportrequest *InstancesImportRequest 6714 urlParams_ gensupport.URLParams 6715 ctx_ context.Context 6716 header_ http.Header 6717} 6718 6719// Import: Imports data into a Cloud SQL instance from a SQL dump or CSV 6720// file in Cloud Storage. 6721// 6722// - instance: Cloud SQL instance ID. This does not include the project 6723// ID. 6724// - project: Project ID of the project that contains the instance. 6725func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall { 6726 c := &InstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6727 c.project = project 6728 c.instance = instance 6729 c.instancesimportrequest = instancesimportrequest 6730 return c 6731} 6732 6733// Fields allows partial responses to be retrieved. See 6734// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6735// for more information. 6736func (c *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall { 6737 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6738 return c 6739} 6740 6741// Context sets the context to be used in this call's Do method. Any 6742// pending HTTP request will be aborted if the provided context is 6743// canceled. 6744func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall { 6745 c.ctx_ = ctx 6746 return c 6747} 6748 6749// Header returns an http.Header that can be modified by the caller to 6750// add HTTP headers to the request. 6751func (c *InstancesImportCall) Header() http.Header { 6752 if c.header_ == nil { 6753 c.header_ = make(http.Header) 6754 } 6755 return c.header_ 6756} 6757 6758func (c *InstancesImportCall) doRequest(alt string) (*http.Response, error) { 6759 reqHeaders := make(http.Header) 6760 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6761 for k, v := range c.header_ { 6762 reqHeaders[k] = v 6763 } 6764 reqHeaders.Set("User-Agent", c.s.userAgent()) 6765 var body io.Reader = nil 6766 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest) 6767 if err != nil { 6768 return nil, err 6769 } 6770 reqHeaders.Set("Content-Type", "application/json") 6771 c.urlParams_.Set("alt", alt) 6772 c.urlParams_.Set("prettyPrint", "false") 6773 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/import") 6774 urls += "?" + c.urlParams_.Encode() 6775 req, err := http.NewRequest("POST", urls, body) 6776 if err != nil { 6777 return nil, err 6778 } 6779 req.Header = reqHeaders 6780 googleapi.Expand(req.URL, map[string]string{ 6781 "project": c.project, 6782 "instance": c.instance, 6783 }) 6784 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6785} 6786 6787// Do executes the "sql.instances.import" call. 6788// Exactly one of *Operation or error will be non-nil. Any non-2xx 6789// status code is an error. Response headers are in either 6790// *Operation.ServerResponse.Header or (if a response was returned at 6791// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6792// to check whether the returned error was because 6793// http.StatusNotModified was returned. 6794func (c *InstancesImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6795 gensupport.SetOptions(c.urlParams_, opts...) 6796 res, err := c.doRequest("json") 6797 if res != nil && res.StatusCode == http.StatusNotModified { 6798 if res.Body != nil { 6799 res.Body.Close() 6800 } 6801 return nil, &googleapi.Error{ 6802 Code: res.StatusCode, 6803 Header: res.Header, 6804 } 6805 } 6806 if err != nil { 6807 return nil, err 6808 } 6809 defer googleapi.CloseBody(res) 6810 if err := googleapi.CheckResponse(res); err != nil { 6811 return nil, err 6812 } 6813 ret := &Operation{ 6814 ServerResponse: googleapi.ServerResponse{ 6815 Header: res.Header, 6816 HTTPStatusCode: res.StatusCode, 6817 }, 6818 } 6819 target := &ret 6820 if err := gensupport.DecodeResponse(target, res); err != nil { 6821 return nil, err 6822 } 6823 return ret, nil 6824 // { 6825 // "description": "Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.", 6826 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/import", 6827 // "httpMethod": "POST", 6828 // "id": "sql.instances.import", 6829 // "parameterOrder": [ 6830 // "project", 6831 // "instance" 6832 // ], 6833 // "parameters": { 6834 // "instance": { 6835 // "description": "Cloud SQL instance ID. This does not include the project ID.", 6836 // "location": "path", 6837 // "required": true, 6838 // "type": "string" 6839 // }, 6840 // "project": { 6841 // "description": "Project ID of the project that contains the instance.", 6842 // "location": "path", 6843 // "required": true, 6844 // "type": "string" 6845 // } 6846 // }, 6847 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/import", 6848 // "request": { 6849 // "$ref": "InstancesImportRequest" 6850 // }, 6851 // "response": { 6852 // "$ref": "Operation" 6853 // }, 6854 // "scopes": [ 6855 // "https://www.googleapis.com/auth/cloud-platform" 6856 // ] 6857 // } 6858 6859} 6860 6861// method id "sql.instances.insert": 6862 6863type InstancesInsertCall struct { 6864 s *Service 6865 project string 6866 databaseinstance *DatabaseInstance 6867 urlParams_ gensupport.URLParams 6868 ctx_ context.Context 6869 header_ http.Header 6870} 6871 6872// Insert: Creates a new Cloud SQL instance. 6873// 6874// - project: Project ID of the project to which the newly created Cloud 6875// SQL instances should belong. 6876func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall { 6877 c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6878 c.project = project 6879 c.databaseinstance = databaseinstance 6880 return c 6881} 6882 6883// Fields allows partial responses to be retrieved. See 6884// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6885// for more information. 6886func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall { 6887 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6888 return c 6889} 6890 6891// Context sets the context to be used in this call's Do method. Any 6892// pending HTTP request will be aborted if the provided context is 6893// canceled. 6894func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall { 6895 c.ctx_ = ctx 6896 return c 6897} 6898 6899// Header returns an http.Header that can be modified by the caller to 6900// add HTTP headers to the request. 6901func (c *InstancesInsertCall) Header() http.Header { 6902 if c.header_ == nil { 6903 c.header_ = make(http.Header) 6904 } 6905 return c.header_ 6906} 6907 6908func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) { 6909 reqHeaders := make(http.Header) 6910 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6911 for k, v := range c.header_ { 6912 reqHeaders[k] = v 6913 } 6914 reqHeaders.Set("User-Agent", c.s.userAgent()) 6915 var body io.Reader = nil 6916 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) 6917 if err != nil { 6918 return nil, err 6919 } 6920 reqHeaders.Set("Content-Type", "application/json") 6921 c.urlParams_.Set("alt", alt) 6922 c.urlParams_.Set("prettyPrint", "false") 6923 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances") 6924 urls += "?" + c.urlParams_.Encode() 6925 req, err := http.NewRequest("POST", urls, body) 6926 if err != nil { 6927 return nil, err 6928 } 6929 req.Header = reqHeaders 6930 googleapi.Expand(req.URL, map[string]string{ 6931 "project": c.project, 6932 }) 6933 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6934} 6935 6936// Do executes the "sql.instances.insert" call. 6937// Exactly one of *Operation or error will be non-nil. Any non-2xx 6938// status code is an error. Response headers are in either 6939// *Operation.ServerResponse.Header or (if a response was returned at 6940// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6941// to check whether the returned error was because 6942// http.StatusNotModified was returned. 6943func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6944 gensupport.SetOptions(c.urlParams_, opts...) 6945 res, err := c.doRequest("json") 6946 if res != nil && res.StatusCode == http.StatusNotModified { 6947 if res.Body != nil { 6948 res.Body.Close() 6949 } 6950 return nil, &googleapi.Error{ 6951 Code: res.StatusCode, 6952 Header: res.Header, 6953 } 6954 } 6955 if err != nil { 6956 return nil, err 6957 } 6958 defer googleapi.CloseBody(res) 6959 if err := googleapi.CheckResponse(res); err != nil { 6960 return nil, err 6961 } 6962 ret := &Operation{ 6963 ServerResponse: googleapi.ServerResponse{ 6964 Header: res.Header, 6965 HTTPStatusCode: res.StatusCode, 6966 }, 6967 } 6968 target := &ret 6969 if err := gensupport.DecodeResponse(target, res); err != nil { 6970 return nil, err 6971 } 6972 return ret, nil 6973 // { 6974 // "description": "Creates a new Cloud SQL instance.", 6975 // "flatPath": "sql/v1beta4/projects/{project}/instances", 6976 // "httpMethod": "POST", 6977 // "id": "sql.instances.insert", 6978 // "parameterOrder": [ 6979 // "project" 6980 // ], 6981 // "parameters": { 6982 // "project": { 6983 // "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.", 6984 // "location": "path", 6985 // "required": true, 6986 // "type": "string" 6987 // } 6988 // }, 6989 // "path": "sql/v1beta4/projects/{project}/instances", 6990 // "request": { 6991 // "$ref": "DatabaseInstance" 6992 // }, 6993 // "response": { 6994 // "$ref": "Operation" 6995 // }, 6996 // "scopes": [ 6997 // "https://www.googleapis.com/auth/cloud-platform", 6998 // "https://www.googleapis.com/auth/sqlservice.admin" 6999 // ] 7000 // } 7001 7002} 7003 7004// method id "sql.instances.list": 7005 7006type InstancesListCall struct { 7007 s *Service 7008 project string 7009 urlParams_ gensupport.URLParams 7010 ifNoneMatch_ string 7011 ctx_ context.Context 7012 header_ http.Header 7013} 7014 7015// List: Lists instances under a given project. 7016// 7017// - project: Project ID of the project for which to list Cloud SQL 7018// instances. 7019func (r *InstancesService) List(project string) *InstancesListCall { 7020 c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7021 c.project = project 7022 return c 7023} 7024 7025// Filter sets the optional parameter "filter": A filter expression that 7026// filters resources listed in the response. The expression is in the 7027// form of field:value. For example, 'instanceType:CLOUD_SQL_INSTANCE'. 7028// Fields can be nested as needed as per their JSON representation, such 7029// as 'settings.userLabels.auto_start:true'. Multiple filter queries are 7030// space-separated. For example. 'state:RUNNABLE 7031// instanceType:CLOUD_SQL_INSTANCE'. By default, each expression is an 7032// AND expression. However, you can include AND and OR expressions 7033// explicitly. 7034func (c *InstancesListCall) Filter(filter string) *InstancesListCall { 7035 c.urlParams_.Set("filter", filter) 7036 return c 7037} 7038 7039// MaxResults sets the optional parameter "maxResults": The maximum 7040// number of results to return per response. 7041func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { 7042 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 7043 return c 7044} 7045 7046// PageToken sets the optional parameter "pageToken": A 7047// previously-returned page token representing part of the larger set of 7048// results to view. 7049func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { 7050 c.urlParams_.Set("pageToken", pageToken) 7051 return c 7052} 7053 7054// Fields allows partial responses to be retrieved. See 7055// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7056// for more information. 7057func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall { 7058 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7059 return c 7060} 7061 7062// IfNoneMatch sets the optional parameter which makes the operation 7063// fail if the object's ETag matches the given value. This is useful for 7064// getting updates only after the object has changed since the last 7065// request. Use googleapi.IsNotModified to check whether the response 7066// error from Do is the result of In-None-Match. 7067func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall { 7068 c.ifNoneMatch_ = entityTag 7069 return c 7070} 7071 7072// Context sets the context to be used in this call's Do method. Any 7073// pending HTTP request will be aborted if the provided context is 7074// canceled. 7075func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall { 7076 c.ctx_ = ctx 7077 return c 7078} 7079 7080// Header returns an http.Header that can be modified by the caller to 7081// add HTTP headers to the request. 7082func (c *InstancesListCall) Header() http.Header { 7083 if c.header_ == nil { 7084 c.header_ = make(http.Header) 7085 } 7086 return c.header_ 7087} 7088 7089func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { 7090 reqHeaders := make(http.Header) 7091 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7092 for k, v := range c.header_ { 7093 reqHeaders[k] = v 7094 } 7095 reqHeaders.Set("User-Agent", c.s.userAgent()) 7096 if c.ifNoneMatch_ != "" { 7097 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7098 } 7099 var body io.Reader = nil 7100 c.urlParams_.Set("alt", alt) 7101 c.urlParams_.Set("prettyPrint", "false") 7102 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances") 7103 urls += "?" + c.urlParams_.Encode() 7104 req, err := http.NewRequest("GET", urls, body) 7105 if err != nil { 7106 return nil, err 7107 } 7108 req.Header = reqHeaders 7109 googleapi.Expand(req.URL, map[string]string{ 7110 "project": c.project, 7111 }) 7112 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7113} 7114 7115// Do executes the "sql.instances.list" call. 7116// Exactly one of *InstancesListResponse or error will be non-nil. Any 7117// non-2xx status code is an error. Response headers are in either 7118// *InstancesListResponse.ServerResponse.Header or (if a response was 7119// returned at all) in error.(*googleapi.Error).Header. Use 7120// googleapi.IsNotModified to check whether the returned error was 7121// because http.StatusNotModified was returned. 7122func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstancesListResponse, error) { 7123 gensupport.SetOptions(c.urlParams_, opts...) 7124 res, err := c.doRequest("json") 7125 if res != nil && res.StatusCode == http.StatusNotModified { 7126 if res.Body != nil { 7127 res.Body.Close() 7128 } 7129 return nil, &googleapi.Error{ 7130 Code: res.StatusCode, 7131 Header: res.Header, 7132 } 7133 } 7134 if err != nil { 7135 return nil, err 7136 } 7137 defer googleapi.CloseBody(res) 7138 if err := googleapi.CheckResponse(res); err != nil { 7139 return nil, err 7140 } 7141 ret := &InstancesListResponse{ 7142 ServerResponse: googleapi.ServerResponse{ 7143 Header: res.Header, 7144 HTTPStatusCode: res.StatusCode, 7145 }, 7146 } 7147 target := &ret 7148 if err := gensupport.DecodeResponse(target, res); err != nil { 7149 return nil, err 7150 } 7151 return ret, nil 7152 // { 7153 // "description": "Lists instances under a given project.", 7154 // "flatPath": "sql/v1beta4/projects/{project}/instances", 7155 // "httpMethod": "GET", 7156 // "id": "sql.instances.list", 7157 // "parameterOrder": [ 7158 // "project" 7159 // ], 7160 // "parameters": { 7161 // "filter": { 7162 // "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.", 7163 // "location": "query", 7164 // "type": "string" 7165 // }, 7166 // "maxResults": { 7167 // "description": "The maximum number of results to return per response.", 7168 // "format": "uint32", 7169 // "location": "query", 7170 // "type": "integer" 7171 // }, 7172 // "pageToken": { 7173 // "description": "A previously-returned page token representing part of the larger set of results to view.", 7174 // "location": "query", 7175 // "type": "string" 7176 // }, 7177 // "project": { 7178 // "description": "Project ID of the project for which to list Cloud SQL instances.", 7179 // "location": "path", 7180 // "required": true, 7181 // "type": "string" 7182 // } 7183 // }, 7184 // "path": "sql/v1beta4/projects/{project}/instances", 7185 // "response": { 7186 // "$ref": "InstancesListResponse" 7187 // }, 7188 // "scopes": [ 7189 // "https://www.googleapis.com/auth/cloud-platform", 7190 // "https://www.googleapis.com/auth/sqlservice.admin" 7191 // ] 7192 // } 7193 7194} 7195 7196// Pages invokes f for each page of results. 7197// A non-nil error returned from f will halt the iteration. 7198// The provided context supersedes any context provided to the Context method. 7199func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstancesListResponse) error) error { 7200 c.ctx_ = ctx 7201 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7202 for { 7203 x, err := c.Do() 7204 if err != nil { 7205 return err 7206 } 7207 if err := f(x); err != nil { 7208 return err 7209 } 7210 if x.NextPageToken == "" { 7211 return nil 7212 } 7213 c.PageToken(x.NextPageToken) 7214 } 7215} 7216 7217// method id "sql.instances.listServerCas": 7218 7219type InstancesListServerCasCall struct { 7220 s *Service 7221 project string 7222 instance string 7223 urlParams_ gensupport.URLParams 7224 ifNoneMatch_ string 7225 ctx_ context.Context 7226 header_ http.Header 7227} 7228 7229// ListServerCas: Lists all of the trusted Certificate Authorities (CAs) 7230// for the specified instance. There can be up to three CAs listed: the 7231// CA that was used to sign the certificate that is currently in use, a 7232// CA that has been added but not yet used to sign a certificate, and a 7233// CA used to sign a certificate that has previously rotated out. 7234// 7235// - instance: Cloud SQL instance ID. This does not include the project 7236// ID. 7237// - project: Project ID of the project that contains the instance. 7238func (r *InstancesService) ListServerCas(project string, instance string) *InstancesListServerCasCall { 7239 c := &InstancesListServerCasCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7240 c.project = project 7241 c.instance = instance 7242 return c 7243} 7244 7245// Fields allows partial responses to be retrieved. See 7246// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7247// for more information. 7248func (c *InstancesListServerCasCall) Fields(s ...googleapi.Field) *InstancesListServerCasCall { 7249 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7250 return c 7251} 7252 7253// IfNoneMatch sets the optional parameter which makes the operation 7254// fail if the object's ETag matches the given value. This is useful for 7255// getting updates only after the object has changed since the last 7256// request. Use googleapi.IsNotModified to check whether the response 7257// error from Do is the result of In-None-Match. 7258func (c *InstancesListServerCasCall) IfNoneMatch(entityTag string) *InstancesListServerCasCall { 7259 c.ifNoneMatch_ = entityTag 7260 return c 7261} 7262 7263// Context sets the context to be used in this call's Do method. Any 7264// pending HTTP request will be aborted if the provided context is 7265// canceled. 7266func (c *InstancesListServerCasCall) Context(ctx context.Context) *InstancesListServerCasCall { 7267 c.ctx_ = ctx 7268 return c 7269} 7270 7271// Header returns an http.Header that can be modified by the caller to 7272// add HTTP headers to the request. 7273func (c *InstancesListServerCasCall) Header() http.Header { 7274 if c.header_ == nil { 7275 c.header_ = make(http.Header) 7276 } 7277 return c.header_ 7278} 7279 7280func (c *InstancesListServerCasCall) doRequest(alt string) (*http.Response, error) { 7281 reqHeaders := make(http.Header) 7282 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7283 for k, v := range c.header_ { 7284 reqHeaders[k] = v 7285 } 7286 reqHeaders.Set("User-Agent", c.s.userAgent()) 7287 if c.ifNoneMatch_ != "" { 7288 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7289 } 7290 var body io.Reader = nil 7291 c.urlParams_.Set("alt", alt) 7292 c.urlParams_.Set("prettyPrint", "false") 7293 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas") 7294 urls += "?" + c.urlParams_.Encode() 7295 req, err := http.NewRequest("GET", urls, body) 7296 if err != nil { 7297 return nil, err 7298 } 7299 req.Header = reqHeaders 7300 googleapi.Expand(req.URL, map[string]string{ 7301 "project": c.project, 7302 "instance": c.instance, 7303 }) 7304 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7305} 7306 7307// Do executes the "sql.instances.listServerCas" call. 7308// Exactly one of *InstancesListServerCasResponse or error will be 7309// non-nil. Any non-2xx status code is an error. Response headers are in 7310// either *InstancesListServerCasResponse.ServerResponse.Header or (if a 7311// response was returned at all) in error.(*googleapi.Error).Header. Use 7312// googleapi.IsNotModified to check whether the returned error was 7313// because http.StatusNotModified was returned. 7314func (c *InstancesListServerCasCall) Do(opts ...googleapi.CallOption) (*InstancesListServerCasResponse, error) { 7315 gensupport.SetOptions(c.urlParams_, opts...) 7316 res, err := c.doRequest("json") 7317 if res != nil && res.StatusCode == http.StatusNotModified { 7318 if res.Body != nil { 7319 res.Body.Close() 7320 } 7321 return nil, &googleapi.Error{ 7322 Code: res.StatusCode, 7323 Header: res.Header, 7324 } 7325 } 7326 if err != nil { 7327 return nil, err 7328 } 7329 defer googleapi.CloseBody(res) 7330 if err := googleapi.CheckResponse(res); err != nil { 7331 return nil, err 7332 } 7333 ret := &InstancesListServerCasResponse{ 7334 ServerResponse: googleapi.ServerResponse{ 7335 Header: res.Header, 7336 HTTPStatusCode: res.StatusCode, 7337 }, 7338 } 7339 target := &ret 7340 if err := gensupport.DecodeResponse(target, res); err != nil { 7341 return nil, err 7342 } 7343 return ret, nil 7344 // { 7345 // "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.", 7346 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas", 7347 // "httpMethod": "GET", 7348 // "id": "sql.instances.listServerCas", 7349 // "parameterOrder": [ 7350 // "project", 7351 // "instance" 7352 // ], 7353 // "parameters": { 7354 // "instance": { 7355 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7356 // "location": "path", 7357 // "required": true, 7358 // "type": "string" 7359 // }, 7360 // "project": { 7361 // "description": "Project ID of the project that contains the instance.", 7362 // "location": "path", 7363 // "required": true, 7364 // "type": "string" 7365 // } 7366 // }, 7367 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas", 7368 // "response": { 7369 // "$ref": "InstancesListServerCasResponse" 7370 // }, 7371 // "scopes": [ 7372 // "https://www.googleapis.com/auth/cloud-platform", 7373 // "https://www.googleapis.com/auth/sqlservice.admin" 7374 // ] 7375 // } 7376 7377} 7378 7379// method id "sql.instances.patch": 7380 7381type InstancesPatchCall struct { 7382 s *Service 7383 project string 7384 instance string 7385 databaseinstance *DatabaseInstance 7386 urlParams_ gensupport.URLParams 7387 ctx_ context.Context 7388 header_ http.Header 7389} 7390 7391// Patch: Updates settings of a Cloud SQL instance. This method supports 7392// patch semantics. 7393// 7394// - instance: Cloud SQL instance ID. This does not include the project 7395// ID. 7396// - project: Project ID of the project that contains the instance. 7397func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall { 7398 c := &InstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7399 c.project = project 7400 c.instance = instance 7401 c.databaseinstance = databaseinstance 7402 return c 7403} 7404 7405// Fields allows partial responses to be retrieved. See 7406// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7407// for more information. 7408func (c *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall { 7409 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7410 return c 7411} 7412 7413// Context sets the context to be used in this call's Do method. Any 7414// pending HTTP request will be aborted if the provided context is 7415// canceled. 7416func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall { 7417 c.ctx_ = ctx 7418 return c 7419} 7420 7421// Header returns an http.Header that can be modified by the caller to 7422// add HTTP headers to the request. 7423func (c *InstancesPatchCall) Header() http.Header { 7424 if c.header_ == nil { 7425 c.header_ = make(http.Header) 7426 } 7427 return c.header_ 7428} 7429 7430func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, error) { 7431 reqHeaders := make(http.Header) 7432 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7433 for k, v := range c.header_ { 7434 reqHeaders[k] = v 7435 } 7436 reqHeaders.Set("User-Agent", c.s.userAgent()) 7437 var body io.Reader = nil 7438 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) 7439 if err != nil { 7440 return nil, err 7441 } 7442 reqHeaders.Set("Content-Type", "application/json") 7443 c.urlParams_.Set("alt", alt) 7444 c.urlParams_.Set("prettyPrint", "false") 7445 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 7446 urls += "?" + c.urlParams_.Encode() 7447 req, err := http.NewRequest("PATCH", urls, body) 7448 if err != nil { 7449 return nil, err 7450 } 7451 req.Header = reqHeaders 7452 googleapi.Expand(req.URL, map[string]string{ 7453 "project": c.project, 7454 "instance": c.instance, 7455 }) 7456 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7457} 7458 7459// Do executes the "sql.instances.patch" call. 7460// Exactly one of *Operation or error will be non-nil. Any non-2xx 7461// status code is an error. Response headers are in either 7462// *Operation.ServerResponse.Header or (if a response was returned at 7463// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7464// to check whether the returned error was because 7465// http.StatusNotModified was returned. 7466func (c *InstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7467 gensupport.SetOptions(c.urlParams_, opts...) 7468 res, err := c.doRequest("json") 7469 if res != nil && res.StatusCode == http.StatusNotModified { 7470 if res.Body != nil { 7471 res.Body.Close() 7472 } 7473 return nil, &googleapi.Error{ 7474 Code: res.StatusCode, 7475 Header: res.Header, 7476 } 7477 } 7478 if err != nil { 7479 return nil, err 7480 } 7481 defer googleapi.CloseBody(res) 7482 if err := googleapi.CheckResponse(res); err != nil { 7483 return nil, err 7484 } 7485 ret := &Operation{ 7486 ServerResponse: googleapi.ServerResponse{ 7487 Header: res.Header, 7488 HTTPStatusCode: res.StatusCode, 7489 }, 7490 } 7491 target := &ret 7492 if err := gensupport.DecodeResponse(target, res); err != nil { 7493 return nil, err 7494 } 7495 return ret, nil 7496 // { 7497 // "description": "Updates settings of a Cloud SQL instance. This method supports patch semantics.", 7498 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 7499 // "httpMethod": "PATCH", 7500 // "id": "sql.instances.patch", 7501 // "parameterOrder": [ 7502 // "project", 7503 // "instance" 7504 // ], 7505 // "parameters": { 7506 // "instance": { 7507 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7508 // "location": "path", 7509 // "required": true, 7510 // "type": "string" 7511 // }, 7512 // "project": { 7513 // "description": "Project ID of the project that contains the instance.", 7514 // "location": "path", 7515 // "required": true, 7516 // "type": "string" 7517 // } 7518 // }, 7519 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 7520 // "request": { 7521 // "$ref": "DatabaseInstance" 7522 // }, 7523 // "response": { 7524 // "$ref": "Operation" 7525 // }, 7526 // "scopes": [ 7527 // "https://www.googleapis.com/auth/cloud-platform", 7528 // "https://www.googleapis.com/auth/sqlservice.admin" 7529 // ] 7530 // } 7531 7532} 7533 7534// method id "sql.instances.promoteReplica": 7535 7536type InstancesPromoteReplicaCall struct { 7537 s *Service 7538 project string 7539 instance string 7540 urlParams_ gensupport.URLParams 7541 ctx_ context.Context 7542 header_ http.Header 7543} 7544 7545// PromoteReplica: Promotes the read replica instance to be a 7546// stand-alone Cloud SQL instance. Using this operation might cause your 7547// instance to restart. 7548// 7549// - instance: Cloud SQL read replica instance name. 7550// - project: ID of the project that contains the read replica. 7551func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall { 7552 c := &InstancesPromoteReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7553 c.project = project 7554 c.instance = instance 7555 return c 7556} 7557 7558// Fields allows partial responses to be retrieved. See 7559// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7560// for more information. 7561func (c *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall { 7562 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7563 return c 7564} 7565 7566// Context sets the context to be used in this call's Do method. Any 7567// pending HTTP request will be aborted if the provided context is 7568// canceled. 7569func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall { 7570 c.ctx_ = ctx 7571 return c 7572} 7573 7574// Header returns an http.Header that can be modified by the caller to 7575// add HTTP headers to the request. 7576func (c *InstancesPromoteReplicaCall) Header() http.Header { 7577 if c.header_ == nil { 7578 c.header_ = make(http.Header) 7579 } 7580 return c.header_ 7581} 7582 7583func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) { 7584 reqHeaders := make(http.Header) 7585 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7586 for k, v := range c.header_ { 7587 reqHeaders[k] = v 7588 } 7589 reqHeaders.Set("User-Agent", c.s.userAgent()) 7590 var body io.Reader = nil 7591 c.urlParams_.Set("alt", alt) 7592 c.urlParams_.Set("prettyPrint", "false") 7593 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica") 7594 urls += "?" + c.urlParams_.Encode() 7595 req, err := http.NewRequest("POST", urls, body) 7596 if err != nil { 7597 return nil, err 7598 } 7599 req.Header = reqHeaders 7600 googleapi.Expand(req.URL, map[string]string{ 7601 "project": c.project, 7602 "instance": c.instance, 7603 }) 7604 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7605} 7606 7607// Do executes the "sql.instances.promoteReplica" call. 7608// Exactly one of *Operation or error will be non-nil. Any non-2xx 7609// status code is an error. Response headers are in either 7610// *Operation.ServerResponse.Header or (if a response was returned at 7611// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7612// to check whether the returned error was because 7613// http.StatusNotModified was returned. 7614func (c *InstancesPromoteReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7615 gensupport.SetOptions(c.urlParams_, opts...) 7616 res, err := c.doRequest("json") 7617 if res != nil && res.StatusCode == http.StatusNotModified { 7618 if res.Body != nil { 7619 res.Body.Close() 7620 } 7621 return nil, &googleapi.Error{ 7622 Code: res.StatusCode, 7623 Header: res.Header, 7624 } 7625 } 7626 if err != nil { 7627 return nil, err 7628 } 7629 defer googleapi.CloseBody(res) 7630 if err := googleapi.CheckResponse(res); err != nil { 7631 return nil, err 7632 } 7633 ret := &Operation{ 7634 ServerResponse: googleapi.ServerResponse{ 7635 Header: res.Header, 7636 HTTPStatusCode: res.StatusCode, 7637 }, 7638 } 7639 target := &ret 7640 if err := gensupport.DecodeResponse(target, res); err != nil { 7641 return nil, err 7642 } 7643 return ret, nil 7644 // { 7645 // "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance. Using this operation might cause your instance to restart.", 7646 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica", 7647 // "httpMethod": "POST", 7648 // "id": "sql.instances.promoteReplica", 7649 // "parameterOrder": [ 7650 // "project", 7651 // "instance" 7652 // ], 7653 // "parameters": { 7654 // "instance": { 7655 // "description": "Cloud SQL read replica instance name.", 7656 // "location": "path", 7657 // "required": true, 7658 // "type": "string" 7659 // }, 7660 // "project": { 7661 // "description": "ID of the project that contains the read replica.", 7662 // "location": "path", 7663 // "required": true, 7664 // "type": "string" 7665 // } 7666 // }, 7667 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica", 7668 // "response": { 7669 // "$ref": "Operation" 7670 // }, 7671 // "scopes": [ 7672 // "https://www.googleapis.com/auth/cloud-platform", 7673 // "https://www.googleapis.com/auth/sqlservice.admin" 7674 // ] 7675 // } 7676 7677} 7678 7679// method id "sql.instances.resetSslConfig": 7680 7681type InstancesResetSslConfigCall struct { 7682 s *Service 7683 project string 7684 instance string 7685 urlParams_ gensupport.URLParams 7686 ctx_ context.Context 7687 header_ http.Header 7688} 7689 7690// ResetSslConfig: Deletes all client certificates and generates a new 7691// server SSL certificate for the instance. 7692// 7693// - instance: Cloud SQL instance ID. This does not include the project 7694// ID. 7695// - project: Project ID of the project that contains the instance. 7696func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall { 7697 c := &InstancesResetSslConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7698 c.project = project 7699 c.instance = instance 7700 return c 7701} 7702 7703// Fields allows partial responses to be retrieved. See 7704// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7705// for more information. 7706func (c *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall { 7707 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7708 return c 7709} 7710 7711// Context sets the context to be used in this call's Do method. Any 7712// pending HTTP request will be aborted if the provided context is 7713// canceled. 7714func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall { 7715 c.ctx_ = ctx 7716 return c 7717} 7718 7719// Header returns an http.Header that can be modified by the caller to 7720// add HTTP headers to the request. 7721func (c *InstancesResetSslConfigCall) Header() http.Header { 7722 if c.header_ == nil { 7723 c.header_ = make(http.Header) 7724 } 7725 return c.header_ 7726} 7727 7728func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) { 7729 reqHeaders := make(http.Header) 7730 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7731 for k, v := range c.header_ { 7732 reqHeaders[k] = v 7733 } 7734 reqHeaders.Set("User-Agent", c.s.userAgent()) 7735 var body io.Reader = nil 7736 c.urlParams_.Set("alt", alt) 7737 c.urlParams_.Set("prettyPrint", "false") 7738 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig") 7739 urls += "?" + c.urlParams_.Encode() 7740 req, err := http.NewRequest("POST", urls, body) 7741 if err != nil { 7742 return nil, err 7743 } 7744 req.Header = reqHeaders 7745 googleapi.Expand(req.URL, map[string]string{ 7746 "project": c.project, 7747 "instance": c.instance, 7748 }) 7749 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7750} 7751 7752// Do executes the "sql.instances.resetSslConfig" call. 7753// Exactly one of *Operation or error will be non-nil. Any non-2xx 7754// status code is an error. Response headers are in either 7755// *Operation.ServerResponse.Header or (if a response was returned at 7756// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7757// to check whether the returned error was because 7758// http.StatusNotModified was returned. 7759func (c *InstancesResetSslConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7760 gensupport.SetOptions(c.urlParams_, opts...) 7761 res, err := c.doRequest("json") 7762 if res != nil && res.StatusCode == http.StatusNotModified { 7763 if res.Body != nil { 7764 res.Body.Close() 7765 } 7766 return nil, &googleapi.Error{ 7767 Code: res.StatusCode, 7768 Header: res.Header, 7769 } 7770 } 7771 if err != nil { 7772 return nil, err 7773 } 7774 defer googleapi.CloseBody(res) 7775 if err := googleapi.CheckResponse(res); err != nil { 7776 return nil, err 7777 } 7778 ret := &Operation{ 7779 ServerResponse: googleapi.ServerResponse{ 7780 Header: res.Header, 7781 HTTPStatusCode: res.StatusCode, 7782 }, 7783 } 7784 target := &ret 7785 if err := gensupport.DecodeResponse(target, res); err != nil { 7786 return nil, err 7787 } 7788 return ret, nil 7789 // { 7790 // "description": "Deletes all client certificates and generates a new server SSL certificate for the instance.", 7791 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig", 7792 // "httpMethod": "POST", 7793 // "id": "sql.instances.resetSslConfig", 7794 // "parameterOrder": [ 7795 // "project", 7796 // "instance" 7797 // ], 7798 // "parameters": { 7799 // "instance": { 7800 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7801 // "location": "path", 7802 // "required": true, 7803 // "type": "string" 7804 // }, 7805 // "project": { 7806 // "description": "Project ID of the project that contains the instance.", 7807 // "location": "path", 7808 // "required": true, 7809 // "type": "string" 7810 // } 7811 // }, 7812 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig", 7813 // "response": { 7814 // "$ref": "Operation" 7815 // }, 7816 // "scopes": [ 7817 // "https://www.googleapis.com/auth/cloud-platform", 7818 // "https://www.googleapis.com/auth/sqlservice.admin" 7819 // ] 7820 // } 7821 7822} 7823 7824// method id "sql.instances.restart": 7825 7826type InstancesRestartCall struct { 7827 s *Service 7828 project string 7829 instance string 7830 urlParams_ gensupport.URLParams 7831 ctx_ context.Context 7832 header_ http.Header 7833} 7834 7835// Restart: Restarts a Cloud SQL instance. 7836// 7837// - instance: Cloud SQL instance ID. This does not include the project 7838// ID. 7839// - project: Project ID of the project that contains the instance to be 7840// restarted. 7841func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall { 7842 c := &InstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7843 c.project = project 7844 c.instance = instance 7845 return c 7846} 7847 7848// Fields allows partial responses to be retrieved. See 7849// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7850// for more information. 7851func (c *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall { 7852 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7853 return c 7854} 7855 7856// Context sets the context to be used in this call's Do method. Any 7857// pending HTTP request will be aborted if the provided context is 7858// canceled. 7859func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall { 7860 c.ctx_ = ctx 7861 return c 7862} 7863 7864// Header returns an http.Header that can be modified by the caller to 7865// add HTTP headers to the request. 7866func (c *InstancesRestartCall) Header() http.Header { 7867 if c.header_ == nil { 7868 c.header_ = make(http.Header) 7869 } 7870 return c.header_ 7871} 7872 7873func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) { 7874 reqHeaders := make(http.Header) 7875 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7876 for k, v := range c.header_ { 7877 reqHeaders[k] = v 7878 } 7879 reqHeaders.Set("User-Agent", c.s.userAgent()) 7880 var body io.Reader = nil 7881 c.urlParams_.Set("alt", alt) 7882 c.urlParams_.Set("prettyPrint", "false") 7883 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/restart") 7884 urls += "?" + c.urlParams_.Encode() 7885 req, err := http.NewRequest("POST", urls, body) 7886 if err != nil { 7887 return nil, err 7888 } 7889 req.Header = reqHeaders 7890 googleapi.Expand(req.URL, map[string]string{ 7891 "project": c.project, 7892 "instance": c.instance, 7893 }) 7894 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7895} 7896 7897// Do executes the "sql.instances.restart" call. 7898// Exactly one of *Operation or error will be non-nil. Any non-2xx 7899// status code is an error. Response headers are in either 7900// *Operation.ServerResponse.Header or (if a response was returned at 7901// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7902// to check whether the returned error was because 7903// http.StatusNotModified was returned. 7904func (c *InstancesRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7905 gensupport.SetOptions(c.urlParams_, opts...) 7906 res, err := c.doRequest("json") 7907 if res != nil && res.StatusCode == http.StatusNotModified { 7908 if res.Body != nil { 7909 res.Body.Close() 7910 } 7911 return nil, &googleapi.Error{ 7912 Code: res.StatusCode, 7913 Header: res.Header, 7914 } 7915 } 7916 if err != nil { 7917 return nil, err 7918 } 7919 defer googleapi.CloseBody(res) 7920 if err := googleapi.CheckResponse(res); err != nil { 7921 return nil, err 7922 } 7923 ret := &Operation{ 7924 ServerResponse: googleapi.ServerResponse{ 7925 Header: res.Header, 7926 HTTPStatusCode: res.StatusCode, 7927 }, 7928 } 7929 target := &ret 7930 if err := gensupport.DecodeResponse(target, res); err != nil { 7931 return nil, err 7932 } 7933 return ret, nil 7934 // { 7935 // "description": "Restarts a Cloud SQL instance.", 7936 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/restart", 7937 // "httpMethod": "POST", 7938 // "id": "sql.instances.restart", 7939 // "parameterOrder": [ 7940 // "project", 7941 // "instance" 7942 // ], 7943 // "parameters": { 7944 // "instance": { 7945 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7946 // "location": "path", 7947 // "required": true, 7948 // "type": "string" 7949 // }, 7950 // "project": { 7951 // "description": "Project ID of the project that contains the instance to be restarted.", 7952 // "location": "path", 7953 // "required": true, 7954 // "type": "string" 7955 // } 7956 // }, 7957 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/restart", 7958 // "response": { 7959 // "$ref": "Operation" 7960 // }, 7961 // "scopes": [ 7962 // "https://www.googleapis.com/auth/cloud-platform", 7963 // "https://www.googleapis.com/auth/sqlservice.admin" 7964 // ] 7965 // } 7966 7967} 7968 7969// method id "sql.instances.restoreBackup": 7970 7971type InstancesRestoreBackupCall struct { 7972 s *Service 7973 project string 7974 instance string 7975 instancesrestorebackuprequest *InstancesRestoreBackupRequest 7976 urlParams_ gensupport.URLParams 7977 ctx_ context.Context 7978 header_ http.Header 7979} 7980 7981// RestoreBackup: Restores a backup of a Cloud SQL instance. Using this 7982// operation might cause your instance to restart. 7983// 7984// - instance: Cloud SQL instance ID. This does not include the project 7985// ID. 7986// - project: Project ID of the project that contains the instance. 7987func (r *InstancesService) RestoreBackup(project string, instance string, instancesrestorebackuprequest *InstancesRestoreBackupRequest) *InstancesRestoreBackupCall { 7988 c := &InstancesRestoreBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7989 c.project = project 7990 c.instance = instance 7991 c.instancesrestorebackuprequest = instancesrestorebackuprequest 7992 return c 7993} 7994 7995// Fields allows partial responses to be retrieved. See 7996// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7997// for more information. 7998func (c *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall { 7999 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8000 return c 8001} 8002 8003// Context sets the context to be used in this call's Do method. Any 8004// pending HTTP request will be aborted if the provided context is 8005// canceled. 8006func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall { 8007 c.ctx_ = ctx 8008 return c 8009} 8010 8011// Header returns an http.Header that can be modified by the caller to 8012// add HTTP headers to the request. 8013func (c *InstancesRestoreBackupCall) Header() http.Header { 8014 if c.header_ == nil { 8015 c.header_ = make(http.Header) 8016 } 8017 return c.header_ 8018} 8019 8020func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) { 8021 reqHeaders := make(http.Header) 8022 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8023 for k, v := range c.header_ { 8024 reqHeaders[k] = v 8025 } 8026 reqHeaders.Set("User-Agent", c.s.userAgent()) 8027 var body io.Reader = nil 8028 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrestorebackuprequest) 8029 if err != nil { 8030 return nil, err 8031 } 8032 reqHeaders.Set("Content-Type", "application/json") 8033 c.urlParams_.Set("alt", alt) 8034 c.urlParams_.Set("prettyPrint", "false") 8035 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup") 8036 urls += "?" + c.urlParams_.Encode() 8037 req, err := http.NewRequest("POST", urls, body) 8038 if err != nil { 8039 return nil, err 8040 } 8041 req.Header = reqHeaders 8042 googleapi.Expand(req.URL, map[string]string{ 8043 "project": c.project, 8044 "instance": c.instance, 8045 }) 8046 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8047} 8048 8049// Do executes the "sql.instances.restoreBackup" call. 8050// Exactly one of *Operation or error will be non-nil. Any non-2xx 8051// status code is an error. Response headers are in either 8052// *Operation.ServerResponse.Header or (if a response was returned at 8053// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8054// to check whether the returned error was because 8055// http.StatusNotModified was returned. 8056func (c *InstancesRestoreBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8057 gensupport.SetOptions(c.urlParams_, opts...) 8058 res, err := c.doRequest("json") 8059 if res != nil && res.StatusCode == http.StatusNotModified { 8060 if res.Body != nil { 8061 res.Body.Close() 8062 } 8063 return nil, &googleapi.Error{ 8064 Code: res.StatusCode, 8065 Header: res.Header, 8066 } 8067 } 8068 if err != nil { 8069 return nil, err 8070 } 8071 defer googleapi.CloseBody(res) 8072 if err := googleapi.CheckResponse(res); err != nil { 8073 return nil, err 8074 } 8075 ret := &Operation{ 8076 ServerResponse: googleapi.ServerResponse{ 8077 Header: res.Header, 8078 HTTPStatusCode: res.StatusCode, 8079 }, 8080 } 8081 target := &ret 8082 if err := gensupport.DecodeResponse(target, res); err != nil { 8083 return nil, err 8084 } 8085 return ret, nil 8086 // { 8087 // "description": "Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.", 8088 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup", 8089 // "httpMethod": "POST", 8090 // "id": "sql.instances.restoreBackup", 8091 // "parameterOrder": [ 8092 // "project", 8093 // "instance" 8094 // ], 8095 // "parameters": { 8096 // "instance": { 8097 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8098 // "location": "path", 8099 // "required": true, 8100 // "type": "string" 8101 // }, 8102 // "project": { 8103 // "description": "Project ID of the project that contains the instance.", 8104 // "location": "path", 8105 // "required": true, 8106 // "type": "string" 8107 // } 8108 // }, 8109 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup", 8110 // "request": { 8111 // "$ref": "InstancesRestoreBackupRequest" 8112 // }, 8113 // "response": { 8114 // "$ref": "Operation" 8115 // }, 8116 // "scopes": [ 8117 // "https://www.googleapis.com/auth/cloud-platform", 8118 // "https://www.googleapis.com/auth/sqlservice.admin" 8119 // ] 8120 // } 8121 8122} 8123 8124// method id "sql.instances.rotateServerCa": 8125 8126type InstancesRotateServerCaCall struct { 8127 s *Service 8128 project string 8129 instance string 8130 instancesrotateservercarequest *InstancesRotateServerCaRequest 8131 urlParams_ gensupport.URLParams 8132 ctx_ context.Context 8133 header_ http.Header 8134} 8135 8136// RotateServerCa: Rotates the server certificate to one signed by the 8137// Certificate Authority (CA) version previously added with the 8138// addServerCA method. 8139// 8140// - instance: Cloud SQL instance ID. This does not include the project 8141// ID. 8142// - project: Project ID of the project that contains the instance. 8143func (r *InstancesService) RotateServerCa(project string, instance string, instancesrotateservercarequest *InstancesRotateServerCaRequest) *InstancesRotateServerCaCall { 8144 c := &InstancesRotateServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8145 c.project = project 8146 c.instance = instance 8147 c.instancesrotateservercarequest = instancesrotateservercarequest 8148 return c 8149} 8150 8151// Fields allows partial responses to be retrieved. See 8152// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8153// for more information. 8154func (c *InstancesRotateServerCaCall) Fields(s ...googleapi.Field) *InstancesRotateServerCaCall { 8155 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8156 return c 8157} 8158 8159// Context sets the context to be used in this call's Do method. Any 8160// pending HTTP request will be aborted if the provided context is 8161// canceled. 8162func (c *InstancesRotateServerCaCall) Context(ctx context.Context) *InstancesRotateServerCaCall { 8163 c.ctx_ = ctx 8164 return c 8165} 8166 8167// Header returns an http.Header that can be modified by the caller to 8168// add HTTP headers to the request. 8169func (c *InstancesRotateServerCaCall) Header() http.Header { 8170 if c.header_ == nil { 8171 c.header_ = make(http.Header) 8172 } 8173 return c.header_ 8174} 8175 8176func (c *InstancesRotateServerCaCall) doRequest(alt string) (*http.Response, error) { 8177 reqHeaders := make(http.Header) 8178 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8179 for k, v := range c.header_ { 8180 reqHeaders[k] = v 8181 } 8182 reqHeaders.Set("User-Agent", c.s.userAgent()) 8183 var body io.Reader = nil 8184 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrotateservercarequest) 8185 if err != nil { 8186 return nil, err 8187 } 8188 reqHeaders.Set("Content-Type", "application/json") 8189 c.urlParams_.Set("alt", alt) 8190 c.urlParams_.Set("prettyPrint", "false") 8191 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa") 8192 urls += "?" + c.urlParams_.Encode() 8193 req, err := http.NewRequest("POST", urls, body) 8194 if err != nil { 8195 return nil, err 8196 } 8197 req.Header = reqHeaders 8198 googleapi.Expand(req.URL, map[string]string{ 8199 "project": c.project, 8200 "instance": c.instance, 8201 }) 8202 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8203} 8204 8205// Do executes the "sql.instances.rotateServerCa" call. 8206// Exactly one of *Operation or error will be non-nil. Any non-2xx 8207// status code is an error. Response headers are in either 8208// *Operation.ServerResponse.Header or (if a response was returned at 8209// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8210// to check whether the returned error was because 8211// http.StatusNotModified was returned. 8212func (c *InstancesRotateServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8213 gensupport.SetOptions(c.urlParams_, opts...) 8214 res, err := c.doRequest("json") 8215 if res != nil && res.StatusCode == http.StatusNotModified { 8216 if res.Body != nil { 8217 res.Body.Close() 8218 } 8219 return nil, &googleapi.Error{ 8220 Code: res.StatusCode, 8221 Header: res.Header, 8222 } 8223 } 8224 if err != nil { 8225 return nil, err 8226 } 8227 defer googleapi.CloseBody(res) 8228 if err := googleapi.CheckResponse(res); err != nil { 8229 return nil, err 8230 } 8231 ret := &Operation{ 8232 ServerResponse: googleapi.ServerResponse{ 8233 Header: res.Header, 8234 HTTPStatusCode: res.StatusCode, 8235 }, 8236 } 8237 target := &ret 8238 if err := gensupport.DecodeResponse(target, res); err != nil { 8239 return nil, err 8240 } 8241 return ret, nil 8242 // { 8243 // "description": "Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.", 8244 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa", 8245 // "httpMethod": "POST", 8246 // "id": "sql.instances.rotateServerCa", 8247 // "parameterOrder": [ 8248 // "project", 8249 // "instance" 8250 // ], 8251 // "parameters": { 8252 // "instance": { 8253 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8254 // "location": "path", 8255 // "required": true, 8256 // "type": "string" 8257 // }, 8258 // "project": { 8259 // "description": "Project ID of the project that contains the instance.", 8260 // "location": "path", 8261 // "required": true, 8262 // "type": "string" 8263 // } 8264 // }, 8265 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa", 8266 // "request": { 8267 // "$ref": "InstancesRotateServerCaRequest" 8268 // }, 8269 // "response": { 8270 // "$ref": "Operation" 8271 // }, 8272 // "scopes": [ 8273 // "https://www.googleapis.com/auth/cloud-platform", 8274 // "https://www.googleapis.com/auth/sqlservice.admin" 8275 // ] 8276 // } 8277 8278} 8279 8280// method id "sql.instances.startReplica": 8281 8282type InstancesStartReplicaCall struct { 8283 s *Service 8284 project string 8285 instance string 8286 urlParams_ gensupport.URLParams 8287 ctx_ context.Context 8288 header_ http.Header 8289} 8290 8291// StartReplica: Starts the replication in the read replica instance. 8292// 8293// - instance: Cloud SQL read replica instance name. 8294// - project: ID of the project that contains the read replica. 8295func (r *InstancesService) StartReplica(project string, instance string) *InstancesStartReplicaCall { 8296 c := &InstancesStartReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8297 c.project = project 8298 c.instance = instance 8299 return c 8300} 8301 8302// Fields allows partial responses to be retrieved. See 8303// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8304// for more information. 8305func (c *InstancesStartReplicaCall) Fields(s ...googleapi.Field) *InstancesStartReplicaCall { 8306 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8307 return c 8308} 8309 8310// Context sets the context to be used in this call's Do method. Any 8311// pending HTTP request will be aborted if the provided context is 8312// canceled. 8313func (c *InstancesStartReplicaCall) Context(ctx context.Context) *InstancesStartReplicaCall { 8314 c.ctx_ = ctx 8315 return c 8316} 8317 8318// Header returns an http.Header that can be modified by the caller to 8319// add HTTP headers to the request. 8320func (c *InstancesStartReplicaCall) Header() http.Header { 8321 if c.header_ == nil { 8322 c.header_ = make(http.Header) 8323 } 8324 return c.header_ 8325} 8326 8327func (c *InstancesStartReplicaCall) doRequest(alt string) (*http.Response, error) { 8328 reqHeaders := make(http.Header) 8329 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8330 for k, v := range c.header_ { 8331 reqHeaders[k] = v 8332 } 8333 reqHeaders.Set("User-Agent", c.s.userAgent()) 8334 var body io.Reader = nil 8335 c.urlParams_.Set("alt", alt) 8336 c.urlParams_.Set("prettyPrint", "false") 8337 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/startReplica") 8338 urls += "?" + c.urlParams_.Encode() 8339 req, err := http.NewRequest("POST", urls, body) 8340 if err != nil { 8341 return nil, err 8342 } 8343 req.Header = reqHeaders 8344 googleapi.Expand(req.URL, map[string]string{ 8345 "project": c.project, 8346 "instance": c.instance, 8347 }) 8348 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8349} 8350 8351// Do executes the "sql.instances.startReplica" call. 8352// Exactly one of *Operation or error will be non-nil. Any non-2xx 8353// status code is an error. Response headers are in either 8354// *Operation.ServerResponse.Header or (if a response was returned at 8355// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8356// to check whether the returned error was because 8357// http.StatusNotModified was returned. 8358func (c *InstancesStartReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8359 gensupport.SetOptions(c.urlParams_, opts...) 8360 res, err := c.doRequest("json") 8361 if res != nil && res.StatusCode == http.StatusNotModified { 8362 if res.Body != nil { 8363 res.Body.Close() 8364 } 8365 return nil, &googleapi.Error{ 8366 Code: res.StatusCode, 8367 Header: res.Header, 8368 } 8369 } 8370 if err != nil { 8371 return nil, err 8372 } 8373 defer googleapi.CloseBody(res) 8374 if err := googleapi.CheckResponse(res); err != nil { 8375 return nil, err 8376 } 8377 ret := &Operation{ 8378 ServerResponse: googleapi.ServerResponse{ 8379 Header: res.Header, 8380 HTTPStatusCode: res.StatusCode, 8381 }, 8382 } 8383 target := &ret 8384 if err := gensupport.DecodeResponse(target, res); err != nil { 8385 return nil, err 8386 } 8387 return ret, nil 8388 // { 8389 // "description": "Starts the replication in the read replica instance.", 8390 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/startReplica", 8391 // "httpMethod": "POST", 8392 // "id": "sql.instances.startReplica", 8393 // "parameterOrder": [ 8394 // "project", 8395 // "instance" 8396 // ], 8397 // "parameters": { 8398 // "instance": { 8399 // "description": "Cloud SQL read replica instance name.", 8400 // "location": "path", 8401 // "required": true, 8402 // "type": "string" 8403 // }, 8404 // "project": { 8405 // "description": "ID of the project that contains the read replica.", 8406 // "location": "path", 8407 // "required": true, 8408 // "type": "string" 8409 // } 8410 // }, 8411 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/startReplica", 8412 // "response": { 8413 // "$ref": "Operation" 8414 // }, 8415 // "scopes": [ 8416 // "https://www.googleapis.com/auth/cloud-platform", 8417 // "https://www.googleapis.com/auth/sqlservice.admin" 8418 // ] 8419 // } 8420 8421} 8422 8423// method id "sql.instances.stopReplica": 8424 8425type InstancesStopReplicaCall struct { 8426 s *Service 8427 project string 8428 instance string 8429 urlParams_ gensupport.URLParams 8430 ctx_ context.Context 8431 header_ http.Header 8432} 8433 8434// StopReplica: Stops the replication in the read replica instance. 8435// 8436// - instance: Cloud SQL read replica instance name. 8437// - project: ID of the project that contains the read replica. 8438func (r *InstancesService) StopReplica(project string, instance string) *InstancesStopReplicaCall { 8439 c := &InstancesStopReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8440 c.project = project 8441 c.instance = instance 8442 return c 8443} 8444 8445// Fields allows partial responses to be retrieved. See 8446// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8447// for more information. 8448func (c *InstancesStopReplicaCall) Fields(s ...googleapi.Field) *InstancesStopReplicaCall { 8449 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8450 return c 8451} 8452 8453// Context sets the context to be used in this call's Do method. Any 8454// pending HTTP request will be aborted if the provided context is 8455// canceled. 8456func (c *InstancesStopReplicaCall) Context(ctx context.Context) *InstancesStopReplicaCall { 8457 c.ctx_ = ctx 8458 return c 8459} 8460 8461// Header returns an http.Header that can be modified by the caller to 8462// add HTTP headers to the request. 8463func (c *InstancesStopReplicaCall) Header() http.Header { 8464 if c.header_ == nil { 8465 c.header_ = make(http.Header) 8466 } 8467 return c.header_ 8468} 8469 8470func (c *InstancesStopReplicaCall) doRequest(alt string) (*http.Response, error) { 8471 reqHeaders := make(http.Header) 8472 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8473 for k, v := range c.header_ { 8474 reqHeaders[k] = v 8475 } 8476 reqHeaders.Set("User-Agent", c.s.userAgent()) 8477 var body io.Reader = nil 8478 c.urlParams_.Set("alt", alt) 8479 c.urlParams_.Set("prettyPrint", "false") 8480 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica") 8481 urls += "?" + c.urlParams_.Encode() 8482 req, err := http.NewRequest("POST", urls, body) 8483 if err != nil { 8484 return nil, err 8485 } 8486 req.Header = reqHeaders 8487 googleapi.Expand(req.URL, map[string]string{ 8488 "project": c.project, 8489 "instance": c.instance, 8490 }) 8491 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8492} 8493 8494// Do executes the "sql.instances.stopReplica" call. 8495// Exactly one of *Operation or error will be non-nil. Any non-2xx 8496// status code is an error. Response headers are in either 8497// *Operation.ServerResponse.Header or (if a response was returned at 8498// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8499// to check whether the returned error was because 8500// http.StatusNotModified was returned. 8501func (c *InstancesStopReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8502 gensupport.SetOptions(c.urlParams_, opts...) 8503 res, err := c.doRequest("json") 8504 if res != nil && res.StatusCode == http.StatusNotModified { 8505 if res.Body != nil { 8506 res.Body.Close() 8507 } 8508 return nil, &googleapi.Error{ 8509 Code: res.StatusCode, 8510 Header: res.Header, 8511 } 8512 } 8513 if err != nil { 8514 return nil, err 8515 } 8516 defer googleapi.CloseBody(res) 8517 if err := googleapi.CheckResponse(res); err != nil { 8518 return nil, err 8519 } 8520 ret := &Operation{ 8521 ServerResponse: googleapi.ServerResponse{ 8522 Header: res.Header, 8523 HTTPStatusCode: res.StatusCode, 8524 }, 8525 } 8526 target := &ret 8527 if err := gensupport.DecodeResponse(target, res); err != nil { 8528 return nil, err 8529 } 8530 return ret, nil 8531 // { 8532 // "description": "Stops the replication in the read replica instance.", 8533 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica", 8534 // "httpMethod": "POST", 8535 // "id": "sql.instances.stopReplica", 8536 // "parameterOrder": [ 8537 // "project", 8538 // "instance" 8539 // ], 8540 // "parameters": { 8541 // "instance": { 8542 // "description": "Cloud SQL read replica instance name.", 8543 // "location": "path", 8544 // "required": true, 8545 // "type": "string" 8546 // }, 8547 // "project": { 8548 // "description": "ID of the project that contains the read replica.", 8549 // "location": "path", 8550 // "required": true, 8551 // "type": "string" 8552 // } 8553 // }, 8554 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica", 8555 // "response": { 8556 // "$ref": "Operation" 8557 // }, 8558 // "scopes": [ 8559 // "https://www.googleapis.com/auth/cloud-platform", 8560 // "https://www.googleapis.com/auth/sqlservice.admin" 8561 // ] 8562 // } 8563 8564} 8565 8566// method id "sql.instances.truncateLog": 8567 8568type InstancesTruncateLogCall struct { 8569 s *Service 8570 project string 8571 instance string 8572 instancestruncatelogrequest *InstancesTruncateLogRequest 8573 urlParams_ gensupport.URLParams 8574 ctx_ context.Context 8575 header_ http.Header 8576} 8577 8578// TruncateLog: Truncate MySQL general and slow query log tables MySQL 8579// only. 8580// 8581// - instance: Cloud SQL instance ID. This does not include the project 8582// ID. 8583// - project: Project ID of the Cloud SQL project. 8584func (r *InstancesService) TruncateLog(project string, instance string, instancestruncatelogrequest *InstancesTruncateLogRequest) *InstancesTruncateLogCall { 8585 c := &InstancesTruncateLogCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8586 c.project = project 8587 c.instance = instance 8588 c.instancestruncatelogrequest = instancestruncatelogrequest 8589 return c 8590} 8591 8592// Fields allows partial responses to be retrieved. See 8593// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8594// for more information. 8595func (c *InstancesTruncateLogCall) Fields(s ...googleapi.Field) *InstancesTruncateLogCall { 8596 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8597 return c 8598} 8599 8600// Context sets the context to be used in this call's Do method. Any 8601// pending HTTP request will be aborted if the provided context is 8602// canceled. 8603func (c *InstancesTruncateLogCall) Context(ctx context.Context) *InstancesTruncateLogCall { 8604 c.ctx_ = ctx 8605 return c 8606} 8607 8608// Header returns an http.Header that can be modified by the caller to 8609// add HTTP headers to the request. 8610func (c *InstancesTruncateLogCall) Header() http.Header { 8611 if c.header_ == nil { 8612 c.header_ = make(http.Header) 8613 } 8614 return c.header_ 8615} 8616 8617func (c *InstancesTruncateLogCall) doRequest(alt string) (*http.Response, error) { 8618 reqHeaders := make(http.Header) 8619 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8620 for k, v := range c.header_ { 8621 reqHeaders[k] = v 8622 } 8623 reqHeaders.Set("User-Agent", c.s.userAgent()) 8624 var body io.Reader = nil 8625 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancestruncatelogrequest) 8626 if err != nil { 8627 return nil, err 8628 } 8629 reqHeaders.Set("Content-Type", "application/json") 8630 c.urlParams_.Set("alt", alt) 8631 c.urlParams_.Set("prettyPrint", "false") 8632 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/truncateLog") 8633 urls += "?" + c.urlParams_.Encode() 8634 req, err := http.NewRequest("POST", urls, body) 8635 if err != nil { 8636 return nil, err 8637 } 8638 req.Header = reqHeaders 8639 googleapi.Expand(req.URL, map[string]string{ 8640 "project": c.project, 8641 "instance": c.instance, 8642 }) 8643 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8644} 8645 8646// Do executes the "sql.instances.truncateLog" call. 8647// Exactly one of *Operation or error will be non-nil. Any non-2xx 8648// status code is an error. Response headers are in either 8649// *Operation.ServerResponse.Header or (if a response was returned at 8650// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8651// to check whether the returned error was because 8652// http.StatusNotModified was returned. 8653func (c *InstancesTruncateLogCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8654 gensupport.SetOptions(c.urlParams_, opts...) 8655 res, err := c.doRequest("json") 8656 if res != nil && res.StatusCode == http.StatusNotModified { 8657 if res.Body != nil { 8658 res.Body.Close() 8659 } 8660 return nil, &googleapi.Error{ 8661 Code: res.StatusCode, 8662 Header: res.Header, 8663 } 8664 } 8665 if err != nil { 8666 return nil, err 8667 } 8668 defer googleapi.CloseBody(res) 8669 if err := googleapi.CheckResponse(res); err != nil { 8670 return nil, err 8671 } 8672 ret := &Operation{ 8673 ServerResponse: googleapi.ServerResponse{ 8674 Header: res.Header, 8675 HTTPStatusCode: res.StatusCode, 8676 }, 8677 } 8678 target := &ret 8679 if err := gensupport.DecodeResponse(target, res); err != nil { 8680 return nil, err 8681 } 8682 return ret, nil 8683 // { 8684 // "description": "Truncate MySQL general and slow query log tables MySQL only.", 8685 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/truncateLog", 8686 // "httpMethod": "POST", 8687 // "id": "sql.instances.truncateLog", 8688 // "parameterOrder": [ 8689 // "project", 8690 // "instance" 8691 // ], 8692 // "parameters": { 8693 // "instance": { 8694 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8695 // "location": "path", 8696 // "required": true, 8697 // "type": "string" 8698 // }, 8699 // "project": { 8700 // "description": "Project ID of the Cloud SQL project.", 8701 // "location": "path", 8702 // "required": true, 8703 // "type": "string" 8704 // } 8705 // }, 8706 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/truncateLog", 8707 // "request": { 8708 // "$ref": "InstancesTruncateLogRequest" 8709 // }, 8710 // "response": { 8711 // "$ref": "Operation" 8712 // }, 8713 // "scopes": [ 8714 // "https://www.googleapis.com/auth/cloud-platform", 8715 // "https://www.googleapis.com/auth/sqlservice.admin" 8716 // ] 8717 // } 8718 8719} 8720 8721// method id "sql.instances.update": 8722 8723type InstancesUpdateCall struct { 8724 s *Service 8725 project string 8726 instance string 8727 databaseinstance *DatabaseInstance 8728 urlParams_ gensupport.URLParams 8729 ctx_ context.Context 8730 header_ http.Header 8731} 8732 8733// Update: Updates settings of a Cloud SQL instance. Using this 8734// operation might cause your instance to restart. 8735// 8736// - instance: Cloud SQL instance ID. This does not include the project 8737// ID. 8738// - project: Project ID of the project that contains the instance. 8739func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall { 8740 c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8741 c.project = project 8742 c.instance = instance 8743 c.databaseinstance = databaseinstance 8744 return c 8745} 8746 8747// Fields allows partial responses to be retrieved. See 8748// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8749// for more information. 8750func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall { 8751 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8752 return c 8753} 8754 8755// Context sets the context to be used in this call's Do method. Any 8756// pending HTTP request will be aborted if the provided context is 8757// canceled. 8758func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall { 8759 c.ctx_ = ctx 8760 return c 8761} 8762 8763// Header returns an http.Header that can be modified by the caller to 8764// add HTTP headers to the request. 8765func (c *InstancesUpdateCall) Header() http.Header { 8766 if c.header_ == nil { 8767 c.header_ = make(http.Header) 8768 } 8769 return c.header_ 8770} 8771 8772func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) { 8773 reqHeaders := make(http.Header) 8774 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8775 for k, v := range c.header_ { 8776 reqHeaders[k] = v 8777 } 8778 reqHeaders.Set("User-Agent", c.s.userAgent()) 8779 var body io.Reader = nil 8780 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) 8781 if err != nil { 8782 return nil, err 8783 } 8784 reqHeaders.Set("Content-Type", "application/json") 8785 c.urlParams_.Set("alt", alt) 8786 c.urlParams_.Set("prettyPrint", "false") 8787 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 8788 urls += "?" + c.urlParams_.Encode() 8789 req, err := http.NewRequest("PUT", urls, body) 8790 if err != nil { 8791 return nil, err 8792 } 8793 req.Header = reqHeaders 8794 googleapi.Expand(req.URL, map[string]string{ 8795 "project": c.project, 8796 "instance": c.instance, 8797 }) 8798 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8799} 8800 8801// Do executes the "sql.instances.update" call. 8802// Exactly one of *Operation or error will be non-nil. Any non-2xx 8803// status code is an error. Response headers are in either 8804// *Operation.ServerResponse.Header or (if a response was returned at 8805// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8806// to check whether the returned error was because 8807// http.StatusNotModified was returned. 8808func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8809 gensupport.SetOptions(c.urlParams_, opts...) 8810 res, err := c.doRequest("json") 8811 if res != nil && res.StatusCode == http.StatusNotModified { 8812 if res.Body != nil { 8813 res.Body.Close() 8814 } 8815 return nil, &googleapi.Error{ 8816 Code: res.StatusCode, 8817 Header: res.Header, 8818 } 8819 } 8820 if err != nil { 8821 return nil, err 8822 } 8823 defer googleapi.CloseBody(res) 8824 if err := googleapi.CheckResponse(res); err != nil { 8825 return nil, err 8826 } 8827 ret := &Operation{ 8828 ServerResponse: googleapi.ServerResponse{ 8829 Header: res.Header, 8830 HTTPStatusCode: res.StatusCode, 8831 }, 8832 } 8833 target := &ret 8834 if err := gensupport.DecodeResponse(target, res); err != nil { 8835 return nil, err 8836 } 8837 return ret, nil 8838 // { 8839 // "description": "Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.", 8840 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 8841 // "httpMethod": "PUT", 8842 // "id": "sql.instances.update", 8843 // "parameterOrder": [ 8844 // "project", 8845 // "instance" 8846 // ], 8847 // "parameters": { 8848 // "instance": { 8849 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8850 // "location": "path", 8851 // "required": true, 8852 // "type": "string" 8853 // }, 8854 // "project": { 8855 // "description": "Project ID of the project that contains the instance.", 8856 // "location": "path", 8857 // "required": true, 8858 // "type": "string" 8859 // } 8860 // }, 8861 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 8862 // "request": { 8863 // "$ref": "DatabaseInstance" 8864 // }, 8865 // "response": { 8866 // "$ref": "Operation" 8867 // }, 8868 // "scopes": [ 8869 // "https://www.googleapis.com/auth/cloud-platform", 8870 // "https://www.googleapis.com/auth/sqlservice.admin" 8871 // ] 8872 // } 8873 8874} 8875 8876// method id "sql.operations.get": 8877 8878type OperationsGetCall struct { 8879 s *Service 8880 project string 8881 operation string 8882 urlParams_ gensupport.URLParams 8883 ifNoneMatch_ string 8884 ctx_ context.Context 8885 header_ http.Header 8886} 8887 8888// Get: Retrieves an instance operation that has been performed on an 8889// instance. 8890// 8891// - operation: Instance operation ID. 8892// - project: Project ID of the project that contains the instance. 8893func (r *OperationsService) Get(project string, operation string) *OperationsGetCall { 8894 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8895 c.project = project 8896 c.operation = operation 8897 return c 8898} 8899 8900// Fields allows partial responses to be retrieved. See 8901// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8902// for more information. 8903func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 8904 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8905 return c 8906} 8907 8908// IfNoneMatch sets the optional parameter which makes the operation 8909// fail if the object's ETag matches the given value. This is useful for 8910// getting updates only after the object has changed since the last 8911// request. Use googleapi.IsNotModified to check whether the response 8912// error from Do is the result of In-None-Match. 8913func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 8914 c.ifNoneMatch_ = entityTag 8915 return c 8916} 8917 8918// Context sets the context to be used in this call's Do method. Any 8919// pending HTTP request will be aborted if the provided context is 8920// canceled. 8921func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 8922 c.ctx_ = ctx 8923 return c 8924} 8925 8926// Header returns an http.Header that can be modified by the caller to 8927// add HTTP headers to the request. 8928func (c *OperationsGetCall) Header() http.Header { 8929 if c.header_ == nil { 8930 c.header_ = make(http.Header) 8931 } 8932 return c.header_ 8933} 8934 8935func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 8936 reqHeaders := make(http.Header) 8937 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8938 for k, v := range c.header_ { 8939 reqHeaders[k] = v 8940 } 8941 reqHeaders.Set("User-Agent", c.s.userAgent()) 8942 if c.ifNoneMatch_ != "" { 8943 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8944 } 8945 var body io.Reader = nil 8946 c.urlParams_.Set("alt", alt) 8947 c.urlParams_.Set("prettyPrint", "false") 8948 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/operations/{operation}") 8949 urls += "?" + c.urlParams_.Encode() 8950 req, err := http.NewRequest("GET", urls, body) 8951 if err != nil { 8952 return nil, err 8953 } 8954 req.Header = reqHeaders 8955 googleapi.Expand(req.URL, map[string]string{ 8956 "project": c.project, 8957 "operation": c.operation, 8958 }) 8959 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8960} 8961 8962// Do executes the "sql.operations.get" call. 8963// Exactly one of *Operation or error will be non-nil. Any non-2xx 8964// status code is an error. Response headers are in either 8965// *Operation.ServerResponse.Header or (if a response was returned at 8966// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8967// to check whether the returned error was because 8968// http.StatusNotModified was returned. 8969func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8970 gensupport.SetOptions(c.urlParams_, opts...) 8971 res, err := c.doRequest("json") 8972 if res != nil && res.StatusCode == http.StatusNotModified { 8973 if res.Body != nil { 8974 res.Body.Close() 8975 } 8976 return nil, &googleapi.Error{ 8977 Code: res.StatusCode, 8978 Header: res.Header, 8979 } 8980 } 8981 if err != nil { 8982 return nil, err 8983 } 8984 defer googleapi.CloseBody(res) 8985 if err := googleapi.CheckResponse(res); err != nil { 8986 return nil, err 8987 } 8988 ret := &Operation{ 8989 ServerResponse: googleapi.ServerResponse{ 8990 Header: res.Header, 8991 HTTPStatusCode: res.StatusCode, 8992 }, 8993 } 8994 target := &ret 8995 if err := gensupport.DecodeResponse(target, res); err != nil { 8996 return nil, err 8997 } 8998 return ret, nil 8999 // { 9000 // "description": "Retrieves an instance operation that has been performed on an instance.", 9001 // "flatPath": "sql/v1beta4/projects/{project}/operations/{operation}", 9002 // "httpMethod": "GET", 9003 // "id": "sql.operations.get", 9004 // "parameterOrder": [ 9005 // "project", 9006 // "operation" 9007 // ], 9008 // "parameters": { 9009 // "operation": { 9010 // "description": "Instance operation ID.", 9011 // "location": "path", 9012 // "required": true, 9013 // "type": "string" 9014 // }, 9015 // "project": { 9016 // "description": "Project ID of the project that contains the instance.", 9017 // "location": "path", 9018 // "required": true, 9019 // "type": "string" 9020 // } 9021 // }, 9022 // "path": "sql/v1beta4/projects/{project}/operations/{operation}", 9023 // "response": { 9024 // "$ref": "Operation" 9025 // }, 9026 // "scopes": [ 9027 // "https://www.googleapis.com/auth/cloud-platform", 9028 // "https://www.googleapis.com/auth/sqlservice.admin" 9029 // ] 9030 // } 9031 9032} 9033 9034// method id "sql.operations.list": 9035 9036type OperationsListCall struct { 9037 s *Service 9038 project string 9039 urlParams_ gensupport.URLParams 9040 ifNoneMatch_ string 9041 ctx_ context.Context 9042 header_ http.Header 9043} 9044 9045// List: Lists all instance operations that have been performed on the 9046// given Cloud SQL instance in the reverse chronological order of the 9047// start time. 9048// 9049// - project: Project ID of the project that contains the instance. 9050func (r *OperationsService) List(project string) *OperationsListCall { 9051 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9052 c.project = project 9053 return c 9054} 9055 9056// Instance sets the optional parameter "instance": Cloud SQL instance 9057// ID. This does not include the project ID. 9058func (c *OperationsListCall) Instance(instance string) *OperationsListCall { 9059 c.urlParams_.Set("instance", instance) 9060 return c 9061} 9062 9063// MaxResults sets the optional parameter "maxResults": Maximum number 9064// of operations per response. 9065func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall { 9066 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 9067 return c 9068} 9069 9070// PageToken sets the optional parameter "pageToken": A 9071// previously-returned page token representing part of the larger set of 9072// results to view. 9073func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { 9074 c.urlParams_.Set("pageToken", pageToken) 9075 return c 9076} 9077 9078// Fields allows partial responses to be retrieved. See 9079// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9080// for more information. 9081func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { 9082 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9083 return c 9084} 9085 9086// IfNoneMatch sets the optional parameter which makes the operation 9087// fail if the object's ETag matches the given value. This is useful for 9088// getting updates only after the object has changed since the last 9089// request. Use googleapi.IsNotModified to check whether the response 9090// error from Do is the result of In-None-Match. 9091func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { 9092 c.ifNoneMatch_ = entityTag 9093 return c 9094} 9095 9096// Context sets the context to be used in this call's Do method. Any 9097// pending HTTP request will be aborted if the provided context is 9098// canceled. 9099func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { 9100 c.ctx_ = ctx 9101 return c 9102} 9103 9104// Header returns an http.Header that can be modified by the caller to 9105// add HTTP headers to the request. 9106func (c *OperationsListCall) Header() http.Header { 9107 if c.header_ == nil { 9108 c.header_ = make(http.Header) 9109 } 9110 return c.header_ 9111} 9112 9113func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { 9114 reqHeaders := make(http.Header) 9115 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9116 for k, v := range c.header_ { 9117 reqHeaders[k] = v 9118 } 9119 reqHeaders.Set("User-Agent", c.s.userAgent()) 9120 if c.ifNoneMatch_ != "" { 9121 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9122 } 9123 var body io.Reader = nil 9124 c.urlParams_.Set("alt", alt) 9125 c.urlParams_.Set("prettyPrint", "false") 9126 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/operations") 9127 urls += "?" + c.urlParams_.Encode() 9128 req, err := http.NewRequest("GET", urls, body) 9129 if err != nil { 9130 return nil, err 9131 } 9132 req.Header = reqHeaders 9133 googleapi.Expand(req.URL, map[string]string{ 9134 "project": c.project, 9135 }) 9136 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9137} 9138 9139// Do executes the "sql.operations.list" call. 9140// Exactly one of *OperationsListResponse or error will be non-nil. Any 9141// non-2xx status code is an error. Response headers are in either 9142// *OperationsListResponse.ServerResponse.Header or (if a response was 9143// returned at all) in error.(*googleapi.Error).Header. Use 9144// googleapi.IsNotModified to check whether the returned error was 9145// because http.StatusNotModified was returned. 9146func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) { 9147 gensupport.SetOptions(c.urlParams_, opts...) 9148 res, err := c.doRequest("json") 9149 if res != nil && res.StatusCode == http.StatusNotModified { 9150 if res.Body != nil { 9151 res.Body.Close() 9152 } 9153 return nil, &googleapi.Error{ 9154 Code: res.StatusCode, 9155 Header: res.Header, 9156 } 9157 } 9158 if err != nil { 9159 return nil, err 9160 } 9161 defer googleapi.CloseBody(res) 9162 if err := googleapi.CheckResponse(res); err != nil { 9163 return nil, err 9164 } 9165 ret := &OperationsListResponse{ 9166 ServerResponse: googleapi.ServerResponse{ 9167 Header: res.Header, 9168 HTTPStatusCode: res.StatusCode, 9169 }, 9170 } 9171 target := &ret 9172 if err := gensupport.DecodeResponse(target, res); err != nil { 9173 return nil, err 9174 } 9175 return ret, nil 9176 // { 9177 // "description": "Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.", 9178 // "flatPath": "sql/v1beta4/projects/{project}/operations", 9179 // "httpMethod": "GET", 9180 // "id": "sql.operations.list", 9181 // "parameterOrder": [ 9182 // "project" 9183 // ], 9184 // "parameters": { 9185 // "instance": { 9186 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9187 // "location": "query", 9188 // "type": "string" 9189 // }, 9190 // "maxResults": { 9191 // "description": "Maximum number of operations per response.", 9192 // "format": "uint32", 9193 // "location": "query", 9194 // "type": "integer" 9195 // }, 9196 // "pageToken": { 9197 // "description": "A previously-returned page token representing part of the larger set of results to view.", 9198 // "location": "query", 9199 // "type": "string" 9200 // }, 9201 // "project": { 9202 // "description": "Project ID of the project that contains the instance.", 9203 // "location": "path", 9204 // "required": true, 9205 // "type": "string" 9206 // } 9207 // }, 9208 // "path": "sql/v1beta4/projects/{project}/operations", 9209 // "response": { 9210 // "$ref": "OperationsListResponse" 9211 // }, 9212 // "scopes": [ 9213 // "https://www.googleapis.com/auth/cloud-platform", 9214 // "https://www.googleapis.com/auth/sqlservice.admin" 9215 // ] 9216 // } 9217 9218} 9219 9220// Pages invokes f for each page of results. 9221// A non-nil error returned from f will halt the iteration. 9222// The provided context supersedes any context provided to the Context method. 9223func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error { 9224 c.ctx_ = ctx 9225 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9226 for { 9227 x, err := c.Do() 9228 if err != nil { 9229 return err 9230 } 9231 if err := f(x); err != nil { 9232 return err 9233 } 9234 if x.NextPageToken == "" { 9235 return nil 9236 } 9237 c.PageToken(x.NextPageToken) 9238 } 9239} 9240 9241// method id "sql.projects.instances.rescheduleMaintenance": 9242 9243type ProjectsInstancesRescheduleMaintenanceCall struct { 9244 s *Service 9245 project string 9246 instance string 9247 sqlinstancesreschedulemaintenancerequestbody *SqlInstancesRescheduleMaintenanceRequestBody 9248 urlParams_ gensupport.URLParams 9249 ctx_ context.Context 9250 header_ http.Header 9251} 9252 9253// RescheduleMaintenance: Reschedules the maintenance on the given 9254// instance. 9255// 9256// - instance: Cloud SQL instance ID. This does not include the project 9257// ID. 9258// - project: ID of the project that contains the instance. 9259func (r *ProjectsInstancesService) RescheduleMaintenance(project string, instance string, sqlinstancesreschedulemaintenancerequestbody *SqlInstancesRescheduleMaintenanceRequestBody) *ProjectsInstancesRescheduleMaintenanceCall { 9260 c := &ProjectsInstancesRescheduleMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9261 c.project = project 9262 c.instance = instance 9263 c.sqlinstancesreschedulemaintenancerequestbody = sqlinstancesreschedulemaintenancerequestbody 9264 return c 9265} 9266 9267// Fields allows partial responses to be retrieved. See 9268// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9269// for more information. 9270func (c *ProjectsInstancesRescheduleMaintenanceCall) Fields(s ...googleapi.Field) *ProjectsInstancesRescheduleMaintenanceCall { 9271 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9272 return c 9273} 9274 9275// Context sets the context to be used in this call's Do method. Any 9276// pending HTTP request will be aborted if the provided context is 9277// canceled. 9278func (c *ProjectsInstancesRescheduleMaintenanceCall) Context(ctx context.Context) *ProjectsInstancesRescheduleMaintenanceCall { 9279 c.ctx_ = ctx 9280 return c 9281} 9282 9283// Header returns an http.Header that can be modified by the caller to 9284// add HTTP headers to the request. 9285func (c *ProjectsInstancesRescheduleMaintenanceCall) Header() http.Header { 9286 if c.header_ == nil { 9287 c.header_ = make(http.Header) 9288 } 9289 return c.header_ 9290} 9291 9292func (c *ProjectsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) { 9293 reqHeaders := make(http.Header) 9294 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9295 for k, v := range c.header_ { 9296 reqHeaders[k] = v 9297 } 9298 reqHeaders.Set("User-Agent", c.s.userAgent()) 9299 var body io.Reader = nil 9300 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesreschedulemaintenancerequestbody) 9301 if err != nil { 9302 return nil, err 9303 } 9304 reqHeaders.Set("Content-Type", "application/json") 9305 c.urlParams_.Set("alt", alt) 9306 c.urlParams_.Set("prettyPrint", "false") 9307 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance") 9308 urls += "?" + c.urlParams_.Encode() 9309 req, err := http.NewRequest("POST", urls, body) 9310 if err != nil { 9311 return nil, err 9312 } 9313 req.Header = reqHeaders 9314 googleapi.Expand(req.URL, map[string]string{ 9315 "project": c.project, 9316 "instance": c.instance, 9317 }) 9318 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9319} 9320 9321// Do executes the "sql.projects.instances.rescheduleMaintenance" call. 9322// Exactly one of *Operation or error will be non-nil. Any non-2xx 9323// status code is an error. Response headers are in either 9324// *Operation.ServerResponse.Header or (if a response was returned at 9325// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9326// to check whether the returned error was because 9327// http.StatusNotModified was returned. 9328func (c *ProjectsInstancesRescheduleMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9329 gensupport.SetOptions(c.urlParams_, opts...) 9330 res, err := c.doRequest("json") 9331 if res != nil && res.StatusCode == http.StatusNotModified { 9332 if res.Body != nil { 9333 res.Body.Close() 9334 } 9335 return nil, &googleapi.Error{ 9336 Code: res.StatusCode, 9337 Header: res.Header, 9338 } 9339 } 9340 if err != nil { 9341 return nil, err 9342 } 9343 defer googleapi.CloseBody(res) 9344 if err := googleapi.CheckResponse(res); err != nil { 9345 return nil, err 9346 } 9347 ret := &Operation{ 9348 ServerResponse: googleapi.ServerResponse{ 9349 Header: res.Header, 9350 HTTPStatusCode: res.StatusCode, 9351 }, 9352 } 9353 target := &ret 9354 if err := gensupport.DecodeResponse(target, res); err != nil { 9355 return nil, err 9356 } 9357 return ret, nil 9358 // { 9359 // "description": "Reschedules the maintenance on the given instance.", 9360 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance", 9361 // "httpMethod": "POST", 9362 // "id": "sql.projects.instances.rescheduleMaintenance", 9363 // "parameterOrder": [ 9364 // "project", 9365 // "instance" 9366 // ], 9367 // "parameters": { 9368 // "instance": { 9369 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9370 // "location": "path", 9371 // "required": true, 9372 // "type": "string" 9373 // }, 9374 // "project": { 9375 // "description": "ID of the project that contains the instance.", 9376 // "location": "path", 9377 // "required": true, 9378 // "type": "string" 9379 // } 9380 // }, 9381 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance", 9382 // "request": { 9383 // "$ref": "SqlInstancesRescheduleMaintenanceRequestBody" 9384 // }, 9385 // "response": { 9386 // "$ref": "Operation" 9387 // }, 9388 // "scopes": [ 9389 // "https://www.googleapis.com/auth/cloud-platform", 9390 // "https://www.googleapis.com/auth/sqlservice.admin" 9391 // ] 9392 // } 9393 9394} 9395 9396// method id "sql.projects.instances.startExternalSync": 9397 9398type ProjectsInstancesStartExternalSyncCall struct { 9399 s *Service 9400 project string 9401 instance string 9402 urlParams_ gensupport.URLParams 9403 ctx_ context.Context 9404 header_ http.Header 9405} 9406 9407// StartExternalSync: Start External primary instance migration. 9408// 9409// - instance: Cloud SQL instance ID. This does not include the project 9410// ID. 9411// - project: ID of the project that contains the instance. 9412func (r *ProjectsInstancesService) StartExternalSync(project string, instance string) *ProjectsInstancesStartExternalSyncCall { 9413 c := &ProjectsInstancesStartExternalSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9414 c.project = project 9415 c.instance = instance 9416 return c 9417} 9418 9419// SkipVerification sets the optional parameter "skipVerification": 9420// Whether to skip the verification step (VESS). 9421func (c *ProjectsInstancesStartExternalSyncCall) SkipVerification(skipVerification bool) *ProjectsInstancesStartExternalSyncCall { 9422 c.urlParams_.Set("skipVerification", fmt.Sprint(skipVerification)) 9423 return c 9424} 9425 9426// SyncMode sets the optional parameter "syncMode": External sync mode. 9427// 9428// Possible values: 9429// "EXTERNAL_SYNC_MODE_UNSPECIFIED" - Unknown external sync mode, will 9430// be defaulted to ONLINE mode 9431// "ONLINE" - Online external sync will set up replication after 9432// initial data external sync 9433// "OFFLINE" - Offline external sync only dumps and loads a one-time 9434// snapshot of the primary instance's data 9435func (c *ProjectsInstancesStartExternalSyncCall) SyncMode(syncMode string) *ProjectsInstancesStartExternalSyncCall { 9436 c.urlParams_.Set("syncMode", syncMode) 9437 return c 9438} 9439 9440// Fields allows partial responses to be retrieved. See 9441// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9442// for more information. 9443func (c *ProjectsInstancesStartExternalSyncCall) Fields(s ...googleapi.Field) *ProjectsInstancesStartExternalSyncCall { 9444 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9445 return c 9446} 9447 9448// Context sets the context to be used in this call's Do method. Any 9449// pending HTTP request will be aborted if the provided context is 9450// canceled. 9451func (c *ProjectsInstancesStartExternalSyncCall) Context(ctx context.Context) *ProjectsInstancesStartExternalSyncCall { 9452 c.ctx_ = ctx 9453 return c 9454} 9455 9456// Header returns an http.Header that can be modified by the caller to 9457// add HTTP headers to the request. 9458func (c *ProjectsInstancesStartExternalSyncCall) Header() http.Header { 9459 if c.header_ == nil { 9460 c.header_ = make(http.Header) 9461 } 9462 return c.header_ 9463} 9464 9465func (c *ProjectsInstancesStartExternalSyncCall) doRequest(alt string) (*http.Response, error) { 9466 reqHeaders := make(http.Header) 9467 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9468 for k, v := range c.header_ { 9469 reqHeaders[k] = v 9470 } 9471 reqHeaders.Set("User-Agent", c.s.userAgent()) 9472 var body io.Reader = nil 9473 c.urlParams_.Set("alt", alt) 9474 c.urlParams_.Set("prettyPrint", "false") 9475 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync") 9476 urls += "?" + c.urlParams_.Encode() 9477 req, err := http.NewRequest("POST", urls, body) 9478 if err != nil { 9479 return nil, err 9480 } 9481 req.Header = reqHeaders 9482 googleapi.Expand(req.URL, map[string]string{ 9483 "project": c.project, 9484 "instance": c.instance, 9485 }) 9486 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9487} 9488 9489// Do executes the "sql.projects.instances.startExternalSync" call. 9490// Exactly one of *Operation or error will be non-nil. Any non-2xx 9491// status code is an error. Response headers are in either 9492// *Operation.ServerResponse.Header or (if a response was returned at 9493// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9494// to check whether the returned error was because 9495// http.StatusNotModified was returned. 9496func (c *ProjectsInstancesStartExternalSyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9497 gensupport.SetOptions(c.urlParams_, opts...) 9498 res, err := c.doRequest("json") 9499 if res != nil && res.StatusCode == http.StatusNotModified { 9500 if res.Body != nil { 9501 res.Body.Close() 9502 } 9503 return nil, &googleapi.Error{ 9504 Code: res.StatusCode, 9505 Header: res.Header, 9506 } 9507 } 9508 if err != nil { 9509 return nil, err 9510 } 9511 defer googleapi.CloseBody(res) 9512 if err := googleapi.CheckResponse(res); err != nil { 9513 return nil, err 9514 } 9515 ret := &Operation{ 9516 ServerResponse: googleapi.ServerResponse{ 9517 Header: res.Header, 9518 HTTPStatusCode: res.StatusCode, 9519 }, 9520 } 9521 target := &ret 9522 if err := gensupport.DecodeResponse(target, res); err != nil { 9523 return nil, err 9524 } 9525 return ret, nil 9526 // { 9527 // "description": "Start External primary instance migration.", 9528 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync", 9529 // "httpMethod": "POST", 9530 // "id": "sql.projects.instances.startExternalSync", 9531 // "parameterOrder": [ 9532 // "project", 9533 // "instance" 9534 // ], 9535 // "parameters": { 9536 // "instance": { 9537 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9538 // "location": "path", 9539 // "required": true, 9540 // "type": "string" 9541 // }, 9542 // "project": { 9543 // "description": "ID of the project that contains the instance.", 9544 // "location": "path", 9545 // "required": true, 9546 // "type": "string" 9547 // }, 9548 // "skipVerification": { 9549 // "description": "Whether to skip the verification step (VESS).", 9550 // "location": "query", 9551 // "type": "boolean" 9552 // }, 9553 // "syncMode": { 9554 // "description": "External sync mode.", 9555 // "enum": [ 9556 // "EXTERNAL_SYNC_MODE_UNSPECIFIED", 9557 // "ONLINE", 9558 // "OFFLINE" 9559 // ], 9560 // "enumDescriptions": [ 9561 // "Unknown external sync mode, will be defaulted to ONLINE mode", 9562 // "Online external sync will set up replication after initial data external sync", 9563 // "Offline external sync only dumps and loads a one-time snapshot of the primary instance's data" 9564 // ], 9565 // "location": "query", 9566 // "type": "string" 9567 // } 9568 // }, 9569 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync", 9570 // "response": { 9571 // "$ref": "Operation" 9572 // }, 9573 // "scopes": [ 9574 // "https://www.googleapis.com/auth/cloud-platform", 9575 // "https://www.googleapis.com/auth/sqlservice.admin" 9576 // ] 9577 // } 9578 9579} 9580 9581// method id "sql.projects.instances.verifyExternalSyncSettings": 9582 9583type ProjectsInstancesVerifyExternalSyncSettingsCall struct { 9584 s *Service 9585 project string 9586 instance string 9587 urlParams_ gensupport.URLParams 9588 ctx_ context.Context 9589 header_ http.Header 9590} 9591 9592// VerifyExternalSyncSettings: Verify External primary instance external 9593// sync settings. 9594// 9595// - instance: Cloud SQL instance ID. This does not include the project 9596// ID. 9597// - project: Project ID of the project that contains the instance. 9598func (r *ProjectsInstancesService) VerifyExternalSyncSettings(project string, instance string) *ProjectsInstancesVerifyExternalSyncSettingsCall { 9599 c := &ProjectsInstancesVerifyExternalSyncSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9600 c.project = project 9601 c.instance = instance 9602 return c 9603} 9604 9605// SyncMode sets the optional parameter "syncMode": External sync mode 9606// 9607// Possible values: 9608// "EXTERNAL_SYNC_MODE_UNSPECIFIED" - Unknown external sync mode, will 9609// be defaulted to ONLINE mode 9610// "ONLINE" - Online external sync will set up replication after 9611// initial data external sync 9612// "OFFLINE" - Offline external sync only dumps and loads a one-time 9613// snapshot of the primary instance's data 9614func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) SyncMode(syncMode string) *ProjectsInstancesVerifyExternalSyncSettingsCall { 9615 c.urlParams_.Set("syncMode", syncMode) 9616 return c 9617} 9618 9619// VerifyConnectionOnly sets the optional parameter 9620// "verifyConnectionOnly": Flag to enable verifying connection only 9621func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) VerifyConnectionOnly(verifyConnectionOnly bool) *ProjectsInstancesVerifyExternalSyncSettingsCall { 9622 c.urlParams_.Set("verifyConnectionOnly", fmt.Sprint(verifyConnectionOnly)) 9623 return c 9624} 9625 9626// Fields allows partial responses to be retrieved. See 9627// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9628// for more information. 9629func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Fields(s ...googleapi.Field) *ProjectsInstancesVerifyExternalSyncSettingsCall { 9630 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9631 return c 9632} 9633 9634// Context sets the context to be used in this call's Do method. Any 9635// pending HTTP request will be aborted if the provided context is 9636// canceled. 9637func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Context(ctx context.Context) *ProjectsInstancesVerifyExternalSyncSettingsCall { 9638 c.ctx_ = ctx 9639 return c 9640} 9641 9642// Header returns an http.Header that can be modified by the caller to 9643// add HTTP headers to the request. 9644func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Header() http.Header { 9645 if c.header_ == nil { 9646 c.header_ = make(http.Header) 9647 } 9648 return c.header_ 9649} 9650 9651func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) doRequest(alt string) (*http.Response, error) { 9652 reqHeaders := make(http.Header) 9653 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9654 for k, v := range c.header_ { 9655 reqHeaders[k] = v 9656 } 9657 reqHeaders.Set("User-Agent", c.s.userAgent()) 9658 var body io.Reader = nil 9659 c.urlParams_.Set("alt", alt) 9660 c.urlParams_.Set("prettyPrint", "false") 9661 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings") 9662 urls += "?" + c.urlParams_.Encode() 9663 req, err := http.NewRequest("POST", urls, body) 9664 if err != nil { 9665 return nil, err 9666 } 9667 req.Header = reqHeaders 9668 googleapi.Expand(req.URL, map[string]string{ 9669 "project": c.project, 9670 "instance": c.instance, 9671 }) 9672 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9673} 9674 9675// Do executes the "sql.projects.instances.verifyExternalSyncSettings" call. 9676// Exactly one of *SqlInstancesVerifyExternalSyncSettingsResponse or 9677// error will be non-nil. Any non-2xx status code is an error. Response 9678// headers are in either 9679// *SqlInstancesVerifyExternalSyncSettingsResponse.ServerResponse.Header 9680// or (if a response was returned at all) in 9681// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9682// whether the returned error was because http.StatusNotModified was 9683// returned. 9684func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Do(opts ...googleapi.CallOption) (*SqlInstancesVerifyExternalSyncSettingsResponse, error) { 9685 gensupport.SetOptions(c.urlParams_, opts...) 9686 res, err := c.doRequest("json") 9687 if res != nil && res.StatusCode == http.StatusNotModified { 9688 if res.Body != nil { 9689 res.Body.Close() 9690 } 9691 return nil, &googleapi.Error{ 9692 Code: res.StatusCode, 9693 Header: res.Header, 9694 } 9695 } 9696 if err != nil { 9697 return nil, err 9698 } 9699 defer googleapi.CloseBody(res) 9700 if err := googleapi.CheckResponse(res); err != nil { 9701 return nil, err 9702 } 9703 ret := &SqlInstancesVerifyExternalSyncSettingsResponse{ 9704 ServerResponse: googleapi.ServerResponse{ 9705 Header: res.Header, 9706 HTTPStatusCode: res.StatusCode, 9707 }, 9708 } 9709 target := &ret 9710 if err := gensupport.DecodeResponse(target, res); err != nil { 9711 return nil, err 9712 } 9713 return ret, nil 9714 // { 9715 // "description": "Verify External primary instance external sync settings.", 9716 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings", 9717 // "httpMethod": "POST", 9718 // "id": "sql.projects.instances.verifyExternalSyncSettings", 9719 // "parameterOrder": [ 9720 // "project", 9721 // "instance" 9722 // ], 9723 // "parameters": { 9724 // "instance": { 9725 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9726 // "location": "path", 9727 // "required": true, 9728 // "type": "string" 9729 // }, 9730 // "project": { 9731 // "description": "Project ID of the project that contains the instance.", 9732 // "location": "path", 9733 // "required": true, 9734 // "type": "string" 9735 // }, 9736 // "syncMode": { 9737 // "description": "External sync mode", 9738 // "enum": [ 9739 // "EXTERNAL_SYNC_MODE_UNSPECIFIED", 9740 // "ONLINE", 9741 // "OFFLINE" 9742 // ], 9743 // "enumDescriptions": [ 9744 // "Unknown external sync mode, will be defaulted to ONLINE mode", 9745 // "Online external sync will set up replication after initial data external sync", 9746 // "Offline external sync only dumps and loads a one-time snapshot of the primary instance's data" 9747 // ], 9748 // "location": "query", 9749 // "type": "string" 9750 // }, 9751 // "verifyConnectionOnly": { 9752 // "description": "Flag to enable verifying connection only", 9753 // "location": "query", 9754 // "type": "boolean" 9755 // } 9756 // }, 9757 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings", 9758 // "response": { 9759 // "$ref": "SqlInstancesVerifyExternalSyncSettingsResponse" 9760 // }, 9761 // "scopes": [ 9762 // "https://www.googleapis.com/auth/cloud-platform", 9763 // "https://www.googleapis.com/auth/sqlservice.admin" 9764 // ] 9765 // } 9766 9767} 9768 9769// method id "sql.sslCerts.createEphemeral": 9770 9771type SslCertsCreateEphemeralCall struct { 9772 s *Service 9773 project string 9774 instance string 9775 sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest 9776 urlParams_ gensupport.URLParams 9777 ctx_ context.Context 9778 header_ http.Header 9779} 9780 9781// CreateEphemeral: Generates a short-lived X509 certificate containing 9782// the provided public key and signed by a private key specific to the 9783// target instance. Users may use the certificate to authenticate as 9784// themselves when connecting to the database. 9785// 9786// - instance: Cloud SQL instance ID. This does not include the project 9787// ID. 9788// - project: Project ID of the Cloud SQL project. 9789func (r *SslCertsService) CreateEphemeral(project string, instance string, sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest) *SslCertsCreateEphemeralCall { 9790 c := &SslCertsCreateEphemeralCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9791 c.project = project 9792 c.instance = instance 9793 c.sslcertscreateephemeralrequest = sslcertscreateephemeralrequest 9794 return c 9795} 9796 9797// Fields allows partial responses to be retrieved. See 9798// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9799// for more information. 9800func (c *SslCertsCreateEphemeralCall) Fields(s ...googleapi.Field) *SslCertsCreateEphemeralCall { 9801 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9802 return c 9803} 9804 9805// Context sets the context to be used in this call's Do method. Any 9806// pending HTTP request will be aborted if the provided context is 9807// canceled. 9808func (c *SslCertsCreateEphemeralCall) Context(ctx context.Context) *SslCertsCreateEphemeralCall { 9809 c.ctx_ = ctx 9810 return c 9811} 9812 9813// Header returns an http.Header that can be modified by the caller to 9814// add HTTP headers to the request. 9815func (c *SslCertsCreateEphemeralCall) Header() http.Header { 9816 if c.header_ == nil { 9817 c.header_ = make(http.Header) 9818 } 9819 return c.header_ 9820} 9821 9822func (c *SslCertsCreateEphemeralCall) doRequest(alt string) (*http.Response, error) { 9823 reqHeaders := make(http.Header) 9824 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9825 for k, v := range c.header_ { 9826 reqHeaders[k] = v 9827 } 9828 reqHeaders.Set("User-Agent", c.s.userAgent()) 9829 var body io.Reader = nil 9830 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertscreateephemeralrequest) 9831 if err != nil { 9832 return nil, err 9833 } 9834 reqHeaders.Set("Content-Type", "application/json") 9835 c.urlParams_.Set("alt", alt) 9836 c.urlParams_.Set("prettyPrint", "false") 9837 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral") 9838 urls += "?" + c.urlParams_.Encode() 9839 req, err := http.NewRequest("POST", urls, body) 9840 if err != nil { 9841 return nil, err 9842 } 9843 req.Header = reqHeaders 9844 googleapi.Expand(req.URL, map[string]string{ 9845 "project": c.project, 9846 "instance": c.instance, 9847 }) 9848 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9849} 9850 9851// Do executes the "sql.sslCerts.createEphemeral" call. 9852// Exactly one of *SslCert or error will be non-nil. Any non-2xx status 9853// code is an error. Response headers are in either 9854// *SslCert.ServerResponse.Header or (if a response was returned at all) 9855// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9856// check whether the returned error was because http.StatusNotModified 9857// was returned. 9858func (c *SslCertsCreateEphemeralCall) Do(opts ...googleapi.CallOption) (*SslCert, error) { 9859 gensupport.SetOptions(c.urlParams_, opts...) 9860 res, err := c.doRequest("json") 9861 if res != nil && res.StatusCode == http.StatusNotModified { 9862 if res.Body != nil { 9863 res.Body.Close() 9864 } 9865 return nil, &googleapi.Error{ 9866 Code: res.StatusCode, 9867 Header: res.Header, 9868 } 9869 } 9870 if err != nil { 9871 return nil, err 9872 } 9873 defer googleapi.CloseBody(res) 9874 if err := googleapi.CheckResponse(res); err != nil { 9875 return nil, err 9876 } 9877 ret := &SslCert{ 9878 ServerResponse: googleapi.ServerResponse{ 9879 Header: res.Header, 9880 HTTPStatusCode: res.StatusCode, 9881 }, 9882 } 9883 target := &ret 9884 if err := gensupport.DecodeResponse(target, res); err != nil { 9885 return nil, err 9886 } 9887 return ret, nil 9888 // { 9889 // "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.", 9890 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral", 9891 // "httpMethod": "POST", 9892 // "id": "sql.sslCerts.createEphemeral", 9893 // "parameterOrder": [ 9894 // "project", 9895 // "instance" 9896 // ], 9897 // "parameters": { 9898 // "instance": { 9899 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9900 // "location": "path", 9901 // "required": true, 9902 // "type": "string" 9903 // }, 9904 // "project": { 9905 // "description": "Project ID of the Cloud SQL project.", 9906 // "location": "path", 9907 // "required": true, 9908 // "type": "string" 9909 // } 9910 // }, 9911 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral", 9912 // "request": { 9913 // "$ref": "SslCertsCreateEphemeralRequest" 9914 // }, 9915 // "response": { 9916 // "$ref": "SslCert" 9917 // }, 9918 // "scopes": [ 9919 // "https://www.googleapis.com/auth/cloud-platform", 9920 // "https://www.googleapis.com/auth/sqlservice.admin" 9921 // ] 9922 // } 9923 9924} 9925 9926// method id "sql.sslCerts.delete": 9927 9928type SslCertsDeleteCall struct { 9929 s *Service 9930 project string 9931 instance string 9932 sha1Fingerprint string 9933 urlParams_ gensupport.URLParams 9934 ctx_ context.Context 9935 header_ http.Header 9936} 9937 9938// Delete: Deletes the SSL certificate. For First Generation instances, 9939// the certificate remains valid until the instance is restarted. 9940// 9941// - instance: Cloud SQL instance ID. This does not include the project 9942// ID. 9943// - project: Project ID of the project that contains the instance. 9944// - sha1Fingerprint: Sha1 FingerPrint. 9945func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall { 9946 c := &SslCertsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9947 c.project = project 9948 c.instance = instance 9949 c.sha1Fingerprint = sha1Fingerprint 9950 return c 9951} 9952 9953// Fields allows partial responses to be retrieved. See 9954// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9955// for more information. 9956func (c *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall { 9957 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9958 return c 9959} 9960 9961// Context sets the context to be used in this call's Do method. Any 9962// pending HTTP request will be aborted if the provided context is 9963// canceled. 9964func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall { 9965 c.ctx_ = ctx 9966 return c 9967} 9968 9969// Header returns an http.Header that can be modified by the caller to 9970// add HTTP headers to the request. 9971func (c *SslCertsDeleteCall) Header() http.Header { 9972 if c.header_ == nil { 9973 c.header_ = make(http.Header) 9974 } 9975 return c.header_ 9976} 9977 9978func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) { 9979 reqHeaders := make(http.Header) 9980 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9981 for k, v := range c.header_ { 9982 reqHeaders[k] = v 9983 } 9984 reqHeaders.Set("User-Agent", c.s.userAgent()) 9985 var body io.Reader = nil 9986 c.urlParams_.Set("alt", alt) 9987 c.urlParams_.Set("prettyPrint", "false") 9988 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") 9989 urls += "?" + c.urlParams_.Encode() 9990 req, err := http.NewRequest("DELETE", urls, body) 9991 if err != nil { 9992 return nil, err 9993 } 9994 req.Header = reqHeaders 9995 googleapi.Expand(req.URL, map[string]string{ 9996 "project": c.project, 9997 "instance": c.instance, 9998 "sha1Fingerprint": c.sha1Fingerprint, 9999 }) 10000 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10001} 10002 10003// Do executes the "sql.sslCerts.delete" call. 10004// Exactly one of *Operation or error will be non-nil. Any non-2xx 10005// status code is an error. Response headers are in either 10006// *Operation.ServerResponse.Header or (if a response was returned at 10007// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10008// to check whether the returned error was because 10009// http.StatusNotModified was returned. 10010func (c *SslCertsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10011 gensupport.SetOptions(c.urlParams_, opts...) 10012 res, err := c.doRequest("json") 10013 if res != nil && res.StatusCode == http.StatusNotModified { 10014 if res.Body != nil { 10015 res.Body.Close() 10016 } 10017 return nil, &googleapi.Error{ 10018 Code: res.StatusCode, 10019 Header: res.Header, 10020 } 10021 } 10022 if err != nil { 10023 return nil, err 10024 } 10025 defer googleapi.CloseBody(res) 10026 if err := googleapi.CheckResponse(res); err != nil { 10027 return nil, err 10028 } 10029 ret := &Operation{ 10030 ServerResponse: googleapi.ServerResponse{ 10031 Header: res.Header, 10032 HTTPStatusCode: res.StatusCode, 10033 }, 10034 } 10035 target := &ret 10036 if err := gensupport.DecodeResponse(target, res); err != nil { 10037 return nil, err 10038 } 10039 return ret, nil 10040 // { 10041 // "description": "Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.", 10042 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 10043 // "httpMethod": "DELETE", 10044 // "id": "sql.sslCerts.delete", 10045 // "parameterOrder": [ 10046 // "project", 10047 // "instance", 10048 // "sha1Fingerprint" 10049 // ], 10050 // "parameters": { 10051 // "instance": { 10052 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10053 // "location": "path", 10054 // "required": true, 10055 // "type": "string" 10056 // }, 10057 // "project": { 10058 // "description": "Project ID of the project that contains the instance.", 10059 // "location": "path", 10060 // "required": true, 10061 // "type": "string" 10062 // }, 10063 // "sha1Fingerprint": { 10064 // "description": "Sha1 FingerPrint.", 10065 // "location": "path", 10066 // "required": true, 10067 // "type": "string" 10068 // } 10069 // }, 10070 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 10071 // "response": { 10072 // "$ref": "Operation" 10073 // }, 10074 // "scopes": [ 10075 // "https://www.googleapis.com/auth/cloud-platform", 10076 // "https://www.googleapis.com/auth/sqlservice.admin" 10077 // ] 10078 // } 10079 10080} 10081 10082// method id "sql.sslCerts.get": 10083 10084type SslCertsGetCall struct { 10085 s *Service 10086 project string 10087 instance string 10088 sha1Fingerprint string 10089 urlParams_ gensupport.URLParams 10090 ifNoneMatch_ string 10091 ctx_ context.Context 10092 header_ http.Header 10093} 10094 10095// Get: Retrieves a particular SSL certificate. Does not include the 10096// private key (required for usage). The private key must be saved from 10097// the response to initial creation. 10098// 10099// - instance: Cloud SQL instance ID. This does not include the project 10100// ID. 10101// - project: Project ID of the project that contains the instance. 10102// - sha1Fingerprint: Sha1 FingerPrint. 10103func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall { 10104 c := &SslCertsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10105 c.project = project 10106 c.instance = instance 10107 c.sha1Fingerprint = sha1Fingerprint 10108 return c 10109} 10110 10111// Fields allows partial responses to be retrieved. See 10112// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10113// for more information. 10114func (c *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall { 10115 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10116 return c 10117} 10118 10119// IfNoneMatch sets the optional parameter which makes the operation 10120// fail if the object's ETag matches the given value. This is useful for 10121// getting updates only after the object has changed since the last 10122// request. Use googleapi.IsNotModified to check whether the response 10123// error from Do is the result of In-None-Match. 10124func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall { 10125 c.ifNoneMatch_ = entityTag 10126 return c 10127} 10128 10129// Context sets the context to be used in this call's Do method. Any 10130// pending HTTP request will be aborted if the provided context is 10131// canceled. 10132func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall { 10133 c.ctx_ = ctx 10134 return c 10135} 10136 10137// Header returns an http.Header that can be modified by the caller to 10138// add HTTP headers to the request. 10139func (c *SslCertsGetCall) Header() http.Header { 10140 if c.header_ == nil { 10141 c.header_ = make(http.Header) 10142 } 10143 return c.header_ 10144} 10145 10146func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) { 10147 reqHeaders := make(http.Header) 10148 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10149 for k, v := range c.header_ { 10150 reqHeaders[k] = v 10151 } 10152 reqHeaders.Set("User-Agent", c.s.userAgent()) 10153 if c.ifNoneMatch_ != "" { 10154 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10155 } 10156 var body io.Reader = nil 10157 c.urlParams_.Set("alt", alt) 10158 c.urlParams_.Set("prettyPrint", "false") 10159 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") 10160 urls += "?" + c.urlParams_.Encode() 10161 req, err := http.NewRequest("GET", urls, body) 10162 if err != nil { 10163 return nil, err 10164 } 10165 req.Header = reqHeaders 10166 googleapi.Expand(req.URL, map[string]string{ 10167 "project": c.project, 10168 "instance": c.instance, 10169 "sha1Fingerprint": c.sha1Fingerprint, 10170 }) 10171 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10172} 10173 10174// Do executes the "sql.sslCerts.get" call. 10175// Exactly one of *SslCert or error will be non-nil. Any non-2xx status 10176// code is an error. Response headers are in either 10177// *SslCert.ServerResponse.Header or (if a response was returned at all) 10178// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10179// check whether the returned error was because http.StatusNotModified 10180// was returned. 10181func (c *SslCertsGetCall) Do(opts ...googleapi.CallOption) (*SslCert, error) { 10182 gensupport.SetOptions(c.urlParams_, opts...) 10183 res, err := c.doRequest("json") 10184 if res != nil && res.StatusCode == http.StatusNotModified { 10185 if res.Body != nil { 10186 res.Body.Close() 10187 } 10188 return nil, &googleapi.Error{ 10189 Code: res.StatusCode, 10190 Header: res.Header, 10191 } 10192 } 10193 if err != nil { 10194 return nil, err 10195 } 10196 defer googleapi.CloseBody(res) 10197 if err := googleapi.CheckResponse(res); err != nil { 10198 return nil, err 10199 } 10200 ret := &SslCert{ 10201 ServerResponse: googleapi.ServerResponse{ 10202 Header: res.Header, 10203 HTTPStatusCode: res.StatusCode, 10204 }, 10205 } 10206 target := &ret 10207 if err := gensupport.DecodeResponse(target, res); err != nil { 10208 return nil, err 10209 } 10210 return ret, nil 10211 // { 10212 // "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.", 10213 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 10214 // "httpMethod": "GET", 10215 // "id": "sql.sslCerts.get", 10216 // "parameterOrder": [ 10217 // "project", 10218 // "instance", 10219 // "sha1Fingerprint" 10220 // ], 10221 // "parameters": { 10222 // "instance": { 10223 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10224 // "location": "path", 10225 // "required": true, 10226 // "type": "string" 10227 // }, 10228 // "project": { 10229 // "description": "Project ID of the project that contains the instance.", 10230 // "location": "path", 10231 // "required": true, 10232 // "type": "string" 10233 // }, 10234 // "sha1Fingerprint": { 10235 // "description": "Sha1 FingerPrint.", 10236 // "location": "path", 10237 // "required": true, 10238 // "type": "string" 10239 // } 10240 // }, 10241 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 10242 // "response": { 10243 // "$ref": "SslCert" 10244 // }, 10245 // "scopes": [ 10246 // "https://www.googleapis.com/auth/cloud-platform", 10247 // "https://www.googleapis.com/auth/sqlservice.admin" 10248 // ] 10249 // } 10250 10251} 10252 10253// method id "sql.sslCerts.insert": 10254 10255type SslCertsInsertCall struct { 10256 s *Service 10257 project string 10258 instance string 10259 sslcertsinsertrequest *SslCertsInsertRequest 10260 urlParams_ gensupport.URLParams 10261 ctx_ context.Context 10262 header_ http.Header 10263} 10264 10265// Insert: Creates an SSL certificate and returns it along with the 10266// private key and server certificate authority. The new certificate 10267// will not be usable until the instance is restarted. 10268// 10269// - instance: Cloud SQL instance ID. This does not include the project 10270// ID. 10271// - project: Project ID of the project that contains the instance. 10272func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall { 10273 c := &SslCertsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10274 c.project = project 10275 c.instance = instance 10276 c.sslcertsinsertrequest = sslcertsinsertrequest 10277 return c 10278} 10279 10280// Fields allows partial responses to be retrieved. See 10281// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10282// for more information. 10283func (c *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall { 10284 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10285 return c 10286} 10287 10288// Context sets the context to be used in this call's Do method. Any 10289// pending HTTP request will be aborted if the provided context is 10290// canceled. 10291func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall { 10292 c.ctx_ = ctx 10293 return c 10294} 10295 10296// Header returns an http.Header that can be modified by the caller to 10297// add HTTP headers to the request. 10298func (c *SslCertsInsertCall) Header() http.Header { 10299 if c.header_ == nil { 10300 c.header_ = make(http.Header) 10301 } 10302 return c.header_ 10303} 10304 10305func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, error) { 10306 reqHeaders := make(http.Header) 10307 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10308 for k, v := range c.header_ { 10309 reqHeaders[k] = v 10310 } 10311 reqHeaders.Set("User-Agent", c.s.userAgent()) 10312 var body io.Reader = nil 10313 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest) 10314 if err != nil { 10315 return nil, err 10316 } 10317 reqHeaders.Set("Content-Type", "application/json") 10318 c.urlParams_.Set("alt", alt) 10319 c.urlParams_.Set("prettyPrint", "false") 10320 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts") 10321 urls += "?" + c.urlParams_.Encode() 10322 req, err := http.NewRequest("POST", urls, body) 10323 if err != nil { 10324 return nil, err 10325 } 10326 req.Header = reqHeaders 10327 googleapi.Expand(req.URL, map[string]string{ 10328 "project": c.project, 10329 "instance": c.instance, 10330 }) 10331 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10332} 10333 10334// Do executes the "sql.sslCerts.insert" call. 10335// Exactly one of *SslCertsInsertResponse or error will be non-nil. Any 10336// non-2xx status code is an error. Response headers are in either 10337// *SslCertsInsertResponse.ServerResponse.Header or (if a response was 10338// returned at all) in error.(*googleapi.Error).Header. Use 10339// googleapi.IsNotModified to check whether the returned error was 10340// because http.StatusNotModified was returned. 10341func (c *SslCertsInsertCall) Do(opts ...googleapi.CallOption) (*SslCertsInsertResponse, error) { 10342 gensupport.SetOptions(c.urlParams_, opts...) 10343 res, err := c.doRequest("json") 10344 if res != nil && res.StatusCode == http.StatusNotModified { 10345 if res.Body != nil { 10346 res.Body.Close() 10347 } 10348 return nil, &googleapi.Error{ 10349 Code: res.StatusCode, 10350 Header: res.Header, 10351 } 10352 } 10353 if err != nil { 10354 return nil, err 10355 } 10356 defer googleapi.CloseBody(res) 10357 if err := googleapi.CheckResponse(res); err != nil { 10358 return nil, err 10359 } 10360 ret := &SslCertsInsertResponse{ 10361 ServerResponse: googleapi.ServerResponse{ 10362 Header: res.Header, 10363 HTTPStatusCode: res.StatusCode, 10364 }, 10365 } 10366 target := &ret 10367 if err := gensupport.DecodeResponse(target, res); err != nil { 10368 return nil, err 10369 } 10370 return ret, nil 10371 // { 10372 // "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.", 10373 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 10374 // "httpMethod": "POST", 10375 // "id": "sql.sslCerts.insert", 10376 // "parameterOrder": [ 10377 // "project", 10378 // "instance" 10379 // ], 10380 // "parameters": { 10381 // "instance": { 10382 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10383 // "location": "path", 10384 // "required": true, 10385 // "type": "string" 10386 // }, 10387 // "project": { 10388 // "description": "Project ID of the project that contains the instance.", 10389 // "location": "path", 10390 // "required": true, 10391 // "type": "string" 10392 // } 10393 // }, 10394 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 10395 // "request": { 10396 // "$ref": "SslCertsInsertRequest" 10397 // }, 10398 // "response": { 10399 // "$ref": "SslCertsInsertResponse" 10400 // }, 10401 // "scopes": [ 10402 // "https://www.googleapis.com/auth/cloud-platform", 10403 // "https://www.googleapis.com/auth/sqlservice.admin" 10404 // ] 10405 // } 10406 10407} 10408 10409// method id "sql.sslCerts.list": 10410 10411type SslCertsListCall struct { 10412 s *Service 10413 project string 10414 instance string 10415 urlParams_ gensupport.URLParams 10416 ifNoneMatch_ string 10417 ctx_ context.Context 10418 header_ http.Header 10419} 10420 10421// List: Lists all of the current SSL certificates for the instance. 10422// 10423// - instance: Cloud SQL instance ID. This does not include the project 10424// ID. 10425// - project: Project ID of the project that contains the instance. 10426func (r *SslCertsService) List(project string, instance string) *SslCertsListCall { 10427 c := &SslCertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10428 c.project = project 10429 c.instance = instance 10430 return c 10431} 10432 10433// Fields allows partial responses to be retrieved. See 10434// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10435// for more information. 10436func (c *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall { 10437 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10438 return c 10439} 10440 10441// IfNoneMatch sets the optional parameter which makes the operation 10442// fail if the object's ETag matches the given value. This is useful for 10443// getting updates only after the object has changed since the last 10444// request. Use googleapi.IsNotModified to check whether the response 10445// error from Do is the result of In-None-Match. 10446func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall { 10447 c.ifNoneMatch_ = entityTag 10448 return c 10449} 10450 10451// Context sets the context to be used in this call's Do method. Any 10452// pending HTTP request will be aborted if the provided context is 10453// canceled. 10454func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall { 10455 c.ctx_ = ctx 10456 return c 10457} 10458 10459// Header returns an http.Header that can be modified by the caller to 10460// add HTTP headers to the request. 10461func (c *SslCertsListCall) Header() http.Header { 10462 if c.header_ == nil { 10463 c.header_ = make(http.Header) 10464 } 10465 return c.header_ 10466} 10467 10468func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) { 10469 reqHeaders := make(http.Header) 10470 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10471 for k, v := range c.header_ { 10472 reqHeaders[k] = v 10473 } 10474 reqHeaders.Set("User-Agent", c.s.userAgent()) 10475 if c.ifNoneMatch_ != "" { 10476 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10477 } 10478 var body io.Reader = nil 10479 c.urlParams_.Set("alt", alt) 10480 c.urlParams_.Set("prettyPrint", "false") 10481 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts") 10482 urls += "?" + c.urlParams_.Encode() 10483 req, err := http.NewRequest("GET", urls, body) 10484 if err != nil { 10485 return nil, err 10486 } 10487 req.Header = reqHeaders 10488 googleapi.Expand(req.URL, map[string]string{ 10489 "project": c.project, 10490 "instance": c.instance, 10491 }) 10492 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10493} 10494 10495// Do executes the "sql.sslCerts.list" call. 10496// Exactly one of *SslCertsListResponse or error will be non-nil. Any 10497// non-2xx status code is an error. Response headers are in either 10498// *SslCertsListResponse.ServerResponse.Header or (if a response was 10499// returned at all) in error.(*googleapi.Error).Header. Use 10500// googleapi.IsNotModified to check whether the returned error was 10501// because http.StatusNotModified was returned. 10502func (c *SslCertsListCall) Do(opts ...googleapi.CallOption) (*SslCertsListResponse, error) { 10503 gensupport.SetOptions(c.urlParams_, opts...) 10504 res, err := c.doRequest("json") 10505 if res != nil && res.StatusCode == http.StatusNotModified { 10506 if res.Body != nil { 10507 res.Body.Close() 10508 } 10509 return nil, &googleapi.Error{ 10510 Code: res.StatusCode, 10511 Header: res.Header, 10512 } 10513 } 10514 if err != nil { 10515 return nil, err 10516 } 10517 defer googleapi.CloseBody(res) 10518 if err := googleapi.CheckResponse(res); err != nil { 10519 return nil, err 10520 } 10521 ret := &SslCertsListResponse{ 10522 ServerResponse: googleapi.ServerResponse{ 10523 Header: res.Header, 10524 HTTPStatusCode: res.StatusCode, 10525 }, 10526 } 10527 target := &ret 10528 if err := gensupport.DecodeResponse(target, res); err != nil { 10529 return nil, err 10530 } 10531 return ret, nil 10532 // { 10533 // "description": "Lists all of the current SSL certificates for the instance.", 10534 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 10535 // "httpMethod": "GET", 10536 // "id": "sql.sslCerts.list", 10537 // "parameterOrder": [ 10538 // "project", 10539 // "instance" 10540 // ], 10541 // "parameters": { 10542 // "instance": { 10543 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10544 // "location": "path", 10545 // "required": true, 10546 // "type": "string" 10547 // }, 10548 // "project": { 10549 // "description": "Project ID of the project that contains the instance.", 10550 // "location": "path", 10551 // "required": true, 10552 // "type": "string" 10553 // } 10554 // }, 10555 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 10556 // "response": { 10557 // "$ref": "SslCertsListResponse" 10558 // }, 10559 // "scopes": [ 10560 // "https://www.googleapis.com/auth/cloud-platform", 10561 // "https://www.googleapis.com/auth/sqlservice.admin" 10562 // ] 10563 // } 10564 10565} 10566 10567// method id "sql.tiers.list": 10568 10569type TiersListCall struct { 10570 s *Service 10571 project string 10572 urlParams_ gensupport.URLParams 10573 ifNoneMatch_ string 10574 ctx_ context.Context 10575 header_ http.Header 10576} 10577 10578// List: Lists all available machine types (tiers) for Cloud SQL, for 10579// example, db-custom-1-3840. For related information, see Pricing. 10580// 10581// - project: Project ID of the project for which to list tiers. 10582func (r *TiersService) List(project string) *TiersListCall { 10583 c := &TiersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10584 c.project = project 10585 return c 10586} 10587 10588// Fields allows partial responses to be retrieved. See 10589// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10590// for more information. 10591func (c *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall { 10592 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10593 return c 10594} 10595 10596// IfNoneMatch sets the optional parameter which makes the operation 10597// fail if the object's ETag matches the given value. This is useful for 10598// getting updates only after the object has changed since the last 10599// request. Use googleapi.IsNotModified to check whether the response 10600// error from Do is the result of In-None-Match. 10601func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall { 10602 c.ifNoneMatch_ = entityTag 10603 return c 10604} 10605 10606// Context sets the context to be used in this call's Do method. Any 10607// pending HTTP request will be aborted if the provided context is 10608// canceled. 10609func (c *TiersListCall) Context(ctx context.Context) *TiersListCall { 10610 c.ctx_ = ctx 10611 return c 10612} 10613 10614// Header returns an http.Header that can be modified by the caller to 10615// add HTTP headers to the request. 10616func (c *TiersListCall) Header() http.Header { 10617 if c.header_ == nil { 10618 c.header_ = make(http.Header) 10619 } 10620 return c.header_ 10621} 10622 10623func (c *TiersListCall) doRequest(alt string) (*http.Response, error) { 10624 reqHeaders := make(http.Header) 10625 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10626 for k, v := range c.header_ { 10627 reqHeaders[k] = v 10628 } 10629 reqHeaders.Set("User-Agent", c.s.userAgent()) 10630 if c.ifNoneMatch_ != "" { 10631 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10632 } 10633 var body io.Reader = nil 10634 c.urlParams_.Set("alt", alt) 10635 c.urlParams_.Set("prettyPrint", "false") 10636 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/tiers") 10637 urls += "?" + c.urlParams_.Encode() 10638 req, err := http.NewRequest("GET", urls, body) 10639 if err != nil { 10640 return nil, err 10641 } 10642 req.Header = reqHeaders 10643 googleapi.Expand(req.URL, map[string]string{ 10644 "project": c.project, 10645 }) 10646 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10647} 10648 10649// Do executes the "sql.tiers.list" call. 10650// Exactly one of *TiersListResponse or error will be non-nil. Any 10651// non-2xx status code is an error. Response headers are in either 10652// *TiersListResponse.ServerResponse.Header or (if a response was 10653// returned at all) in error.(*googleapi.Error).Header. Use 10654// googleapi.IsNotModified to check whether the returned error was 10655// because http.StatusNotModified was returned. 10656func (c *TiersListCall) Do(opts ...googleapi.CallOption) (*TiersListResponse, error) { 10657 gensupport.SetOptions(c.urlParams_, opts...) 10658 res, err := c.doRequest("json") 10659 if res != nil && res.StatusCode == http.StatusNotModified { 10660 if res.Body != nil { 10661 res.Body.Close() 10662 } 10663 return nil, &googleapi.Error{ 10664 Code: res.StatusCode, 10665 Header: res.Header, 10666 } 10667 } 10668 if err != nil { 10669 return nil, err 10670 } 10671 defer googleapi.CloseBody(res) 10672 if err := googleapi.CheckResponse(res); err != nil { 10673 return nil, err 10674 } 10675 ret := &TiersListResponse{ 10676 ServerResponse: googleapi.ServerResponse{ 10677 Header: res.Header, 10678 HTTPStatusCode: res.StatusCode, 10679 }, 10680 } 10681 target := &ret 10682 if err := gensupport.DecodeResponse(target, res); err != nil { 10683 return nil, err 10684 } 10685 return ret, nil 10686 // { 10687 // "description": "Lists all available machine types (tiers) for Cloud SQL, for example, db-custom-1-3840. For related information, see Pricing.", 10688 // "flatPath": "sql/v1beta4/projects/{project}/tiers", 10689 // "httpMethod": "GET", 10690 // "id": "sql.tiers.list", 10691 // "parameterOrder": [ 10692 // "project" 10693 // ], 10694 // "parameters": { 10695 // "project": { 10696 // "description": "Project ID of the project for which to list tiers.", 10697 // "location": "path", 10698 // "required": true, 10699 // "type": "string" 10700 // } 10701 // }, 10702 // "path": "sql/v1beta4/projects/{project}/tiers", 10703 // "response": { 10704 // "$ref": "TiersListResponse" 10705 // }, 10706 // "scopes": [ 10707 // "https://www.googleapis.com/auth/cloud-platform", 10708 // "https://www.googleapis.com/auth/sqlservice.admin" 10709 // ] 10710 // } 10711 10712} 10713 10714// method id "sql.users.delete": 10715 10716type UsersDeleteCall struct { 10717 s *Service 10718 project string 10719 instance string 10720 urlParams_ gensupport.URLParams 10721 ctx_ context.Context 10722 header_ http.Header 10723} 10724 10725// Delete: Deletes a user from a Cloud SQL instance. 10726// 10727// - instance: Database instance ID. This does not include the project 10728// ID. 10729// - project: Project ID of the project that contains the instance. 10730func (r *UsersService) Delete(project string, instance string) *UsersDeleteCall { 10731 c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10732 c.project = project 10733 c.instance = instance 10734 return c 10735} 10736 10737// Host sets the optional parameter "host": Host of the user in the 10738// instance. 10739func (c *UsersDeleteCall) Host(host string) *UsersDeleteCall { 10740 c.urlParams_.Set("host", host) 10741 return c 10742} 10743 10744// Name sets the optional parameter "name": Name of the user in the 10745// instance. 10746func (c *UsersDeleteCall) Name(name string) *UsersDeleteCall { 10747 c.urlParams_.Set("name", name) 10748 return c 10749} 10750 10751// Fields allows partial responses to be retrieved. See 10752// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10753// for more information. 10754func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { 10755 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10756 return c 10757} 10758 10759// Context sets the context to be used in this call's Do method. Any 10760// pending HTTP request will be aborted if the provided context is 10761// canceled. 10762func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { 10763 c.ctx_ = ctx 10764 return c 10765} 10766 10767// Header returns an http.Header that can be modified by the caller to 10768// add HTTP headers to the request. 10769func (c *UsersDeleteCall) Header() http.Header { 10770 if c.header_ == nil { 10771 c.header_ = make(http.Header) 10772 } 10773 return c.header_ 10774} 10775 10776func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { 10777 reqHeaders := make(http.Header) 10778 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10779 for k, v := range c.header_ { 10780 reqHeaders[k] = v 10781 } 10782 reqHeaders.Set("User-Agent", c.s.userAgent()) 10783 var body io.Reader = nil 10784 c.urlParams_.Set("alt", alt) 10785 c.urlParams_.Set("prettyPrint", "false") 10786 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 10787 urls += "?" + c.urlParams_.Encode() 10788 req, err := http.NewRequest("DELETE", urls, body) 10789 if err != nil { 10790 return nil, err 10791 } 10792 req.Header = reqHeaders 10793 googleapi.Expand(req.URL, map[string]string{ 10794 "project": c.project, 10795 "instance": c.instance, 10796 }) 10797 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10798} 10799 10800// Do executes the "sql.users.delete" call. 10801// Exactly one of *Operation or error will be non-nil. Any non-2xx 10802// status code is an error. Response headers are in either 10803// *Operation.ServerResponse.Header or (if a response was returned at 10804// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10805// to check whether the returned error was because 10806// http.StatusNotModified was returned. 10807func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10808 gensupport.SetOptions(c.urlParams_, opts...) 10809 res, err := c.doRequest("json") 10810 if res != nil && res.StatusCode == http.StatusNotModified { 10811 if res.Body != nil { 10812 res.Body.Close() 10813 } 10814 return nil, &googleapi.Error{ 10815 Code: res.StatusCode, 10816 Header: res.Header, 10817 } 10818 } 10819 if err != nil { 10820 return nil, err 10821 } 10822 defer googleapi.CloseBody(res) 10823 if err := googleapi.CheckResponse(res); err != nil { 10824 return nil, err 10825 } 10826 ret := &Operation{ 10827 ServerResponse: googleapi.ServerResponse{ 10828 Header: res.Header, 10829 HTTPStatusCode: res.StatusCode, 10830 }, 10831 } 10832 target := &ret 10833 if err := gensupport.DecodeResponse(target, res); err != nil { 10834 return nil, err 10835 } 10836 return ret, nil 10837 // { 10838 // "description": "Deletes a user from a Cloud SQL instance.", 10839 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 10840 // "httpMethod": "DELETE", 10841 // "id": "sql.users.delete", 10842 // "parameterOrder": [ 10843 // "project", 10844 // "instance" 10845 // ], 10846 // "parameters": { 10847 // "host": { 10848 // "description": "Host of the user in the instance.", 10849 // "location": "query", 10850 // "type": "string" 10851 // }, 10852 // "instance": { 10853 // "description": "Database instance ID. This does not include the project ID.", 10854 // "location": "path", 10855 // "required": true, 10856 // "type": "string" 10857 // }, 10858 // "name": { 10859 // "description": "Name of the user in the instance.", 10860 // "location": "query", 10861 // "type": "string" 10862 // }, 10863 // "project": { 10864 // "description": "Project ID of the project that contains the instance.", 10865 // "location": "path", 10866 // "required": true, 10867 // "type": "string" 10868 // } 10869 // }, 10870 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 10871 // "response": { 10872 // "$ref": "Operation" 10873 // }, 10874 // "scopes": [ 10875 // "https://www.googleapis.com/auth/cloud-platform", 10876 // "https://www.googleapis.com/auth/sqlservice.admin" 10877 // ] 10878 // } 10879 10880} 10881 10882// method id "sql.users.insert": 10883 10884type UsersInsertCall struct { 10885 s *Service 10886 project string 10887 instance string 10888 user *User 10889 urlParams_ gensupport.URLParams 10890 ctx_ context.Context 10891 header_ http.Header 10892} 10893 10894// Insert: Creates a new user in a Cloud SQL instance. 10895// 10896// - instance: Database instance ID. This does not include the project 10897// ID. 10898// - project: Project ID of the project that contains the instance. 10899func (r *UsersService) Insert(project string, instance string, user *User) *UsersInsertCall { 10900 c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10901 c.project = project 10902 c.instance = instance 10903 c.user = user 10904 return c 10905} 10906 10907// Fields allows partial responses to be retrieved. See 10908// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10909// for more information. 10910func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { 10911 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10912 return c 10913} 10914 10915// Context sets the context to be used in this call's Do method. Any 10916// pending HTTP request will be aborted if the provided context is 10917// canceled. 10918func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { 10919 c.ctx_ = ctx 10920 return c 10921} 10922 10923// Header returns an http.Header that can be modified by the caller to 10924// add HTTP headers to the request. 10925func (c *UsersInsertCall) Header() http.Header { 10926 if c.header_ == nil { 10927 c.header_ = make(http.Header) 10928 } 10929 return c.header_ 10930} 10931 10932func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) { 10933 reqHeaders := make(http.Header) 10934 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10935 for k, v := range c.header_ { 10936 reqHeaders[k] = v 10937 } 10938 reqHeaders.Set("User-Agent", c.s.userAgent()) 10939 var body io.Reader = nil 10940 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 10941 if err != nil { 10942 return nil, err 10943 } 10944 reqHeaders.Set("Content-Type", "application/json") 10945 c.urlParams_.Set("alt", alt) 10946 c.urlParams_.Set("prettyPrint", "false") 10947 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 10948 urls += "?" + c.urlParams_.Encode() 10949 req, err := http.NewRequest("POST", urls, body) 10950 if err != nil { 10951 return nil, err 10952 } 10953 req.Header = reqHeaders 10954 googleapi.Expand(req.URL, map[string]string{ 10955 "project": c.project, 10956 "instance": c.instance, 10957 }) 10958 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10959} 10960 10961// Do executes the "sql.users.insert" call. 10962// Exactly one of *Operation or error will be non-nil. Any non-2xx 10963// status code is an error. Response headers are in either 10964// *Operation.ServerResponse.Header or (if a response was returned at 10965// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10966// to check whether the returned error was because 10967// http.StatusNotModified was returned. 10968func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10969 gensupport.SetOptions(c.urlParams_, opts...) 10970 res, err := c.doRequest("json") 10971 if res != nil && res.StatusCode == http.StatusNotModified { 10972 if res.Body != nil { 10973 res.Body.Close() 10974 } 10975 return nil, &googleapi.Error{ 10976 Code: res.StatusCode, 10977 Header: res.Header, 10978 } 10979 } 10980 if err != nil { 10981 return nil, err 10982 } 10983 defer googleapi.CloseBody(res) 10984 if err := googleapi.CheckResponse(res); err != nil { 10985 return nil, err 10986 } 10987 ret := &Operation{ 10988 ServerResponse: googleapi.ServerResponse{ 10989 Header: res.Header, 10990 HTTPStatusCode: res.StatusCode, 10991 }, 10992 } 10993 target := &ret 10994 if err := gensupport.DecodeResponse(target, res); err != nil { 10995 return nil, err 10996 } 10997 return ret, nil 10998 // { 10999 // "description": "Creates a new user in a Cloud SQL instance.", 11000 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11001 // "httpMethod": "POST", 11002 // "id": "sql.users.insert", 11003 // "parameterOrder": [ 11004 // "project", 11005 // "instance" 11006 // ], 11007 // "parameters": { 11008 // "instance": { 11009 // "description": "Database instance ID. This does not include the project ID.", 11010 // "location": "path", 11011 // "required": true, 11012 // "type": "string" 11013 // }, 11014 // "project": { 11015 // "description": "Project ID of the project that contains the instance.", 11016 // "location": "path", 11017 // "required": true, 11018 // "type": "string" 11019 // } 11020 // }, 11021 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11022 // "request": { 11023 // "$ref": "User" 11024 // }, 11025 // "response": { 11026 // "$ref": "Operation" 11027 // }, 11028 // "scopes": [ 11029 // "https://www.googleapis.com/auth/cloud-platform", 11030 // "https://www.googleapis.com/auth/sqlservice.admin" 11031 // ] 11032 // } 11033 11034} 11035 11036// method id "sql.users.list": 11037 11038type UsersListCall struct { 11039 s *Service 11040 project string 11041 instance string 11042 urlParams_ gensupport.URLParams 11043 ifNoneMatch_ string 11044 ctx_ context.Context 11045 header_ http.Header 11046} 11047 11048// List: Lists users in the specified Cloud SQL instance. 11049// 11050// - instance: Database instance ID. This does not include the project 11051// ID. 11052// - project: Project ID of the project that contains the instance. 11053func (r *UsersService) List(project string, instance string) *UsersListCall { 11054 c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11055 c.project = project 11056 c.instance = instance 11057 return c 11058} 11059 11060// Fields allows partial responses to be retrieved. See 11061// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11062// for more information. 11063func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { 11064 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11065 return c 11066} 11067 11068// IfNoneMatch sets the optional parameter which makes the operation 11069// fail if the object's ETag matches the given value. This is useful for 11070// getting updates only after the object has changed since the last 11071// request. Use googleapi.IsNotModified to check whether the response 11072// error from Do is the result of In-None-Match. 11073func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { 11074 c.ifNoneMatch_ = entityTag 11075 return c 11076} 11077 11078// Context sets the context to be used in this call's Do method. Any 11079// pending HTTP request will be aborted if the provided context is 11080// canceled. 11081func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { 11082 c.ctx_ = ctx 11083 return c 11084} 11085 11086// Header returns an http.Header that can be modified by the caller to 11087// add HTTP headers to the request. 11088func (c *UsersListCall) Header() http.Header { 11089 if c.header_ == nil { 11090 c.header_ = make(http.Header) 11091 } 11092 return c.header_ 11093} 11094 11095func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { 11096 reqHeaders := make(http.Header) 11097 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 11098 for k, v := range c.header_ { 11099 reqHeaders[k] = v 11100 } 11101 reqHeaders.Set("User-Agent", c.s.userAgent()) 11102 if c.ifNoneMatch_ != "" { 11103 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11104 } 11105 var body io.Reader = nil 11106 c.urlParams_.Set("alt", alt) 11107 c.urlParams_.Set("prettyPrint", "false") 11108 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 11109 urls += "?" + c.urlParams_.Encode() 11110 req, err := http.NewRequest("GET", urls, body) 11111 if err != nil { 11112 return nil, err 11113 } 11114 req.Header = reqHeaders 11115 googleapi.Expand(req.URL, map[string]string{ 11116 "project": c.project, 11117 "instance": c.instance, 11118 }) 11119 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11120} 11121 11122// Do executes the "sql.users.list" call. 11123// Exactly one of *UsersListResponse or error will be non-nil. Any 11124// non-2xx status code is an error. Response headers are in either 11125// *UsersListResponse.ServerResponse.Header or (if a response was 11126// returned at all) in error.(*googleapi.Error).Header. Use 11127// googleapi.IsNotModified to check whether the returned error was 11128// because http.StatusNotModified was returned. 11129func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) { 11130 gensupport.SetOptions(c.urlParams_, opts...) 11131 res, err := c.doRequest("json") 11132 if res != nil && res.StatusCode == http.StatusNotModified { 11133 if res.Body != nil { 11134 res.Body.Close() 11135 } 11136 return nil, &googleapi.Error{ 11137 Code: res.StatusCode, 11138 Header: res.Header, 11139 } 11140 } 11141 if err != nil { 11142 return nil, err 11143 } 11144 defer googleapi.CloseBody(res) 11145 if err := googleapi.CheckResponse(res); err != nil { 11146 return nil, err 11147 } 11148 ret := &UsersListResponse{ 11149 ServerResponse: googleapi.ServerResponse{ 11150 Header: res.Header, 11151 HTTPStatusCode: res.StatusCode, 11152 }, 11153 } 11154 target := &ret 11155 if err := gensupport.DecodeResponse(target, res); err != nil { 11156 return nil, err 11157 } 11158 return ret, nil 11159 // { 11160 // "description": "Lists users in the specified Cloud SQL instance.", 11161 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11162 // "httpMethod": "GET", 11163 // "id": "sql.users.list", 11164 // "parameterOrder": [ 11165 // "project", 11166 // "instance" 11167 // ], 11168 // "parameters": { 11169 // "instance": { 11170 // "description": "Database instance ID. This does not include the project ID.", 11171 // "location": "path", 11172 // "required": true, 11173 // "type": "string" 11174 // }, 11175 // "project": { 11176 // "description": "Project ID of the project that contains the instance.", 11177 // "location": "path", 11178 // "required": true, 11179 // "type": "string" 11180 // } 11181 // }, 11182 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11183 // "response": { 11184 // "$ref": "UsersListResponse" 11185 // }, 11186 // "scopes": [ 11187 // "https://www.googleapis.com/auth/cloud-platform", 11188 // "https://www.googleapis.com/auth/sqlservice.admin" 11189 // ] 11190 // } 11191 11192} 11193 11194// method id "sql.users.update": 11195 11196type UsersUpdateCall struct { 11197 s *Service 11198 project string 11199 instance string 11200 user *User 11201 urlParams_ gensupport.URLParams 11202 ctx_ context.Context 11203 header_ http.Header 11204} 11205 11206// Update: Updates an existing user in a Cloud SQL instance. 11207// 11208// - instance: Database instance ID. This does not include the project 11209// ID. 11210// - project: Project ID of the project that contains the instance. 11211func (r *UsersService) Update(project string, instance string, user *User) *UsersUpdateCall { 11212 c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11213 c.project = project 11214 c.instance = instance 11215 c.user = user 11216 return c 11217} 11218 11219// Host sets the optional parameter "host": Host of the user in the 11220// instance. 11221func (c *UsersUpdateCall) Host(host string) *UsersUpdateCall { 11222 c.urlParams_.Set("host", host) 11223 return c 11224} 11225 11226// Name sets the optional parameter "name": Name of the user in the 11227// instance. 11228func (c *UsersUpdateCall) Name(name string) *UsersUpdateCall { 11229 c.urlParams_.Set("name", name) 11230 return c 11231} 11232 11233// Fields allows partial responses to be retrieved. See 11234// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11235// for more information. 11236func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall { 11237 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11238 return c 11239} 11240 11241// Context sets the context to be used in this call's Do method. Any 11242// pending HTTP request will be aborted if the provided context is 11243// canceled. 11244func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall { 11245 c.ctx_ = ctx 11246 return c 11247} 11248 11249// Header returns an http.Header that can be modified by the caller to 11250// add HTTP headers to the request. 11251func (c *UsersUpdateCall) Header() http.Header { 11252 if c.header_ == nil { 11253 c.header_ = make(http.Header) 11254 } 11255 return c.header_ 11256} 11257 11258func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) { 11259 reqHeaders := make(http.Header) 11260 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 11261 for k, v := range c.header_ { 11262 reqHeaders[k] = v 11263 } 11264 reqHeaders.Set("User-Agent", c.s.userAgent()) 11265 var body io.Reader = nil 11266 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 11267 if err != nil { 11268 return nil, err 11269 } 11270 reqHeaders.Set("Content-Type", "application/json") 11271 c.urlParams_.Set("alt", alt) 11272 c.urlParams_.Set("prettyPrint", "false") 11273 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 11274 urls += "?" + c.urlParams_.Encode() 11275 req, err := http.NewRequest("PUT", urls, body) 11276 if err != nil { 11277 return nil, err 11278 } 11279 req.Header = reqHeaders 11280 googleapi.Expand(req.URL, map[string]string{ 11281 "project": c.project, 11282 "instance": c.instance, 11283 }) 11284 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11285} 11286 11287// Do executes the "sql.users.update" call. 11288// Exactly one of *Operation or error will be non-nil. Any non-2xx 11289// status code is an error. Response headers are in either 11290// *Operation.ServerResponse.Header or (if a response was returned at 11291// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11292// to check whether the returned error was because 11293// http.StatusNotModified was returned. 11294func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 11295 gensupport.SetOptions(c.urlParams_, opts...) 11296 res, err := c.doRequest("json") 11297 if res != nil && res.StatusCode == http.StatusNotModified { 11298 if res.Body != nil { 11299 res.Body.Close() 11300 } 11301 return nil, &googleapi.Error{ 11302 Code: res.StatusCode, 11303 Header: res.Header, 11304 } 11305 } 11306 if err != nil { 11307 return nil, err 11308 } 11309 defer googleapi.CloseBody(res) 11310 if err := googleapi.CheckResponse(res); err != nil { 11311 return nil, err 11312 } 11313 ret := &Operation{ 11314 ServerResponse: googleapi.ServerResponse{ 11315 Header: res.Header, 11316 HTTPStatusCode: res.StatusCode, 11317 }, 11318 } 11319 target := &ret 11320 if err := gensupport.DecodeResponse(target, res); err != nil { 11321 return nil, err 11322 } 11323 return ret, nil 11324 // { 11325 // "description": "Updates an existing user in a Cloud SQL instance.", 11326 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11327 // "httpMethod": "PUT", 11328 // "id": "sql.users.update", 11329 // "parameterOrder": [ 11330 // "project", 11331 // "instance" 11332 // ], 11333 // "parameters": { 11334 // "host": { 11335 // "description": "Optional. Host of the user in the instance.", 11336 // "location": "query", 11337 // "type": "string" 11338 // }, 11339 // "instance": { 11340 // "description": "Database instance ID. This does not include the project ID.", 11341 // "location": "path", 11342 // "required": true, 11343 // "type": "string" 11344 // }, 11345 // "name": { 11346 // "description": "Name of the user in the instance.", 11347 // "location": "query", 11348 // "type": "string" 11349 // }, 11350 // "project": { 11351 // "description": "Project ID of the project that contains the instance.", 11352 // "location": "path", 11353 // "required": true, 11354 // "type": "string" 11355 // } 11356 // }, 11357 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11358 // "request": { 11359 // "$ref": "User" 11360 // }, 11361 // "response": { 11362 // "$ref": "Operation" 11363 // }, 11364 // "scopes": [ 11365 // "https://www.googleapis.com/auth/cloud-platform", 11366 // "https://www.googleapis.com/auth/sqlservice.admin" 11367 // ] 11368 // } 11369 11370} 11371