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 // "SQLSERVER_2019_STANDARD" - The database version is SQL Server 2019 859 // Standard. 860 // "SQLSERVER_2019_ENTERPRISE" - The database version is SQL Server 861 // 2019 Enterprise. 862 // "SQLSERVER_2019_EXPRESS" - The database version is SQL Server 2019 863 // Express. 864 // "SQLSERVER_2019_WEB" - The database version is SQL Server 2019 Web. 865 DatabaseVersion string `json:"databaseVersion,omitempty"` 866 867 // DiskEncryptionConfiguration: Disk encryption configuration specific 868 // to an instance. Applies only to Second Generation instances. 869 DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"` 870 871 // DiskEncryptionStatus: Disk encryption status specific to an instance. 872 // Applies only to Second Generation instances. 873 DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"` 874 875 // Etag: This field is deprecated and will be removed from a future 876 // version of the API. Use the *settings.settingsVersion* field instead. 877 Etag string `json:"etag,omitempty"` 878 879 // FailoverReplica: The name and status of the failover replica. This 880 // property is applicable only to Second Generation instances. 881 FailoverReplica *DatabaseInstanceFailoverReplica `json:"failoverReplica,omitempty"` 882 883 // GceZone: The Compute Engine zone that the instance is currently 884 // serving from. This value could be different from the zone that was 885 // specified when the instance was created if the instance has failed 886 // over to its secondary zone. 887 GceZone string `json:"gceZone,omitempty"` 888 889 // InstanceType: The instance type. This can be one of the following. 890 // *CLOUD_SQL_INSTANCE*: A Cloud SQL instance that is not replicating 891 // from a primary instance. *ON_PREMISES_INSTANCE*: An instance running 892 // on the customer's premises. *READ_REPLICA_INSTANCE*: A Cloud SQL 893 // instance configured as a read-replica. 894 // 895 // Possible values: 896 // "SQL_INSTANCE_TYPE_UNSPECIFIED" - This is an unknown Cloud SQL 897 // instance type. 898 // "CLOUD_SQL_INSTANCE" - A regular Cloud SQL instance. 899 // "ON_PREMISES_INSTANCE" - An instance running on the customer's 900 // premises that is not managed by Cloud SQL. 901 // "READ_REPLICA_INSTANCE" - A Cloud SQL instance acting as a 902 // read-replica. 903 InstanceType string `json:"instanceType,omitempty"` 904 905 // IpAddresses: The assigned IP addresses for the instance. 906 IpAddresses []*IpMapping `json:"ipAddresses,omitempty"` 907 908 // Ipv6Address: The IPv6 address assigned to the instance. (Deprecated) 909 // This property was applicable only to First Generation instances. 910 Ipv6Address string `json:"ipv6Address,omitempty"` 911 912 // Kind: This is always *sql#instance*. 913 Kind string `json:"kind,omitempty"` 914 915 // MasterInstanceName: The name of the instance which will act as 916 // primary in the replication setup. 917 MasterInstanceName string `json:"masterInstanceName,omitempty"` 918 919 // MaxDiskSize: The maximum disk size of the instance in bytes. 920 MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"` 921 922 // Name: Name of the Cloud SQL instance. This does not include the 923 // project ID. 924 Name string `json:"name,omitempty"` 925 926 // OnPremisesConfiguration: Configuration specific to on-premises 927 // instances. 928 OnPremisesConfiguration *OnPremisesConfiguration `json:"onPremisesConfiguration,omitempty"` 929 930 // OutOfDiskReport: This field represents the report generated by the 931 // proactive database wellness job for OutOfDisk issues. Writers: -- the 932 // proactive database wellness job for OOD. Readers: -- the proactive 933 // database wellness job 934 OutOfDiskReport *SqlOutOfDiskReport `json:"outOfDiskReport,omitempty"` 935 936 // Project: The project ID of the project containing the Cloud SQL 937 // instance. The Google apps domain is prefixed if applicable. 938 Project string `json:"project,omitempty"` 939 940 // Region: The geographical region. Can be *us-central* (*FIRST_GEN* 941 // instances only) *us-central1* (*SECOND_GEN* instances only) 942 // *asia-east1* or *europe-west1*. Defaults to *us-central* or 943 // *us-central1* depending on the instance type. The region cannot be 944 // changed after instance creation. 945 Region string `json:"region,omitempty"` 946 947 // ReplicaConfiguration: Configuration specific to failover replicas and 948 // read replicas. 949 ReplicaConfiguration *ReplicaConfiguration `json:"replicaConfiguration,omitempty"` 950 951 // ReplicaNames: The replicas of the instance. 952 ReplicaNames []string `json:"replicaNames,omitempty"` 953 954 // RootPassword: Initial root password. Use only on creation. 955 RootPassword string `json:"rootPassword,omitempty"` 956 957 // SatisfiesPzs: The status indicating if instance satisfiesPzs. 958 // Reserved for future use. 959 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"` 960 961 // ScheduledMaintenance: The start time of any upcoming scheduled 962 // maintenance for this instance. 963 ScheduledMaintenance *SqlScheduledMaintenance `json:"scheduledMaintenance,omitempty"` 964 965 // SecondaryGceZone: The Compute Engine zone that the failover instance 966 // is currently serving from for a regional instance. This value could 967 // be different from the zone that was specified when the instance was 968 // created if the instance has failed over to its secondary/failover 969 // zone. Reserved for future use. 970 SecondaryGceZone string `json:"secondaryGceZone,omitempty"` 971 972 // SelfLink: The URI of this resource. 973 SelfLink string `json:"selfLink,omitempty"` 974 975 // ServerCaCert: SSL configuration. 976 ServerCaCert *SslCert `json:"serverCaCert,omitempty"` 977 978 // ServiceAccountEmailAddress: The service account email address 979 // assigned to the instance. This property is read-only. 980 ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,omitempty"` 981 982 // Settings: The user settings. 983 Settings *Settings `json:"settings,omitempty"` 984 985 // State: The current serving state of the Cloud SQL instance. This can 986 // be one of the following. *SQL_INSTANCE_STATE_UNSPECIFIED*: The state 987 // of the instance is unknown. *RUNNABLE*: The instance is running, or 988 // has been stopped by owner. *SUSPENDED*: The instance is not 989 // available, for example due to problems with billing. 990 // *PENDING_DELETE*: The instance is being deleted. *PENDING_CREATE*: 991 // The instance is being created. *MAINTENANCE*: The instance is down 992 // for maintenance. *FAILED*: The instance creation failed. 993 // 994 // Possible values: 995 // "SQL_INSTANCE_STATE_UNSPECIFIED" - The state of the instance is 996 // unknown. 997 // "RUNNABLE" - The instance is running, or has been stopped by owner. 998 // "SUSPENDED" - The instance is not available, for example due to 999 // problems with billing. 1000 // "PENDING_DELETE" - The instance is being deleted. 1001 // "PENDING_CREATE" - The instance is being created. 1002 // "MAINTENANCE" - The instance is down for maintenance. 1003 // "FAILED" - The creation of the instance failed or a fatal error 1004 // occurred during maintenance. 1005 State string `json:"state,omitempty"` 1006 1007 // SuspensionReason: If the instance state is SUSPENDED, the reason for 1008 // the suspension. 1009 // 1010 // Possible values: 1011 // "SQL_SUSPENSION_REASON_UNSPECIFIED" - This is an unknown suspension 1012 // reason. 1013 // "BILLING_ISSUE" - The instance is suspended due to billing issues 1014 // (for example:, GCP account issue) 1015 // "LEGAL_ISSUE" - The instance is suspended due to illegal content 1016 // (for example:, child pornography, copyrighted material, etc.). 1017 // "OPERATIONAL_ISSUE" - The instance is causing operational issues 1018 // (for example:, causing the database to crash). 1019 // "KMS_KEY_ISSUE" - The KMS key used by the instance is either 1020 // revoked or denied access to 1021 SuspensionReason []string `json:"suspensionReason,omitempty"` 1022 1023 // ServerResponse contains the HTTP response code and headers from the 1024 // server. 1025 googleapi.ServerResponse `json:"-"` 1026 1027 // ForceSendFields is a list of field names (e.g. "BackendType") to 1028 // unconditionally include in API requests. By default, fields with 1029 // empty values are omitted from API requests. However, any non-pointer, 1030 // non-interface field appearing in ForceSendFields will be sent to the 1031 // server regardless of whether the field is empty or not. This may be 1032 // used to include empty fields in Patch requests. 1033 ForceSendFields []string `json:"-"` 1034 1035 // NullFields is a list of field names (e.g. "BackendType") to include 1036 // in API requests with the JSON null value. By default, fields with 1037 // empty values are omitted from API requests. However, any field with 1038 // an empty value appearing in NullFields will be sent to the server as 1039 // null. It is an error if a field in this list has a non-empty value. 1040 // This may be used to include null fields in Patch requests. 1041 NullFields []string `json:"-"` 1042} 1043 1044func (s *DatabaseInstance) MarshalJSON() ([]byte, error) { 1045 type NoMethod DatabaseInstance 1046 raw := NoMethod(*s) 1047 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1048} 1049 1050// DatabaseInstanceFailoverReplica: The name and status of the failover 1051// replica. This property is applicable only to Second Generation 1052// instances. 1053type DatabaseInstanceFailoverReplica struct { 1054 // Available: The availability status of the failover replica. A false 1055 // status indicates that the failover replica is out of sync. The 1056 // primary instance can only failover to the failover replica when the 1057 // status is true. 1058 Available bool `json:"available,omitempty"` 1059 1060 // Name: The name of the failover replica. If specified at instance 1061 // creation, a failover replica is created for the instance. The name 1062 // doesn't include the project ID. This property is applicable only to 1063 // Second Generation instances. 1064 Name string `json:"name,omitempty"` 1065 1066 // ForceSendFields is a list of field names (e.g. "Available") to 1067 // unconditionally include in API requests. By default, fields with 1068 // empty values are omitted from API requests. However, any non-pointer, 1069 // non-interface field appearing in ForceSendFields will be sent to the 1070 // server regardless of whether the field is empty or not. This may be 1071 // used to include empty fields in Patch requests. 1072 ForceSendFields []string `json:"-"` 1073 1074 // NullFields is a list of field names (e.g. "Available") to include in 1075 // API requests with the JSON null value. By default, fields with empty 1076 // values are omitted from API requests. However, any field with an 1077 // empty value appearing in NullFields will be sent to the server as 1078 // null. It is an error if a field in this list has a non-empty value. 1079 // This may be used to include null fields in Patch requests. 1080 NullFields []string `json:"-"` 1081} 1082 1083func (s *DatabaseInstanceFailoverReplica) MarshalJSON() ([]byte, error) { 1084 type NoMethod DatabaseInstanceFailoverReplica 1085 raw := NoMethod(*s) 1086 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1087} 1088 1089// DatabasesListResponse: Database list response. 1090type DatabasesListResponse struct { 1091 // Items: List of database resources in the instance. 1092 Items []*Database `json:"items,omitempty"` 1093 1094 // Kind: This is always *sql#databasesList*. 1095 Kind string `json:"kind,omitempty"` 1096 1097 // ServerResponse contains the HTTP response code and headers from the 1098 // server. 1099 googleapi.ServerResponse `json:"-"` 1100 1101 // ForceSendFields is a list of field names (e.g. "Items") to 1102 // unconditionally include in API requests. By default, fields with 1103 // empty values are omitted from API requests. However, any non-pointer, 1104 // non-interface field appearing in ForceSendFields will be sent to the 1105 // server regardless of whether the field is empty or not. This may be 1106 // used to include empty fields in Patch requests. 1107 ForceSendFields []string `json:"-"` 1108 1109 // NullFields is a list of field names (e.g. "Items") to include in API 1110 // requests with the JSON null value. By default, fields with empty 1111 // values are omitted from API requests. However, any field with an 1112 // empty value appearing in NullFields will be sent to the server as 1113 // null. It is an error if a field in this list has a non-empty value. 1114 // This may be used to include null fields in Patch requests. 1115 NullFields []string `json:"-"` 1116} 1117 1118func (s *DatabasesListResponse) MarshalJSON() ([]byte, error) { 1119 type NoMethod DatabasesListResponse 1120 raw := NoMethod(*s) 1121 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1122} 1123 1124// DemoteMasterConfiguration: Read-replica configuration for connecting 1125// to the on-premises primary instance. 1126type DemoteMasterConfiguration struct { 1127 // Kind: This is always *sql#demoteMasterConfiguration*. 1128 Kind string `json:"kind,omitempty"` 1129 1130 // MysqlReplicaConfiguration: MySQL specific configuration when 1131 // replicating from a MySQL on-premises primary instance. Replication 1132 // configuration information such as the username, password, 1133 // certificates, and keys are not stored in the instance metadata. The 1134 // configuration information is used only to set up the replication 1135 // connection and is stored by MySQL in a file named *master.info* in 1136 // the data directory. 1137 MysqlReplicaConfiguration *DemoteMasterMySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"` 1138 1139 // ForceSendFields is a list of field names (e.g. "Kind") to 1140 // unconditionally include in API requests. By default, fields with 1141 // empty values are omitted from API requests. However, any non-pointer, 1142 // non-interface field appearing in ForceSendFields will be sent to the 1143 // server regardless of whether the field is empty or not. This may be 1144 // used to include empty fields in Patch requests. 1145 ForceSendFields []string `json:"-"` 1146 1147 // NullFields is a list of field names (e.g. "Kind") to include in API 1148 // requests with the JSON null value. By default, fields with empty 1149 // values are omitted from API requests. However, any field with an 1150 // empty value appearing in NullFields will be sent to the server as 1151 // null. It is an error if a field in this list has a non-empty value. 1152 // This may be used to include null fields in Patch requests. 1153 NullFields []string `json:"-"` 1154} 1155 1156func (s *DemoteMasterConfiguration) MarshalJSON() ([]byte, error) { 1157 type NoMethod DemoteMasterConfiguration 1158 raw := NoMethod(*s) 1159 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1160} 1161 1162// DemoteMasterContext: Database instance demote primary instance 1163// context. 1164type DemoteMasterContext struct { 1165 // Kind: This is always *sql#demoteMasterContext*. 1166 Kind string `json:"kind,omitempty"` 1167 1168 // MasterInstanceName: The name of the instance which will act as 1169 // on-premises primary instance in the replication setup. 1170 MasterInstanceName string `json:"masterInstanceName,omitempty"` 1171 1172 // ReplicaConfiguration: Configuration specific to read-replicas 1173 // replicating from the on-premises primary instance. 1174 ReplicaConfiguration *DemoteMasterConfiguration `json:"replicaConfiguration,omitempty"` 1175 1176 // VerifyGtidConsistency: Verify GTID consistency for demote operation. 1177 // Default value: *True*. Second Generation instances only. Setting this 1178 // flag to false enables you to bypass GTID consistency check between 1179 // on-premises primary instance and Cloud SQL instance during the 1180 // demotion operation but also exposes you to the risk of future 1181 // replication failures. Change the value only if you know the reason 1182 // for the GTID divergence and are confident that doing so will not 1183 // cause any replication issues. 1184 VerifyGtidConsistency bool `json:"verifyGtidConsistency,omitempty"` 1185 1186 // ForceSendFields is a list of field names (e.g. "Kind") to 1187 // unconditionally include in API requests. By default, fields with 1188 // empty values are omitted from API requests. However, any non-pointer, 1189 // non-interface field appearing in ForceSendFields will be sent to the 1190 // server regardless of whether the field is empty or not. This may be 1191 // used to include empty fields in Patch requests. 1192 ForceSendFields []string `json:"-"` 1193 1194 // NullFields is a list of field names (e.g. "Kind") to include in API 1195 // requests with the JSON null value. By default, fields with empty 1196 // values are omitted from API requests. However, any field with an 1197 // empty value appearing in NullFields will be sent to the server as 1198 // null. It is an error if a field in this list has a non-empty value. 1199 // This may be used to include null fields in Patch requests. 1200 NullFields []string `json:"-"` 1201} 1202 1203func (s *DemoteMasterContext) MarshalJSON() ([]byte, error) { 1204 type NoMethod DemoteMasterContext 1205 raw := NoMethod(*s) 1206 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1207} 1208 1209// DemoteMasterMySqlReplicaConfiguration: Read-replica configuration 1210// specific to MySQL databases. 1211type DemoteMasterMySqlReplicaConfiguration struct { 1212 // CaCertificate: PEM representation of the trusted CA's x509 1213 // certificate. 1214 CaCertificate string `json:"caCertificate,omitempty"` 1215 1216 // ClientCertificate: PEM representation of the replica's x509 1217 // certificate. 1218 ClientCertificate string `json:"clientCertificate,omitempty"` 1219 1220 // ClientKey: PEM representation of the replica's private key. The 1221 // corresponsing public key is encoded in the client's certificate. The 1222 // format of the replica's private key can be either PKCS #1 or PKCS #8. 1223 ClientKey string `json:"clientKey,omitempty"` 1224 1225 // Kind: This is always *sql#demoteMasterMysqlReplicaConfiguration*. 1226 Kind string `json:"kind,omitempty"` 1227 1228 // Password: The password for the replication connection. 1229 Password string `json:"password,omitempty"` 1230 1231 // Username: The username for the replication connection. 1232 Username string `json:"username,omitempty"` 1233 1234 // ForceSendFields is a list of field names (e.g. "CaCertificate") to 1235 // unconditionally include in API requests. By default, fields with 1236 // empty values are omitted from API requests. However, any non-pointer, 1237 // non-interface field appearing in ForceSendFields will be sent to the 1238 // server regardless of whether the field is empty or not. This may be 1239 // used to include empty fields in Patch requests. 1240 ForceSendFields []string `json:"-"` 1241 1242 // NullFields is a list of field names (e.g. "CaCertificate") to include 1243 // in API requests with the JSON null value. By default, fields with 1244 // empty values are omitted from API requests. However, any field with 1245 // an empty value appearing in NullFields will be sent to the server as 1246 // null. It is an error if a field in this list has a non-empty value. 1247 // This may be used to include null fields in Patch requests. 1248 NullFields []string `json:"-"` 1249} 1250 1251func (s *DemoteMasterMySqlReplicaConfiguration) MarshalJSON() ([]byte, error) { 1252 type NoMethod DemoteMasterMySqlReplicaConfiguration 1253 raw := NoMethod(*s) 1254 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1255} 1256 1257// DenyMaintenancePeriod: Deny Maintenance Periods. This specifies a 1258// date range during when all CSA rollout will be denied. 1259type DenyMaintenancePeriod struct { 1260 // EndDate: "deny maintenance period" end date. If the year of the end 1261 // date is empty, the year of the start date also must be empty. In this 1262 // case, it means the deny maintenance period recurs every year. The 1263 // date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01 1264 EndDate string `json:"endDate,omitempty"` 1265 1266 // StartDate: "deny maintenance period" start date. If the year of the 1267 // start date is empty, the year of the end date also must be empty. In 1268 // this case, it means the deny maintenance period recurs every year. 1269 // The date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 1270 // 11-01 1271 StartDate string `json:"startDate,omitempty"` 1272 1273 // Time: Time in UTC when the "deny maintenance period" starts on 1274 // start_date and ends on end_date. The time is in format: HH:mm:SS, 1275 // i.e., 00:00:00 1276 Time string `json:"time,omitempty"` 1277 1278 // ForceSendFields is a list of field names (e.g. "EndDate") to 1279 // unconditionally include in API requests. By default, fields with 1280 // empty values are omitted from API requests. However, any non-pointer, 1281 // non-interface field appearing in ForceSendFields will be sent to the 1282 // server regardless of whether the field is empty or not. This may be 1283 // used to include empty fields in Patch requests. 1284 ForceSendFields []string `json:"-"` 1285 1286 // NullFields is a list of field names (e.g. "EndDate") to include in 1287 // API requests with the JSON null value. By default, fields with empty 1288 // values are omitted from API requests. However, any field with an 1289 // empty value appearing in NullFields will be sent to the server as 1290 // null. It is an error if a field in this list has a non-empty value. 1291 // This may be used to include null fields in Patch requests. 1292 NullFields []string `json:"-"` 1293} 1294 1295func (s *DenyMaintenancePeriod) MarshalJSON() ([]byte, error) { 1296 type NoMethod DenyMaintenancePeriod 1297 raw := NoMethod(*s) 1298 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1299} 1300 1301// DiskEncryptionConfiguration: Disk encryption configuration for an 1302// instance. 1303type DiskEncryptionConfiguration struct { 1304 // Kind: This is always *sql#diskEncryptionConfiguration*. 1305 Kind string `json:"kind,omitempty"` 1306 1307 // KmsKeyName: Resource name of KMS key for disk encryption 1308 KmsKeyName string `json:"kmsKeyName,omitempty"` 1309 1310 // ForceSendFields is a list of field names (e.g. "Kind") to 1311 // unconditionally include in API requests. By default, fields with 1312 // empty values are omitted from API requests. However, any non-pointer, 1313 // non-interface field appearing in ForceSendFields will be sent to the 1314 // server regardless of whether the field is empty or not. This may be 1315 // used to include empty fields in Patch requests. 1316 ForceSendFields []string `json:"-"` 1317 1318 // NullFields is a list of field names (e.g. "Kind") to include in API 1319 // requests with the JSON null value. By default, fields with empty 1320 // values are omitted from API requests. However, any field with an 1321 // empty value appearing in NullFields will be sent to the server as 1322 // null. It is an error if a field in this list has a non-empty value. 1323 // This may be used to include null fields in Patch requests. 1324 NullFields []string `json:"-"` 1325} 1326 1327func (s *DiskEncryptionConfiguration) MarshalJSON() ([]byte, error) { 1328 type NoMethod DiskEncryptionConfiguration 1329 raw := NoMethod(*s) 1330 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1331} 1332 1333// DiskEncryptionStatus: Disk encryption status for an instance. 1334type DiskEncryptionStatus struct { 1335 // Kind: This is always *sql#diskEncryptionStatus*. 1336 Kind string `json:"kind,omitempty"` 1337 1338 // KmsKeyVersionName: KMS key version used to encrypt the Cloud SQL 1339 // instance resource 1340 KmsKeyVersionName string `json:"kmsKeyVersionName,omitempty"` 1341 1342 // ForceSendFields is a list of field names (e.g. "Kind") to 1343 // unconditionally include in API requests. By default, fields with 1344 // empty values are omitted from API requests. However, any non-pointer, 1345 // non-interface field appearing in ForceSendFields will be sent to the 1346 // server regardless of whether the field is empty or not. This may be 1347 // used to include empty fields in Patch requests. 1348 ForceSendFields []string `json:"-"` 1349 1350 // NullFields is a list of field names (e.g. "Kind") to include in API 1351 // requests with the JSON null value. By default, fields with empty 1352 // values are omitted from API requests. However, any field with an 1353 // empty value appearing in NullFields will be sent to the server as 1354 // null. It is an error if a field in this list has a non-empty value. 1355 // This may be used to include null fields in Patch requests. 1356 NullFields []string `json:"-"` 1357} 1358 1359func (s *DiskEncryptionStatus) MarshalJSON() ([]byte, error) { 1360 type NoMethod DiskEncryptionStatus 1361 raw := NoMethod(*s) 1362 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1363} 1364 1365// ExportContext: Database instance export context. 1366type ExportContext struct { 1367 // CsvExportOptions: Options for exporting data as CSV. *MySQL* and 1368 // *PostgreSQL* instances only. 1369 CsvExportOptions *ExportContextCsvExportOptions `json:"csvExportOptions,omitempty"` 1370 1371 // Databases: Databases to be exported. *MySQL instances:* If *fileType* 1372 // is *SQL* and no database is specified, all databases are exported, 1373 // except for the *mysql* system database. If *fileType* is *CSV*, you 1374 // can specify one database, either by using this property or by using 1375 // the *csvExportOptions.selectQuery* property, which takes precedence 1376 // over this property. *PostgreSQL instances:* You must specify one 1377 // database to be exported. If *fileType* is *CSV*, this database must 1378 // match the one specified in the *csvExportOptions.selectQuery* 1379 // property. *SQL Server instances:* You must specify one database to be 1380 // exported, and the *fileType* must be *BAK*. 1381 Databases []string `json:"databases,omitempty"` 1382 1383 // FileType: The file type for the specified uri. *SQL*: The file 1384 // contains SQL statements. *CSV*: The file contains CSV data. *BAK*: 1385 // The file contains backup data for a SQL Server instance. 1386 // 1387 // Possible values: 1388 // "SQL_FILE_TYPE_UNSPECIFIED" - Unknown file type. 1389 // "SQL" - File containing SQL statements. 1390 // "CSV" - File in CSV format. 1391 // "BAK" 1392 FileType string `json:"fileType,omitempty"` 1393 1394 // Kind: This is always *sql#exportContext*. 1395 Kind string `json:"kind,omitempty"` 1396 1397 // Offload: Option for export offload. 1398 Offload bool `json:"offload,omitempty"` 1399 1400 // SqlExportOptions: Options for exporting data as SQL statements. 1401 SqlExportOptions *ExportContextSqlExportOptions `json:"sqlExportOptions,omitempty"` 1402 1403 // Uri: The path to the file in Google Cloud Storage where the export 1404 // will be stored. The URI is in the form *gs://bucketName/fileName*. If 1405 // the file already exists, the request succeeds, but the operation 1406 // fails. If *fileType* is *SQL* and the filename ends with .gz, the 1407 // contents are compressed. 1408 Uri string `json:"uri,omitempty"` 1409 1410 // ForceSendFields is a list of field names (e.g. "CsvExportOptions") to 1411 // unconditionally include in API requests. By default, fields with 1412 // empty values are omitted from API requests. However, any non-pointer, 1413 // non-interface field appearing in ForceSendFields will be sent to the 1414 // server regardless of whether the field is empty or not. This may be 1415 // used to include empty fields in Patch requests. 1416 ForceSendFields []string `json:"-"` 1417 1418 // NullFields is a list of field names (e.g. "CsvExportOptions") to 1419 // include in API requests with the JSON null value. By default, fields 1420 // with empty values are omitted from API requests. However, any field 1421 // with an empty value appearing in NullFields will be sent to the 1422 // server as null. It is an error if a field in this list has a 1423 // non-empty value. This may be used to include null fields in Patch 1424 // requests. 1425 NullFields []string `json:"-"` 1426} 1427 1428func (s *ExportContext) MarshalJSON() ([]byte, error) { 1429 type NoMethod ExportContext 1430 raw := NoMethod(*s) 1431 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1432} 1433 1434// ExportContextCsvExportOptions: Options for exporting data as CSV. 1435// *MySQL* and *PostgreSQL* instances only. 1436type ExportContextCsvExportOptions struct { 1437 // SelectQuery: The select query used to extract the data. 1438 SelectQuery string `json:"selectQuery,omitempty"` 1439 1440 // ForceSendFields is a list of field names (e.g. "SelectQuery") to 1441 // unconditionally include in API requests. By default, fields with 1442 // empty values are omitted from API requests. However, any non-pointer, 1443 // non-interface field appearing in ForceSendFields will be sent to the 1444 // server regardless of whether the field is empty or not. This may be 1445 // used to include empty fields in Patch requests. 1446 ForceSendFields []string `json:"-"` 1447 1448 // NullFields is a list of field names (e.g. "SelectQuery") to include 1449 // in API requests with the JSON null value. By default, fields with 1450 // empty values are omitted from API requests. However, any field with 1451 // an empty value appearing in NullFields will be sent to the server as 1452 // null. It is an error if a field in this list has a non-empty value. 1453 // This may be used to include null fields in Patch requests. 1454 NullFields []string `json:"-"` 1455} 1456 1457func (s *ExportContextCsvExportOptions) MarshalJSON() ([]byte, error) { 1458 type NoMethod ExportContextCsvExportOptions 1459 raw := NoMethod(*s) 1460 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1461} 1462 1463// ExportContextSqlExportOptions: Options for exporting data as SQL 1464// statements. 1465type ExportContextSqlExportOptions struct { 1466 // MysqlExportOptions: Options for exporting from MySQL. 1467 MysqlExportOptions *ExportContextSqlExportOptionsMysqlExportOptions `json:"mysqlExportOptions,omitempty"` 1468 1469 // SchemaOnly: Export only schemas. 1470 SchemaOnly bool `json:"schemaOnly,omitempty"` 1471 1472 // Tables: Tables to export, or that were exported, from the specified 1473 // database. If you specify tables, specify one and only one database. 1474 // For PostgreSQL instances, you can specify only one table. 1475 Tables []string `json:"tables,omitempty"` 1476 1477 // ForceSendFields is a list of field names (e.g. "MysqlExportOptions") 1478 // to unconditionally include in API requests. By default, fields with 1479 // empty values are omitted from API requests. However, any non-pointer, 1480 // non-interface field appearing in ForceSendFields will be sent to the 1481 // server regardless of whether the field is empty or not. This may be 1482 // used to include empty fields in Patch requests. 1483 ForceSendFields []string `json:"-"` 1484 1485 // NullFields is a list of field names (e.g. "MysqlExportOptions") to 1486 // include in API requests with the JSON null value. By default, fields 1487 // with empty values are omitted from API requests. However, any field 1488 // with an empty value appearing in NullFields will be sent to the 1489 // server as null. It is an error if a field in this list has a 1490 // non-empty value. This may be used to include null fields in Patch 1491 // requests. 1492 NullFields []string `json:"-"` 1493} 1494 1495func (s *ExportContextSqlExportOptions) MarshalJSON() ([]byte, error) { 1496 type NoMethod ExportContextSqlExportOptions 1497 raw := NoMethod(*s) 1498 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1499} 1500 1501// ExportContextSqlExportOptionsMysqlExportOptions: Options for 1502// exporting from MySQL. 1503type ExportContextSqlExportOptionsMysqlExportOptions struct { 1504 // MasterData: Option to include SQL statement required to set up 1505 // replication. If set to *1*, the dump file includes a CHANGE MASTER TO 1506 // statement with the binary log coordinates, and --set-gtid-purged is 1507 // set to ON. If set to *2*, the CHANGE MASTER TO statement is written 1508 // as a SQL comment and has no effect. If set to any value other than 1509 // *1*, --set-gtid-purged is set to OFF. 1510 MasterData int64 `json:"masterData,omitempty"` 1511 1512 // ForceSendFields is a list of field names (e.g. "MasterData") to 1513 // unconditionally include in API requests. By default, fields with 1514 // empty values are omitted from API requests. However, any non-pointer, 1515 // non-interface field appearing in ForceSendFields will be sent to the 1516 // server regardless of whether the field is empty or not. This may be 1517 // used to include empty fields in Patch requests. 1518 ForceSendFields []string `json:"-"` 1519 1520 // NullFields is a list of field names (e.g. "MasterData") to include in 1521 // API requests with the JSON null value. By default, fields with empty 1522 // values are omitted from API requests. However, any field with an 1523 // empty value appearing in NullFields will be sent to the server as 1524 // null. It is an error if a field in this list has a non-empty value. 1525 // This may be used to include null fields in Patch requests. 1526 NullFields []string `json:"-"` 1527} 1528 1529func (s *ExportContextSqlExportOptionsMysqlExportOptions) MarshalJSON() ([]byte, error) { 1530 type NoMethod ExportContextSqlExportOptionsMysqlExportOptions 1531 raw := NoMethod(*s) 1532 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1533} 1534 1535// FailoverContext: Database instance failover context. 1536type FailoverContext struct { 1537 // Kind: This is always *sql#failoverContext*. 1538 Kind string `json:"kind,omitempty"` 1539 1540 // SettingsVersion: The current settings version of this instance. 1541 // Request will be rejected if this version doesn't match the current 1542 // settings version. 1543 SettingsVersion int64 `json:"settingsVersion,omitempty,string"` 1544 1545 // ForceSendFields is a list of field names (e.g. "Kind") to 1546 // unconditionally include in API requests. By default, fields with 1547 // empty values are omitted from API requests. However, any non-pointer, 1548 // non-interface field appearing in ForceSendFields will be sent to the 1549 // server regardless of whether the field is empty or not. This may be 1550 // used to include empty fields in Patch requests. 1551 ForceSendFields []string `json:"-"` 1552 1553 // NullFields is a list of field names (e.g. "Kind") to include in API 1554 // requests with the JSON null value. By default, fields with empty 1555 // values are omitted from API requests. However, any field with an 1556 // empty value appearing in NullFields will be sent to the server as 1557 // null. It is an error if a field in this list has a non-empty value. 1558 // This may be used to include null fields in Patch requests. 1559 NullFields []string `json:"-"` 1560} 1561 1562func (s *FailoverContext) MarshalJSON() ([]byte, error) { 1563 type NoMethod FailoverContext 1564 raw := NoMethod(*s) 1565 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1566} 1567 1568// Flag: A flag resource. 1569type Flag struct { 1570 // AllowedIntValues: Use this field if only certain integers are 1571 // accepted. Can be combined with min_value and max_value to add 1572 // additional values. 1573 AllowedIntValues googleapi.Int64s `json:"allowedIntValues,omitempty"` 1574 1575 // AllowedStringValues: For *STRING* flags, a list of strings that the 1576 // value can be set to. 1577 AllowedStringValues []string `json:"allowedStringValues,omitempty"` 1578 1579 // AppliesTo: The database version this flag applies to. Can be 1580 // *MYSQL_8_0*, *MYSQL_5_6*, or *MYSQL_5_7*. 1581 // 1582 // Possible values: 1583 // "SQL_DATABASE_VERSION_UNSPECIFIED" - This is an unknown database 1584 // version. 1585 // "MYSQL_5_1" - The database version is MySQL 5.1. 1586 // "MYSQL_5_5" - The database version is MySQL 5.5. 1587 // "MYSQL_5_6" - The database version is MySQL 5.6. 1588 // "MYSQL_5_7" - The database version is MySQL 5.7. 1589 // "POSTGRES_9_6" - The database version is PostgreSQL 9.6. 1590 // "POSTGRES_11" - The database version is PostgreSQL 11. 1591 // "SQLSERVER_2017_STANDARD" - The database version is SQL Server 2017 1592 // Standard. 1593 // "SQLSERVER_2017_ENTERPRISE" - The database version is SQL Server 1594 // 2017 Enterprise. 1595 // "SQLSERVER_2017_EXPRESS" - The database version is SQL Server 2017 1596 // Express. 1597 // "SQLSERVER_2017_WEB" - The database version is SQL Server 2017 Web. 1598 // "POSTGRES_10" - The database version is PostgreSQL 10. 1599 // "POSTGRES_12" - The database version is PostgreSQL 12. 1600 // "MYSQL_8_0" - The database version is MySQL 8. 1601 // "POSTGRES_13" - The database version is PostgreSQL 13. 1602 // "SQLSERVER_2019_STANDARD" - The database version is SQL Server 2019 1603 // Standard. 1604 // "SQLSERVER_2019_ENTERPRISE" - The database version is SQL Server 1605 // 2019 Enterprise. 1606 // "SQLSERVER_2019_EXPRESS" - The database version is SQL Server 2019 1607 // Express. 1608 // "SQLSERVER_2019_WEB" - The database version is SQL Server 2019 Web. 1609 AppliesTo []string `json:"appliesTo,omitempty"` 1610 1611 // InBeta: Whether or not the flag is considered in beta. 1612 InBeta bool `json:"inBeta,omitempty"` 1613 1614 // Kind: This is always *sql#flag*. 1615 Kind string `json:"kind,omitempty"` 1616 1617 // MaxValue: For *INTEGER* flags, the maximum allowed value. 1618 MaxValue int64 `json:"maxValue,omitempty,string"` 1619 1620 // MinValue: For *INTEGER* flags, the minimum allowed value. 1621 MinValue int64 `json:"minValue,omitempty,string"` 1622 1623 // Name: This is the name of the flag. Flag names always use 1624 // underscores, not hyphens, for example: *max_allowed_packet* 1625 Name string `json:"name,omitempty"` 1626 1627 // RequiresRestart: Indicates whether changing this flag will trigger a 1628 // database restart. Only applicable to Second Generation instances. 1629 RequiresRestart bool `json:"requiresRestart,omitempty"` 1630 1631 // Type: The type of the flag. Flags are typed to being *BOOLEAN*, 1632 // *STRING*, *INTEGER* or *NONE*. *NONE* is used for flags which do not 1633 // take a value, such as *skip_grant_tables*. 1634 // 1635 // Possible values: 1636 // "SQL_FLAG_TYPE_UNSPECIFIED" - This is an unknown flag type. 1637 // "BOOLEAN" - Boolean type flag. 1638 // "STRING" - String type flag. 1639 // "INTEGER" - Integer type flag. 1640 // "NONE" - Flag type used for a server startup option. 1641 // "MYSQL_TIMEZONE_OFFSET" - Type introduced specially for MySQL 1642 // TimeZone offset. Accept a string value with the format [-12:59, 1643 // 13:00]. 1644 // "FLOAT" - Float type flag. 1645 // "REPEATED_STRING" - Comma-separated list of the strings in a 1646 // SqlFlagType enum. 1647 Type string `json:"type,omitempty"` 1648 1649 // ForceSendFields is a list of field names (e.g. "AllowedIntValues") to 1650 // unconditionally include in API requests. By default, fields with 1651 // empty values are omitted from API requests. However, any non-pointer, 1652 // non-interface field appearing in ForceSendFields will be sent to the 1653 // server regardless of whether the field is empty or not. This may be 1654 // used to include empty fields in Patch requests. 1655 ForceSendFields []string `json:"-"` 1656 1657 // NullFields is a list of field names (e.g. "AllowedIntValues") to 1658 // include in API requests with the JSON null value. By default, fields 1659 // with empty values are omitted from API requests. However, any field 1660 // with an empty value appearing in NullFields will be sent to the 1661 // server as null. It is an error if a field in this list has a 1662 // non-empty value. This may be used to include null fields in Patch 1663 // requests. 1664 NullFields []string `json:"-"` 1665} 1666 1667func (s *Flag) MarshalJSON() ([]byte, error) { 1668 type NoMethod Flag 1669 raw := NoMethod(*s) 1670 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1671} 1672 1673// FlagsListResponse: Flags list response. 1674type FlagsListResponse struct { 1675 // Items: List of flags. 1676 Items []*Flag `json:"items,omitempty"` 1677 1678 // Kind: This is always *sql#flagsList*. 1679 Kind string `json:"kind,omitempty"` 1680 1681 // ServerResponse contains the HTTP response code and headers from the 1682 // server. 1683 googleapi.ServerResponse `json:"-"` 1684 1685 // ForceSendFields is a list of field names (e.g. "Items") to 1686 // unconditionally include in API requests. By default, fields with 1687 // empty values are omitted from API requests. However, any non-pointer, 1688 // non-interface field appearing in ForceSendFields will be sent to the 1689 // server regardless of whether the field is empty or not. This may be 1690 // used to include empty fields in Patch requests. 1691 ForceSendFields []string `json:"-"` 1692 1693 // NullFields is a list of field names (e.g. "Items") to include in API 1694 // requests with the JSON null value. By default, fields with empty 1695 // values are omitted from API requests. However, any field with an 1696 // empty value appearing in NullFields will be sent to the server as 1697 // null. It is an error if a field in this list has a non-empty value. 1698 // This may be used to include null fields in Patch requests. 1699 NullFields []string `json:"-"` 1700} 1701 1702func (s *FlagsListResponse) MarshalJSON() ([]byte, error) { 1703 type NoMethod FlagsListResponse 1704 raw := NoMethod(*s) 1705 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1706} 1707 1708// ImportContext: Database instance import context. 1709type ImportContext struct { 1710 // BakImportOptions: Import parameters specific to SQL Server .BAK files 1711 BakImportOptions *ImportContextBakImportOptions `json:"bakImportOptions,omitempty"` 1712 1713 // CsvImportOptions: Options for importing data as CSV. 1714 CsvImportOptions *ImportContextCsvImportOptions `json:"csvImportOptions,omitempty"` 1715 1716 // Database: The target database for the import. If *fileType* is *SQL*, 1717 // this field is required only if the import file does not specify a 1718 // database, and is overridden by any database specification in the 1719 // import file. If *fileType* is *CSV*, one database must be specified. 1720 Database string `json:"database,omitempty"` 1721 1722 // FileType: The file type for the specified uri. *SQL*: The file 1723 // contains SQL statements. *CSV*: The file contains CSV data. 1724 // 1725 // Possible values: 1726 // "SQL_FILE_TYPE_UNSPECIFIED" - Unknown file type. 1727 // "SQL" - File containing SQL statements. 1728 // "CSV" - File in CSV format. 1729 // "BAK" 1730 FileType string `json:"fileType,omitempty"` 1731 1732 // ImportUser: The PostgreSQL user for this import operation. PostgreSQL 1733 // instances only. 1734 ImportUser string `json:"importUser,omitempty"` 1735 1736 // Kind: This is always *sql#importContext*. 1737 Kind string `json:"kind,omitempty"` 1738 1739 // Uri: Path to the import file in Cloud Storage, in the form 1740 // *gs://bucketName/fileName*. Compressed gzip files (.gz) are supported 1741 // when *fileType* is *SQL*. The instance must have write permissions to 1742 // the bucket and read access to the file. 1743 Uri string `json:"uri,omitempty"` 1744 1745 // ForceSendFields is a list of field names (e.g. "BakImportOptions") to 1746 // unconditionally include in API requests. By default, fields with 1747 // empty values are omitted from API requests. However, any non-pointer, 1748 // non-interface field appearing in ForceSendFields will be sent to the 1749 // server regardless of whether the field is empty or not. This may be 1750 // used to include empty fields in Patch requests. 1751 ForceSendFields []string `json:"-"` 1752 1753 // NullFields is a list of field names (e.g. "BakImportOptions") to 1754 // include in API requests with the JSON null value. By default, fields 1755 // with empty values are omitted from API requests. However, any field 1756 // with an empty value appearing in NullFields will be sent to the 1757 // server as null. It is an error if a field in this list has a 1758 // non-empty value. This may be used to include null fields in Patch 1759 // requests. 1760 NullFields []string `json:"-"` 1761} 1762 1763func (s *ImportContext) MarshalJSON() ([]byte, error) { 1764 type NoMethod ImportContext 1765 raw := NoMethod(*s) 1766 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1767} 1768 1769// ImportContextBakImportOptions: Import parameters specific to SQL 1770// Server .BAK files 1771type ImportContextBakImportOptions struct { 1772 EncryptionOptions *ImportContextBakImportOptionsEncryptionOptions `json:"encryptionOptions,omitempty"` 1773 1774 // ForceSendFields is a list of field names (e.g. "EncryptionOptions") 1775 // to unconditionally include in API requests. By default, fields with 1776 // empty values are omitted from API requests. However, any non-pointer, 1777 // non-interface field appearing in ForceSendFields will be sent to the 1778 // server regardless of whether the field is empty or not. This may be 1779 // used to include empty fields in Patch requests. 1780 ForceSendFields []string `json:"-"` 1781 1782 // NullFields is a list of field names (e.g. "EncryptionOptions") to 1783 // include in API requests with the JSON null value. By default, fields 1784 // with empty values are omitted from API requests. However, any field 1785 // with an empty value appearing in NullFields will be sent to the 1786 // server as null. It is an error if a field in this list has a 1787 // non-empty value. This may be used to include null fields in Patch 1788 // requests. 1789 NullFields []string `json:"-"` 1790} 1791 1792func (s *ImportContextBakImportOptions) MarshalJSON() ([]byte, error) { 1793 type NoMethod ImportContextBakImportOptions 1794 raw := NoMethod(*s) 1795 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1796} 1797 1798type ImportContextBakImportOptionsEncryptionOptions struct { 1799 // CertPath: Path to the Certificate (.cer) in Cloud Storage, in the 1800 // form *gs://bucketName/fileName*. The instance must have write 1801 // permissions to the bucket and read access to the file. 1802 CertPath string `json:"certPath,omitempty"` 1803 1804 // PvkPassword: Password that encrypts the private key 1805 PvkPassword string `json:"pvkPassword,omitempty"` 1806 1807 // PvkPath: Path to the Certificate Private Key (.pvk) in Cloud Storage, 1808 // in the form *gs://bucketName/fileName*. The instance must have write 1809 // permissions to the bucket and read access to the file. 1810 PvkPath string `json:"pvkPath,omitempty"` 1811 1812 // ForceSendFields is a list of field names (e.g. "CertPath") to 1813 // unconditionally include in API requests. By default, fields with 1814 // empty values are omitted from API requests. However, any non-pointer, 1815 // non-interface field appearing in ForceSendFields will be sent to the 1816 // server regardless of whether the field is empty or not. This may be 1817 // used to include empty fields in Patch requests. 1818 ForceSendFields []string `json:"-"` 1819 1820 // NullFields is a list of field names (e.g. "CertPath") to include in 1821 // API requests with the JSON null value. By default, fields with empty 1822 // values are omitted from API requests. However, any field with an 1823 // empty value appearing in NullFields will be sent to the server as 1824 // null. It is an error if a field in this list has a non-empty value. 1825 // This may be used to include null fields in Patch requests. 1826 NullFields []string `json:"-"` 1827} 1828 1829func (s *ImportContextBakImportOptionsEncryptionOptions) MarshalJSON() ([]byte, error) { 1830 type NoMethod ImportContextBakImportOptionsEncryptionOptions 1831 raw := NoMethod(*s) 1832 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1833} 1834 1835// ImportContextCsvImportOptions: Options for importing data as CSV. 1836type ImportContextCsvImportOptions struct { 1837 // Columns: The columns to which CSV data is imported. If not specified, 1838 // all columns of the database table are loaded with CSV data. 1839 Columns []string `json:"columns,omitempty"` 1840 1841 // Table: The table to which CSV data is imported. 1842 Table string `json:"table,omitempty"` 1843 1844 // ForceSendFields is a list of field names (e.g. "Columns") to 1845 // unconditionally include in API requests. By default, fields with 1846 // empty values are omitted from API requests. However, any non-pointer, 1847 // non-interface field appearing in ForceSendFields will be sent to the 1848 // server regardless of whether the field is empty or not. This may be 1849 // used to include empty fields in Patch requests. 1850 ForceSendFields []string `json:"-"` 1851 1852 // NullFields is a list of field names (e.g. "Columns") to include in 1853 // API requests with the JSON null value. By default, fields with empty 1854 // values are omitted from API requests. However, any field with an 1855 // empty value appearing in NullFields will be sent to the server as 1856 // null. It is an error if a field in this list has a non-empty value. 1857 // This may be used to include null fields in Patch requests. 1858 NullFields []string `json:"-"` 1859} 1860 1861func (s *ImportContextCsvImportOptions) MarshalJSON() ([]byte, error) { 1862 type NoMethod ImportContextCsvImportOptions 1863 raw := NoMethod(*s) 1864 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1865} 1866 1867// InsightsConfig: Insights configuration. This specifies when Cloud SQL 1868// Insights feature is enabled and optional configuration. 1869type InsightsConfig struct { 1870 // QueryInsightsEnabled: Whether Query Insights feature is enabled. 1871 QueryInsightsEnabled bool `json:"queryInsightsEnabled,omitempty"` 1872 1873 // QueryPlansPerMinute: Number of query plans generated by Insights per 1874 // minute. Default is 5. Changing this will restart the database. 1875 QueryPlansPerMinute int64 `json:"queryPlansPerMinute,omitempty"` 1876 1877 // QueryStringLength: Maximum query length stored in bytes. Default 1878 // value: 1024 bytes. Range: 256-4500 bytes. Query length more than this 1879 // field value will be truncated to this value. When unset, query length 1880 // will be the default value. Changing query length will restart the 1881 // database. 1882 QueryStringLength int64 `json:"queryStringLength,omitempty"` 1883 1884 // RecordApplicationTags: Whether Query Insights will record application 1885 // tags from query when enabled. 1886 RecordApplicationTags bool `json:"recordApplicationTags,omitempty"` 1887 1888 // RecordClientAddress: Whether Query Insights will record client 1889 // address when enabled. 1890 RecordClientAddress bool `json:"recordClientAddress,omitempty"` 1891 1892 // ForceSendFields is a list of field names (e.g. 1893 // "QueryInsightsEnabled") to unconditionally include in API requests. 1894 // By default, fields with empty values are omitted from API requests. 1895 // However, any non-pointer, non-interface field appearing in 1896 // ForceSendFields will be sent to the server regardless of whether the 1897 // field is empty or not. This may be used to include empty fields in 1898 // Patch requests. 1899 ForceSendFields []string `json:"-"` 1900 1901 // NullFields is a list of field names (e.g. "QueryInsightsEnabled") to 1902 // include in API requests with the JSON null value. By default, fields 1903 // with empty values are omitted from API requests. However, any field 1904 // with an empty value appearing in NullFields will be sent to the 1905 // server as null. It is an error if a field in this list has a 1906 // non-empty value. This may be used to include null fields in Patch 1907 // requests. 1908 NullFields []string `json:"-"` 1909} 1910 1911func (s *InsightsConfig) MarshalJSON() ([]byte, error) { 1912 type NoMethod InsightsConfig 1913 raw := NoMethod(*s) 1914 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1915} 1916 1917// InstancesCloneRequest: Database instance clone request. 1918type InstancesCloneRequest struct { 1919 // CloneContext: Contains details about the clone operation. 1920 CloneContext *CloneContext `json:"cloneContext,omitempty"` 1921 1922 // ForceSendFields is a list of field names (e.g. "CloneContext") to 1923 // unconditionally include in API requests. By default, fields with 1924 // empty values are omitted from API requests. However, any non-pointer, 1925 // non-interface field appearing in ForceSendFields will be sent to the 1926 // server regardless of whether the field is empty or not. This may be 1927 // used to include empty fields in Patch requests. 1928 ForceSendFields []string `json:"-"` 1929 1930 // NullFields is a list of field names (e.g. "CloneContext") to include 1931 // in API requests with the JSON null value. By default, fields with 1932 // empty values are omitted from API requests. However, any field with 1933 // an empty value appearing in NullFields will be sent to the server as 1934 // null. It is an error if a field in this list has a non-empty value. 1935 // This may be used to include null fields in Patch requests. 1936 NullFields []string `json:"-"` 1937} 1938 1939func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error) { 1940 type NoMethod InstancesCloneRequest 1941 raw := NoMethod(*s) 1942 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1943} 1944 1945// InstancesDemoteMasterRequest: Database demote primary instance 1946// request. 1947type InstancesDemoteMasterRequest struct { 1948 // DemoteMasterContext: Contains details about the demoteMaster 1949 // operation. 1950 DemoteMasterContext *DemoteMasterContext `json:"demoteMasterContext,omitempty"` 1951 1952 // ForceSendFields is a list of field names (e.g. "DemoteMasterContext") 1953 // to unconditionally include in API requests. By default, fields with 1954 // empty values are omitted from API requests. However, any non-pointer, 1955 // non-interface field appearing in ForceSendFields will be sent to the 1956 // server regardless of whether the field is empty or not. This may be 1957 // used to include empty fields in Patch requests. 1958 ForceSendFields []string `json:"-"` 1959 1960 // NullFields is a list of field names (e.g. "DemoteMasterContext") to 1961 // include in API requests with the JSON null value. By default, fields 1962 // with empty values are omitted from API requests. However, any field 1963 // with an empty value appearing in NullFields will be sent to the 1964 // server as null. It is an error if a field in this list has a 1965 // non-empty value. This may be used to include null fields in Patch 1966 // requests. 1967 NullFields []string `json:"-"` 1968} 1969 1970func (s *InstancesDemoteMasterRequest) MarshalJSON() ([]byte, error) { 1971 type NoMethod InstancesDemoteMasterRequest 1972 raw := NoMethod(*s) 1973 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1974} 1975 1976// InstancesExportRequest: Database instance export request. 1977type InstancesExportRequest struct { 1978 // ExportContext: Contains details about the export operation. 1979 ExportContext *ExportContext `json:"exportContext,omitempty"` 1980 1981 // ForceSendFields is a list of field names (e.g. "ExportContext") to 1982 // unconditionally include in API requests. By default, fields with 1983 // empty values are omitted from API requests. However, any non-pointer, 1984 // non-interface field appearing in ForceSendFields will be sent to the 1985 // server regardless of whether the field is empty or not. This may be 1986 // used to include empty fields in Patch requests. 1987 ForceSendFields []string `json:"-"` 1988 1989 // NullFields is a list of field names (e.g. "ExportContext") to include 1990 // in API requests with the JSON null value. By default, fields with 1991 // empty values are omitted from API requests. However, any field with 1992 // an empty value appearing in NullFields will be sent to the server as 1993 // null. It is an error if a field in this list has a non-empty value. 1994 // This may be used to include null fields in Patch requests. 1995 NullFields []string `json:"-"` 1996} 1997 1998func (s *InstancesExportRequest) MarshalJSON() ([]byte, error) { 1999 type NoMethod InstancesExportRequest 2000 raw := NoMethod(*s) 2001 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2002} 2003 2004// InstancesFailoverRequest: Instance failover request. 2005type InstancesFailoverRequest struct { 2006 // FailoverContext: Failover Context. 2007 FailoverContext *FailoverContext `json:"failoverContext,omitempty"` 2008 2009 // ForceSendFields is a list of field names (e.g. "FailoverContext") to 2010 // unconditionally include in API requests. By default, fields with 2011 // empty values are omitted from API requests. However, any non-pointer, 2012 // non-interface field appearing in ForceSendFields will be sent to the 2013 // server regardless of whether the field is empty or not. This may be 2014 // used to include empty fields in Patch requests. 2015 ForceSendFields []string `json:"-"` 2016 2017 // NullFields is a list of field names (e.g. "FailoverContext") to 2018 // include in API requests with the JSON null value. By default, fields 2019 // with empty values are omitted from API requests. However, any field 2020 // with an empty value appearing in NullFields will be sent to the 2021 // server as null. It is an error if a field in this list has a 2022 // non-empty value. This may be used to include null fields in Patch 2023 // requests. 2024 NullFields []string `json:"-"` 2025} 2026 2027func (s *InstancesFailoverRequest) MarshalJSON() ([]byte, error) { 2028 type NoMethod InstancesFailoverRequest 2029 raw := NoMethod(*s) 2030 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2031} 2032 2033// InstancesImportRequest: Database instance import request. 2034type InstancesImportRequest struct { 2035 // ImportContext: Contains details about the import operation. 2036 ImportContext *ImportContext `json:"importContext,omitempty"` 2037 2038 // ForceSendFields is a list of field names (e.g. "ImportContext") to 2039 // unconditionally include in API requests. By default, fields with 2040 // empty values are omitted from API requests. However, any non-pointer, 2041 // non-interface field appearing in ForceSendFields will be sent to the 2042 // server regardless of whether the field is empty or not. This may be 2043 // used to include empty fields in Patch requests. 2044 ForceSendFields []string `json:"-"` 2045 2046 // NullFields is a list of field names (e.g. "ImportContext") to include 2047 // in API requests with the JSON null value. By default, fields with 2048 // empty values are omitted from API requests. However, any field with 2049 // an empty value appearing in NullFields will be sent to the server as 2050 // null. It is an error if a field in this list has a non-empty value. 2051 // This may be used to include null fields in Patch requests. 2052 NullFields []string `json:"-"` 2053} 2054 2055func (s *InstancesImportRequest) MarshalJSON() ([]byte, error) { 2056 type NoMethod InstancesImportRequest 2057 raw := NoMethod(*s) 2058 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2059} 2060 2061// InstancesListResponse: Database instances list response. 2062type InstancesListResponse struct { 2063 // Items: List of database instance resources. 2064 Items []*DatabaseInstance `json:"items,omitempty"` 2065 2066 // Kind: This is always *sql#instancesList*. 2067 Kind string `json:"kind,omitempty"` 2068 2069 // NextPageToken: The continuation token, used to page through large 2070 // result sets. Provide this value in a subsequent request to return the 2071 // next page of results. 2072 NextPageToken string `json:"nextPageToken,omitempty"` 2073 2074 // Warnings: List of warnings that occurred while handling the request. 2075 Warnings []*ApiWarning `json:"warnings,omitempty"` 2076 2077 // ServerResponse contains the HTTP response code and headers from the 2078 // server. 2079 googleapi.ServerResponse `json:"-"` 2080 2081 // ForceSendFields is a list of field names (e.g. "Items") to 2082 // unconditionally include in API requests. By default, fields with 2083 // empty values are omitted from API requests. However, any non-pointer, 2084 // non-interface field appearing in ForceSendFields will be sent to the 2085 // server regardless of whether the field is empty or not. This may be 2086 // used to include empty fields in Patch requests. 2087 ForceSendFields []string `json:"-"` 2088 2089 // NullFields is a list of field names (e.g. "Items") to include in API 2090 // requests with the JSON null value. By default, fields with empty 2091 // values are omitted from API requests. However, any field with an 2092 // empty value appearing in NullFields will be sent to the server as 2093 // null. It is an error if a field in this list has a non-empty value. 2094 // This may be used to include null fields in Patch requests. 2095 NullFields []string `json:"-"` 2096} 2097 2098func (s *InstancesListResponse) MarshalJSON() ([]byte, error) { 2099 type NoMethod InstancesListResponse 2100 raw := NoMethod(*s) 2101 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2102} 2103 2104// InstancesListServerCasResponse: Instances ListServerCas response. 2105type InstancesListServerCasResponse struct { 2106 ActiveVersion string `json:"activeVersion,omitempty"` 2107 2108 // Certs: List of server CA certificates for the instance. 2109 Certs []*SslCert `json:"certs,omitempty"` 2110 2111 // Kind: This is always *sql#instancesListServerCas*. 2112 Kind string `json:"kind,omitempty"` 2113 2114 // ServerResponse contains the HTTP response code and headers from the 2115 // server. 2116 googleapi.ServerResponse `json:"-"` 2117 2118 // ForceSendFields is a list of field names (e.g. "ActiveVersion") to 2119 // unconditionally include in API requests. By default, fields with 2120 // empty values are omitted from API requests. However, any non-pointer, 2121 // non-interface field appearing in ForceSendFields will be sent to the 2122 // server regardless of whether the field is empty or not. This may be 2123 // used to include empty fields in Patch requests. 2124 ForceSendFields []string `json:"-"` 2125 2126 // NullFields is a list of field names (e.g. "ActiveVersion") to include 2127 // in API requests with the JSON null value. By default, fields with 2128 // empty values are omitted from API requests. However, any field with 2129 // an empty value appearing in NullFields will be sent to the server as 2130 // null. It is an error if a field in this list has a non-empty value. 2131 // This may be used to include null fields in Patch requests. 2132 NullFields []string `json:"-"` 2133} 2134 2135func (s *InstancesListServerCasResponse) MarshalJSON() ([]byte, error) { 2136 type NoMethod InstancesListServerCasResponse 2137 raw := NoMethod(*s) 2138 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2139} 2140 2141// InstancesRestoreBackupRequest: Database instance restore backup 2142// request. 2143type InstancesRestoreBackupRequest struct { 2144 // RestoreBackupContext: Parameters required to perform the restore 2145 // backup operation. 2146 RestoreBackupContext *RestoreBackupContext `json:"restoreBackupContext,omitempty"` 2147 2148 // ForceSendFields is a list of field names (e.g. 2149 // "RestoreBackupContext") to unconditionally include in API requests. 2150 // By default, fields with empty values are omitted from API requests. 2151 // However, any non-pointer, non-interface field appearing in 2152 // ForceSendFields will be sent to the server regardless of whether the 2153 // field is empty or not. This may be used to include empty fields in 2154 // Patch requests. 2155 ForceSendFields []string `json:"-"` 2156 2157 // NullFields is a list of field names (e.g. "RestoreBackupContext") to 2158 // include in API requests with the JSON null value. By default, fields 2159 // with empty values are omitted from API requests. However, any field 2160 // with an empty value appearing in NullFields will be sent to the 2161 // server as null. It is an error if a field in this list has a 2162 // non-empty value. This may be used to include null fields in Patch 2163 // requests. 2164 NullFields []string `json:"-"` 2165} 2166 2167func (s *InstancesRestoreBackupRequest) MarshalJSON() ([]byte, error) { 2168 type NoMethod InstancesRestoreBackupRequest 2169 raw := NoMethod(*s) 2170 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2171} 2172 2173// InstancesRotateServerCaRequest: Rotate Server CA request. 2174type InstancesRotateServerCaRequest struct { 2175 // RotateServerCaContext: Contains details about the rotate server CA 2176 // operation. 2177 RotateServerCaContext *RotateServerCaContext `json:"rotateServerCaContext,omitempty"` 2178 2179 // ForceSendFields is a list of field names (e.g. 2180 // "RotateServerCaContext") to unconditionally include in API requests. 2181 // By default, fields with empty values are omitted from API requests. 2182 // However, any non-pointer, non-interface field appearing in 2183 // ForceSendFields will be sent to the server regardless of whether the 2184 // field is empty or not. This may be used to include empty fields in 2185 // Patch requests. 2186 ForceSendFields []string `json:"-"` 2187 2188 // NullFields is a list of field names (e.g. "RotateServerCaContext") to 2189 // include in API requests with the JSON null value. By default, fields 2190 // with empty values are omitted from API requests. However, any field 2191 // with an empty value appearing in NullFields will be sent to the 2192 // server as null. It is an error if a field in this list has a 2193 // non-empty value. This may be used to include null fields in Patch 2194 // requests. 2195 NullFields []string `json:"-"` 2196} 2197 2198func (s *InstancesRotateServerCaRequest) MarshalJSON() ([]byte, error) { 2199 type NoMethod InstancesRotateServerCaRequest 2200 raw := NoMethod(*s) 2201 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2202} 2203 2204// InstancesTruncateLogRequest: Instance truncate log request. 2205type InstancesTruncateLogRequest struct { 2206 // TruncateLogContext: Contains details about the truncate log 2207 // operation. 2208 TruncateLogContext *TruncateLogContext `json:"truncateLogContext,omitempty"` 2209 2210 // ForceSendFields is a list of field names (e.g. "TruncateLogContext") 2211 // to unconditionally include in API requests. By default, fields with 2212 // empty values are omitted from API requests. However, any non-pointer, 2213 // non-interface field appearing in ForceSendFields will be sent to the 2214 // server regardless of whether the field is empty or not. This may be 2215 // used to include empty fields in Patch requests. 2216 ForceSendFields []string `json:"-"` 2217 2218 // NullFields is a list of field names (e.g. "TruncateLogContext") to 2219 // include in API requests with the JSON null value. By default, fields 2220 // with empty values are omitted from API requests. However, any field 2221 // with an empty value appearing in NullFields will be sent to the 2222 // server as null. It is an error if a field in this list has a 2223 // non-empty value. This may be used to include null fields in Patch 2224 // requests. 2225 NullFields []string `json:"-"` 2226} 2227 2228func (s *InstancesTruncateLogRequest) MarshalJSON() ([]byte, error) { 2229 type NoMethod InstancesTruncateLogRequest 2230 raw := NoMethod(*s) 2231 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2232} 2233 2234// IpConfiguration: IP Management configuration. 2235type IpConfiguration struct { 2236 // AuthorizedNetworks: The list of external networks that are allowed to 2237 // connect to the instance using the IP. In 'CIDR' notation, also known 2238 // as 'slash' notation (for example: *192.168.100.0/24*). 2239 AuthorizedNetworks []*AclEntry `json:"authorizedNetworks,omitempty"` 2240 2241 // Ipv4Enabled: Whether the instance is assigned a public IP address or 2242 // not. 2243 Ipv4Enabled bool `json:"ipv4Enabled,omitempty"` 2244 2245 // PrivateNetwork: The resource link for the VPC network from which the 2246 // Cloud SQL instance is accessible for private IP. For example, 2247 // */projects/myProject/global/networks/default*. This setting can be 2248 // updated, but it cannot be removed after it is set. 2249 PrivateNetwork string `json:"privateNetwork,omitempty"` 2250 2251 // RequireSsl: Whether SSL connections over IP are enforced or not. 2252 RequireSsl bool `json:"requireSsl,omitempty"` 2253 2254 // ForceSendFields is a list of field names (e.g. "AuthorizedNetworks") 2255 // to unconditionally include in API requests. By default, fields with 2256 // empty values are omitted from API requests. However, any non-pointer, 2257 // non-interface field appearing in ForceSendFields will be sent to the 2258 // server regardless of whether the field is empty or not. This may be 2259 // used to include empty fields in Patch requests. 2260 ForceSendFields []string `json:"-"` 2261 2262 // NullFields is a list of field names (e.g. "AuthorizedNetworks") to 2263 // include in API requests with the JSON null value. By default, fields 2264 // with empty values are omitted from API requests. However, any field 2265 // with an empty value appearing in NullFields will be sent to the 2266 // server as null. It is an error if a field in this list has a 2267 // non-empty value. This may be used to include null fields in Patch 2268 // requests. 2269 NullFields []string `json:"-"` 2270} 2271 2272func (s *IpConfiguration) MarshalJSON() ([]byte, error) { 2273 type NoMethod IpConfiguration 2274 raw := NoMethod(*s) 2275 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2276} 2277 2278// IpMapping: Database instance IP Mapping. 2279type IpMapping struct { 2280 // IpAddress: The IP address assigned. 2281 IpAddress string `json:"ipAddress,omitempty"` 2282 2283 // TimeToRetire: The due time for this IP to be retired in RFC 3339 2284 // format, for example *2012-11-15T16:19:00.094Z*. This field is only 2285 // available when the IP is scheduled to be retired. 2286 TimeToRetire string `json:"timeToRetire,omitempty"` 2287 2288 // Type: The type of this IP address. A *PRIMARY* address is a public 2289 // address that can accept incoming connections. A *PRIVATE* address is 2290 // a private address that can accept incoming connections. An *OUTGOING* 2291 // address is the source address of connections originating from the 2292 // instance, if supported. 2293 // 2294 // Possible values: 2295 // "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" - This is an unknown IP address 2296 // type. 2297 // "PRIMARY" - IP address the customer is supposed to connect to. 2298 // Usually this is the load balancer's IP address 2299 // "OUTGOING" - Source IP address of the connection a read replica 2300 // establishes to its external primary instance. This IP address can be 2301 // allowlisted by the customer in case it has a firewall that filters 2302 // incoming connection to its on premises primary instance. 2303 // "PRIVATE" - Private IP used when using private IPs and network 2304 // peering. 2305 // "MIGRATED_1ST_GEN" - V1 IP of a migrated instance. We want the user 2306 // to decommission this IP as soon as the migration is complete. Note: 2307 // V1 instances with V1 ip addresses will be counted as PRIMARY. 2308 Type string `json:"type,omitempty"` 2309 2310 // ForceSendFields is a list of field names (e.g. "IpAddress") to 2311 // unconditionally include in API requests. By default, fields with 2312 // empty values are omitted from API requests. However, any non-pointer, 2313 // non-interface field appearing in ForceSendFields will be sent to the 2314 // server regardless of whether the field is empty or not. This may be 2315 // used to include empty fields in Patch requests. 2316 ForceSendFields []string `json:"-"` 2317 2318 // NullFields is a list of field names (e.g. "IpAddress") to include in 2319 // API requests with the JSON null value. By default, fields with empty 2320 // values are omitted from API requests. However, any field with an 2321 // empty value appearing in NullFields will be sent to the server as 2322 // null. It is an error if a field in this list has a non-empty value. 2323 // This may be used to include null fields in Patch requests. 2324 NullFields []string `json:"-"` 2325} 2326 2327func (s *IpMapping) MarshalJSON() ([]byte, error) { 2328 type NoMethod IpMapping 2329 raw := NoMethod(*s) 2330 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2331} 2332 2333// LocationPreference: Preferred location. This specifies where a Cloud 2334// SQL instance is located, either in a specific Compute Engine zone, or 2335// co-located with an App Engine application. Note that if the preferred 2336// location is not available, the instance will be located as close as 2337// possible within the region. Only one location may be specified. 2338type LocationPreference struct { 2339 // FollowGaeApplication: The App Engine application to follow, it must 2340 // be in the same region as the Cloud SQL instance. 2341 FollowGaeApplication string `json:"followGaeApplication,omitempty"` 2342 2343 // Kind: This is always *sql#locationPreference*. 2344 Kind string `json:"kind,omitempty"` 2345 2346 // SecondaryZone: The preferred Compute Engine zone for the 2347 // secondary/failover (for example: us-central1-a, us-central1-b, etc.). 2348 // Reserved for future use. 2349 SecondaryZone string `json:"secondaryZone,omitempty"` 2350 2351 // Zone: The preferred Compute Engine zone (for example: us-central1-a, 2352 // us-central1-b, etc.). 2353 Zone string `json:"zone,omitempty"` 2354 2355 // ForceSendFields is a list of field names (e.g. 2356 // "FollowGaeApplication") to unconditionally include in API requests. 2357 // By default, fields with empty values are omitted from API requests. 2358 // However, any non-pointer, non-interface field appearing in 2359 // ForceSendFields will be sent to the server regardless of whether the 2360 // field is empty or not. This may be used to include empty fields in 2361 // Patch requests. 2362 ForceSendFields []string `json:"-"` 2363 2364 // NullFields is a list of field names (e.g. "FollowGaeApplication") to 2365 // include in API requests with the JSON null value. By default, fields 2366 // with empty values are omitted from API requests. However, any field 2367 // with an empty value appearing in NullFields will be sent to the 2368 // server as null. It is an error if a field in this list has a 2369 // non-empty value. This may be used to include null fields in Patch 2370 // requests. 2371 NullFields []string `json:"-"` 2372} 2373 2374func (s *LocationPreference) MarshalJSON() ([]byte, error) { 2375 type NoMethod LocationPreference 2376 raw := NoMethod(*s) 2377 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2378} 2379 2380// MaintenanceWindow: Maintenance window. This specifies when a Cloud 2381// SQL instance is restarted for system maintenance purposes. 2382type MaintenanceWindow struct { 2383 // Day: day of week (1-7), starting on Monday. 2384 Day int64 `json:"day,omitempty"` 2385 2386 // Hour: hour of day - 0 to 23. 2387 Hour int64 `json:"hour,omitempty"` 2388 2389 // Kind: This is always *sql#maintenanceWindow*. 2390 Kind string `json:"kind,omitempty"` 2391 2392 // UpdateTrack: Maintenance timing setting: *canary* (Earlier) or 2393 // *stable* (Later). Learn more. 2394 // 2395 // Possible values: 2396 // "SQL_UPDATE_TRACK_UNSPECIFIED" - This is an unknown maintenance 2397 // timing preference. 2398 // "canary" - For instance update that requires a restart, this update 2399 // track indicates your instance prefer to restart for new version early 2400 // in maintenance window. 2401 // "stable" - For instance update that requires a restart, this update 2402 // track indicates your instance prefer to let Cloud SQL choose the 2403 // timing of restart (within its Maintenance window, if applicable). 2404 UpdateTrack string `json:"updateTrack,omitempty"` 2405 2406 // ForceSendFields is a list of field names (e.g. "Day") to 2407 // unconditionally include in API requests. By default, fields with 2408 // empty values are omitted from API requests. However, any non-pointer, 2409 // non-interface field appearing in ForceSendFields will be sent to the 2410 // server regardless of whether the field is empty or not. This may be 2411 // used to include empty fields in Patch requests. 2412 ForceSendFields []string `json:"-"` 2413 2414 // NullFields is a list of field names (e.g. "Day") to include in API 2415 // requests with the JSON null value. By default, fields with empty 2416 // values are omitted from API requests. However, any field with an 2417 // empty value appearing in NullFields will be sent to the server as 2418 // null. It is an error if a field in this list has a non-empty value. 2419 // This may be used to include null fields in Patch requests. 2420 NullFields []string `json:"-"` 2421} 2422 2423func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) { 2424 type NoMethod MaintenanceWindow 2425 raw := NoMethod(*s) 2426 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2427} 2428 2429// MySqlReplicaConfiguration: Read-replica configuration specific to 2430// MySQL databases. 2431type MySqlReplicaConfiguration struct { 2432 // CaCertificate: PEM representation of the trusted CA's x509 2433 // certificate. 2434 CaCertificate string `json:"caCertificate,omitempty"` 2435 2436 // ClientCertificate: PEM representation of the replica's x509 2437 // certificate. 2438 ClientCertificate string `json:"clientCertificate,omitempty"` 2439 2440 // ClientKey: PEM representation of the replica's private key. The 2441 // corresponsing public key is encoded in the client's certificate. 2442 ClientKey string `json:"clientKey,omitempty"` 2443 2444 // ConnectRetryInterval: Seconds to wait between connect retries. 2445 // MySQL's default is 60 seconds. 2446 ConnectRetryInterval int64 `json:"connectRetryInterval,omitempty"` 2447 2448 // DumpFilePath: Path to a SQL dump file in Google Cloud Storage from 2449 // which the replica instance is to be created. The URI is in the form 2450 // gs://bucketName/fileName. Compressed gzip files (.gz) are also 2451 // supported. Dumps have the binlog co-ordinates from which replication 2452 // begins. This can be accomplished by setting --master-data to 1 when 2453 // using mysqldump. 2454 DumpFilePath string `json:"dumpFilePath,omitempty"` 2455 2456 // Kind: This is always *sql#mysqlReplicaConfiguration*. 2457 Kind string `json:"kind,omitempty"` 2458 2459 // MasterHeartbeatPeriod: Interval in milliseconds between replication 2460 // heartbeats. 2461 MasterHeartbeatPeriod int64 `json:"masterHeartbeatPeriod,omitempty,string"` 2462 2463 // Password: The password for the replication connection. 2464 Password string `json:"password,omitempty"` 2465 2466 // SslCipher: A list of permissible ciphers to use for SSL encryption. 2467 SslCipher string `json:"sslCipher,omitempty"` 2468 2469 // Username: The username for the replication connection. 2470 Username string `json:"username,omitempty"` 2471 2472 // VerifyServerCertificate: Whether or not to check the primary 2473 // instance's Common Name value in the certificate that it sends during 2474 // the SSL handshake. 2475 VerifyServerCertificate bool `json:"verifyServerCertificate,omitempty"` 2476 2477 // ForceSendFields is a list of field names (e.g. "CaCertificate") to 2478 // unconditionally include in API requests. By default, fields with 2479 // empty values are omitted from API requests. However, any non-pointer, 2480 // non-interface field appearing in ForceSendFields will be sent to the 2481 // server regardless of whether the field is empty or not. This may be 2482 // used to include empty fields in Patch requests. 2483 ForceSendFields []string `json:"-"` 2484 2485 // NullFields is a list of field names (e.g. "CaCertificate") to include 2486 // in API requests with the JSON null value. By default, fields with 2487 // empty values are omitted from API requests. However, any field with 2488 // an empty value appearing in NullFields will be sent to the server as 2489 // null. It is an error if a field in this list has a non-empty value. 2490 // This may be used to include null fields in Patch requests. 2491 NullFields []string `json:"-"` 2492} 2493 2494func (s *MySqlReplicaConfiguration) MarshalJSON() ([]byte, error) { 2495 type NoMethod MySqlReplicaConfiguration 2496 raw := NoMethod(*s) 2497 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2498} 2499 2500// OnPremisesConfiguration: On-premises instance configuration. 2501type OnPremisesConfiguration struct { 2502 // CaCertificate: PEM representation of the trusted CA's x509 2503 // certificate. 2504 CaCertificate string `json:"caCertificate,omitempty"` 2505 2506 // ClientCertificate: PEM representation of the replica's x509 2507 // certificate. 2508 ClientCertificate string `json:"clientCertificate,omitempty"` 2509 2510 // ClientKey: PEM representation of the replica's private key. The 2511 // corresponsing public key is encoded in the client's certificate. 2512 ClientKey string `json:"clientKey,omitempty"` 2513 2514 // DumpFilePath: The dump file to create the Cloud SQL replica. 2515 DumpFilePath string `json:"dumpFilePath,omitempty"` 2516 2517 // HostPort: The host and port of the on-premises instance in host:port 2518 // format 2519 HostPort string `json:"hostPort,omitempty"` 2520 2521 // Kind: This is always *sql#onPremisesConfiguration*. 2522 Kind string `json:"kind,omitempty"` 2523 2524 // Password: The password for connecting to on-premises instance. 2525 Password string `json:"password,omitempty"` 2526 2527 // Username: The username for connecting to on-premises instance. 2528 Username string `json:"username,omitempty"` 2529 2530 // ForceSendFields is a list of field names (e.g. "CaCertificate") to 2531 // unconditionally include in API requests. By default, fields with 2532 // empty values are omitted from API requests. However, any non-pointer, 2533 // non-interface field appearing in ForceSendFields will be sent to the 2534 // server regardless of whether the field is empty or not. This may be 2535 // used to include empty fields in Patch requests. 2536 ForceSendFields []string `json:"-"` 2537 2538 // NullFields is a list of field names (e.g. "CaCertificate") to include 2539 // in API requests with the JSON null value. By default, fields with 2540 // empty values are omitted from API requests. However, any field with 2541 // an empty value appearing in NullFields will be sent to the server as 2542 // null. It is an error if a field in this list has a non-empty value. 2543 // This may be used to include null fields in Patch requests. 2544 NullFields []string `json:"-"` 2545} 2546 2547func (s *OnPremisesConfiguration) MarshalJSON() ([]byte, error) { 2548 type NoMethod OnPremisesConfiguration 2549 raw := NoMethod(*s) 2550 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2551} 2552 2553// Operation: An Operation resource. For successful operations that 2554// return an Operation resource, only the fields relevant to the 2555// operation are populated in the resource. 2556type Operation struct { 2557 // BackupContext: The context for backup operation, if applicable. 2558 BackupContext *BackupContext `json:"backupContext,omitempty"` 2559 2560 // EndTime: The time this operation finished in UTC timezone in RFC 3339 2561 // format, for example *2012-11-15T16:19:00.094Z*. 2562 EndTime string `json:"endTime,omitempty"` 2563 2564 // Error: If errors occurred during processing of this operation, this 2565 // field will be populated. 2566 Error *OperationErrors `json:"error,omitempty"` 2567 2568 // ExportContext: The context for export operation, if applicable. 2569 ExportContext *ExportContext `json:"exportContext,omitempty"` 2570 2571 // ImportContext: The context for import operation, if applicable. 2572 ImportContext *ImportContext `json:"importContext,omitempty"` 2573 2574 // InsertTime: The time this operation was enqueued in UTC timezone in 2575 // RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. 2576 InsertTime string `json:"insertTime,omitempty"` 2577 2578 // Kind: This is always *sql#operation*. 2579 Kind string `json:"kind,omitempty"` 2580 2581 // Name: An identifier that uniquely identifies the operation. You can 2582 // use this identifier to retrieve the Operations resource that has 2583 // information about the operation. 2584 Name string `json:"name,omitempty"` 2585 2586 // OperationType: The type of the operation. Valid values are: *CREATE* 2587 // *DELETE* *UPDATE* *RESTART* *IMPORT* *EXPORT* *BACKUP_VOLUME* 2588 // *RESTORE_VOLUME* *CREATE_USER* *DELETE_USER* *CREATE_DATABASE* 2589 // *DELETE_DATABASE* 2590 // 2591 // Possible values: 2592 // "SQL_OPERATION_TYPE_UNSPECIFIED" - Unknown operation type. 2593 // "IMPORT" - Imports data into a Cloud SQL instance. 2594 // "EXPORT" - Exports data from a Cloud SQL instance to a Cloud 2595 // Storage bucket. 2596 // "CREATE" - Creates a new Cloud SQL instance. 2597 // "UPDATE" - Updates the settings of a Cloud SQL instance. 2598 // "DELETE" - Deletes a Cloud SQL instance. 2599 // "RESTART" - Restarts the Cloud SQL instance. 2600 // "BACKUP" 2601 // "SNAPSHOT" 2602 // "BACKUP_VOLUME" - Performs instance backup. 2603 // "DELETE_VOLUME" - Deletes an instance backup. 2604 // "RESTORE_VOLUME" - Restores an instance backup. 2605 // "INJECT_USER" - Injects a privileged user in mysql for MOB 2606 // instances. 2607 // "CLONE" - Clones a Cloud SQL instance. 2608 // "STOP_REPLICA" - Stops replication on a Cloud SQL read replica 2609 // instance. 2610 // "START_REPLICA" - Starts replication on a Cloud SQL read replica 2611 // instance. 2612 // "PROMOTE_REPLICA" - Promotes a Cloud SQL replica instance. 2613 // "CREATE_REPLICA" - Creates a Cloud SQL replica instance. 2614 // "CREATE_USER" - Creates a new user in a Cloud SQL instance. 2615 // "DELETE_USER" - Deletes a user from a Cloud SQL instance. 2616 // "UPDATE_USER" - Updates an existing user in a Cloud SQL instance. 2617 // "CREATE_DATABASE" - Creates a database in the Cloud SQL instance. 2618 // "DELETE_DATABASE" - Deletes a database in the Cloud SQL instance. 2619 // "UPDATE_DATABASE" - Updates a database in the Cloud SQL instance. 2620 // "FAILOVER" - Performs failover of an HA-enabled Cloud SQL failover 2621 // replica. 2622 // "DELETE_BACKUP" - Deletes the backup taken by a backup run. 2623 // "RECREATE_REPLICA" 2624 // "TRUNCATE_LOG" - Truncates a general or slow log table in MySQL. 2625 // "DEMOTE_MASTER" - Demotes the stand-alone instance to be a Cloud 2626 // SQL read replica for an external database server. 2627 // "MAINTENANCE" - Indicates that the instance is currently in 2628 // maintenance. Maintenance typically causes the instance to be 2629 // unavailable for 1-3 minutes. 2630 // "ENABLE_PRIVATE_IP" - This field is deprecated, and will be removed 2631 // in future version of API. 2632 // "DEFER_MAINTENANCE" 2633 // "CREATE_CLONE" - Creates clone instance. 2634 // "RESCHEDULE_MAINTENANCE" - Reschedule maintenance to another time. 2635 // "START_EXTERNAL_SYNC" - Starts external sync of a Cloud SQL EM 2636 // replica to an external primary instance. 2637 OperationType string `json:"operationType,omitempty"` 2638 2639 // SelfLink: The URI of this resource. 2640 SelfLink string `json:"selfLink,omitempty"` 2641 2642 // StartTime: The time this operation actually started in UTC timezone 2643 // in RFC 3339 format, for example *2012-11-15T16:19:00.094Z*. 2644 StartTime string `json:"startTime,omitempty"` 2645 2646 // Status: The status of an operation. Valid values are: *PENDING* 2647 // *RUNNING* *DONE* *SQL_OPERATION_STATUS_UNSPECIFIED* 2648 // 2649 // Possible values: 2650 // "SQL_OPERATION_STATUS_UNSPECIFIED" - The state of the operation is 2651 // unknown. 2652 // "PENDING" - The operation has been queued, but has not started yet. 2653 // "RUNNING" - The operation is running. 2654 // "DONE" - The operation completed. 2655 Status string `json:"status,omitempty"` 2656 2657 // TargetId: Name of the database instance related to this operation. 2658 TargetId string `json:"targetId,omitempty"` 2659 2660 TargetLink string `json:"targetLink,omitempty"` 2661 2662 // TargetProject: The project ID of the target instance related to this 2663 // operation. 2664 TargetProject string `json:"targetProject,omitempty"` 2665 2666 // User: The email address of the user who initiated this operation. 2667 User string `json:"user,omitempty"` 2668 2669 // ServerResponse contains the HTTP response code and headers from the 2670 // server. 2671 googleapi.ServerResponse `json:"-"` 2672 2673 // ForceSendFields is a list of field names (e.g. "BackupContext") to 2674 // unconditionally include in API requests. By default, fields with 2675 // empty values are omitted from API requests. However, any non-pointer, 2676 // non-interface field appearing in ForceSendFields will be sent to the 2677 // server regardless of whether the field is empty or not. This may be 2678 // used to include empty fields in Patch requests. 2679 ForceSendFields []string `json:"-"` 2680 2681 // NullFields is a list of field names (e.g. "BackupContext") to include 2682 // in API requests with the JSON null value. By default, fields with 2683 // empty values are omitted from API requests. However, any field with 2684 // an empty value appearing in NullFields will be sent to the server as 2685 // null. It is an error if a field in this list has a non-empty value. 2686 // This may be used to include null fields in Patch requests. 2687 NullFields []string `json:"-"` 2688} 2689 2690func (s *Operation) MarshalJSON() ([]byte, error) { 2691 type NoMethod Operation 2692 raw := NoMethod(*s) 2693 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2694} 2695 2696// OperationError: Database instance operation error. 2697type OperationError struct { 2698 // Code: Identifies the specific error that occurred. 2699 Code string `json:"code,omitempty"` 2700 2701 // Kind: This is always *sql#operationError*. 2702 Kind string `json:"kind,omitempty"` 2703 2704 // Message: Additional information about the error encountered. 2705 Message string `json:"message,omitempty"` 2706 2707 // ForceSendFields is a list of field names (e.g. "Code") to 2708 // unconditionally include in API requests. By default, fields with 2709 // empty values are omitted from API requests. However, any non-pointer, 2710 // non-interface field appearing in ForceSendFields will be sent to the 2711 // server regardless of whether the field is empty or not. This may be 2712 // used to include empty fields in Patch requests. 2713 ForceSendFields []string `json:"-"` 2714 2715 // NullFields is a list of field names (e.g. "Code") to include in API 2716 // requests with the JSON null value. By default, fields with empty 2717 // values are omitted from API requests. However, any field with an 2718 // empty value appearing in NullFields will be sent to the server as 2719 // null. It is an error if a field in this list has a non-empty value. 2720 // This may be used to include null fields in Patch requests. 2721 NullFields []string `json:"-"` 2722} 2723 2724func (s *OperationError) MarshalJSON() ([]byte, error) { 2725 type NoMethod OperationError 2726 raw := NoMethod(*s) 2727 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2728} 2729 2730// OperationErrors: Database instance operation errors list wrapper. 2731type OperationErrors struct { 2732 // Errors: The list of errors encountered while processing this 2733 // operation. 2734 Errors []*OperationError `json:"errors,omitempty"` 2735 2736 // Kind: This is always *sql#operationErrors*. 2737 Kind string `json:"kind,omitempty"` 2738 2739 // ForceSendFields is a list of field names (e.g. "Errors") to 2740 // unconditionally include in API requests. By default, fields with 2741 // empty values are omitted from API requests. However, any non-pointer, 2742 // non-interface field appearing in ForceSendFields will be sent to the 2743 // server regardless of whether the field is empty or not. This may be 2744 // used to include empty fields in Patch requests. 2745 ForceSendFields []string `json:"-"` 2746 2747 // NullFields is a list of field names (e.g. "Errors") to include in API 2748 // requests with the JSON null value. By default, fields with empty 2749 // values are omitted from API requests. However, any field with an 2750 // empty value appearing in NullFields will be sent to the server as 2751 // null. It is an error if a field in this list has a non-empty value. 2752 // This may be used to include null fields in Patch requests. 2753 NullFields []string `json:"-"` 2754} 2755 2756func (s *OperationErrors) MarshalJSON() ([]byte, error) { 2757 type NoMethod OperationErrors 2758 raw := NoMethod(*s) 2759 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2760} 2761 2762// OperationsListResponse: Database instance list operations response. 2763type OperationsListResponse struct { 2764 // Items: List of operation resources. 2765 Items []*Operation `json:"items,omitempty"` 2766 2767 // Kind: This is always *sql#operationsList*. 2768 Kind string `json:"kind,omitempty"` 2769 2770 // NextPageToken: The continuation token, used to page through large 2771 // result sets. Provide this value in a subsequent request to return the 2772 // next page of results. 2773 NextPageToken string `json:"nextPageToken,omitempty"` 2774 2775 // ServerResponse contains the HTTP response code and headers from the 2776 // server. 2777 googleapi.ServerResponse `json:"-"` 2778 2779 // ForceSendFields is a list of field names (e.g. "Items") to 2780 // unconditionally include in API requests. By default, fields with 2781 // empty values are omitted from API requests. However, any non-pointer, 2782 // non-interface field appearing in ForceSendFields will be sent to the 2783 // server regardless of whether the field is empty or not. This may be 2784 // used to include empty fields in Patch requests. 2785 ForceSendFields []string `json:"-"` 2786 2787 // NullFields is a list of field names (e.g. "Items") to include in API 2788 // requests with the JSON null value. By default, fields with empty 2789 // values are omitted from API requests. However, any field with an 2790 // empty value appearing in NullFields will be sent to the server as 2791 // null. It is an error if a field in this list has a non-empty value. 2792 // This may be used to include null fields in Patch requests. 2793 NullFields []string `json:"-"` 2794} 2795 2796func (s *OperationsListResponse) MarshalJSON() ([]byte, error) { 2797 type NoMethod OperationsListResponse 2798 raw := NoMethod(*s) 2799 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2800} 2801 2802// ReplicaConfiguration: Read-replica configuration for connecting to 2803// the primary instance. 2804type ReplicaConfiguration struct { 2805 // FailoverTarget: Specifies if the replica is the failover target. If 2806 // the field is set to *true* the replica will be designated as a 2807 // failover replica. In case the primary instance fails, the replica 2808 // instance will be promoted as the new primary instance. Only one 2809 // replica can be specified as failover target, and the replica has to 2810 // be in different zone with the primary instance. 2811 FailoverTarget bool `json:"failoverTarget,omitempty"` 2812 2813 // Kind: This is always *sql#replicaConfiguration*. 2814 Kind string `json:"kind,omitempty"` 2815 2816 // MysqlReplicaConfiguration: MySQL specific configuration when 2817 // replicating from a MySQL on-premises primary instance. Replication 2818 // configuration information such as the username, password, 2819 // certificates, and keys are not stored in the instance metadata. The 2820 // configuration information is used only to set up the replication 2821 // connection and is stored by MySQL in a file named *master.info* in 2822 // the data directory. 2823 MysqlReplicaConfiguration *MySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"` 2824 2825 // ForceSendFields is a list of field names (e.g. "FailoverTarget") to 2826 // unconditionally include in API requests. By default, fields with 2827 // empty values are omitted from API requests. However, any non-pointer, 2828 // non-interface field appearing in ForceSendFields will be sent to the 2829 // server regardless of whether the field is empty or not. This may be 2830 // used to include empty fields in Patch requests. 2831 ForceSendFields []string `json:"-"` 2832 2833 // NullFields is a list of field names (e.g. "FailoverTarget") to 2834 // include in API requests with the JSON null value. By default, fields 2835 // with empty values are omitted from API requests. However, any field 2836 // with an empty value appearing in NullFields will be sent to the 2837 // server as null. It is an error if a field in this list has a 2838 // non-empty value. This may be used to include null fields in Patch 2839 // requests. 2840 NullFields []string `json:"-"` 2841} 2842 2843func (s *ReplicaConfiguration) MarshalJSON() ([]byte, error) { 2844 type NoMethod ReplicaConfiguration 2845 raw := NoMethod(*s) 2846 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2847} 2848 2849type Reschedule struct { 2850 // RescheduleType: Required. The type of the reschedule. 2851 // 2852 // Possible values: 2853 // "RESCHEDULE_TYPE_UNSPECIFIED" 2854 // "IMMEDIATE" - Reschedules maintenance to happen now (within 5 2855 // minutes). 2856 // "NEXT_AVAILABLE_WINDOW" - Reschedules maintenance to occur within 2857 // one week from the originally scheduled day and time. 2858 // "SPECIFIC_TIME" - Reschedules maintenance to a specific time and 2859 // day. 2860 RescheduleType string `json:"rescheduleType,omitempty"` 2861 2862 // ScheduleTime: Optional. Timestamp when the maintenance shall be 2863 // rescheduled to if reschedule_type=SPECIFIC_TIME, in RFC 3339 format, 2864 // for example *2012-11-15T16:19:00.094Z*. 2865 ScheduleTime string `json:"scheduleTime,omitempty"` 2866 2867 // ForceSendFields is a list of field names (e.g. "RescheduleType") to 2868 // unconditionally include in API requests. By default, fields with 2869 // empty values are omitted from API requests. However, any non-pointer, 2870 // non-interface field appearing in ForceSendFields will be sent to the 2871 // server regardless of whether the field is empty or not. This may be 2872 // used to include empty fields in Patch requests. 2873 ForceSendFields []string `json:"-"` 2874 2875 // NullFields is a list of field names (e.g. "RescheduleType") to 2876 // include in API requests with the JSON null value. By default, fields 2877 // with empty values are omitted from API requests. However, any field 2878 // with an empty value appearing in NullFields will be sent to the 2879 // server as null. It is an error if a field in this list has a 2880 // non-empty value. This may be used to include null fields in Patch 2881 // requests. 2882 NullFields []string `json:"-"` 2883} 2884 2885func (s *Reschedule) MarshalJSON() ([]byte, error) { 2886 type NoMethod Reschedule 2887 raw := NoMethod(*s) 2888 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2889} 2890 2891// RestoreBackupContext: Database instance restore from backup context. 2892// Backup context contains source instance id and project id. 2893type RestoreBackupContext struct { 2894 // BackupRunId: The ID of the backup run to restore from. 2895 BackupRunId int64 `json:"backupRunId,omitempty,string"` 2896 2897 // InstanceId: The ID of the instance that the backup was taken from. 2898 InstanceId string `json:"instanceId,omitempty"` 2899 2900 // Kind: This is always *sql#restoreBackupContext*. 2901 Kind string `json:"kind,omitempty"` 2902 2903 // Project: The full project ID of the source instance. 2904 Project string `json:"project,omitempty"` 2905 2906 // ForceSendFields is a list of field names (e.g. "BackupRunId") to 2907 // unconditionally include in API requests. By default, fields with 2908 // empty values are omitted from API requests. However, any non-pointer, 2909 // non-interface field appearing in ForceSendFields will be sent to the 2910 // server regardless of whether the field is empty or not. This may be 2911 // used to include empty fields in Patch requests. 2912 ForceSendFields []string `json:"-"` 2913 2914 // NullFields is a list of field names (e.g. "BackupRunId") to include 2915 // in API requests with the JSON null value. By default, fields with 2916 // empty values are omitted from API requests. However, any field with 2917 // an empty value appearing in NullFields will be sent to the server as 2918 // null. It is an error if a field in this list has a non-empty value. 2919 // This may be used to include null fields in Patch requests. 2920 NullFields []string `json:"-"` 2921} 2922 2923func (s *RestoreBackupContext) MarshalJSON() ([]byte, error) { 2924 type NoMethod RestoreBackupContext 2925 raw := NoMethod(*s) 2926 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2927} 2928 2929// RotateServerCaContext: Instance rotate server CA context. 2930type RotateServerCaContext struct { 2931 // Kind: This is always *sql#rotateServerCaContext*. 2932 Kind string `json:"kind,omitempty"` 2933 2934 // NextVersion: The fingerprint of the next version to be rotated to. If 2935 // left unspecified, will be rotated to the most recently added server 2936 // CA version. 2937 NextVersion string `json:"nextVersion,omitempty"` 2938 2939 // ForceSendFields is a list of field names (e.g. "Kind") to 2940 // unconditionally include in API requests. By default, fields with 2941 // empty values are omitted from API requests. However, any non-pointer, 2942 // non-interface field appearing in ForceSendFields will be sent to the 2943 // server regardless of whether the field is empty or not. This may be 2944 // used to include empty fields in Patch requests. 2945 ForceSendFields []string `json:"-"` 2946 2947 // NullFields is a list of field names (e.g. "Kind") to include in API 2948 // requests with the JSON null value. By default, fields with empty 2949 // values are omitted from API requests. However, any field with an 2950 // empty value appearing in NullFields will be sent to the server as 2951 // null. It is an error if a field in this list has a non-empty value. 2952 // This may be used to include null fields in Patch requests. 2953 NullFields []string `json:"-"` 2954} 2955 2956func (s *RotateServerCaContext) MarshalJSON() ([]byte, error) { 2957 type NoMethod RotateServerCaContext 2958 raw := NoMethod(*s) 2959 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2960} 2961 2962// Settings: Database instance settings. 2963type Settings struct { 2964 // ActivationPolicy: The activation policy specifies when the instance 2965 // is activated; it is applicable only when the instance state is 2966 // RUNNABLE. Valid values: *ALWAYS*: The instance is on, and remains so 2967 // even in the absence of connection requests. *NEVER*: The instance is 2968 // off; it is not activated, even if a connection request arrives. 2969 // 2970 // Possible values: 2971 // "SQL_ACTIVATION_POLICY_UNSPECIFIED" - Unknown activation plan. 2972 // "ALWAYS" - The instance is always up and running. 2973 // "NEVER" - The instance never starts. 2974 // "ON_DEMAND" - The instance starts upon receiving requests. 2975 ActivationPolicy string `json:"activationPolicy,omitempty"` 2976 2977 // ActiveDirectoryConfig: Active Directory configuration, relevant only 2978 // for Cloud SQL for SQL Server. 2979 ActiveDirectoryConfig *SqlActiveDirectoryConfig `json:"activeDirectoryConfig,omitempty"` 2980 2981 // AuthorizedGaeApplications: The App Engine app IDs that can access 2982 // this instance. (Deprecated) Applied to First Generation instances 2983 // only. 2984 AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"` 2985 2986 // AvailabilityType: Availability type. Potential values: *ZONAL*: The 2987 // instance serves data from only one zone. Outages in that zone affect 2988 // data accessibility. *REGIONAL*: The instance can serve data from more 2989 // than one zone in a region (it is highly available). For more 2990 // information, see Overview of the High Availability Configuration. 2991 // 2992 // Possible values: 2993 // "SQL_AVAILABILITY_TYPE_UNSPECIFIED" - This is an unknown 2994 // Availability type. 2995 // "ZONAL" - Zonal available instance. 2996 // "REGIONAL" - Regional available instance. 2997 AvailabilityType string `json:"availabilityType,omitempty"` 2998 2999 // BackupConfiguration: The daily backup configuration for the instance. 3000 BackupConfiguration *BackupConfiguration `json:"backupConfiguration,omitempty"` 3001 3002 // Collation: The name of server Instance collation. 3003 Collation string `json:"collation,omitempty"` 3004 3005 // CrashSafeReplicationEnabled: Configuration specific to read replica 3006 // instances. Indicates whether database flags for crash-safe 3007 // replication are enabled. This property was only applicable to First 3008 // Generation instances. 3009 CrashSafeReplicationEnabled bool `json:"crashSafeReplicationEnabled,omitempty"` 3010 3011 // DataDiskSizeGb: The size of data disk, in GB. The data disk size 3012 // minimum is 10GB. 3013 DataDiskSizeGb int64 `json:"dataDiskSizeGb,omitempty,string"` 3014 3015 // DataDiskType: The type of data disk: PD_SSD (default) or PD_HDD. Not 3016 // used for First Generation instances. 3017 // 3018 // Possible values: 3019 // "SQL_DATA_DISK_TYPE_UNSPECIFIED" - This is an unknown data disk 3020 // type. 3021 // "PD_SSD" - An SSD data disk. 3022 // "PD_HDD" - An HDD data disk. 3023 // "OBSOLETE_LOCAL_SSD" - This field is deprecated and will be removed 3024 // from a future version of the API. 3025 DataDiskType string `json:"dataDiskType,omitempty"` 3026 3027 // DatabaseFlags: The database flags passed to the instance at startup. 3028 DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"` 3029 3030 // DatabaseReplicationEnabled: Configuration specific to read replica 3031 // instances. Indicates whether replication is enabled or not. 3032 DatabaseReplicationEnabled bool `json:"databaseReplicationEnabled,omitempty"` 3033 3034 // DenyMaintenancePeriods: Deny maintenance periods 3035 DenyMaintenancePeriods []*DenyMaintenancePeriod `json:"denyMaintenancePeriods,omitempty"` 3036 3037 // InsightsConfig: Insights configuration, for now relevant only for 3038 // Postgres. 3039 InsightsConfig *InsightsConfig `json:"insightsConfig,omitempty"` 3040 3041 // IpConfiguration: The settings for IP Management. This allows to 3042 // enable or disable the instance IP and manage which external networks 3043 // can connect to the instance. The IPv4 address cannot be disabled for 3044 // Second Generation instances. 3045 IpConfiguration *IpConfiguration `json:"ipConfiguration,omitempty"` 3046 3047 // Kind: This is always *sql#settings*. 3048 Kind string `json:"kind,omitempty"` 3049 3050 // LocationPreference: The location preference settings. This allows the 3051 // instance to be located as near as possible to either an App Engine 3052 // app or Compute Engine zone for better performance. App Engine 3053 // co-location was only applicable to First Generation instances. 3054 LocationPreference *LocationPreference `json:"locationPreference,omitempty"` 3055 3056 // MaintenanceWindow: The maintenance window for this instance. This 3057 // specifies when the instance can be restarted for maintenance 3058 // purposes. 3059 MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` 3060 3061 // PricingPlan: The pricing plan for this instance. This can be either 3062 // *PER_USE* or *PACKAGE*. Only *PER_USE* is supported for Second 3063 // Generation instances. 3064 // 3065 // Possible values: 3066 // "SQL_PRICING_PLAN_UNSPECIFIED" - This is an unknown pricing plan 3067 // for this instance. 3068 // "PACKAGE" - The instance is billed at a monthly flat rate. 3069 // "PER_USE" - The instance is billed per usage. 3070 PricingPlan string `json:"pricingPlan,omitempty"` 3071 3072 // ReplicationType: The type of replication this instance uses. This can 3073 // be either *ASYNCHRONOUS* or *SYNCHRONOUS*. (Deprecated_ This property 3074 // was only applicable to First Generation instances. 3075 // 3076 // Possible values: 3077 // "SQL_REPLICATION_TYPE_UNSPECIFIED" - This is an unknown replication 3078 // type for a Cloud SQL instance. 3079 // "SYNCHRONOUS" - The synchronous replication mode for First 3080 // Generation instances. It is the default value. 3081 // "ASYNCHRONOUS" - The asynchronous replication mode for First 3082 // Generation instances. It provides a slight performance gain, but if 3083 // an outage occurs while this option is set to asynchronous, you can 3084 // lose up to a few seconds of updates to your data. 3085 ReplicationType string `json:"replicationType,omitempty"` 3086 3087 // SettingsVersion: The version of instance settings. This is a required 3088 // field for update method to make sure concurrent updates are handled 3089 // properly. During update, use the most recent settingsVersion value 3090 // for this instance and do not try to update this value. 3091 SettingsVersion int64 `json:"settingsVersion,omitempty,string"` 3092 3093 // StorageAutoResize: Configuration to increase storage size 3094 // automatically. The default value is true. 3095 StorageAutoResize *bool `json:"storageAutoResize,omitempty"` 3096 3097 // StorageAutoResizeLimit: The maximum size to which storage capacity 3098 // can be automatically increased. The default value is 0, which 3099 // specifies that there is no limit. 3100 StorageAutoResizeLimit int64 `json:"storageAutoResizeLimit,omitempty,string"` 3101 3102 // Tier: The tier (or machine type) for this instance, for example 3103 // *db-custom-1-3840* . 3104 Tier string `json:"tier,omitempty"` 3105 3106 // UserLabels: User-provided labels, represented as a dictionary where 3107 // each label is a single key value pair. 3108 UserLabels map[string]string `json:"userLabels,omitempty"` 3109 3110 // ForceSendFields is a list of field names (e.g. "ActivationPolicy") to 3111 // unconditionally include in API requests. By default, fields with 3112 // empty values are omitted from API requests. However, any non-pointer, 3113 // non-interface field appearing in ForceSendFields will be sent to the 3114 // server regardless of whether the field is empty or not. This may be 3115 // used to include empty fields in Patch requests. 3116 ForceSendFields []string `json:"-"` 3117 3118 // NullFields is a list of field names (e.g. "ActivationPolicy") to 3119 // include in API requests with the JSON null value. By default, fields 3120 // with empty values are omitted from API requests. However, any field 3121 // with an empty value appearing in NullFields will be sent to the 3122 // server as null. It is an error if a field in this list has a 3123 // non-empty value. This may be used to include null fields in Patch 3124 // requests. 3125 NullFields []string `json:"-"` 3126} 3127 3128func (s *Settings) MarshalJSON() ([]byte, error) { 3129 type NoMethod Settings 3130 raw := NoMethod(*s) 3131 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3132} 3133 3134// SqlActiveDirectoryConfig: Active Directory configuration, relevant 3135// only for Cloud SQL for SQL Server. 3136type SqlActiveDirectoryConfig struct { 3137 // Domain: The name of the domain (e.g., mydomain.com). 3138 Domain string `json:"domain,omitempty"` 3139 3140 // Kind: This is always sql#activeDirectoryConfig. 3141 Kind string `json:"kind,omitempty"` 3142 3143 // ForceSendFields is a list of field names (e.g. "Domain") to 3144 // unconditionally include in API requests. By default, fields with 3145 // empty values are omitted from API requests. However, any non-pointer, 3146 // non-interface field appearing in ForceSendFields will be sent to the 3147 // server regardless of whether the field is empty or not. This may be 3148 // used to include empty fields in Patch requests. 3149 ForceSendFields []string `json:"-"` 3150 3151 // NullFields is a list of field names (e.g. "Domain") to include in API 3152 // requests with the JSON null value. By default, fields with empty 3153 // values are omitted from API requests. However, any field with an 3154 // empty value appearing in NullFields will be sent to the server as 3155 // null. It is an error if a field in this list has a non-empty value. 3156 // This may be used to include null fields in Patch requests. 3157 NullFields []string `json:"-"` 3158} 3159 3160func (s *SqlActiveDirectoryConfig) MarshalJSON() ([]byte, error) { 3161 type NoMethod SqlActiveDirectoryConfig 3162 raw := NoMethod(*s) 3163 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3164} 3165 3166// SqlExternalSyncSettingError: External primary instance migration 3167// setting error/warning. 3168type SqlExternalSyncSettingError struct { 3169 // Detail: Additional information about the error encountered. 3170 Detail string `json:"detail,omitempty"` 3171 3172 // Kind: Can be *sql#externalSyncSettingError* or 3173 // *sql#externalSyncSettingWarning*. 3174 Kind string `json:"kind,omitempty"` 3175 3176 // Type: Identifies the specific error that occurred. 3177 // 3178 // Possible values: 3179 // "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" 3180 // "CONNECTION_FAILURE" 3181 // "BINLOG_NOT_ENABLED" 3182 // "INCOMPATIBLE_DATABASE_VERSION" 3183 // "REPLICA_ALREADY_SETUP" 3184 // "INSUFFICIENT_PRIVILEGE" 3185 // "UNSUPPORTED_MIGRATION_TYPE" - Unsupported migration type. 3186 // "NO_PGLOGICAL_INSTALLED" - No pglogical extension installed on 3187 // databases, applicable for postgres. 3188 // "PGLOGICAL_NODE_ALREADY_EXISTS" - pglogical node already exists on 3189 // databases, applicable for postgres. 3190 // "INVALID_WAL_LEVEL" - The value of parameter wal_level is not set 3191 // to logical. 3192 // "INVALID_SHARED_PRELOAD_LIBRARY" - The value of parameter 3193 // shared_preload_libraries does not include pglogical. 3194 // "INSUFFICIENT_MAX_REPLICATION_SLOTS" - The value of parameter 3195 // max_replication_slots is not sufficient. 3196 // "INSUFFICIENT_MAX_WAL_SENDERS" - The value of parameter 3197 // max_wal_senders is not sufficient. 3198 // "INSUFFICIENT_MAX_WORKER_PROCESSES" - The value of parameter 3199 // max_worker_processes is not sufficient. 3200 // "UNSUPPORTED_EXTENSIONS" - Extensions installed are either not 3201 // supported or having unsupported versions 3202 // "INVALID_RDS_LOGICAL_REPLICATION" - The value of parameter 3203 // rds.logical_replication is not set to 1. 3204 // "INVALID_LOGGING_SETUP" - The primary instance logging setup 3205 // doesn't allow EM sync. 3206 // "INVALID_DB_PARAM" - The primary instance database parameter setup 3207 // doesn't allow EM sync. 3208 // "UNSUPPORTED_GTID_MODE" - The gtid_mode is not supported, 3209 // applicable for MySQL. 3210 // "SQLSERVER_AGENT_NOT_RUNNING" - SQL Server Agent is not running. 3211 // "UNSUPPORTED_TABLE_DEFINITION" - The table definition is not 3212 // support due to missing primary key or replica identity, applicable 3213 // for postgres. 3214 // "UNSUPPORTED_DEFINER" - The customer has a definer that will break 3215 // EM setup. 3216 // "SQLSERVER_SERVERNAME_MISMATCH" - SQL Server @@SERVERNAME does not 3217 // match actual host name 3218 // "PRIMARY_ALREADY_SETUP" - The primary instance has been setup and 3219 // will fail the setup. 3220 Type string `json:"type,omitempty"` 3221 3222 // ForceSendFields is a list of field names (e.g. "Detail") to 3223 // unconditionally include in API requests. By default, fields with 3224 // empty values are omitted from API requests. However, any non-pointer, 3225 // non-interface field appearing in ForceSendFields will be sent to the 3226 // server regardless of whether the field is empty or not. This may be 3227 // used to include empty fields in Patch requests. 3228 ForceSendFields []string `json:"-"` 3229 3230 // NullFields is a list of field names (e.g. "Detail") to include in API 3231 // requests with the JSON null value. By default, fields with empty 3232 // values are omitted from API requests. However, any field with an 3233 // empty value appearing in NullFields will be sent to the server as 3234 // null. It is an error if a field in this list has a non-empty value. 3235 // This may be used to include null fields in Patch requests. 3236 NullFields []string `json:"-"` 3237} 3238 3239func (s *SqlExternalSyncSettingError) MarshalJSON() ([]byte, error) { 3240 type NoMethod SqlExternalSyncSettingError 3241 raw := NoMethod(*s) 3242 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3243} 3244 3245// SqlInstancesRescheduleMaintenanceRequestBody: Reschedule options for 3246// maintenance windows. 3247type SqlInstancesRescheduleMaintenanceRequestBody struct { 3248 // Reschedule: Required. The type of the reschedule the user wants. 3249 Reschedule *Reschedule `json:"reschedule,omitempty"` 3250 3251 // ForceSendFields is a list of field names (e.g. "Reschedule") to 3252 // unconditionally include in API requests. By default, fields with 3253 // empty values are omitted from API requests. However, any non-pointer, 3254 // non-interface field appearing in ForceSendFields will be sent to the 3255 // server regardless of whether the field is empty or not. This may be 3256 // used to include empty fields in Patch requests. 3257 ForceSendFields []string `json:"-"` 3258 3259 // NullFields is a list of field names (e.g. "Reschedule") to include in 3260 // API requests with the JSON null value. By default, fields with empty 3261 // values are omitted from API requests. However, any field with an 3262 // empty value appearing in NullFields will be sent to the server as 3263 // null. It is an error if a field in this list has a non-empty value. 3264 // This may be used to include null fields in Patch requests. 3265 NullFields []string `json:"-"` 3266} 3267 3268func (s *SqlInstancesRescheduleMaintenanceRequestBody) MarshalJSON() ([]byte, error) { 3269 type NoMethod SqlInstancesRescheduleMaintenanceRequestBody 3270 raw := NoMethod(*s) 3271 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3272} 3273 3274// SqlInstancesVerifyExternalSyncSettingsResponse: Instance verify 3275// external sync settings response. 3276type SqlInstancesVerifyExternalSyncSettingsResponse struct { 3277 // Errors: List of migration violations. 3278 Errors []*SqlExternalSyncSettingError `json:"errors,omitempty"` 3279 3280 // Kind: This is always *sql#migrationSettingErrorList*. 3281 Kind string `json:"kind,omitempty"` 3282 3283 // Warnings: List of migration warnings. 3284 Warnings []*SqlExternalSyncSettingError `json:"warnings,omitempty"` 3285 3286 // ServerResponse contains the HTTP response code and headers from the 3287 // server. 3288 googleapi.ServerResponse `json:"-"` 3289 3290 // ForceSendFields is a list of field names (e.g. "Errors") to 3291 // unconditionally include in API requests. By default, fields with 3292 // empty values are omitted from API requests. However, any non-pointer, 3293 // non-interface field appearing in ForceSendFields will be sent to the 3294 // server regardless of whether the field is empty or not. This may be 3295 // used to include empty fields in Patch requests. 3296 ForceSendFields []string `json:"-"` 3297 3298 // NullFields is a list of field names (e.g. "Errors") to include in API 3299 // requests with the JSON null value. By default, fields with empty 3300 // values are omitted from API requests. However, any field with an 3301 // empty value appearing in NullFields will be sent to the server as 3302 // null. It is an error if a field in this list has a non-empty value. 3303 // This may be used to include null fields in Patch requests. 3304 NullFields []string `json:"-"` 3305} 3306 3307func (s *SqlInstancesVerifyExternalSyncSettingsResponse) MarshalJSON() ([]byte, error) { 3308 type NoMethod SqlInstancesVerifyExternalSyncSettingsResponse 3309 raw := NoMethod(*s) 3310 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3311} 3312 3313// SqlOutOfDiskReport: This message wraps up the information written by 3314// out-of-disk detection job. 3315type SqlOutOfDiskReport struct { 3316 // SqlMinRecommendedIncreaseSizeGb: The minimum recommended increase 3317 // size in GigaBytes This field is consumed by the frontend Writers: -- 3318 // the proactive database wellness job for OOD. 3319 SqlMinRecommendedIncreaseSizeGb int64 `json:"sqlMinRecommendedIncreaseSizeGb,omitempty"` 3320 3321 // SqlOutOfDiskState: This field represents the state generated by the 3322 // proactive database wellness job for OutOfDisk issues. Writers: -- the 3323 // proactive database wellness job for OOD. Readers: -- the proactive 3324 // database wellness job 3325 // 3326 // Possible values: 3327 // "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" - Unspecified state 3328 // "NORMAL" - The instance has plenty space on data disk 3329 // "SOFT_SHUTDOWN" - Data disk is almost used up. It is shutdown to 3330 // prevent data corruption. 3331 SqlOutOfDiskState string `json:"sqlOutOfDiskState,omitempty"` 3332 3333 // ForceSendFields is a list of field names (e.g. 3334 // "SqlMinRecommendedIncreaseSizeGb") to unconditionally include in API 3335 // requests. By default, fields with empty values are omitted from API 3336 // requests. However, any non-pointer, non-interface field appearing in 3337 // ForceSendFields will be sent to the server regardless of whether the 3338 // field is empty or not. This may be used to include empty fields in 3339 // Patch requests. 3340 ForceSendFields []string `json:"-"` 3341 3342 // NullFields is a list of field names (e.g. 3343 // "SqlMinRecommendedIncreaseSizeGb") to include in API requests with 3344 // the JSON null value. By default, fields with empty values are omitted 3345 // from API requests. However, any field with an empty value appearing 3346 // in NullFields will be sent to the server as null. It is an error if a 3347 // field in this list has a non-empty value. This may be used to include 3348 // null fields in Patch requests. 3349 NullFields []string `json:"-"` 3350} 3351 3352func (s *SqlOutOfDiskReport) MarshalJSON() ([]byte, error) { 3353 type NoMethod SqlOutOfDiskReport 3354 raw := NoMethod(*s) 3355 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3356} 3357 3358// SqlScheduledMaintenance: Any scheduled maintenancce for this 3359// instance. 3360type SqlScheduledMaintenance struct { 3361 CanDefer bool `json:"canDefer,omitempty"` 3362 3363 // CanReschedule: If the scheduled maintenance can be rescheduled. 3364 CanReschedule bool `json:"canReschedule,omitempty"` 3365 3366 // StartTime: The start time of any upcoming scheduled maintenance for 3367 // this instance. 3368 StartTime string `json:"startTime,omitempty"` 3369 3370 // ForceSendFields is a list of field names (e.g. "CanDefer") to 3371 // unconditionally include in API requests. By default, fields with 3372 // empty values are omitted from API requests. However, any non-pointer, 3373 // non-interface field appearing in ForceSendFields will be sent to the 3374 // server regardless of whether the field is empty or not. This may be 3375 // used to include empty fields in Patch requests. 3376 ForceSendFields []string `json:"-"` 3377 3378 // NullFields is a list of field names (e.g. "CanDefer") to include in 3379 // API requests with the JSON null value. By default, fields with empty 3380 // values are omitted from API requests. However, any field with an 3381 // empty value appearing in NullFields will be sent to the server as 3382 // null. It is an error if a field in this list has a non-empty value. 3383 // This may be used to include null fields in Patch requests. 3384 NullFields []string `json:"-"` 3385} 3386 3387func (s *SqlScheduledMaintenance) MarshalJSON() ([]byte, error) { 3388 type NoMethod SqlScheduledMaintenance 3389 raw := NoMethod(*s) 3390 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3391} 3392 3393// SqlServerDatabaseDetails: Represents a Sql Server database on the 3394// Cloud SQL instance. 3395type SqlServerDatabaseDetails struct { 3396 // CompatibilityLevel: The version of SQL Server with which the database 3397 // is to be made compatible 3398 CompatibilityLevel int64 `json:"compatibilityLevel,omitempty"` 3399 3400 // RecoveryModel: The recovery model of a SQL Server database 3401 RecoveryModel string `json:"recoveryModel,omitempty"` 3402 3403 // ForceSendFields is a list of field names (e.g. "CompatibilityLevel") 3404 // to unconditionally include in API requests. By default, fields with 3405 // empty values are omitted from API requests. However, any non-pointer, 3406 // non-interface field appearing in ForceSendFields will be sent to the 3407 // server regardless of whether the field is empty or not. This may be 3408 // used to include empty fields in Patch requests. 3409 ForceSendFields []string `json:"-"` 3410 3411 // NullFields is a list of field names (e.g. "CompatibilityLevel") to 3412 // include in API requests with the JSON null value. By default, fields 3413 // with empty values are omitted from API requests. However, any field 3414 // with an empty value appearing in NullFields will be sent to the 3415 // server as null. It is an error if a field in this list has a 3416 // non-empty value. This may be used to include null fields in Patch 3417 // requests. 3418 NullFields []string `json:"-"` 3419} 3420 3421func (s *SqlServerDatabaseDetails) MarshalJSON() ([]byte, error) { 3422 type NoMethod SqlServerDatabaseDetails 3423 raw := NoMethod(*s) 3424 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3425} 3426 3427// SqlServerUserDetails: Represents a Sql Server user on the Cloud SQL 3428// instance. 3429type SqlServerUserDetails struct { 3430 // Disabled: If the user has been disabled 3431 Disabled bool `json:"disabled,omitempty"` 3432 3433 // ServerRoles: The server roles for this user 3434 ServerRoles []string `json:"serverRoles,omitempty"` 3435 3436 // ForceSendFields is a list of field names (e.g. "Disabled") to 3437 // unconditionally include in API requests. By default, fields with 3438 // empty values are omitted from API requests. However, any non-pointer, 3439 // non-interface field appearing in ForceSendFields will be sent to the 3440 // server regardless of whether the field is empty or not. This may be 3441 // used to include empty fields in Patch requests. 3442 ForceSendFields []string `json:"-"` 3443 3444 // NullFields is a list of field names (e.g. "Disabled") to include in 3445 // API requests with the JSON null value. By default, fields with empty 3446 // values are omitted from API requests. However, any field with an 3447 // empty value appearing in NullFields will be sent to the server as 3448 // null. It is an error if a field in this list has a non-empty value. 3449 // This may be used to include null fields in Patch requests. 3450 NullFields []string `json:"-"` 3451} 3452 3453func (s *SqlServerUserDetails) MarshalJSON() ([]byte, error) { 3454 type NoMethod SqlServerUserDetails 3455 raw := NoMethod(*s) 3456 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3457} 3458 3459// SslCert: SslCerts Resource 3460type SslCert struct { 3461 // Cert: PEM representation. 3462 Cert string `json:"cert,omitempty"` 3463 3464 // CertSerialNumber: Serial number, as extracted from the certificate. 3465 CertSerialNumber string `json:"certSerialNumber,omitempty"` 3466 3467 // CommonName: User supplied name. Constrained to [a-zA-Z.-_ ]+. 3468 CommonName string `json:"commonName,omitempty"` 3469 3470 // CreateTime: The time when the certificate was created in RFC 3339 3471 // format, for example *2012-11-15T16:19:00.094Z* 3472 CreateTime string `json:"createTime,omitempty"` 3473 3474 // ExpirationTime: The time when the certificate expires in RFC 3339 3475 // format, for example *2012-11-15T16:19:00.094Z*. 3476 ExpirationTime string `json:"expirationTime,omitempty"` 3477 3478 // Instance: Name of the database instance. 3479 Instance string `json:"instance,omitempty"` 3480 3481 // Kind: This is always *sql#sslCert*. 3482 Kind string `json:"kind,omitempty"` 3483 3484 // SelfLink: The URI of this resource. 3485 SelfLink string `json:"selfLink,omitempty"` 3486 3487 // Sha1Fingerprint: Sha1 Fingerprint. 3488 Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"` 3489 3490 // ServerResponse contains the HTTP response code and headers from the 3491 // server. 3492 googleapi.ServerResponse `json:"-"` 3493 3494 // ForceSendFields is a list of field names (e.g. "Cert") to 3495 // unconditionally include in API requests. By default, fields with 3496 // empty values are omitted from API requests. However, any non-pointer, 3497 // non-interface field appearing in ForceSendFields will be sent to the 3498 // server regardless of whether the field is empty or not. This may be 3499 // used to include empty fields in Patch requests. 3500 ForceSendFields []string `json:"-"` 3501 3502 // NullFields is a list of field names (e.g. "Cert") to include in API 3503 // requests with the JSON null value. By default, fields with empty 3504 // values are omitted from API requests. However, any field with an 3505 // empty value appearing in NullFields will be sent to the server as 3506 // null. It is an error if a field in this list has a non-empty value. 3507 // This may be used to include null fields in Patch requests. 3508 NullFields []string `json:"-"` 3509} 3510 3511func (s *SslCert) MarshalJSON() ([]byte, error) { 3512 type NoMethod SslCert 3513 raw := NoMethod(*s) 3514 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3515} 3516 3517// SslCertDetail: SslCertDetail. 3518type SslCertDetail struct { 3519 // CertInfo: The public information about the cert. 3520 CertInfo *SslCert `json:"certInfo,omitempty"` 3521 3522 // CertPrivateKey: The private key for the client cert, in pem format. 3523 // Keep private in order to protect your security. 3524 CertPrivateKey string `json:"certPrivateKey,omitempty"` 3525 3526 // ForceSendFields is a list of field names (e.g. "CertInfo") to 3527 // unconditionally include in API requests. By default, fields with 3528 // empty values are omitted from API requests. However, any non-pointer, 3529 // non-interface field appearing in ForceSendFields will be sent to the 3530 // server regardless of whether the field is empty or not. This may be 3531 // used to include empty fields in Patch requests. 3532 ForceSendFields []string `json:"-"` 3533 3534 // NullFields is a list of field names (e.g. "CertInfo") to include in 3535 // API requests with the JSON null value. By default, fields with empty 3536 // values are omitted from API requests. However, any field with an 3537 // empty value appearing in NullFields will be sent to the server as 3538 // null. It is an error if a field in this list has a non-empty value. 3539 // This may be used to include null fields in Patch requests. 3540 NullFields []string `json:"-"` 3541} 3542 3543func (s *SslCertDetail) MarshalJSON() ([]byte, error) { 3544 type NoMethod SslCertDetail 3545 raw := NoMethod(*s) 3546 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3547} 3548 3549// SslCertsCreateEphemeralRequest: SslCerts create ephemeral certificate 3550// request. 3551type SslCertsCreateEphemeralRequest struct { 3552 // AccessToken: Access token to include in the signed certificate. 3553 AccessToken string `json:"access_token,omitempty"` 3554 3555 // PublicKey: PEM encoded public key to include in the signed 3556 // certificate. 3557 PublicKey string `json:"public_key,omitempty"` 3558 3559 // ForceSendFields is a list of field names (e.g. "AccessToken") 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. "AccessToken") to include 3568 // in API requests with the JSON null value. By default, fields with 3569 // empty values are omitted from API requests. However, any field with 3570 // an 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 *SslCertsCreateEphemeralRequest) MarshalJSON() ([]byte, error) { 3577 type NoMethod SslCertsCreateEphemeralRequest 3578 raw := NoMethod(*s) 3579 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3580} 3581 3582// SslCertsInsertRequest: SslCerts insert request. 3583type SslCertsInsertRequest struct { 3584 // CommonName: User supplied name. Must be a distinct name from the 3585 // other certificates for this instance. 3586 CommonName string `json:"commonName,omitempty"` 3587 3588 // ForceSendFields is a list of field names (e.g. "CommonName") to 3589 // unconditionally include in API requests. By default, fields with 3590 // empty values are omitted from API requests. However, any non-pointer, 3591 // non-interface field appearing in ForceSendFields will be sent to the 3592 // server regardless of whether the field is empty or not. This may be 3593 // used to include empty fields in Patch requests. 3594 ForceSendFields []string `json:"-"` 3595 3596 // NullFields is a list of field names (e.g. "CommonName") to include in 3597 // API requests with the JSON null value. By default, fields with empty 3598 // values are omitted from API requests. However, any field with an 3599 // empty value appearing in NullFields will be sent to the server as 3600 // null. It is an error if a field in this list has a non-empty value. 3601 // This may be used to include null fields in Patch requests. 3602 NullFields []string `json:"-"` 3603} 3604 3605func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error) { 3606 type NoMethod SslCertsInsertRequest 3607 raw := NoMethod(*s) 3608 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3609} 3610 3611// SslCertsInsertResponse: SslCert insert response. 3612type SslCertsInsertResponse struct { 3613 // ClientCert: The new client certificate and private key. 3614 ClientCert *SslCertDetail `json:"clientCert,omitempty"` 3615 3616 // Kind: This is always *sql#sslCertsInsert*. 3617 Kind string `json:"kind,omitempty"` 3618 3619 // Operation: The operation to track the ssl certs insert request. 3620 Operation *Operation `json:"operation,omitempty"` 3621 3622 // ServerCaCert: The server Certificate Authority's certificate. If this 3623 // is missing you can force a new one to be generated by calling 3624 // resetSslConfig method on instances resource. 3625 ServerCaCert *SslCert `json:"serverCaCert,omitempty"` 3626 3627 // ServerResponse contains the HTTP response code and headers from the 3628 // server. 3629 googleapi.ServerResponse `json:"-"` 3630 3631 // ForceSendFields is a list of field names (e.g. "ClientCert") to 3632 // unconditionally include in API requests. By default, fields with 3633 // empty values are omitted from API requests. However, any non-pointer, 3634 // non-interface field appearing in ForceSendFields will be sent to the 3635 // server regardless of whether the field is empty or not. This may be 3636 // used to include empty fields in Patch requests. 3637 ForceSendFields []string `json:"-"` 3638 3639 // NullFields is a list of field names (e.g. "ClientCert") to include in 3640 // API requests with the JSON null value. By default, fields with empty 3641 // values are omitted from API requests. However, any field with an 3642 // empty value appearing in NullFields will be sent to the server as 3643 // null. It is an error if a field in this list has a non-empty value. 3644 // This may be used to include null fields in Patch requests. 3645 NullFields []string `json:"-"` 3646} 3647 3648func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error) { 3649 type NoMethod SslCertsInsertResponse 3650 raw := NoMethod(*s) 3651 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3652} 3653 3654// SslCertsListResponse: SslCerts list response. 3655type SslCertsListResponse struct { 3656 // Items: List of client certificates for the instance. 3657 Items []*SslCert `json:"items,omitempty"` 3658 3659 // Kind: This is always *sql#sslCertsList*. 3660 Kind string `json:"kind,omitempty"` 3661 3662 // ServerResponse contains the HTTP response code and headers from the 3663 // server. 3664 googleapi.ServerResponse `json:"-"` 3665 3666 // ForceSendFields is a list of field names (e.g. "Items") to 3667 // unconditionally include in API requests. By default, fields with 3668 // empty values are omitted from API requests. However, any non-pointer, 3669 // non-interface field appearing in ForceSendFields will be sent to the 3670 // server regardless of whether the field is empty or not. This may be 3671 // used to include empty fields in Patch requests. 3672 ForceSendFields []string `json:"-"` 3673 3674 // NullFields is a list of field names (e.g. "Items") to include in API 3675 // requests with the JSON null value. By default, fields with empty 3676 // values are omitted from API requests. However, any field with an 3677 // empty value appearing in NullFields will be sent to the server as 3678 // null. It is an error if a field in this list has a non-empty value. 3679 // This may be used to include null fields in Patch requests. 3680 NullFields []string `json:"-"` 3681} 3682 3683func (s *SslCertsListResponse) MarshalJSON() ([]byte, error) { 3684 type NoMethod SslCertsListResponse 3685 raw := NoMethod(*s) 3686 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3687} 3688 3689// Tier: A Google Cloud SQL service tier resource. 3690type Tier struct { 3691 // DiskQuota: The maximum disk size of this tier in bytes. 3692 DiskQuota int64 `json:"DiskQuota,omitempty,string"` 3693 3694 // RAM: The maximum RAM usage of this tier in bytes. 3695 RAM int64 `json:"RAM,omitempty,string"` 3696 3697 // Kind: This is always *sql#tier*. 3698 Kind string `json:"kind,omitempty"` 3699 3700 // Region: The applicable regions for this tier. 3701 Region []string `json:"region,omitempty"` 3702 3703 // Tier: An identifier for the machine type, for example, 3704 // db-custom-1-3840. For related information, see Pricing. 3705 Tier string `json:"tier,omitempty"` 3706 3707 // ForceSendFields is a list of field names (e.g. "DiskQuota") to 3708 // unconditionally include in API requests. By default, fields with 3709 // empty values are omitted from API requests. However, any non-pointer, 3710 // non-interface field appearing in ForceSendFields will be sent to the 3711 // server regardless of whether the field is empty or not. This may be 3712 // used to include empty fields in Patch requests. 3713 ForceSendFields []string `json:"-"` 3714 3715 // NullFields is a list of field names (e.g. "DiskQuota") to include in 3716 // API requests with the JSON null value. By default, fields with empty 3717 // values are omitted from API requests. However, any field with an 3718 // empty value appearing in NullFields will be sent to the server as 3719 // null. It is an error if a field in this list has a non-empty value. 3720 // This may be used to include null fields in Patch requests. 3721 NullFields []string `json:"-"` 3722} 3723 3724func (s *Tier) MarshalJSON() ([]byte, error) { 3725 type NoMethod Tier 3726 raw := NoMethod(*s) 3727 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3728} 3729 3730// TiersListResponse: Tiers list response. 3731type TiersListResponse struct { 3732 // Items: List of tiers. 3733 Items []*Tier `json:"items,omitempty"` 3734 3735 // Kind: This is always *sql#tiersList*. 3736 Kind string `json:"kind,omitempty"` 3737 3738 // ServerResponse contains the HTTP response code and headers from the 3739 // server. 3740 googleapi.ServerResponse `json:"-"` 3741 3742 // ForceSendFields is a list of field names (e.g. "Items") to 3743 // unconditionally include in API requests. By default, fields with 3744 // empty values are omitted from API requests. However, any non-pointer, 3745 // non-interface field appearing in ForceSendFields will be sent to the 3746 // server regardless of whether the field is empty or not. This may be 3747 // used to include empty fields in Patch requests. 3748 ForceSendFields []string `json:"-"` 3749 3750 // NullFields is a list of field names (e.g. "Items") to include in API 3751 // requests with the JSON null value. By default, fields with empty 3752 // values are omitted from API requests. However, any field with an 3753 // empty value appearing in NullFields will be sent to the server as 3754 // null. It is an error if a field in this list has a non-empty value. 3755 // This may be used to include null fields in Patch requests. 3756 NullFields []string `json:"-"` 3757} 3758 3759func (s *TiersListResponse) MarshalJSON() ([]byte, error) { 3760 type NoMethod TiersListResponse 3761 raw := NoMethod(*s) 3762 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3763} 3764 3765// TruncateLogContext: Database Instance truncate log context. 3766type TruncateLogContext struct { 3767 // Kind: This is always *sql#truncateLogContext*. 3768 Kind string `json:"kind,omitempty"` 3769 3770 // LogType: The type of log to truncate. Valid values are 3771 // *MYSQL_GENERAL_TABLE* and *MYSQL_SLOW_TABLE*. 3772 LogType string `json:"logType,omitempty"` 3773 3774 // ForceSendFields is a list of field names (e.g. "Kind") to 3775 // unconditionally include in API requests. By default, fields with 3776 // empty values are omitted from API requests. However, any non-pointer, 3777 // non-interface field appearing in ForceSendFields will be sent to the 3778 // server regardless of whether the field is empty or not. This may be 3779 // used to include empty fields in Patch requests. 3780 ForceSendFields []string `json:"-"` 3781 3782 // NullFields is a list of field names (e.g. "Kind") to include in API 3783 // requests with the JSON null value. By default, fields with empty 3784 // values are omitted from API requests. However, any field with an 3785 // empty value appearing in NullFields will be sent to the server as 3786 // null. It is an error if a field in this list has a non-empty value. 3787 // This may be used to include null fields in Patch requests. 3788 NullFields []string `json:"-"` 3789} 3790 3791func (s *TruncateLogContext) MarshalJSON() ([]byte, error) { 3792 type NoMethod TruncateLogContext 3793 raw := NoMethod(*s) 3794 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3795} 3796 3797// User: A Cloud SQL user resource. 3798type User struct { 3799 // Etag: This field is deprecated and will be removed from a future 3800 // version of the API. 3801 Etag string `json:"etag,omitempty"` 3802 3803 // Host: The host name from which the user can connect. For *insert* 3804 // operations, host defaults to an empty string. For *update* 3805 // operations, host is specified as part of the request URL. The host 3806 // name cannot be updated after insertion. 3807 Host string `json:"host,omitempty"` 3808 3809 // Instance: The name of the Cloud SQL instance. This does not include 3810 // the project ID. Can be omitted for *update* since it is already 3811 // specified on the URL. 3812 Instance string `json:"instance,omitempty"` 3813 3814 // Kind: This is always *sql#user*. 3815 Kind string `json:"kind,omitempty"` 3816 3817 // Name: The name of the user in the Cloud SQL instance. Can be omitted 3818 // for *update* since it is already specified in the URL. 3819 Name string `json:"name,omitempty"` 3820 3821 // Password: The password for the user. 3822 Password string `json:"password,omitempty"` 3823 3824 // Project: The project ID of the project containing the Cloud SQL 3825 // database. The Google apps domain is prefixed if applicable. Can be 3826 // omitted for *update* since it is already specified on the URL. 3827 Project string `json:"project,omitempty"` 3828 3829 SqlserverUserDetails *SqlServerUserDetails `json:"sqlserverUserDetails,omitempty"` 3830 3831 // Type: The user type. It determines the method to authenticate the 3832 // user during login. The default is the database's built-in user type. 3833 // 3834 // Possible values: 3835 // "BUILT_IN" - The database's built-in user type. 3836 // "CLOUD_IAM_USER" - Cloud IAM user. 3837 // "CLOUD_IAM_SERVICE_ACCOUNT" - Cloud IAM service account. 3838 Type string `json:"type,omitempty"` 3839 3840 // ForceSendFields is a list of field names (e.g. "Etag") to 3841 // unconditionally include in API requests. By default, fields with 3842 // empty values are omitted from API requests. However, any non-pointer, 3843 // non-interface field appearing in ForceSendFields will be sent to the 3844 // server regardless of whether the field is empty or not. This may be 3845 // used to include empty fields in Patch requests. 3846 ForceSendFields []string `json:"-"` 3847 3848 // NullFields is a list of field names (e.g. "Etag") to include in API 3849 // requests with the JSON null value. By default, fields with empty 3850 // values are omitted from API requests. However, any field with an 3851 // empty value appearing in NullFields will be sent to the server as 3852 // null. It is an error if a field in this list has a non-empty value. 3853 // This may be used to include null fields in Patch requests. 3854 NullFields []string `json:"-"` 3855} 3856 3857func (s *User) MarshalJSON() ([]byte, error) { 3858 type NoMethod User 3859 raw := NoMethod(*s) 3860 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3861} 3862 3863// UsersListResponse: User list response. 3864type UsersListResponse struct { 3865 // Items: List of user resources in the instance. 3866 Items []*User `json:"items,omitempty"` 3867 3868 // Kind: This is always *sql#usersList*. 3869 Kind string `json:"kind,omitempty"` 3870 3871 // NextPageToken: An identifier that uniquely identifies the operation. 3872 // You can use this identifier to retrieve the Operations resource that 3873 // has information about the operation. 3874 NextPageToken string `json:"nextPageToken,omitempty"` 3875 3876 // ServerResponse contains the HTTP response code and headers from the 3877 // server. 3878 googleapi.ServerResponse `json:"-"` 3879 3880 // ForceSendFields is a list of field names (e.g. "Items") to 3881 // unconditionally include in API requests. By default, fields with 3882 // empty values are omitted from API requests. However, any non-pointer, 3883 // non-interface field appearing in ForceSendFields will be sent to the 3884 // server regardless of whether the field is empty or not. This may be 3885 // used to include empty fields in Patch requests. 3886 ForceSendFields []string `json:"-"` 3887 3888 // NullFields is a list of field names (e.g. "Items") to include in API 3889 // requests with the JSON null value. By default, fields with empty 3890 // values are omitted from API requests. However, any field with an 3891 // empty value appearing in NullFields will be sent to the server as 3892 // null. It is an error if a field in this list has a non-empty value. 3893 // This may be used to include null fields in Patch requests. 3894 NullFields []string `json:"-"` 3895} 3896 3897func (s *UsersListResponse) MarshalJSON() ([]byte, error) { 3898 type NoMethod UsersListResponse 3899 raw := NoMethod(*s) 3900 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3901} 3902 3903// method id "sql.backupRuns.delete": 3904 3905type BackupRunsDeleteCall struct { 3906 s *Service 3907 project string 3908 instance string 3909 id int64 3910 urlParams_ gensupport.URLParams 3911 ctx_ context.Context 3912 header_ http.Header 3913} 3914 3915// Delete: Deletes the backup taken by a backup run. 3916// 3917// - id: The ID of the Backup Run to delete. To find a Backup Run ID, 3918// use the list method. 3919// - instance: Cloud SQL instance ID. This does not include the project 3920// ID. 3921// - project: Project ID of the project that contains the instance. 3922func (r *BackupRunsService) Delete(project string, instance string, id int64) *BackupRunsDeleteCall { 3923 c := &BackupRunsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3924 c.project = project 3925 c.instance = instance 3926 c.id = id 3927 return c 3928} 3929 3930// Fields allows partial responses to be retrieved. See 3931// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3932// for more information. 3933func (c *BackupRunsDeleteCall) Fields(s ...googleapi.Field) *BackupRunsDeleteCall { 3934 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3935 return c 3936} 3937 3938// Context sets the context to be used in this call's Do method. Any 3939// pending HTTP request will be aborted if the provided context is 3940// canceled. 3941func (c *BackupRunsDeleteCall) Context(ctx context.Context) *BackupRunsDeleteCall { 3942 c.ctx_ = ctx 3943 return c 3944} 3945 3946// Header returns an http.Header that can be modified by the caller to 3947// add HTTP headers to the request. 3948func (c *BackupRunsDeleteCall) Header() http.Header { 3949 if c.header_ == nil { 3950 c.header_ = make(http.Header) 3951 } 3952 return c.header_ 3953} 3954 3955func (c *BackupRunsDeleteCall) doRequest(alt string) (*http.Response, error) { 3956 reqHeaders := make(http.Header) 3957 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 3958 for k, v := range c.header_ { 3959 reqHeaders[k] = v 3960 } 3961 reqHeaders.Set("User-Agent", c.s.userAgent()) 3962 var body io.Reader = nil 3963 c.urlParams_.Set("alt", alt) 3964 c.urlParams_.Set("prettyPrint", "false") 3965 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}") 3966 urls += "?" + c.urlParams_.Encode() 3967 req, err := http.NewRequest("DELETE", urls, body) 3968 if err != nil { 3969 return nil, err 3970 } 3971 req.Header = reqHeaders 3972 googleapi.Expand(req.URL, map[string]string{ 3973 "project": c.project, 3974 "instance": c.instance, 3975 "id": strconv.FormatInt(c.id, 10), 3976 }) 3977 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3978} 3979 3980// Do executes the "sql.backupRuns.delete" call. 3981// Exactly one of *Operation or error will be non-nil. Any non-2xx 3982// status code is an error. Response headers are in either 3983// *Operation.ServerResponse.Header or (if a response was returned at 3984// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3985// to check whether the returned error was because 3986// http.StatusNotModified was returned. 3987func (c *BackupRunsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3988 gensupport.SetOptions(c.urlParams_, opts...) 3989 res, err := c.doRequest("json") 3990 if res != nil && res.StatusCode == http.StatusNotModified { 3991 if res.Body != nil { 3992 res.Body.Close() 3993 } 3994 return nil, &googleapi.Error{ 3995 Code: res.StatusCode, 3996 Header: res.Header, 3997 } 3998 } 3999 if err != nil { 4000 return nil, err 4001 } 4002 defer googleapi.CloseBody(res) 4003 if err := googleapi.CheckResponse(res); err != nil { 4004 return nil, err 4005 } 4006 ret := &Operation{ 4007 ServerResponse: googleapi.ServerResponse{ 4008 Header: res.Header, 4009 HTTPStatusCode: res.StatusCode, 4010 }, 4011 } 4012 target := &ret 4013 if err := gensupport.DecodeResponse(target, res); err != nil { 4014 return nil, err 4015 } 4016 return ret, nil 4017 // { 4018 // "description": "Deletes the backup taken by a backup run.", 4019 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4020 // "httpMethod": "DELETE", 4021 // "id": "sql.backupRuns.delete", 4022 // "parameterOrder": [ 4023 // "project", 4024 // "instance", 4025 // "id" 4026 // ], 4027 // "parameters": { 4028 // "id": { 4029 // "description": "The ID of the Backup Run to delete. To find a Backup Run ID, use the list method.", 4030 // "format": "int64", 4031 // "location": "path", 4032 // "required": true, 4033 // "type": "string" 4034 // }, 4035 // "instance": { 4036 // "description": "Cloud SQL instance ID. This does not include the project ID.", 4037 // "location": "path", 4038 // "required": true, 4039 // "type": "string" 4040 // }, 4041 // "project": { 4042 // "description": "Project ID of the project that contains the instance.", 4043 // "location": "path", 4044 // "required": true, 4045 // "type": "string" 4046 // } 4047 // }, 4048 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4049 // "response": { 4050 // "$ref": "Operation" 4051 // }, 4052 // "scopes": [ 4053 // "https://www.googleapis.com/auth/cloud-platform", 4054 // "https://www.googleapis.com/auth/sqlservice.admin" 4055 // ] 4056 // } 4057 4058} 4059 4060// method id "sql.backupRuns.get": 4061 4062type BackupRunsGetCall struct { 4063 s *Service 4064 project string 4065 instance string 4066 id int64 4067 urlParams_ gensupport.URLParams 4068 ifNoneMatch_ string 4069 ctx_ context.Context 4070 header_ http.Header 4071} 4072 4073// Get: Retrieves a resource containing information about a backup run. 4074// 4075// - id: The ID of this Backup Run. 4076// - instance: Cloud SQL instance ID. This does not include the project 4077// ID. 4078// - project: Project ID of the project that contains the instance. 4079func (r *BackupRunsService) Get(project string, instance string, id int64) *BackupRunsGetCall { 4080 c := &BackupRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4081 c.project = project 4082 c.instance = instance 4083 c.id = id 4084 return c 4085} 4086 4087// Fields allows partial responses to be retrieved. See 4088// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4089// for more information. 4090func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall { 4091 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4092 return c 4093} 4094 4095// IfNoneMatch sets the optional parameter which makes the operation 4096// fail if the object's ETag matches the given value. This is useful for 4097// getting updates only after the object has changed since the last 4098// request. Use googleapi.IsNotModified to check whether the response 4099// error from Do is the result of In-None-Match. 4100func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall { 4101 c.ifNoneMatch_ = entityTag 4102 return c 4103} 4104 4105// Context sets the context to be used in this call's Do method. Any 4106// pending HTTP request will be aborted if the provided context is 4107// canceled. 4108func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall { 4109 c.ctx_ = ctx 4110 return c 4111} 4112 4113// Header returns an http.Header that can be modified by the caller to 4114// add HTTP headers to the request. 4115func (c *BackupRunsGetCall) Header() http.Header { 4116 if c.header_ == nil { 4117 c.header_ = make(http.Header) 4118 } 4119 return c.header_ 4120} 4121 4122func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) { 4123 reqHeaders := make(http.Header) 4124 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 4125 for k, v := range c.header_ { 4126 reqHeaders[k] = v 4127 } 4128 reqHeaders.Set("User-Agent", c.s.userAgent()) 4129 if c.ifNoneMatch_ != "" { 4130 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4131 } 4132 var body io.Reader = nil 4133 c.urlParams_.Set("alt", alt) 4134 c.urlParams_.Set("prettyPrint", "false") 4135 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}") 4136 urls += "?" + c.urlParams_.Encode() 4137 req, err := http.NewRequest("GET", urls, body) 4138 if err != nil { 4139 return nil, err 4140 } 4141 req.Header = reqHeaders 4142 googleapi.Expand(req.URL, map[string]string{ 4143 "project": c.project, 4144 "instance": c.instance, 4145 "id": strconv.FormatInt(c.id, 10), 4146 }) 4147 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4148} 4149 4150// Do executes the "sql.backupRuns.get" call. 4151// Exactly one of *BackupRun or error will be non-nil. Any non-2xx 4152// status code is an error. Response headers are in either 4153// *BackupRun.ServerResponse.Header or (if a response was returned at 4154// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4155// to check whether the returned error was because 4156// http.StatusNotModified was returned. 4157func (c *BackupRunsGetCall) Do(opts ...googleapi.CallOption) (*BackupRun, error) { 4158 gensupport.SetOptions(c.urlParams_, opts...) 4159 res, err := c.doRequest("json") 4160 if res != nil && res.StatusCode == http.StatusNotModified { 4161 if res.Body != nil { 4162 res.Body.Close() 4163 } 4164 return nil, &googleapi.Error{ 4165 Code: res.StatusCode, 4166 Header: res.Header, 4167 } 4168 } 4169 if err != nil { 4170 return nil, err 4171 } 4172 defer googleapi.CloseBody(res) 4173 if err := googleapi.CheckResponse(res); err != nil { 4174 return nil, err 4175 } 4176 ret := &BackupRun{ 4177 ServerResponse: googleapi.ServerResponse{ 4178 Header: res.Header, 4179 HTTPStatusCode: res.StatusCode, 4180 }, 4181 } 4182 target := &ret 4183 if err := gensupport.DecodeResponse(target, res); err != nil { 4184 return nil, err 4185 } 4186 return ret, nil 4187 // { 4188 // "description": "Retrieves a resource containing information about a backup run.", 4189 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4190 // "httpMethod": "GET", 4191 // "id": "sql.backupRuns.get", 4192 // "parameterOrder": [ 4193 // "project", 4194 // "instance", 4195 // "id" 4196 // ], 4197 // "parameters": { 4198 // "id": { 4199 // "description": "The ID of this Backup Run.", 4200 // "format": "int64", 4201 // "location": "path", 4202 // "required": true, 4203 // "type": "string" 4204 // }, 4205 // "instance": { 4206 // "description": "Cloud SQL instance ID. This does not include the project ID.", 4207 // "location": "path", 4208 // "required": true, 4209 // "type": "string" 4210 // }, 4211 // "project": { 4212 // "description": "Project ID of the project that contains the instance.", 4213 // "location": "path", 4214 // "required": true, 4215 // "type": "string" 4216 // } 4217 // }, 4218 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4219 // "response": { 4220 // "$ref": "BackupRun" 4221 // }, 4222 // "scopes": [ 4223 // "https://www.googleapis.com/auth/cloud-platform", 4224 // "https://www.googleapis.com/auth/sqlservice.admin" 4225 // ] 4226 // } 4227 4228} 4229 4230// method id "sql.backupRuns.insert": 4231 4232type BackupRunsInsertCall struct { 4233 s *Service 4234 project string 4235 instance string 4236 backuprun *BackupRun 4237 urlParams_ gensupport.URLParams 4238 ctx_ context.Context 4239 header_ http.Header 4240} 4241 4242// Insert: Creates a new backup run on demand. This method is applicable 4243// only to Second Generation instances. 4244// 4245// - instance: Cloud SQL instance ID. This does not include the project 4246// ID. 4247// - project: Project ID of the project that contains the instance. 4248func (r *BackupRunsService) Insert(project string, instance string, backuprun *BackupRun) *BackupRunsInsertCall { 4249 c := &BackupRunsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4250 c.project = project 4251 c.instance = instance 4252 c.backuprun = backuprun 4253 return c 4254} 4255 4256// Fields allows partial responses to be retrieved. See 4257// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4258// for more information. 4259func (c *BackupRunsInsertCall) Fields(s ...googleapi.Field) *BackupRunsInsertCall { 4260 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4261 return c 4262} 4263 4264// Context sets the context to be used in this call's Do method. Any 4265// pending HTTP request will be aborted if the provided context is 4266// canceled. 4267func (c *BackupRunsInsertCall) Context(ctx context.Context) *BackupRunsInsertCall { 4268 c.ctx_ = ctx 4269 return c 4270} 4271 4272// Header returns an http.Header that can be modified by the caller to 4273// add HTTP headers to the request. 4274func (c *BackupRunsInsertCall) Header() http.Header { 4275 if c.header_ == nil { 4276 c.header_ = make(http.Header) 4277 } 4278 return c.header_ 4279} 4280 4281func (c *BackupRunsInsertCall) doRequest(alt string) (*http.Response, error) { 4282 reqHeaders := make(http.Header) 4283 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 4284 for k, v := range c.header_ { 4285 reqHeaders[k] = v 4286 } 4287 reqHeaders.Set("User-Agent", c.s.userAgent()) 4288 var body io.Reader = nil 4289 body, err := googleapi.WithoutDataWrapper.JSONReader(c.backuprun) 4290 if err != nil { 4291 return nil, err 4292 } 4293 reqHeaders.Set("Content-Type", "application/json") 4294 c.urlParams_.Set("alt", alt) 4295 c.urlParams_.Set("prettyPrint", "false") 4296 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns") 4297 urls += "?" + c.urlParams_.Encode() 4298 req, err := http.NewRequest("POST", urls, body) 4299 if err != nil { 4300 return nil, err 4301 } 4302 req.Header = reqHeaders 4303 googleapi.Expand(req.URL, map[string]string{ 4304 "project": c.project, 4305 "instance": c.instance, 4306 }) 4307 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4308} 4309 4310// Do executes the "sql.backupRuns.insert" call. 4311// Exactly one of *Operation or error will be non-nil. Any non-2xx 4312// status code is an error. Response headers are in either 4313// *Operation.ServerResponse.Header or (if a response was returned at 4314// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4315// to check whether the returned error was because 4316// http.StatusNotModified was returned. 4317func (c *BackupRunsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4318 gensupport.SetOptions(c.urlParams_, opts...) 4319 res, err := c.doRequest("json") 4320 if res != nil && res.StatusCode == http.StatusNotModified { 4321 if res.Body != nil { 4322 res.Body.Close() 4323 } 4324 return nil, &googleapi.Error{ 4325 Code: res.StatusCode, 4326 Header: res.Header, 4327 } 4328 } 4329 if err != nil { 4330 return nil, err 4331 } 4332 defer googleapi.CloseBody(res) 4333 if err := googleapi.CheckResponse(res); err != nil { 4334 return nil, err 4335 } 4336 ret := &Operation{ 4337 ServerResponse: googleapi.ServerResponse{ 4338 Header: res.Header, 4339 HTTPStatusCode: res.StatusCode, 4340 }, 4341 } 4342 target := &ret 4343 if err := gensupport.DecodeResponse(target, res); err != nil { 4344 return nil, err 4345 } 4346 return ret, nil 4347 // { 4348 // "description": "Creates a new backup run on demand. This method is applicable only to Second Generation instances.", 4349 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 4350 // "httpMethod": "POST", 4351 // "id": "sql.backupRuns.insert", 4352 // "parameterOrder": [ 4353 // "project", 4354 // "instance" 4355 // ], 4356 // "parameters": { 4357 // "instance": { 4358 // "description": "Cloud SQL instance ID. This does not include the project ID.", 4359 // "location": "path", 4360 // "required": true, 4361 // "type": "string" 4362 // }, 4363 // "project": { 4364 // "description": "Project ID of the project that contains the instance.", 4365 // "location": "path", 4366 // "required": true, 4367 // "type": "string" 4368 // } 4369 // }, 4370 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 4371 // "request": { 4372 // "$ref": "BackupRun" 4373 // }, 4374 // "response": { 4375 // "$ref": "Operation" 4376 // }, 4377 // "scopes": [ 4378 // "https://www.googleapis.com/auth/cloud-platform", 4379 // "https://www.googleapis.com/auth/sqlservice.admin" 4380 // ] 4381 // } 4382 4383} 4384 4385// method id "sql.backupRuns.list": 4386 4387type BackupRunsListCall struct { 4388 s *Service 4389 project string 4390 instance string 4391 urlParams_ gensupport.URLParams 4392 ifNoneMatch_ string 4393 ctx_ context.Context 4394 header_ http.Header 4395} 4396 4397// List: Lists all backup runs associated with a given instance and 4398// configuration in the reverse chronological order of the backup 4399// initiation time. 4400// 4401// - instance: Cloud SQL instance ID. This does not include the project 4402// ID. 4403// - project: Project ID of the project that contains the instance. 4404func (r *BackupRunsService) List(project string, instance string) *BackupRunsListCall { 4405 c := &BackupRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4406 c.project = project 4407 c.instance = instance 4408 return c 4409} 4410 4411// MaxResults sets the optional parameter "maxResults": Maximum number 4412// of backup runs per response. 4413func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall { 4414 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 4415 return c 4416} 4417 4418// PageToken sets the optional parameter "pageToken": A 4419// previously-returned page token representing part of the larger set of 4420// results to view. 4421func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall { 4422 c.urlParams_.Set("pageToken", pageToken) 4423 return c 4424} 4425 4426// Fields allows partial responses to be retrieved. See 4427// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4428// for more information. 4429func (c *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall { 4430 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4431 return c 4432} 4433 4434// IfNoneMatch sets the optional parameter which makes the operation 4435// fail if the object's ETag matches the given value. This is useful for 4436// getting updates only after the object has changed since the last 4437// request. Use googleapi.IsNotModified to check whether the response 4438// error from Do is the result of In-None-Match. 4439func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall { 4440 c.ifNoneMatch_ = entityTag 4441 return c 4442} 4443 4444// Context sets the context to be used in this call's Do method. Any 4445// pending HTTP request will be aborted if the provided context is 4446// canceled. 4447func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall { 4448 c.ctx_ = ctx 4449 return c 4450} 4451 4452// Header returns an http.Header that can be modified by the caller to 4453// add HTTP headers to the request. 4454func (c *BackupRunsListCall) Header() http.Header { 4455 if c.header_ == nil { 4456 c.header_ = make(http.Header) 4457 } 4458 return c.header_ 4459} 4460 4461func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) { 4462 reqHeaders := make(http.Header) 4463 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 4464 for k, v := range c.header_ { 4465 reqHeaders[k] = v 4466 } 4467 reqHeaders.Set("User-Agent", c.s.userAgent()) 4468 if c.ifNoneMatch_ != "" { 4469 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4470 } 4471 var body io.Reader = nil 4472 c.urlParams_.Set("alt", alt) 4473 c.urlParams_.Set("prettyPrint", "false") 4474 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns") 4475 urls += "?" + c.urlParams_.Encode() 4476 req, err := http.NewRequest("GET", urls, body) 4477 if err != nil { 4478 return nil, err 4479 } 4480 req.Header = reqHeaders 4481 googleapi.Expand(req.URL, map[string]string{ 4482 "project": c.project, 4483 "instance": c.instance, 4484 }) 4485 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4486} 4487 4488// Do executes the "sql.backupRuns.list" call. 4489// Exactly one of *BackupRunsListResponse or error will be non-nil. Any 4490// non-2xx status code is an error. Response headers are in either 4491// *BackupRunsListResponse.ServerResponse.Header or (if a response was 4492// returned at all) in error.(*googleapi.Error).Header. Use 4493// googleapi.IsNotModified to check whether the returned error was 4494// because http.StatusNotModified was returned. 4495func (c *BackupRunsListCall) Do(opts ...googleapi.CallOption) (*BackupRunsListResponse, error) { 4496 gensupport.SetOptions(c.urlParams_, opts...) 4497 res, err := c.doRequest("json") 4498 if res != nil && res.StatusCode == http.StatusNotModified { 4499 if res.Body != nil { 4500 res.Body.Close() 4501 } 4502 return nil, &googleapi.Error{ 4503 Code: res.StatusCode, 4504 Header: res.Header, 4505 } 4506 } 4507 if err != nil { 4508 return nil, err 4509 } 4510 defer googleapi.CloseBody(res) 4511 if err := googleapi.CheckResponse(res); err != nil { 4512 return nil, err 4513 } 4514 ret := &BackupRunsListResponse{ 4515 ServerResponse: googleapi.ServerResponse{ 4516 Header: res.Header, 4517 HTTPStatusCode: res.StatusCode, 4518 }, 4519 } 4520 target := &ret 4521 if err := gensupport.DecodeResponse(target, res); err != nil { 4522 return nil, err 4523 } 4524 return ret, nil 4525 // { 4526 // "description": "Lists all backup runs associated with a given instance and configuration in the reverse chronological order of the backup initiation time.", 4527 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 4528 // "httpMethod": "GET", 4529 // "id": "sql.backupRuns.list", 4530 // "parameterOrder": [ 4531 // "project", 4532 // "instance" 4533 // ], 4534 // "parameters": { 4535 // "instance": { 4536 // "description": "Cloud SQL instance ID. This does not include the project ID.", 4537 // "location": "path", 4538 // "required": true, 4539 // "type": "string" 4540 // }, 4541 // "maxResults": { 4542 // "description": "Maximum number of backup runs per response.", 4543 // "format": "int32", 4544 // "location": "query", 4545 // "type": "integer" 4546 // }, 4547 // "pageToken": { 4548 // "description": "A previously-returned page token representing part of the larger set of results to view.", 4549 // "location": "query", 4550 // "type": "string" 4551 // }, 4552 // "project": { 4553 // "description": "Project ID of the project that contains the instance.", 4554 // "location": "path", 4555 // "required": true, 4556 // "type": "string" 4557 // } 4558 // }, 4559 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 4560 // "response": { 4561 // "$ref": "BackupRunsListResponse" 4562 // }, 4563 // "scopes": [ 4564 // "https://www.googleapis.com/auth/cloud-platform", 4565 // "https://www.googleapis.com/auth/sqlservice.admin" 4566 // ] 4567 // } 4568 4569} 4570 4571// Pages invokes f for each page of results. 4572// A non-nil error returned from f will halt the iteration. 4573// The provided context supersedes any context provided to the Context method. 4574func (c *BackupRunsListCall) Pages(ctx context.Context, f func(*BackupRunsListResponse) error) error { 4575 c.ctx_ = ctx 4576 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4577 for { 4578 x, err := c.Do() 4579 if err != nil { 4580 return err 4581 } 4582 if err := f(x); err != nil { 4583 return err 4584 } 4585 if x.NextPageToken == "" { 4586 return nil 4587 } 4588 c.PageToken(x.NextPageToken) 4589 } 4590} 4591 4592// method id "sql.databases.delete": 4593 4594type DatabasesDeleteCall struct { 4595 s *Service 4596 project string 4597 instance string 4598 database string 4599 urlParams_ gensupport.URLParams 4600 ctx_ context.Context 4601 header_ http.Header 4602} 4603 4604// Delete: Deletes a database from a Cloud SQL instance. 4605// 4606// - database: Name of the database to be deleted in the instance. 4607// - instance: Database instance ID. This does not include the project 4608// ID. 4609// - project: Project ID of the project that contains the instance. 4610func (r *DatabasesService) Delete(project string, instance string, database string) *DatabasesDeleteCall { 4611 c := &DatabasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4612 c.project = project 4613 c.instance = instance 4614 c.database = database 4615 return c 4616} 4617 4618// Fields allows partial responses to be retrieved. See 4619// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4620// for more information. 4621func (c *DatabasesDeleteCall) Fields(s ...googleapi.Field) *DatabasesDeleteCall { 4622 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4623 return c 4624} 4625 4626// Context sets the context to be used in this call's Do method. Any 4627// pending HTTP request will be aborted if the provided context is 4628// canceled. 4629func (c *DatabasesDeleteCall) Context(ctx context.Context) *DatabasesDeleteCall { 4630 c.ctx_ = ctx 4631 return c 4632} 4633 4634// Header returns an http.Header that can be modified by the caller to 4635// add HTTP headers to the request. 4636func (c *DatabasesDeleteCall) Header() http.Header { 4637 if c.header_ == nil { 4638 c.header_ = make(http.Header) 4639 } 4640 return c.header_ 4641} 4642 4643func (c *DatabasesDeleteCall) doRequest(alt string) (*http.Response, error) { 4644 reqHeaders := make(http.Header) 4645 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 4646 for k, v := range c.header_ { 4647 reqHeaders[k] = v 4648 } 4649 reqHeaders.Set("User-Agent", c.s.userAgent()) 4650 var body io.Reader = nil 4651 c.urlParams_.Set("alt", alt) 4652 c.urlParams_.Set("prettyPrint", "false") 4653 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 4654 urls += "?" + c.urlParams_.Encode() 4655 req, err := http.NewRequest("DELETE", urls, body) 4656 if err != nil { 4657 return nil, err 4658 } 4659 req.Header = reqHeaders 4660 googleapi.Expand(req.URL, map[string]string{ 4661 "project": c.project, 4662 "instance": c.instance, 4663 "database": c.database, 4664 }) 4665 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4666} 4667 4668// Do executes the "sql.databases.delete" call. 4669// Exactly one of *Operation or error will be non-nil. Any non-2xx 4670// status code is an error. Response headers are in either 4671// *Operation.ServerResponse.Header or (if a response was returned at 4672// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4673// to check whether the returned error was because 4674// http.StatusNotModified was returned. 4675func (c *DatabasesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4676 gensupport.SetOptions(c.urlParams_, opts...) 4677 res, err := c.doRequest("json") 4678 if res != nil && res.StatusCode == http.StatusNotModified { 4679 if res.Body != nil { 4680 res.Body.Close() 4681 } 4682 return nil, &googleapi.Error{ 4683 Code: res.StatusCode, 4684 Header: res.Header, 4685 } 4686 } 4687 if err != nil { 4688 return nil, err 4689 } 4690 defer googleapi.CloseBody(res) 4691 if err := googleapi.CheckResponse(res); err != nil { 4692 return nil, err 4693 } 4694 ret := &Operation{ 4695 ServerResponse: googleapi.ServerResponse{ 4696 Header: res.Header, 4697 HTTPStatusCode: res.StatusCode, 4698 }, 4699 } 4700 target := &ret 4701 if err := gensupport.DecodeResponse(target, res); err != nil { 4702 return nil, err 4703 } 4704 return ret, nil 4705 // { 4706 // "description": "Deletes a database from a Cloud SQL instance.", 4707 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 4708 // "httpMethod": "DELETE", 4709 // "id": "sql.databases.delete", 4710 // "parameterOrder": [ 4711 // "project", 4712 // "instance", 4713 // "database" 4714 // ], 4715 // "parameters": { 4716 // "database": { 4717 // "description": "Name of the database to be deleted in the instance.", 4718 // "location": "path", 4719 // "required": true, 4720 // "type": "string" 4721 // }, 4722 // "instance": { 4723 // "description": "Database instance ID. This does not include the project ID.", 4724 // "location": "path", 4725 // "required": true, 4726 // "type": "string" 4727 // }, 4728 // "project": { 4729 // "description": "Project ID of the project that contains the instance.", 4730 // "location": "path", 4731 // "required": true, 4732 // "type": "string" 4733 // } 4734 // }, 4735 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 4736 // "response": { 4737 // "$ref": "Operation" 4738 // }, 4739 // "scopes": [ 4740 // "https://www.googleapis.com/auth/cloud-platform", 4741 // "https://www.googleapis.com/auth/sqlservice.admin" 4742 // ] 4743 // } 4744 4745} 4746 4747// method id "sql.databases.get": 4748 4749type DatabasesGetCall struct { 4750 s *Service 4751 project string 4752 instance string 4753 database string 4754 urlParams_ gensupport.URLParams 4755 ifNoneMatch_ string 4756 ctx_ context.Context 4757 header_ http.Header 4758} 4759 4760// Get: Retrieves a resource containing information about a database 4761// inside a Cloud SQL instance. 4762// 4763// - database: Name of the database in the instance. 4764// - instance: Database instance ID. This does not include the project 4765// ID. 4766// - project: Project ID of the project that contains the instance. 4767func (r *DatabasesService) Get(project string, instance string, database string) *DatabasesGetCall { 4768 c := &DatabasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4769 c.project = project 4770 c.instance = instance 4771 c.database = database 4772 return c 4773} 4774 4775// Fields allows partial responses to be retrieved. See 4776// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4777// for more information. 4778func (c *DatabasesGetCall) Fields(s ...googleapi.Field) *DatabasesGetCall { 4779 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4780 return c 4781} 4782 4783// IfNoneMatch sets the optional parameter which makes the operation 4784// fail if the object's ETag matches the given value. This is useful for 4785// getting updates only after the object has changed since the last 4786// request. Use googleapi.IsNotModified to check whether the response 4787// error from Do is the result of In-None-Match. 4788func (c *DatabasesGetCall) IfNoneMatch(entityTag string) *DatabasesGetCall { 4789 c.ifNoneMatch_ = entityTag 4790 return c 4791} 4792 4793// Context sets the context to be used in this call's Do method. Any 4794// pending HTTP request will be aborted if the provided context is 4795// canceled. 4796func (c *DatabasesGetCall) Context(ctx context.Context) *DatabasesGetCall { 4797 c.ctx_ = ctx 4798 return c 4799} 4800 4801// Header returns an http.Header that can be modified by the caller to 4802// add HTTP headers to the request. 4803func (c *DatabasesGetCall) Header() http.Header { 4804 if c.header_ == nil { 4805 c.header_ = make(http.Header) 4806 } 4807 return c.header_ 4808} 4809 4810func (c *DatabasesGetCall) doRequest(alt string) (*http.Response, error) { 4811 reqHeaders := make(http.Header) 4812 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 4813 for k, v := range c.header_ { 4814 reqHeaders[k] = v 4815 } 4816 reqHeaders.Set("User-Agent", c.s.userAgent()) 4817 if c.ifNoneMatch_ != "" { 4818 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4819 } 4820 var body io.Reader = nil 4821 c.urlParams_.Set("alt", alt) 4822 c.urlParams_.Set("prettyPrint", "false") 4823 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 4824 urls += "?" + c.urlParams_.Encode() 4825 req, err := http.NewRequest("GET", urls, body) 4826 if err != nil { 4827 return nil, err 4828 } 4829 req.Header = reqHeaders 4830 googleapi.Expand(req.URL, map[string]string{ 4831 "project": c.project, 4832 "instance": c.instance, 4833 "database": c.database, 4834 }) 4835 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4836} 4837 4838// Do executes the "sql.databases.get" call. 4839// Exactly one of *Database or error will be non-nil. Any non-2xx status 4840// code is an error. Response headers are in either 4841// *Database.ServerResponse.Header or (if a response was returned at 4842// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4843// to check whether the returned error was because 4844// http.StatusNotModified was returned. 4845func (c *DatabasesGetCall) Do(opts ...googleapi.CallOption) (*Database, error) { 4846 gensupport.SetOptions(c.urlParams_, opts...) 4847 res, err := c.doRequest("json") 4848 if res != nil && res.StatusCode == http.StatusNotModified { 4849 if res.Body != nil { 4850 res.Body.Close() 4851 } 4852 return nil, &googleapi.Error{ 4853 Code: res.StatusCode, 4854 Header: res.Header, 4855 } 4856 } 4857 if err != nil { 4858 return nil, err 4859 } 4860 defer googleapi.CloseBody(res) 4861 if err := googleapi.CheckResponse(res); err != nil { 4862 return nil, err 4863 } 4864 ret := &Database{ 4865 ServerResponse: googleapi.ServerResponse{ 4866 Header: res.Header, 4867 HTTPStatusCode: res.StatusCode, 4868 }, 4869 } 4870 target := &ret 4871 if err := gensupport.DecodeResponse(target, res); err != nil { 4872 return nil, err 4873 } 4874 return ret, nil 4875 // { 4876 // "description": "Retrieves a resource containing information about a database inside a Cloud SQL instance.", 4877 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 4878 // "httpMethod": "GET", 4879 // "id": "sql.databases.get", 4880 // "parameterOrder": [ 4881 // "project", 4882 // "instance", 4883 // "database" 4884 // ], 4885 // "parameters": { 4886 // "database": { 4887 // "description": "Name of the database in the instance.", 4888 // "location": "path", 4889 // "required": true, 4890 // "type": "string" 4891 // }, 4892 // "instance": { 4893 // "description": "Database instance ID. This does not include the project ID.", 4894 // "location": "path", 4895 // "required": true, 4896 // "type": "string" 4897 // }, 4898 // "project": { 4899 // "description": "Project ID of the project that contains the instance.", 4900 // "location": "path", 4901 // "required": true, 4902 // "type": "string" 4903 // } 4904 // }, 4905 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 4906 // "response": { 4907 // "$ref": "Database" 4908 // }, 4909 // "scopes": [ 4910 // "https://www.googleapis.com/auth/cloud-platform", 4911 // "https://www.googleapis.com/auth/sqlservice.admin" 4912 // ] 4913 // } 4914 4915} 4916 4917// method id "sql.databases.insert": 4918 4919type DatabasesInsertCall struct { 4920 s *Service 4921 project string 4922 instance string 4923 database *Database 4924 urlParams_ gensupport.URLParams 4925 ctx_ context.Context 4926 header_ http.Header 4927} 4928 4929// Insert: Inserts a resource containing information about a database 4930// inside a Cloud SQL instance. 4931// 4932// - instance: Database instance ID. This does not include the project 4933// ID. 4934// - project: Project ID of the project that contains the instance. 4935func (r *DatabasesService) Insert(project string, instance string, database *Database) *DatabasesInsertCall { 4936 c := &DatabasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4937 c.project = project 4938 c.instance = instance 4939 c.database = database 4940 return c 4941} 4942 4943// Fields allows partial responses to be retrieved. See 4944// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4945// for more information. 4946func (c *DatabasesInsertCall) Fields(s ...googleapi.Field) *DatabasesInsertCall { 4947 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4948 return c 4949} 4950 4951// Context sets the context to be used in this call's Do method. Any 4952// pending HTTP request will be aborted if the provided context is 4953// canceled. 4954func (c *DatabasesInsertCall) Context(ctx context.Context) *DatabasesInsertCall { 4955 c.ctx_ = ctx 4956 return c 4957} 4958 4959// Header returns an http.Header that can be modified by the caller to 4960// add HTTP headers to the request. 4961func (c *DatabasesInsertCall) Header() http.Header { 4962 if c.header_ == nil { 4963 c.header_ = make(http.Header) 4964 } 4965 return c.header_ 4966} 4967 4968func (c *DatabasesInsertCall) doRequest(alt string) (*http.Response, error) { 4969 reqHeaders := make(http.Header) 4970 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 4971 for k, v := range c.header_ { 4972 reqHeaders[k] = v 4973 } 4974 reqHeaders.Set("User-Agent", c.s.userAgent()) 4975 var body io.Reader = nil 4976 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database) 4977 if err != nil { 4978 return nil, err 4979 } 4980 reqHeaders.Set("Content-Type", "application/json") 4981 c.urlParams_.Set("alt", alt) 4982 c.urlParams_.Set("prettyPrint", "false") 4983 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases") 4984 urls += "?" + c.urlParams_.Encode() 4985 req, err := http.NewRequest("POST", urls, body) 4986 if err != nil { 4987 return nil, err 4988 } 4989 req.Header = reqHeaders 4990 googleapi.Expand(req.URL, map[string]string{ 4991 "project": c.project, 4992 "instance": c.instance, 4993 }) 4994 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4995} 4996 4997// Do executes the "sql.databases.insert" call. 4998// Exactly one of *Operation or error will be non-nil. Any non-2xx 4999// status code is an error. Response headers are in either 5000// *Operation.ServerResponse.Header or (if a response was returned at 5001// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5002// to check whether the returned error was because 5003// http.StatusNotModified was returned. 5004func (c *DatabasesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5005 gensupport.SetOptions(c.urlParams_, opts...) 5006 res, err := c.doRequest("json") 5007 if res != nil && res.StatusCode == http.StatusNotModified { 5008 if res.Body != nil { 5009 res.Body.Close() 5010 } 5011 return nil, &googleapi.Error{ 5012 Code: res.StatusCode, 5013 Header: res.Header, 5014 } 5015 } 5016 if err != nil { 5017 return nil, err 5018 } 5019 defer googleapi.CloseBody(res) 5020 if err := googleapi.CheckResponse(res); err != nil { 5021 return nil, err 5022 } 5023 ret := &Operation{ 5024 ServerResponse: googleapi.ServerResponse{ 5025 Header: res.Header, 5026 HTTPStatusCode: res.StatusCode, 5027 }, 5028 } 5029 target := &ret 5030 if err := gensupport.DecodeResponse(target, res); err != nil { 5031 return nil, err 5032 } 5033 return ret, nil 5034 // { 5035 // "description": "Inserts a resource containing information about a database inside a Cloud SQL instance.", 5036 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 5037 // "httpMethod": "POST", 5038 // "id": "sql.databases.insert", 5039 // "parameterOrder": [ 5040 // "project", 5041 // "instance" 5042 // ], 5043 // "parameters": { 5044 // "instance": { 5045 // "description": "Database instance ID. This does not include the project ID.", 5046 // "location": "path", 5047 // "required": true, 5048 // "type": "string" 5049 // }, 5050 // "project": { 5051 // "description": "Project ID of the project that contains the instance.", 5052 // "location": "path", 5053 // "required": true, 5054 // "type": "string" 5055 // } 5056 // }, 5057 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 5058 // "request": { 5059 // "$ref": "Database" 5060 // }, 5061 // "response": { 5062 // "$ref": "Operation" 5063 // }, 5064 // "scopes": [ 5065 // "https://www.googleapis.com/auth/cloud-platform", 5066 // "https://www.googleapis.com/auth/sqlservice.admin" 5067 // ] 5068 // } 5069 5070} 5071 5072// method id "sql.databases.list": 5073 5074type DatabasesListCall struct { 5075 s *Service 5076 project string 5077 instance string 5078 urlParams_ gensupport.URLParams 5079 ifNoneMatch_ string 5080 ctx_ context.Context 5081 header_ http.Header 5082} 5083 5084// List: Lists databases in the specified Cloud SQL instance. 5085// 5086// - instance: Cloud SQL instance ID. This does not include the project 5087// ID. 5088// - project: Project ID of the project that contains the instance. 5089func (r *DatabasesService) List(project string, instance string) *DatabasesListCall { 5090 c := &DatabasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5091 c.project = project 5092 c.instance = instance 5093 return c 5094} 5095 5096// Fields allows partial responses to be retrieved. See 5097// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5098// for more information. 5099func (c *DatabasesListCall) Fields(s ...googleapi.Field) *DatabasesListCall { 5100 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5101 return c 5102} 5103 5104// IfNoneMatch sets the optional parameter which makes the operation 5105// fail if the object's ETag matches the given value. This is useful for 5106// getting updates only after the object has changed since the last 5107// request. Use googleapi.IsNotModified to check whether the response 5108// error from Do is the result of In-None-Match. 5109func (c *DatabasesListCall) IfNoneMatch(entityTag string) *DatabasesListCall { 5110 c.ifNoneMatch_ = entityTag 5111 return c 5112} 5113 5114// Context sets the context to be used in this call's Do method. Any 5115// pending HTTP request will be aborted if the provided context is 5116// canceled. 5117func (c *DatabasesListCall) Context(ctx context.Context) *DatabasesListCall { 5118 c.ctx_ = ctx 5119 return c 5120} 5121 5122// Header returns an http.Header that can be modified by the caller to 5123// add HTTP headers to the request. 5124func (c *DatabasesListCall) Header() http.Header { 5125 if c.header_ == nil { 5126 c.header_ = make(http.Header) 5127 } 5128 return c.header_ 5129} 5130 5131func (c *DatabasesListCall) doRequest(alt string) (*http.Response, error) { 5132 reqHeaders := make(http.Header) 5133 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 5134 for k, v := range c.header_ { 5135 reqHeaders[k] = v 5136 } 5137 reqHeaders.Set("User-Agent", c.s.userAgent()) 5138 if c.ifNoneMatch_ != "" { 5139 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5140 } 5141 var body io.Reader = nil 5142 c.urlParams_.Set("alt", alt) 5143 c.urlParams_.Set("prettyPrint", "false") 5144 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases") 5145 urls += "?" + c.urlParams_.Encode() 5146 req, err := http.NewRequest("GET", urls, body) 5147 if err != nil { 5148 return nil, err 5149 } 5150 req.Header = reqHeaders 5151 googleapi.Expand(req.URL, map[string]string{ 5152 "project": c.project, 5153 "instance": c.instance, 5154 }) 5155 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5156} 5157 5158// Do executes the "sql.databases.list" call. 5159// Exactly one of *DatabasesListResponse or error will be non-nil. Any 5160// non-2xx status code is an error. Response headers are in either 5161// *DatabasesListResponse.ServerResponse.Header or (if a response was 5162// returned at all) in error.(*googleapi.Error).Header. Use 5163// googleapi.IsNotModified to check whether the returned error was 5164// because http.StatusNotModified was returned. 5165func (c *DatabasesListCall) Do(opts ...googleapi.CallOption) (*DatabasesListResponse, error) { 5166 gensupport.SetOptions(c.urlParams_, opts...) 5167 res, err := c.doRequest("json") 5168 if res != nil && res.StatusCode == http.StatusNotModified { 5169 if res.Body != nil { 5170 res.Body.Close() 5171 } 5172 return nil, &googleapi.Error{ 5173 Code: res.StatusCode, 5174 Header: res.Header, 5175 } 5176 } 5177 if err != nil { 5178 return nil, err 5179 } 5180 defer googleapi.CloseBody(res) 5181 if err := googleapi.CheckResponse(res); err != nil { 5182 return nil, err 5183 } 5184 ret := &DatabasesListResponse{ 5185 ServerResponse: googleapi.ServerResponse{ 5186 Header: res.Header, 5187 HTTPStatusCode: res.StatusCode, 5188 }, 5189 } 5190 target := &ret 5191 if err := gensupport.DecodeResponse(target, res); err != nil { 5192 return nil, err 5193 } 5194 return ret, nil 5195 // { 5196 // "description": "Lists databases in the specified Cloud SQL instance.", 5197 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 5198 // "httpMethod": "GET", 5199 // "id": "sql.databases.list", 5200 // "parameterOrder": [ 5201 // "project", 5202 // "instance" 5203 // ], 5204 // "parameters": { 5205 // "instance": { 5206 // "description": "Cloud SQL instance ID. This does not include the project ID.", 5207 // "location": "path", 5208 // "required": true, 5209 // "type": "string" 5210 // }, 5211 // "project": { 5212 // "description": "Project ID of the project that contains the instance.", 5213 // "location": "path", 5214 // "required": true, 5215 // "type": "string" 5216 // } 5217 // }, 5218 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 5219 // "response": { 5220 // "$ref": "DatabasesListResponse" 5221 // }, 5222 // "scopes": [ 5223 // "https://www.googleapis.com/auth/cloud-platform", 5224 // "https://www.googleapis.com/auth/sqlservice.admin" 5225 // ] 5226 // } 5227 5228} 5229 5230// method id "sql.databases.patch": 5231 5232type DatabasesPatchCall struct { 5233 s *Service 5234 project string 5235 instance string 5236 database string 5237 database2 *Database 5238 urlParams_ gensupport.URLParams 5239 ctx_ context.Context 5240 header_ http.Header 5241} 5242 5243// Patch: Partially updates a resource containing information about a 5244// database inside a Cloud SQL instance. This method supports patch 5245// semantics. 5246// 5247// - database: Name of the database to be updated in the instance. 5248// - instance: Database instance ID. This does not include the project 5249// ID. 5250// - project: Project ID of the project that contains the instance. 5251func (r *DatabasesService) Patch(project string, instance string, database string, database2 *Database) *DatabasesPatchCall { 5252 c := &DatabasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5253 c.project = project 5254 c.instance = instance 5255 c.database = database 5256 c.database2 = database2 5257 return c 5258} 5259 5260// Fields allows partial responses to be retrieved. See 5261// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5262// for more information. 5263func (c *DatabasesPatchCall) Fields(s ...googleapi.Field) *DatabasesPatchCall { 5264 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5265 return c 5266} 5267 5268// Context sets the context to be used in this call's Do method. Any 5269// pending HTTP request will be aborted if the provided context is 5270// canceled. 5271func (c *DatabasesPatchCall) Context(ctx context.Context) *DatabasesPatchCall { 5272 c.ctx_ = ctx 5273 return c 5274} 5275 5276// Header returns an http.Header that can be modified by the caller to 5277// add HTTP headers to the request. 5278func (c *DatabasesPatchCall) Header() http.Header { 5279 if c.header_ == nil { 5280 c.header_ = make(http.Header) 5281 } 5282 return c.header_ 5283} 5284 5285func (c *DatabasesPatchCall) doRequest(alt string) (*http.Response, error) { 5286 reqHeaders := make(http.Header) 5287 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 5288 for k, v := range c.header_ { 5289 reqHeaders[k] = v 5290 } 5291 reqHeaders.Set("User-Agent", c.s.userAgent()) 5292 var body io.Reader = nil 5293 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) 5294 if err != nil { 5295 return nil, err 5296 } 5297 reqHeaders.Set("Content-Type", "application/json") 5298 c.urlParams_.Set("alt", alt) 5299 c.urlParams_.Set("prettyPrint", "false") 5300 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 5301 urls += "?" + c.urlParams_.Encode() 5302 req, err := http.NewRequest("PATCH", urls, body) 5303 if err != nil { 5304 return nil, err 5305 } 5306 req.Header = reqHeaders 5307 googleapi.Expand(req.URL, map[string]string{ 5308 "project": c.project, 5309 "instance": c.instance, 5310 "database": c.database, 5311 }) 5312 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5313} 5314 5315// Do executes the "sql.databases.patch" call. 5316// Exactly one of *Operation or error will be non-nil. Any non-2xx 5317// status code is an error. Response headers are in either 5318// *Operation.ServerResponse.Header or (if a response was returned at 5319// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5320// to check whether the returned error was because 5321// http.StatusNotModified was returned. 5322func (c *DatabasesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5323 gensupport.SetOptions(c.urlParams_, opts...) 5324 res, err := c.doRequest("json") 5325 if res != nil && res.StatusCode == http.StatusNotModified { 5326 if res.Body != nil { 5327 res.Body.Close() 5328 } 5329 return nil, &googleapi.Error{ 5330 Code: res.StatusCode, 5331 Header: res.Header, 5332 } 5333 } 5334 if err != nil { 5335 return nil, err 5336 } 5337 defer googleapi.CloseBody(res) 5338 if err := googleapi.CheckResponse(res); err != nil { 5339 return nil, err 5340 } 5341 ret := &Operation{ 5342 ServerResponse: googleapi.ServerResponse{ 5343 Header: res.Header, 5344 HTTPStatusCode: res.StatusCode, 5345 }, 5346 } 5347 target := &ret 5348 if err := gensupport.DecodeResponse(target, res); err != nil { 5349 return nil, err 5350 } 5351 return ret, nil 5352 // { 5353 // "description": "Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.", 5354 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5355 // "httpMethod": "PATCH", 5356 // "id": "sql.databases.patch", 5357 // "parameterOrder": [ 5358 // "project", 5359 // "instance", 5360 // "database" 5361 // ], 5362 // "parameters": { 5363 // "database": { 5364 // "description": "Name of the database to be updated in the instance.", 5365 // "location": "path", 5366 // "required": true, 5367 // "type": "string" 5368 // }, 5369 // "instance": { 5370 // "description": "Database instance ID. This does not include the project ID.", 5371 // "location": "path", 5372 // "required": true, 5373 // "type": "string" 5374 // }, 5375 // "project": { 5376 // "description": "Project ID of the project that contains the instance.", 5377 // "location": "path", 5378 // "required": true, 5379 // "type": "string" 5380 // } 5381 // }, 5382 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5383 // "request": { 5384 // "$ref": "Database" 5385 // }, 5386 // "response": { 5387 // "$ref": "Operation" 5388 // }, 5389 // "scopes": [ 5390 // "https://www.googleapis.com/auth/cloud-platform", 5391 // "https://www.googleapis.com/auth/sqlservice.admin" 5392 // ] 5393 // } 5394 5395} 5396 5397// method id "sql.databases.update": 5398 5399type DatabasesUpdateCall struct { 5400 s *Service 5401 project string 5402 instance string 5403 database string 5404 database2 *Database 5405 urlParams_ gensupport.URLParams 5406 ctx_ context.Context 5407 header_ http.Header 5408} 5409 5410// Update: Updates a resource containing information about a database 5411// inside a Cloud SQL instance. 5412// 5413// - database: Name of the database to be updated in the instance. 5414// - instance: Database instance ID. This does not include the project 5415// ID. 5416// - project: Project ID of the project that contains the instance. 5417func (r *DatabasesService) Update(project string, instance string, database string, database2 *Database) *DatabasesUpdateCall { 5418 c := &DatabasesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5419 c.project = project 5420 c.instance = instance 5421 c.database = database 5422 c.database2 = database2 5423 return c 5424} 5425 5426// Fields allows partial responses to be retrieved. See 5427// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5428// for more information. 5429func (c *DatabasesUpdateCall) Fields(s ...googleapi.Field) *DatabasesUpdateCall { 5430 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5431 return c 5432} 5433 5434// Context sets the context to be used in this call's Do method. Any 5435// pending HTTP request will be aborted if the provided context is 5436// canceled. 5437func (c *DatabasesUpdateCall) Context(ctx context.Context) *DatabasesUpdateCall { 5438 c.ctx_ = ctx 5439 return c 5440} 5441 5442// Header returns an http.Header that can be modified by the caller to 5443// add HTTP headers to the request. 5444func (c *DatabasesUpdateCall) Header() http.Header { 5445 if c.header_ == nil { 5446 c.header_ = make(http.Header) 5447 } 5448 return c.header_ 5449} 5450 5451func (c *DatabasesUpdateCall) doRequest(alt string) (*http.Response, error) { 5452 reqHeaders := make(http.Header) 5453 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 5454 for k, v := range c.header_ { 5455 reqHeaders[k] = v 5456 } 5457 reqHeaders.Set("User-Agent", c.s.userAgent()) 5458 var body io.Reader = nil 5459 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) 5460 if err != nil { 5461 return nil, err 5462 } 5463 reqHeaders.Set("Content-Type", "application/json") 5464 c.urlParams_.Set("alt", alt) 5465 c.urlParams_.Set("prettyPrint", "false") 5466 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 5467 urls += "?" + c.urlParams_.Encode() 5468 req, err := http.NewRequest("PUT", urls, body) 5469 if err != nil { 5470 return nil, err 5471 } 5472 req.Header = reqHeaders 5473 googleapi.Expand(req.URL, map[string]string{ 5474 "project": c.project, 5475 "instance": c.instance, 5476 "database": c.database, 5477 }) 5478 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5479} 5480 5481// Do executes the "sql.databases.update" call. 5482// Exactly one of *Operation or error will be non-nil. Any non-2xx 5483// status code is an error. Response headers are in either 5484// *Operation.ServerResponse.Header or (if a response was returned at 5485// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5486// to check whether the returned error was because 5487// http.StatusNotModified was returned. 5488func (c *DatabasesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5489 gensupport.SetOptions(c.urlParams_, opts...) 5490 res, err := c.doRequest("json") 5491 if res != nil && res.StatusCode == http.StatusNotModified { 5492 if res.Body != nil { 5493 res.Body.Close() 5494 } 5495 return nil, &googleapi.Error{ 5496 Code: res.StatusCode, 5497 Header: res.Header, 5498 } 5499 } 5500 if err != nil { 5501 return nil, err 5502 } 5503 defer googleapi.CloseBody(res) 5504 if err := googleapi.CheckResponse(res); err != nil { 5505 return nil, err 5506 } 5507 ret := &Operation{ 5508 ServerResponse: googleapi.ServerResponse{ 5509 Header: res.Header, 5510 HTTPStatusCode: res.StatusCode, 5511 }, 5512 } 5513 target := &ret 5514 if err := gensupport.DecodeResponse(target, res); err != nil { 5515 return nil, err 5516 } 5517 return ret, nil 5518 // { 5519 // "description": "Updates a resource containing information about a database inside a Cloud SQL instance.", 5520 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5521 // "httpMethod": "PUT", 5522 // "id": "sql.databases.update", 5523 // "parameterOrder": [ 5524 // "project", 5525 // "instance", 5526 // "database" 5527 // ], 5528 // "parameters": { 5529 // "database": { 5530 // "description": "Name of the database to be updated in the instance.", 5531 // "location": "path", 5532 // "required": true, 5533 // "type": "string" 5534 // }, 5535 // "instance": { 5536 // "description": "Database instance ID. This does not include the project ID.", 5537 // "location": "path", 5538 // "required": true, 5539 // "type": "string" 5540 // }, 5541 // "project": { 5542 // "description": "Project ID of the project that contains the instance.", 5543 // "location": "path", 5544 // "required": true, 5545 // "type": "string" 5546 // } 5547 // }, 5548 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5549 // "request": { 5550 // "$ref": "Database" 5551 // }, 5552 // "response": { 5553 // "$ref": "Operation" 5554 // }, 5555 // "scopes": [ 5556 // "https://www.googleapis.com/auth/cloud-platform", 5557 // "https://www.googleapis.com/auth/sqlservice.admin" 5558 // ] 5559 // } 5560 5561} 5562 5563// method id "sql.flags.list": 5564 5565type FlagsListCall struct { 5566 s *Service 5567 urlParams_ gensupport.URLParams 5568 ifNoneMatch_ string 5569 ctx_ context.Context 5570 header_ http.Header 5571} 5572 5573// List: List all available database flags for Cloud SQL instances. 5574func (r *FlagsService) List() *FlagsListCall { 5575 c := &FlagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5576 return c 5577} 5578 5579// DatabaseVersion sets the optional parameter "databaseVersion": 5580// Database type and version you want to retrieve flags for. By default, 5581// this method returns flags for all database types and versions. 5582func (c *FlagsListCall) DatabaseVersion(databaseVersion string) *FlagsListCall { 5583 c.urlParams_.Set("databaseVersion", databaseVersion) 5584 return c 5585} 5586 5587// Fields allows partial responses to be retrieved. See 5588// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5589// for more information. 5590func (c *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall { 5591 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5592 return c 5593} 5594 5595// IfNoneMatch sets the optional parameter which makes the operation 5596// fail if the object's ETag matches the given value. This is useful for 5597// getting updates only after the object has changed since the last 5598// request. Use googleapi.IsNotModified to check whether the response 5599// error from Do is the result of In-None-Match. 5600func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall { 5601 c.ifNoneMatch_ = entityTag 5602 return c 5603} 5604 5605// Context sets the context to be used in this call's Do method. Any 5606// pending HTTP request will be aborted if the provided context is 5607// canceled. 5608func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall { 5609 c.ctx_ = ctx 5610 return c 5611} 5612 5613// Header returns an http.Header that can be modified by the caller to 5614// add HTTP headers to the request. 5615func (c *FlagsListCall) Header() http.Header { 5616 if c.header_ == nil { 5617 c.header_ = make(http.Header) 5618 } 5619 return c.header_ 5620} 5621 5622func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) { 5623 reqHeaders := make(http.Header) 5624 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 5625 for k, v := range c.header_ { 5626 reqHeaders[k] = v 5627 } 5628 reqHeaders.Set("User-Agent", c.s.userAgent()) 5629 if c.ifNoneMatch_ != "" { 5630 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5631 } 5632 var body io.Reader = nil 5633 c.urlParams_.Set("alt", alt) 5634 c.urlParams_.Set("prettyPrint", "false") 5635 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/flags") 5636 urls += "?" + c.urlParams_.Encode() 5637 req, err := http.NewRequest("GET", urls, body) 5638 if err != nil { 5639 return nil, err 5640 } 5641 req.Header = reqHeaders 5642 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5643} 5644 5645// Do executes the "sql.flags.list" call. 5646// Exactly one of *FlagsListResponse or error will be non-nil. Any 5647// non-2xx status code is an error. Response headers are in either 5648// *FlagsListResponse.ServerResponse.Header or (if a response was 5649// returned at all) in error.(*googleapi.Error).Header. Use 5650// googleapi.IsNotModified to check whether the returned error was 5651// because http.StatusNotModified was returned. 5652func (c *FlagsListCall) Do(opts ...googleapi.CallOption) (*FlagsListResponse, error) { 5653 gensupport.SetOptions(c.urlParams_, opts...) 5654 res, err := c.doRequest("json") 5655 if res != nil && res.StatusCode == http.StatusNotModified { 5656 if res.Body != nil { 5657 res.Body.Close() 5658 } 5659 return nil, &googleapi.Error{ 5660 Code: res.StatusCode, 5661 Header: res.Header, 5662 } 5663 } 5664 if err != nil { 5665 return nil, err 5666 } 5667 defer googleapi.CloseBody(res) 5668 if err := googleapi.CheckResponse(res); err != nil { 5669 return nil, err 5670 } 5671 ret := &FlagsListResponse{ 5672 ServerResponse: googleapi.ServerResponse{ 5673 Header: res.Header, 5674 HTTPStatusCode: res.StatusCode, 5675 }, 5676 } 5677 target := &ret 5678 if err := gensupport.DecodeResponse(target, res); err != nil { 5679 return nil, err 5680 } 5681 return ret, nil 5682 // { 5683 // "description": "List all available database flags for Cloud SQL instances.", 5684 // "flatPath": "sql/v1beta4/flags", 5685 // "httpMethod": "GET", 5686 // "id": "sql.flags.list", 5687 // "parameterOrder": [], 5688 // "parameters": { 5689 // "databaseVersion": { 5690 // "description": "Database type and version you want to retrieve flags for. By default, this method returns flags for all database types and versions.", 5691 // "location": "query", 5692 // "type": "string" 5693 // } 5694 // }, 5695 // "path": "sql/v1beta4/flags", 5696 // "response": { 5697 // "$ref": "FlagsListResponse" 5698 // }, 5699 // "scopes": [ 5700 // "https://www.googleapis.com/auth/cloud-platform", 5701 // "https://www.googleapis.com/auth/sqlservice.admin" 5702 // ] 5703 // } 5704 5705} 5706 5707// method id "sql.instances.addServerCa": 5708 5709type InstancesAddServerCaCall struct { 5710 s *Service 5711 project string 5712 instance string 5713 urlParams_ gensupport.URLParams 5714 ctx_ context.Context 5715 header_ http.Header 5716} 5717 5718// AddServerCa: Add a new trusted Certificate Authority (CA) version for 5719// the specified instance. Required to prepare for a certificate 5720// rotation. If a CA version was previously added but never used in a 5721// certificate rotation, this operation replaces that version. There 5722// cannot be more than one CA version waiting to be rotated in. 5723// 5724// - instance: Cloud SQL instance ID. This does not include the project 5725// ID. 5726// - project: Project ID of the project that contains the instance. 5727func (r *InstancesService) AddServerCa(project string, instance string) *InstancesAddServerCaCall { 5728 c := &InstancesAddServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5729 c.project = project 5730 c.instance = instance 5731 return c 5732} 5733 5734// Fields allows partial responses to be retrieved. See 5735// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5736// for more information. 5737func (c *InstancesAddServerCaCall) Fields(s ...googleapi.Field) *InstancesAddServerCaCall { 5738 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5739 return c 5740} 5741 5742// Context sets the context to be used in this call's Do method. Any 5743// pending HTTP request will be aborted if the provided context is 5744// canceled. 5745func (c *InstancesAddServerCaCall) Context(ctx context.Context) *InstancesAddServerCaCall { 5746 c.ctx_ = ctx 5747 return c 5748} 5749 5750// Header returns an http.Header that can be modified by the caller to 5751// add HTTP headers to the request. 5752func (c *InstancesAddServerCaCall) Header() http.Header { 5753 if c.header_ == nil { 5754 c.header_ = make(http.Header) 5755 } 5756 return c.header_ 5757} 5758 5759func (c *InstancesAddServerCaCall) doRequest(alt string) (*http.Response, error) { 5760 reqHeaders := make(http.Header) 5761 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 5762 for k, v := range c.header_ { 5763 reqHeaders[k] = v 5764 } 5765 reqHeaders.Set("User-Agent", c.s.userAgent()) 5766 var body io.Reader = nil 5767 c.urlParams_.Set("alt", alt) 5768 c.urlParams_.Set("prettyPrint", "false") 5769 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa") 5770 urls += "?" + c.urlParams_.Encode() 5771 req, err := http.NewRequest("POST", urls, body) 5772 if err != nil { 5773 return nil, err 5774 } 5775 req.Header = reqHeaders 5776 googleapi.Expand(req.URL, map[string]string{ 5777 "project": c.project, 5778 "instance": c.instance, 5779 }) 5780 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5781} 5782 5783// Do executes the "sql.instances.addServerCa" call. 5784// Exactly one of *Operation or error will be non-nil. Any non-2xx 5785// status code is an error. Response headers are in either 5786// *Operation.ServerResponse.Header or (if a response was returned at 5787// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5788// to check whether the returned error was because 5789// http.StatusNotModified was returned. 5790func (c *InstancesAddServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5791 gensupport.SetOptions(c.urlParams_, opts...) 5792 res, err := c.doRequest("json") 5793 if res != nil && res.StatusCode == http.StatusNotModified { 5794 if res.Body != nil { 5795 res.Body.Close() 5796 } 5797 return nil, &googleapi.Error{ 5798 Code: res.StatusCode, 5799 Header: res.Header, 5800 } 5801 } 5802 if err != nil { 5803 return nil, err 5804 } 5805 defer googleapi.CloseBody(res) 5806 if err := googleapi.CheckResponse(res); err != nil { 5807 return nil, err 5808 } 5809 ret := &Operation{ 5810 ServerResponse: googleapi.ServerResponse{ 5811 Header: res.Header, 5812 HTTPStatusCode: res.StatusCode, 5813 }, 5814 } 5815 target := &ret 5816 if err := gensupport.DecodeResponse(target, res); err != nil { 5817 return nil, err 5818 } 5819 return ret, nil 5820 // { 5821 // "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.", 5822 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa", 5823 // "httpMethod": "POST", 5824 // "id": "sql.instances.addServerCa", 5825 // "parameterOrder": [ 5826 // "project", 5827 // "instance" 5828 // ], 5829 // "parameters": { 5830 // "instance": { 5831 // "description": "Cloud SQL instance ID. This does not include the project ID.", 5832 // "location": "path", 5833 // "required": true, 5834 // "type": "string" 5835 // }, 5836 // "project": { 5837 // "description": "Project ID of the project that contains the instance.", 5838 // "location": "path", 5839 // "required": true, 5840 // "type": "string" 5841 // } 5842 // }, 5843 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa", 5844 // "response": { 5845 // "$ref": "Operation" 5846 // }, 5847 // "scopes": [ 5848 // "https://www.googleapis.com/auth/cloud-platform", 5849 // "https://www.googleapis.com/auth/sqlservice.admin" 5850 // ] 5851 // } 5852 5853} 5854 5855// method id "sql.instances.clone": 5856 5857type InstancesCloneCall struct { 5858 s *Service 5859 project string 5860 instance string 5861 instancesclonerequest *InstancesCloneRequest 5862 urlParams_ gensupport.URLParams 5863 ctx_ context.Context 5864 header_ http.Header 5865} 5866 5867// Clone: Creates a Cloud SQL instance as a clone of the source 5868// instance. Using this operation might cause your instance to restart. 5869// 5870// - instance: The ID of the Cloud SQL instance to be cloned (source). 5871// This does not include the project ID. 5872// - project: Project ID of the source as well as the clone Cloud SQL 5873// instance. 5874func (r *InstancesService) Clone(project string, instance string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall { 5875 c := &InstancesCloneCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5876 c.project = project 5877 c.instance = instance 5878 c.instancesclonerequest = instancesclonerequest 5879 return c 5880} 5881 5882// Fields allows partial responses to be retrieved. See 5883// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5884// for more information. 5885func (c *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall { 5886 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5887 return c 5888} 5889 5890// Context sets the context to be used in this call's Do method. Any 5891// pending HTTP request will be aborted if the provided context is 5892// canceled. 5893func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall { 5894 c.ctx_ = ctx 5895 return c 5896} 5897 5898// Header returns an http.Header that can be modified by the caller to 5899// add HTTP headers to the request. 5900func (c *InstancesCloneCall) Header() http.Header { 5901 if c.header_ == nil { 5902 c.header_ = make(http.Header) 5903 } 5904 return c.header_ 5905} 5906 5907func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, error) { 5908 reqHeaders := make(http.Header) 5909 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 5910 for k, v := range c.header_ { 5911 reqHeaders[k] = v 5912 } 5913 reqHeaders.Set("User-Agent", c.s.userAgent()) 5914 var body io.Reader = nil 5915 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest) 5916 if err != nil { 5917 return nil, err 5918 } 5919 reqHeaders.Set("Content-Type", "application/json") 5920 c.urlParams_.Set("alt", alt) 5921 c.urlParams_.Set("prettyPrint", "false") 5922 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/clone") 5923 urls += "?" + c.urlParams_.Encode() 5924 req, err := http.NewRequest("POST", urls, body) 5925 if err != nil { 5926 return nil, err 5927 } 5928 req.Header = reqHeaders 5929 googleapi.Expand(req.URL, map[string]string{ 5930 "project": c.project, 5931 "instance": c.instance, 5932 }) 5933 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5934} 5935 5936// Do executes the "sql.instances.clone" call. 5937// Exactly one of *Operation or error will be non-nil. Any non-2xx 5938// status code is an error. Response headers are in either 5939// *Operation.ServerResponse.Header or (if a response was returned at 5940// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5941// to check whether the returned error was because 5942// http.StatusNotModified was returned. 5943func (c *InstancesCloneCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5944 gensupport.SetOptions(c.urlParams_, opts...) 5945 res, err := c.doRequest("json") 5946 if res != nil && res.StatusCode == http.StatusNotModified { 5947 if res.Body != nil { 5948 res.Body.Close() 5949 } 5950 return nil, &googleapi.Error{ 5951 Code: res.StatusCode, 5952 Header: res.Header, 5953 } 5954 } 5955 if err != nil { 5956 return nil, err 5957 } 5958 defer googleapi.CloseBody(res) 5959 if err := googleapi.CheckResponse(res); err != nil { 5960 return nil, err 5961 } 5962 ret := &Operation{ 5963 ServerResponse: googleapi.ServerResponse{ 5964 Header: res.Header, 5965 HTTPStatusCode: res.StatusCode, 5966 }, 5967 } 5968 target := &ret 5969 if err := gensupport.DecodeResponse(target, res); err != nil { 5970 return nil, err 5971 } 5972 return ret, nil 5973 // { 5974 // "description": "Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.", 5975 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/clone", 5976 // "httpMethod": "POST", 5977 // "id": "sql.instances.clone", 5978 // "parameterOrder": [ 5979 // "project", 5980 // "instance" 5981 // ], 5982 // "parameters": { 5983 // "instance": { 5984 // "description": "The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID.", 5985 // "location": "path", 5986 // "required": true, 5987 // "type": "string" 5988 // }, 5989 // "project": { 5990 // "description": "Project ID of the source as well as the clone Cloud SQL instance.", 5991 // "location": "path", 5992 // "required": true, 5993 // "type": "string" 5994 // } 5995 // }, 5996 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/clone", 5997 // "request": { 5998 // "$ref": "InstancesCloneRequest" 5999 // }, 6000 // "response": { 6001 // "$ref": "Operation" 6002 // }, 6003 // "scopes": [ 6004 // "https://www.googleapis.com/auth/cloud-platform", 6005 // "https://www.googleapis.com/auth/sqlservice.admin" 6006 // ] 6007 // } 6008 6009} 6010 6011// method id "sql.instances.delete": 6012 6013type InstancesDeleteCall struct { 6014 s *Service 6015 project string 6016 instance string 6017 urlParams_ gensupport.URLParams 6018 ctx_ context.Context 6019 header_ http.Header 6020} 6021 6022// Delete: Deletes a Cloud SQL instance. 6023// 6024// - instance: Cloud SQL instance ID. This does not include the project 6025// ID. 6026// - project: Project ID of the project that contains the instance to be 6027// deleted. 6028func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall { 6029 c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6030 c.project = project 6031 c.instance = instance 6032 return c 6033} 6034 6035// Fields allows partial responses to be retrieved. See 6036// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6037// for more information. 6038func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall { 6039 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6040 return c 6041} 6042 6043// Context sets the context to be used in this call's Do method. Any 6044// pending HTTP request will be aborted if the provided context is 6045// canceled. 6046func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall { 6047 c.ctx_ = ctx 6048 return c 6049} 6050 6051// Header returns an http.Header that can be modified by the caller to 6052// add HTTP headers to the request. 6053func (c *InstancesDeleteCall) Header() http.Header { 6054 if c.header_ == nil { 6055 c.header_ = make(http.Header) 6056 } 6057 return c.header_ 6058} 6059 6060func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { 6061 reqHeaders := make(http.Header) 6062 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 6063 for k, v := range c.header_ { 6064 reqHeaders[k] = v 6065 } 6066 reqHeaders.Set("User-Agent", c.s.userAgent()) 6067 var body io.Reader = nil 6068 c.urlParams_.Set("alt", alt) 6069 c.urlParams_.Set("prettyPrint", "false") 6070 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 6071 urls += "?" + c.urlParams_.Encode() 6072 req, err := http.NewRequest("DELETE", urls, body) 6073 if err != nil { 6074 return nil, err 6075 } 6076 req.Header = reqHeaders 6077 googleapi.Expand(req.URL, map[string]string{ 6078 "project": c.project, 6079 "instance": c.instance, 6080 }) 6081 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6082} 6083 6084// Do executes the "sql.instances.delete" call. 6085// Exactly one of *Operation or error will be non-nil. Any non-2xx 6086// status code is an error. Response headers are in either 6087// *Operation.ServerResponse.Header or (if a response was returned at 6088// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6089// to check whether the returned error was because 6090// http.StatusNotModified was returned. 6091func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6092 gensupport.SetOptions(c.urlParams_, opts...) 6093 res, err := c.doRequest("json") 6094 if res != nil && res.StatusCode == http.StatusNotModified { 6095 if res.Body != nil { 6096 res.Body.Close() 6097 } 6098 return nil, &googleapi.Error{ 6099 Code: res.StatusCode, 6100 Header: res.Header, 6101 } 6102 } 6103 if err != nil { 6104 return nil, err 6105 } 6106 defer googleapi.CloseBody(res) 6107 if err := googleapi.CheckResponse(res); err != nil { 6108 return nil, err 6109 } 6110 ret := &Operation{ 6111 ServerResponse: googleapi.ServerResponse{ 6112 Header: res.Header, 6113 HTTPStatusCode: res.StatusCode, 6114 }, 6115 } 6116 target := &ret 6117 if err := gensupport.DecodeResponse(target, res); err != nil { 6118 return nil, err 6119 } 6120 return ret, nil 6121 // { 6122 // "description": "Deletes a Cloud SQL instance.", 6123 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 6124 // "httpMethod": "DELETE", 6125 // "id": "sql.instances.delete", 6126 // "parameterOrder": [ 6127 // "project", 6128 // "instance" 6129 // ], 6130 // "parameters": { 6131 // "instance": { 6132 // "description": "Cloud SQL instance ID. This does not include the project ID.", 6133 // "location": "path", 6134 // "required": true, 6135 // "type": "string" 6136 // }, 6137 // "project": { 6138 // "description": "Project ID of the project that contains the instance to be deleted.", 6139 // "location": "path", 6140 // "required": true, 6141 // "type": "string" 6142 // } 6143 // }, 6144 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 6145 // "response": { 6146 // "$ref": "Operation" 6147 // }, 6148 // "scopes": [ 6149 // "https://www.googleapis.com/auth/cloud-platform", 6150 // "https://www.googleapis.com/auth/sqlservice.admin" 6151 // ] 6152 // } 6153 6154} 6155 6156// method id "sql.instances.demoteMaster": 6157 6158type InstancesDemoteMasterCall struct { 6159 s *Service 6160 project string 6161 instance string 6162 instancesdemotemasterrequest *InstancesDemoteMasterRequest 6163 urlParams_ gensupport.URLParams 6164 ctx_ context.Context 6165 header_ http.Header 6166} 6167 6168// DemoteMaster: Demotes the stand-alone instance to be a Cloud SQL read 6169// replica for an external database server. 6170// 6171// - instance: Cloud SQL instance name. 6172// - project: ID of the project that contains the instance. 6173func (r *InstancesService) DemoteMaster(project string, instance string, instancesdemotemasterrequest *InstancesDemoteMasterRequest) *InstancesDemoteMasterCall { 6174 c := &InstancesDemoteMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6175 c.project = project 6176 c.instance = instance 6177 c.instancesdemotemasterrequest = instancesdemotemasterrequest 6178 return c 6179} 6180 6181// Fields allows partial responses to be retrieved. See 6182// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6183// for more information. 6184func (c *InstancesDemoteMasterCall) Fields(s ...googleapi.Field) *InstancesDemoteMasterCall { 6185 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6186 return c 6187} 6188 6189// Context sets the context to be used in this call's Do method. Any 6190// pending HTTP request will be aborted if the provided context is 6191// canceled. 6192func (c *InstancesDemoteMasterCall) Context(ctx context.Context) *InstancesDemoteMasterCall { 6193 c.ctx_ = ctx 6194 return c 6195} 6196 6197// Header returns an http.Header that can be modified by the caller to 6198// add HTTP headers to the request. 6199func (c *InstancesDemoteMasterCall) Header() http.Header { 6200 if c.header_ == nil { 6201 c.header_ = make(http.Header) 6202 } 6203 return c.header_ 6204} 6205 6206func (c *InstancesDemoteMasterCall) doRequest(alt string) (*http.Response, error) { 6207 reqHeaders := make(http.Header) 6208 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 6209 for k, v := range c.header_ { 6210 reqHeaders[k] = v 6211 } 6212 reqHeaders.Set("User-Agent", c.s.userAgent()) 6213 var body io.Reader = nil 6214 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesdemotemasterrequest) 6215 if err != nil { 6216 return nil, err 6217 } 6218 reqHeaders.Set("Content-Type", "application/json") 6219 c.urlParams_.Set("alt", alt) 6220 c.urlParams_.Set("prettyPrint", "false") 6221 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster") 6222 urls += "?" + c.urlParams_.Encode() 6223 req, err := http.NewRequest("POST", urls, body) 6224 if err != nil { 6225 return nil, err 6226 } 6227 req.Header = reqHeaders 6228 googleapi.Expand(req.URL, map[string]string{ 6229 "project": c.project, 6230 "instance": c.instance, 6231 }) 6232 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6233} 6234 6235// Do executes the "sql.instances.demoteMaster" call. 6236// Exactly one of *Operation or error will be non-nil. Any non-2xx 6237// status code is an error. Response headers are in either 6238// *Operation.ServerResponse.Header or (if a response was returned at 6239// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6240// to check whether the returned error was because 6241// http.StatusNotModified was returned. 6242func (c *InstancesDemoteMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6243 gensupport.SetOptions(c.urlParams_, opts...) 6244 res, err := c.doRequest("json") 6245 if res != nil && res.StatusCode == http.StatusNotModified { 6246 if res.Body != nil { 6247 res.Body.Close() 6248 } 6249 return nil, &googleapi.Error{ 6250 Code: res.StatusCode, 6251 Header: res.Header, 6252 } 6253 } 6254 if err != nil { 6255 return nil, err 6256 } 6257 defer googleapi.CloseBody(res) 6258 if err := googleapi.CheckResponse(res); err != nil { 6259 return nil, err 6260 } 6261 ret := &Operation{ 6262 ServerResponse: googleapi.ServerResponse{ 6263 Header: res.Header, 6264 HTTPStatusCode: res.StatusCode, 6265 }, 6266 } 6267 target := &ret 6268 if err := gensupport.DecodeResponse(target, res); err != nil { 6269 return nil, err 6270 } 6271 return ret, nil 6272 // { 6273 // "description": "Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.", 6274 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster", 6275 // "httpMethod": "POST", 6276 // "id": "sql.instances.demoteMaster", 6277 // "parameterOrder": [ 6278 // "project", 6279 // "instance" 6280 // ], 6281 // "parameters": { 6282 // "instance": { 6283 // "description": "Cloud SQL instance name.", 6284 // "location": "path", 6285 // "required": true, 6286 // "type": "string" 6287 // }, 6288 // "project": { 6289 // "description": "ID of the project that contains the instance.", 6290 // "location": "path", 6291 // "required": true, 6292 // "type": "string" 6293 // } 6294 // }, 6295 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster", 6296 // "request": { 6297 // "$ref": "InstancesDemoteMasterRequest" 6298 // }, 6299 // "response": { 6300 // "$ref": "Operation" 6301 // }, 6302 // "scopes": [ 6303 // "https://www.googleapis.com/auth/cloud-platform", 6304 // "https://www.googleapis.com/auth/sqlservice.admin" 6305 // ] 6306 // } 6307 6308} 6309 6310// method id "sql.instances.export": 6311 6312type InstancesExportCall struct { 6313 s *Service 6314 project string 6315 instance string 6316 instancesexportrequest *InstancesExportRequest 6317 urlParams_ gensupport.URLParams 6318 ctx_ context.Context 6319 header_ http.Header 6320} 6321 6322// Export: Exports data from a Cloud SQL instance to a Cloud Storage 6323// bucket as a SQL dump or CSV file. 6324// 6325// - instance: Cloud SQL instance ID. This does not include the project 6326// ID. 6327// - project: Project ID of the project that contains the instance to be 6328// exported. 6329func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall { 6330 c := &InstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6331 c.project = project 6332 c.instance = instance 6333 c.instancesexportrequest = instancesexportrequest 6334 return c 6335} 6336 6337// Fields allows partial responses to be retrieved. See 6338// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6339// for more information. 6340func (c *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall { 6341 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6342 return c 6343} 6344 6345// Context sets the context to be used in this call's Do method. Any 6346// pending HTTP request will be aborted if the provided context is 6347// canceled. 6348func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall { 6349 c.ctx_ = ctx 6350 return c 6351} 6352 6353// Header returns an http.Header that can be modified by the caller to 6354// add HTTP headers to the request. 6355func (c *InstancesExportCall) Header() http.Header { 6356 if c.header_ == nil { 6357 c.header_ = make(http.Header) 6358 } 6359 return c.header_ 6360} 6361 6362func (c *InstancesExportCall) doRequest(alt string) (*http.Response, error) { 6363 reqHeaders := make(http.Header) 6364 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 6365 for k, v := range c.header_ { 6366 reqHeaders[k] = v 6367 } 6368 reqHeaders.Set("User-Agent", c.s.userAgent()) 6369 var body io.Reader = nil 6370 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest) 6371 if err != nil { 6372 return nil, err 6373 } 6374 reqHeaders.Set("Content-Type", "application/json") 6375 c.urlParams_.Set("alt", alt) 6376 c.urlParams_.Set("prettyPrint", "false") 6377 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/export") 6378 urls += "?" + c.urlParams_.Encode() 6379 req, err := http.NewRequest("POST", urls, body) 6380 if err != nil { 6381 return nil, err 6382 } 6383 req.Header = reqHeaders 6384 googleapi.Expand(req.URL, map[string]string{ 6385 "project": c.project, 6386 "instance": c.instance, 6387 }) 6388 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6389} 6390 6391// Do executes the "sql.instances.export" call. 6392// Exactly one of *Operation or error will be non-nil. Any non-2xx 6393// status code is an error. Response headers are in either 6394// *Operation.ServerResponse.Header or (if a response was returned at 6395// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6396// to check whether the returned error was because 6397// http.StatusNotModified was returned. 6398func (c *InstancesExportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6399 gensupport.SetOptions(c.urlParams_, opts...) 6400 res, err := c.doRequest("json") 6401 if res != nil && res.StatusCode == http.StatusNotModified { 6402 if res.Body != nil { 6403 res.Body.Close() 6404 } 6405 return nil, &googleapi.Error{ 6406 Code: res.StatusCode, 6407 Header: res.Header, 6408 } 6409 } 6410 if err != nil { 6411 return nil, err 6412 } 6413 defer googleapi.CloseBody(res) 6414 if err := googleapi.CheckResponse(res); err != nil { 6415 return nil, err 6416 } 6417 ret := &Operation{ 6418 ServerResponse: googleapi.ServerResponse{ 6419 Header: res.Header, 6420 HTTPStatusCode: res.StatusCode, 6421 }, 6422 } 6423 target := &ret 6424 if err := gensupport.DecodeResponse(target, res); err != nil { 6425 return nil, err 6426 } 6427 return ret, nil 6428 // { 6429 // "description": "Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.", 6430 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/export", 6431 // "httpMethod": "POST", 6432 // "id": "sql.instances.export", 6433 // "parameterOrder": [ 6434 // "project", 6435 // "instance" 6436 // ], 6437 // "parameters": { 6438 // "instance": { 6439 // "description": "Cloud SQL instance ID. This does not include the project ID.", 6440 // "location": "path", 6441 // "required": true, 6442 // "type": "string" 6443 // }, 6444 // "project": { 6445 // "description": "Project ID of the project that contains the instance to be exported.", 6446 // "location": "path", 6447 // "required": true, 6448 // "type": "string" 6449 // } 6450 // }, 6451 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/export", 6452 // "request": { 6453 // "$ref": "InstancesExportRequest" 6454 // }, 6455 // "response": { 6456 // "$ref": "Operation" 6457 // }, 6458 // "scopes": [ 6459 // "https://www.googleapis.com/auth/cloud-platform" 6460 // ] 6461 // } 6462 6463} 6464 6465// method id "sql.instances.failover": 6466 6467type InstancesFailoverCall struct { 6468 s *Service 6469 project string 6470 instance string 6471 instancesfailoverrequest *InstancesFailoverRequest 6472 urlParams_ gensupport.URLParams 6473 ctx_ context.Context 6474 header_ http.Header 6475} 6476 6477// Failover: Failover the instance to its failover replica instance. 6478// Using this operation might cause your instance to restart. 6479// 6480// - instance: Cloud SQL instance ID. This does not include the project 6481// ID. 6482// - project: ID of the project that contains the read replica. 6483func (r *InstancesService) Failover(project string, instance string, instancesfailoverrequest *InstancesFailoverRequest) *InstancesFailoverCall { 6484 c := &InstancesFailoverCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6485 c.project = project 6486 c.instance = instance 6487 c.instancesfailoverrequest = instancesfailoverrequest 6488 return c 6489} 6490 6491// Fields allows partial responses to be retrieved. See 6492// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6493// for more information. 6494func (c *InstancesFailoverCall) Fields(s ...googleapi.Field) *InstancesFailoverCall { 6495 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6496 return c 6497} 6498 6499// Context sets the context to be used in this call's Do method. Any 6500// pending HTTP request will be aborted if the provided context is 6501// canceled. 6502func (c *InstancesFailoverCall) Context(ctx context.Context) *InstancesFailoverCall { 6503 c.ctx_ = ctx 6504 return c 6505} 6506 6507// Header returns an http.Header that can be modified by the caller to 6508// add HTTP headers to the request. 6509func (c *InstancesFailoverCall) Header() http.Header { 6510 if c.header_ == nil { 6511 c.header_ = make(http.Header) 6512 } 6513 return c.header_ 6514} 6515 6516func (c *InstancesFailoverCall) doRequest(alt string) (*http.Response, error) { 6517 reqHeaders := make(http.Header) 6518 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 6519 for k, v := range c.header_ { 6520 reqHeaders[k] = v 6521 } 6522 reqHeaders.Set("User-Agent", c.s.userAgent()) 6523 var body io.Reader = nil 6524 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesfailoverrequest) 6525 if err != nil { 6526 return nil, err 6527 } 6528 reqHeaders.Set("Content-Type", "application/json") 6529 c.urlParams_.Set("alt", alt) 6530 c.urlParams_.Set("prettyPrint", "false") 6531 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/failover") 6532 urls += "?" + c.urlParams_.Encode() 6533 req, err := http.NewRequest("POST", urls, body) 6534 if err != nil { 6535 return nil, err 6536 } 6537 req.Header = reqHeaders 6538 googleapi.Expand(req.URL, map[string]string{ 6539 "project": c.project, 6540 "instance": c.instance, 6541 }) 6542 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6543} 6544 6545// Do executes the "sql.instances.failover" call. 6546// Exactly one of *Operation or error will be non-nil. Any non-2xx 6547// status code is an error. Response headers are in either 6548// *Operation.ServerResponse.Header or (if a response was returned at 6549// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6550// to check whether the returned error was because 6551// http.StatusNotModified was returned. 6552func (c *InstancesFailoverCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6553 gensupport.SetOptions(c.urlParams_, opts...) 6554 res, err := c.doRequest("json") 6555 if res != nil && res.StatusCode == http.StatusNotModified { 6556 if res.Body != nil { 6557 res.Body.Close() 6558 } 6559 return nil, &googleapi.Error{ 6560 Code: res.StatusCode, 6561 Header: res.Header, 6562 } 6563 } 6564 if err != nil { 6565 return nil, err 6566 } 6567 defer googleapi.CloseBody(res) 6568 if err := googleapi.CheckResponse(res); err != nil { 6569 return nil, err 6570 } 6571 ret := &Operation{ 6572 ServerResponse: googleapi.ServerResponse{ 6573 Header: res.Header, 6574 HTTPStatusCode: res.StatusCode, 6575 }, 6576 } 6577 target := &ret 6578 if err := gensupport.DecodeResponse(target, res); err != nil { 6579 return nil, err 6580 } 6581 return ret, nil 6582 // { 6583 // "description": "Failover the instance to its failover replica instance. Using this operation might cause your instance to restart.", 6584 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/failover", 6585 // "httpMethod": "POST", 6586 // "id": "sql.instances.failover", 6587 // "parameterOrder": [ 6588 // "project", 6589 // "instance" 6590 // ], 6591 // "parameters": { 6592 // "instance": { 6593 // "description": "Cloud SQL instance ID. This does not include the project ID.", 6594 // "location": "path", 6595 // "required": true, 6596 // "type": "string" 6597 // }, 6598 // "project": { 6599 // "description": "ID of the project that contains the read replica.", 6600 // "location": "path", 6601 // "required": true, 6602 // "type": "string" 6603 // } 6604 // }, 6605 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/failover", 6606 // "request": { 6607 // "$ref": "InstancesFailoverRequest" 6608 // }, 6609 // "response": { 6610 // "$ref": "Operation" 6611 // }, 6612 // "scopes": [ 6613 // "https://www.googleapis.com/auth/cloud-platform", 6614 // "https://www.googleapis.com/auth/sqlservice.admin" 6615 // ] 6616 // } 6617 6618} 6619 6620// method id "sql.instances.get": 6621 6622type InstancesGetCall struct { 6623 s *Service 6624 project string 6625 instance string 6626 urlParams_ gensupport.URLParams 6627 ifNoneMatch_ string 6628 ctx_ context.Context 6629 header_ http.Header 6630} 6631 6632// Get: Retrieves a resource containing information about a Cloud SQL 6633// instance. 6634// 6635// - instance: Database instance ID. This does not include the project 6636// ID. 6637// - project: Project ID of the project that contains the instance. 6638func (r *InstancesService) Get(project string, instance string) *InstancesGetCall { 6639 c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6640 c.project = project 6641 c.instance = instance 6642 return c 6643} 6644 6645// Fields allows partial responses to be retrieved. See 6646// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6647// for more information. 6648func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall { 6649 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6650 return c 6651} 6652 6653// IfNoneMatch sets the optional parameter which makes the operation 6654// fail if the object's ETag matches the given value. This is useful for 6655// getting updates only after the object has changed since the last 6656// request. Use googleapi.IsNotModified to check whether the response 6657// error from Do is the result of In-None-Match. 6658func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall { 6659 c.ifNoneMatch_ = entityTag 6660 return c 6661} 6662 6663// Context sets the context to be used in this call's Do method. Any 6664// pending HTTP request will be aborted if the provided context is 6665// canceled. 6666func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall { 6667 c.ctx_ = ctx 6668 return c 6669} 6670 6671// Header returns an http.Header that can be modified by the caller to 6672// add HTTP headers to the request. 6673func (c *InstancesGetCall) Header() http.Header { 6674 if c.header_ == nil { 6675 c.header_ = make(http.Header) 6676 } 6677 return c.header_ 6678} 6679 6680func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { 6681 reqHeaders := make(http.Header) 6682 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 6683 for k, v := range c.header_ { 6684 reqHeaders[k] = v 6685 } 6686 reqHeaders.Set("User-Agent", c.s.userAgent()) 6687 if c.ifNoneMatch_ != "" { 6688 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6689 } 6690 var body io.Reader = nil 6691 c.urlParams_.Set("alt", alt) 6692 c.urlParams_.Set("prettyPrint", "false") 6693 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 6694 urls += "?" + c.urlParams_.Encode() 6695 req, err := http.NewRequest("GET", urls, body) 6696 if err != nil { 6697 return nil, err 6698 } 6699 req.Header = reqHeaders 6700 googleapi.Expand(req.URL, map[string]string{ 6701 "project": c.project, 6702 "instance": c.instance, 6703 }) 6704 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6705} 6706 6707// Do executes the "sql.instances.get" call. 6708// Exactly one of *DatabaseInstance or error will be non-nil. Any 6709// non-2xx status code is an error. Response headers are in either 6710// *DatabaseInstance.ServerResponse.Header or (if a response was 6711// returned at all) in error.(*googleapi.Error).Header. Use 6712// googleapi.IsNotModified to check whether the returned error was 6713// because http.StatusNotModified was returned. 6714func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*DatabaseInstance, error) { 6715 gensupport.SetOptions(c.urlParams_, opts...) 6716 res, err := c.doRequest("json") 6717 if res != nil && res.StatusCode == http.StatusNotModified { 6718 if res.Body != nil { 6719 res.Body.Close() 6720 } 6721 return nil, &googleapi.Error{ 6722 Code: res.StatusCode, 6723 Header: res.Header, 6724 } 6725 } 6726 if err != nil { 6727 return nil, err 6728 } 6729 defer googleapi.CloseBody(res) 6730 if err := googleapi.CheckResponse(res); err != nil { 6731 return nil, err 6732 } 6733 ret := &DatabaseInstance{ 6734 ServerResponse: googleapi.ServerResponse{ 6735 Header: res.Header, 6736 HTTPStatusCode: res.StatusCode, 6737 }, 6738 } 6739 target := &ret 6740 if err := gensupport.DecodeResponse(target, res); err != nil { 6741 return nil, err 6742 } 6743 return ret, nil 6744 // { 6745 // "description": "Retrieves a resource containing information about a Cloud SQL instance.", 6746 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 6747 // "httpMethod": "GET", 6748 // "id": "sql.instances.get", 6749 // "parameterOrder": [ 6750 // "project", 6751 // "instance" 6752 // ], 6753 // "parameters": { 6754 // "instance": { 6755 // "description": "Database instance ID. This does not include the project ID.", 6756 // "location": "path", 6757 // "required": true, 6758 // "type": "string" 6759 // }, 6760 // "project": { 6761 // "description": "Project ID of the project that contains the instance.", 6762 // "location": "path", 6763 // "required": true, 6764 // "type": "string" 6765 // } 6766 // }, 6767 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 6768 // "response": { 6769 // "$ref": "DatabaseInstance" 6770 // }, 6771 // "scopes": [ 6772 // "https://www.googleapis.com/auth/cloud-platform", 6773 // "https://www.googleapis.com/auth/sqlservice.admin" 6774 // ] 6775 // } 6776 6777} 6778 6779// method id "sql.instances.import": 6780 6781type InstancesImportCall struct { 6782 s *Service 6783 project string 6784 instance string 6785 instancesimportrequest *InstancesImportRequest 6786 urlParams_ gensupport.URLParams 6787 ctx_ context.Context 6788 header_ http.Header 6789} 6790 6791// Import: Imports data into a Cloud SQL instance from a SQL dump or CSV 6792// file in Cloud Storage. 6793// 6794// - instance: Cloud SQL instance ID. This does not include the project 6795// ID. 6796// - project: Project ID of the project that contains the instance. 6797func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall { 6798 c := &InstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6799 c.project = project 6800 c.instance = instance 6801 c.instancesimportrequest = instancesimportrequest 6802 return c 6803} 6804 6805// Fields allows partial responses to be retrieved. See 6806// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6807// for more information. 6808func (c *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall { 6809 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6810 return c 6811} 6812 6813// Context sets the context to be used in this call's Do method. Any 6814// pending HTTP request will be aborted if the provided context is 6815// canceled. 6816func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall { 6817 c.ctx_ = ctx 6818 return c 6819} 6820 6821// Header returns an http.Header that can be modified by the caller to 6822// add HTTP headers to the request. 6823func (c *InstancesImportCall) Header() http.Header { 6824 if c.header_ == nil { 6825 c.header_ = make(http.Header) 6826 } 6827 return c.header_ 6828} 6829 6830func (c *InstancesImportCall) doRequest(alt string) (*http.Response, error) { 6831 reqHeaders := make(http.Header) 6832 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 6833 for k, v := range c.header_ { 6834 reqHeaders[k] = v 6835 } 6836 reqHeaders.Set("User-Agent", c.s.userAgent()) 6837 var body io.Reader = nil 6838 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest) 6839 if err != nil { 6840 return nil, err 6841 } 6842 reqHeaders.Set("Content-Type", "application/json") 6843 c.urlParams_.Set("alt", alt) 6844 c.urlParams_.Set("prettyPrint", "false") 6845 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/import") 6846 urls += "?" + c.urlParams_.Encode() 6847 req, err := http.NewRequest("POST", urls, body) 6848 if err != nil { 6849 return nil, err 6850 } 6851 req.Header = reqHeaders 6852 googleapi.Expand(req.URL, map[string]string{ 6853 "project": c.project, 6854 "instance": c.instance, 6855 }) 6856 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6857} 6858 6859// Do executes the "sql.instances.import" call. 6860// Exactly one of *Operation or error will be non-nil. Any non-2xx 6861// status code is an error. Response headers are in either 6862// *Operation.ServerResponse.Header or (if a response was returned at 6863// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6864// to check whether the returned error was because 6865// http.StatusNotModified was returned. 6866func (c *InstancesImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6867 gensupport.SetOptions(c.urlParams_, opts...) 6868 res, err := c.doRequest("json") 6869 if res != nil && res.StatusCode == http.StatusNotModified { 6870 if res.Body != nil { 6871 res.Body.Close() 6872 } 6873 return nil, &googleapi.Error{ 6874 Code: res.StatusCode, 6875 Header: res.Header, 6876 } 6877 } 6878 if err != nil { 6879 return nil, err 6880 } 6881 defer googleapi.CloseBody(res) 6882 if err := googleapi.CheckResponse(res); err != nil { 6883 return nil, err 6884 } 6885 ret := &Operation{ 6886 ServerResponse: googleapi.ServerResponse{ 6887 Header: res.Header, 6888 HTTPStatusCode: res.StatusCode, 6889 }, 6890 } 6891 target := &ret 6892 if err := gensupport.DecodeResponse(target, res); err != nil { 6893 return nil, err 6894 } 6895 return ret, nil 6896 // { 6897 // "description": "Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.", 6898 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/import", 6899 // "httpMethod": "POST", 6900 // "id": "sql.instances.import", 6901 // "parameterOrder": [ 6902 // "project", 6903 // "instance" 6904 // ], 6905 // "parameters": { 6906 // "instance": { 6907 // "description": "Cloud SQL instance ID. This does not include the project ID.", 6908 // "location": "path", 6909 // "required": true, 6910 // "type": "string" 6911 // }, 6912 // "project": { 6913 // "description": "Project ID of the project that contains the instance.", 6914 // "location": "path", 6915 // "required": true, 6916 // "type": "string" 6917 // } 6918 // }, 6919 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/import", 6920 // "request": { 6921 // "$ref": "InstancesImportRequest" 6922 // }, 6923 // "response": { 6924 // "$ref": "Operation" 6925 // }, 6926 // "scopes": [ 6927 // "https://www.googleapis.com/auth/cloud-platform" 6928 // ] 6929 // } 6930 6931} 6932 6933// method id "sql.instances.insert": 6934 6935type InstancesInsertCall struct { 6936 s *Service 6937 project string 6938 databaseinstance *DatabaseInstance 6939 urlParams_ gensupport.URLParams 6940 ctx_ context.Context 6941 header_ http.Header 6942} 6943 6944// Insert: Creates a new Cloud SQL instance. 6945// 6946// - project: Project ID of the project to which the newly created Cloud 6947// SQL instances should belong. 6948func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall { 6949 c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6950 c.project = project 6951 c.databaseinstance = databaseinstance 6952 return c 6953} 6954 6955// Fields allows partial responses to be retrieved. See 6956// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6957// for more information. 6958func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall { 6959 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6960 return c 6961} 6962 6963// Context sets the context to be used in this call's Do method. Any 6964// pending HTTP request will be aborted if the provided context is 6965// canceled. 6966func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall { 6967 c.ctx_ = ctx 6968 return c 6969} 6970 6971// Header returns an http.Header that can be modified by the caller to 6972// add HTTP headers to the request. 6973func (c *InstancesInsertCall) Header() http.Header { 6974 if c.header_ == nil { 6975 c.header_ = make(http.Header) 6976 } 6977 return c.header_ 6978} 6979 6980func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) { 6981 reqHeaders := make(http.Header) 6982 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 6983 for k, v := range c.header_ { 6984 reqHeaders[k] = v 6985 } 6986 reqHeaders.Set("User-Agent", c.s.userAgent()) 6987 var body io.Reader = nil 6988 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) 6989 if err != nil { 6990 return nil, err 6991 } 6992 reqHeaders.Set("Content-Type", "application/json") 6993 c.urlParams_.Set("alt", alt) 6994 c.urlParams_.Set("prettyPrint", "false") 6995 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances") 6996 urls += "?" + c.urlParams_.Encode() 6997 req, err := http.NewRequest("POST", urls, body) 6998 if err != nil { 6999 return nil, err 7000 } 7001 req.Header = reqHeaders 7002 googleapi.Expand(req.URL, map[string]string{ 7003 "project": c.project, 7004 }) 7005 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7006} 7007 7008// Do executes the "sql.instances.insert" call. 7009// Exactly one of *Operation or error will be non-nil. Any non-2xx 7010// status code is an error. Response headers are in either 7011// *Operation.ServerResponse.Header or (if a response was returned at 7012// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7013// to check whether the returned error was because 7014// http.StatusNotModified was returned. 7015func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7016 gensupport.SetOptions(c.urlParams_, opts...) 7017 res, err := c.doRequest("json") 7018 if res != nil && res.StatusCode == http.StatusNotModified { 7019 if res.Body != nil { 7020 res.Body.Close() 7021 } 7022 return nil, &googleapi.Error{ 7023 Code: res.StatusCode, 7024 Header: res.Header, 7025 } 7026 } 7027 if err != nil { 7028 return nil, err 7029 } 7030 defer googleapi.CloseBody(res) 7031 if err := googleapi.CheckResponse(res); err != nil { 7032 return nil, err 7033 } 7034 ret := &Operation{ 7035 ServerResponse: googleapi.ServerResponse{ 7036 Header: res.Header, 7037 HTTPStatusCode: res.StatusCode, 7038 }, 7039 } 7040 target := &ret 7041 if err := gensupport.DecodeResponse(target, res); err != nil { 7042 return nil, err 7043 } 7044 return ret, nil 7045 // { 7046 // "description": "Creates a new Cloud SQL instance.", 7047 // "flatPath": "sql/v1beta4/projects/{project}/instances", 7048 // "httpMethod": "POST", 7049 // "id": "sql.instances.insert", 7050 // "parameterOrder": [ 7051 // "project" 7052 // ], 7053 // "parameters": { 7054 // "project": { 7055 // "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.", 7056 // "location": "path", 7057 // "required": true, 7058 // "type": "string" 7059 // } 7060 // }, 7061 // "path": "sql/v1beta4/projects/{project}/instances", 7062 // "request": { 7063 // "$ref": "DatabaseInstance" 7064 // }, 7065 // "response": { 7066 // "$ref": "Operation" 7067 // }, 7068 // "scopes": [ 7069 // "https://www.googleapis.com/auth/cloud-platform", 7070 // "https://www.googleapis.com/auth/sqlservice.admin" 7071 // ] 7072 // } 7073 7074} 7075 7076// method id "sql.instances.list": 7077 7078type InstancesListCall struct { 7079 s *Service 7080 project string 7081 urlParams_ gensupport.URLParams 7082 ifNoneMatch_ string 7083 ctx_ context.Context 7084 header_ http.Header 7085} 7086 7087// List: Lists instances under a given project. 7088// 7089// - project: Project ID of the project for which to list Cloud SQL 7090// instances. 7091func (r *InstancesService) List(project string) *InstancesListCall { 7092 c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7093 c.project = project 7094 return c 7095} 7096 7097// Filter sets the optional parameter "filter": A filter expression that 7098// filters resources listed in the response. The expression is in the 7099// form of field:value. For example, 'instanceType:CLOUD_SQL_INSTANCE'. 7100// Fields can be nested as needed as per their JSON representation, such 7101// as 'settings.userLabels.auto_start:true'. Multiple filter queries are 7102// space-separated. For example. 'state:RUNNABLE 7103// instanceType:CLOUD_SQL_INSTANCE'. By default, each expression is an 7104// AND expression. However, you can include AND and OR expressions 7105// explicitly. 7106func (c *InstancesListCall) Filter(filter string) *InstancesListCall { 7107 c.urlParams_.Set("filter", filter) 7108 return c 7109} 7110 7111// MaxResults sets the optional parameter "maxResults": The maximum 7112// number of results to return per response. 7113func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { 7114 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 7115 return c 7116} 7117 7118// PageToken sets the optional parameter "pageToken": A 7119// previously-returned page token representing part of the larger set of 7120// results to view. 7121func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { 7122 c.urlParams_.Set("pageToken", pageToken) 7123 return c 7124} 7125 7126// Fields allows partial responses to be retrieved. See 7127// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7128// for more information. 7129func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall { 7130 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7131 return c 7132} 7133 7134// IfNoneMatch sets the optional parameter which makes the operation 7135// fail if the object's ETag matches the given value. This is useful for 7136// getting updates only after the object has changed since the last 7137// request. Use googleapi.IsNotModified to check whether the response 7138// error from Do is the result of In-None-Match. 7139func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall { 7140 c.ifNoneMatch_ = entityTag 7141 return c 7142} 7143 7144// Context sets the context to be used in this call's Do method. Any 7145// pending HTTP request will be aborted if the provided context is 7146// canceled. 7147func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall { 7148 c.ctx_ = ctx 7149 return c 7150} 7151 7152// Header returns an http.Header that can be modified by the caller to 7153// add HTTP headers to the request. 7154func (c *InstancesListCall) Header() http.Header { 7155 if c.header_ == nil { 7156 c.header_ = make(http.Header) 7157 } 7158 return c.header_ 7159} 7160 7161func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { 7162 reqHeaders := make(http.Header) 7163 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 7164 for k, v := range c.header_ { 7165 reqHeaders[k] = v 7166 } 7167 reqHeaders.Set("User-Agent", c.s.userAgent()) 7168 if c.ifNoneMatch_ != "" { 7169 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7170 } 7171 var body io.Reader = nil 7172 c.urlParams_.Set("alt", alt) 7173 c.urlParams_.Set("prettyPrint", "false") 7174 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances") 7175 urls += "?" + c.urlParams_.Encode() 7176 req, err := http.NewRequest("GET", urls, body) 7177 if err != nil { 7178 return nil, err 7179 } 7180 req.Header = reqHeaders 7181 googleapi.Expand(req.URL, map[string]string{ 7182 "project": c.project, 7183 }) 7184 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7185} 7186 7187// Do executes the "sql.instances.list" call. 7188// Exactly one of *InstancesListResponse or error will be non-nil. Any 7189// non-2xx status code is an error. Response headers are in either 7190// *InstancesListResponse.ServerResponse.Header or (if a response was 7191// returned at all) in error.(*googleapi.Error).Header. Use 7192// googleapi.IsNotModified to check whether the returned error was 7193// because http.StatusNotModified was returned. 7194func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstancesListResponse, error) { 7195 gensupport.SetOptions(c.urlParams_, opts...) 7196 res, err := c.doRequest("json") 7197 if res != nil && res.StatusCode == http.StatusNotModified { 7198 if res.Body != nil { 7199 res.Body.Close() 7200 } 7201 return nil, &googleapi.Error{ 7202 Code: res.StatusCode, 7203 Header: res.Header, 7204 } 7205 } 7206 if err != nil { 7207 return nil, err 7208 } 7209 defer googleapi.CloseBody(res) 7210 if err := googleapi.CheckResponse(res); err != nil { 7211 return nil, err 7212 } 7213 ret := &InstancesListResponse{ 7214 ServerResponse: googleapi.ServerResponse{ 7215 Header: res.Header, 7216 HTTPStatusCode: res.StatusCode, 7217 }, 7218 } 7219 target := &ret 7220 if err := gensupport.DecodeResponse(target, res); err != nil { 7221 return nil, err 7222 } 7223 return ret, nil 7224 // { 7225 // "description": "Lists instances under a given project.", 7226 // "flatPath": "sql/v1beta4/projects/{project}/instances", 7227 // "httpMethod": "GET", 7228 // "id": "sql.instances.list", 7229 // "parameterOrder": [ 7230 // "project" 7231 // ], 7232 // "parameters": { 7233 // "filter": { 7234 // "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.", 7235 // "location": "query", 7236 // "type": "string" 7237 // }, 7238 // "maxResults": { 7239 // "description": "The maximum number of results to return per response.", 7240 // "format": "uint32", 7241 // "location": "query", 7242 // "type": "integer" 7243 // }, 7244 // "pageToken": { 7245 // "description": "A previously-returned page token representing part of the larger set of results to view.", 7246 // "location": "query", 7247 // "type": "string" 7248 // }, 7249 // "project": { 7250 // "description": "Project ID of the project for which to list Cloud SQL instances.", 7251 // "location": "path", 7252 // "required": true, 7253 // "type": "string" 7254 // } 7255 // }, 7256 // "path": "sql/v1beta4/projects/{project}/instances", 7257 // "response": { 7258 // "$ref": "InstancesListResponse" 7259 // }, 7260 // "scopes": [ 7261 // "https://www.googleapis.com/auth/cloud-platform", 7262 // "https://www.googleapis.com/auth/sqlservice.admin" 7263 // ] 7264 // } 7265 7266} 7267 7268// Pages invokes f for each page of results. 7269// A non-nil error returned from f will halt the iteration. 7270// The provided context supersedes any context provided to the Context method. 7271func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstancesListResponse) error) error { 7272 c.ctx_ = ctx 7273 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7274 for { 7275 x, err := c.Do() 7276 if err != nil { 7277 return err 7278 } 7279 if err := f(x); err != nil { 7280 return err 7281 } 7282 if x.NextPageToken == "" { 7283 return nil 7284 } 7285 c.PageToken(x.NextPageToken) 7286 } 7287} 7288 7289// method id "sql.instances.listServerCas": 7290 7291type InstancesListServerCasCall struct { 7292 s *Service 7293 project string 7294 instance string 7295 urlParams_ gensupport.URLParams 7296 ifNoneMatch_ string 7297 ctx_ context.Context 7298 header_ http.Header 7299} 7300 7301// ListServerCas: Lists all of the trusted Certificate Authorities (CAs) 7302// for the specified instance. There can be up to three CAs listed: the 7303// CA that was used to sign the certificate that is currently in use, a 7304// CA that has been added but not yet used to sign a certificate, and a 7305// CA used to sign a certificate that has previously rotated out. 7306// 7307// - instance: Cloud SQL instance ID. This does not include the project 7308// ID. 7309// - project: Project ID of the project that contains the instance. 7310func (r *InstancesService) ListServerCas(project string, instance string) *InstancesListServerCasCall { 7311 c := &InstancesListServerCasCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7312 c.project = project 7313 c.instance = instance 7314 return c 7315} 7316 7317// Fields allows partial responses to be retrieved. See 7318// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7319// for more information. 7320func (c *InstancesListServerCasCall) Fields(s ...googleapi.Field) *InstancesListServerCasCall { 7321 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7322 return c 7323} 7324 7325// IfNoneMatch sets the optional parameter which makes the operation 7326// fail if the object's ETag matches the given value. This is useful for 7327// getting updates only after the object has changed since the last 7328// request. Use googleapi.IsNotModified to check whether the response 7329// error from Do is the result of In-None-Match. 7330func (c *InstancesListServerCasCall) IfNoneMatch(entityTag string) *InstancesListServerCasCall { 7331 c.ifNoneMatch_ = entityTag 7332 return c 7333} 7334 7335// Context sets the context to be used in this call's Do method. Any 7336// pending HTTP request will be aborted if the provided context is 7337// canceled. 7338func (c *InstancesListServerCasCall) Context(ctx context.Context) *InstancesListServerCasCall { 7339 c.ctx_ = ctx 7340 return c 7341} 7342 7343// Header returns an http.Header that can be modified by the caller to 7344// add HTTP headers to the request. 7345func (c *InstancesListServerCasCall) Header() http.Header { 7346 if c.header_ == nil { 7347 c.header_ = make(http.Header) 7348 } 7349 return c.header_ 7350} 7351 7352func (c *InstancesListServerCasCall) doRequest(alt string) (*http.Response, error) { 7353 reqHeaders := make(http.Header) 7354 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 7355 for k, v := range c.header_ { 7356 reqHeaders[k] = v 7357 } 7358 reqHeaders.Set("User-Agent", c.s.userAgent()) 7359 if c.ifNoneMatch_ != "" { 7360 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7361 } 7362 var body io.Reader = nil 7363 c.urlParams_.Set("alt", alt) 7364 c.urlParams_.Set("prettyPrint", "false") 7365 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas") 7366 urls += "?" + c.urlParams_.Encode() 7367 req, err := http.NewRequest("GET", urls, body) 7368 if err != nil { 7369 return nil, err 7370 } 7371 req.Header = reqHeaders 7372 googleapi.Expand(req.URL, map[string]string{ 7373 "project": c.project, 7374 "instance": c.instance, 7375 }) 7376 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7377} 7378 7379// Do executes the "sql.instances.listServerCas" call. 7380// Exactly one of *InstancesListServerCasResponse or error will be 7381// non-nil. Any non-2xx status code is an error. Response headers are in 7382// either *InstancesListServerCasResponse.ServerResponse.Header or (if a 7383// response was returned at all) in error.(*googleapi.Error).Header. Use 7384// googleapi.IsNotModified to check whether the returned error was 7385// because http.StatusNotModified was returned. 7386func (c *InstancesListServerCasCall) Do(opts ...googleapi.CallOption) (*InstancesListServerCasResponse, error) { 7387 gensupport.SetOptions(c.urlParams_, opts...) 7388 res, err := c.doRequest("json") 7389 if res != nil && res.StatusCode == http.StatusNotModified { 7390 if res.Body != nil { 7391 res.Body.Close() 7392 } 7393 return nil, &googleapi.Error{ 7394 Code: res.StatusCode, 7395 Header: res.Header, 7396 } 7397 } 7398 if err != nil { 7399 return nil, err 7400 } 7401 defer googleapi.CloseBody(res) 7402 if err := googleapi.CheckResponse(res); err != nil { 7403 return nil, err 7404 } 7405 ret := &InstancesListServerCasResponse{ 7406 ServerResponse: googleapi.ServerResponse{ 7407 Header: res.Header, 7408 HTTPStatusCode: res.StatusCode, 7409 }, 7410 } 7411 target := &ret 7412 if err := gensupport.DecodeResponse(target, res); err != nil { 7413 return nil, err 7414 } 7415 return ret, nil 7416 // { 7417 // "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.", 7418 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas", 7419 // "httpMethod": "GET", 7420 // "id": "sql.instances.listServerCas", 7421 // "parameterOrder": [ 7422 // "project", 7423 // "instance" 7424 // ], 7425 // "parameters": { 7426 // "instance": { 7427 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7428 // "location": "path", 7429 // "required": true, 7430 // "type": "string" 7431 // }, 7432 // "project": { 7433 // "description": "Project ID of the project that contains the instance.", 7434 // "location": "path", 7435 // "required": true, 7436 // "type": "string" 7437 // } 7438 // }, 7439 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas", 7440 // "response": { 7441 // "$ref": "InstancesListServerCasResponse" 7442 // }, 7443 // "scopes": [ 7444 // "https://www.googleapis.com/auth/cloud-platform", 7445 // "https://www.googleapis.com/auth/sqlservice.admin" 7446 // ] 7447 // } 7448 7449} 7450 7451// method id "sql.instances.patch": 7452 7453type InstancesPatchCall struct { 7454 s *Service 7455 project string 7456 instance string 7457 databaseinstance *DatabaseInstance 7458 urlParams_ gensupport.URLParams 7459 ctx_ context.Context 7460 header_ http.Header 7461} 7462 7463// Patch: Updates settings of a Cloud SQL instance. This method supports 7464// patch semantics. 7465// 7466// - instance: Cloud SQL instance ID. This does not include the project 7467// ID. 7468// - project: Project ID of the project that contains the instance. 7469func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall { 7470 c := &InstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7471 c.project = project 7472 c.instance = instance 7473 c.databaseinstance = databaseinstance 7474 return c 7475} 7476 7477// Fields allows partial responses to be retrieved. See 7478// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7479// for more information. 7480func (c *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall { 7481 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7482 return c 7483} 7484 7485// Context sets the context to be used in this call's Do method. Any 7486// pending HTTP request will be aborted if the provided context is 7487// canceled. 7488func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall { 7489 c.ctx_ = ctx 7490 return c 7491} 7492 7493// Header returns an http.Header that can be modified by the caller to 7494// add HTTP headers to the request. 7495func (c *InstancesPatchCall) Header() http.Header { 7496 if c.header_ == nil { 7497 c.header_ = make(http.Header) 7498 } 7499 return c.header_ 7500} 7501 7502func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, error) { 7503 reqHeaders := make(http.Header) 7504 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 7505 for k, v := range c.header_ { 7506 reqHeaders[k] = v 7507 } 7508 reqHeaders.Set("User-Agent", c.s.userAgent()) 7509 var body io.Reader = nil 7510 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) 7511 if err != nil { 7512 return nil, err 7513 } 7514 reqHeaders.Set("Content-Type", "application/json") 7515 c.urlParams_.Set("alt", alt) 7516 c.urlParams_.Set("prettyPrint", "false") 7517 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 7518 urls += "?" + c.urlParams_.Encode() 7519 req, err := http.NewRequest("PATCH", urls, body) 7520 if err != nil { 7521 return nil, err 7522 } 7523 req.Header = reqHeaders 7524 googleapi.Expand(req.URL, map[string]string{ 7525 "project": c.project, 7526 "instance": c.instance, 7527 }) 7528 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7529} 7530 7531// Do executes the "sql.instances.patch" call. 7532// Exactly one of *Operation or error will be non-nil. Any non-2xx 7533// status code is an error. Response headers are in either 7534// *Operation.ServerResponse.Header or (if a response was returned at 7535// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7536// to check whether the returned error was because 7537// http.StatusNotModified was returned. 7538func (c *InstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7539 gensupport.SetOptions(c.urlParams_, opts...) 7540 res, err := c.doRequest("json") 7541 if res != nil && res.StatusCode == http.StatusNotModified { 7542 if res.Body != nil { 7543 res.Body.Close() 7544 } 7545 return nil, &googleapi.Error{ 7546 Code: res.StatusCode, 7547 Header: res.Header, 7548 } 7549 } 7550 if err != nil { 7551 return nil, err 7552 } 7553 defer googleapi.CloseBody(res) 7554 if err := googleapi.CheckResponse(res); err != nil { 7555 return nil, err 7556 } 7557 ret := &Operation{ 7558 ServerResponse: googleapi.ServerResponse{ 7559 Header: res.Header, 7560 HTTPStatusCode: res.StatusCode, 7561 }, 7562 } 7563 target := &ret 7564 if err := gensupport.DecodeResponse(target, res); err != nil { 7565 return nil, err 7566 } 7567 return ret, nil 7568 // { 7569 // "description": "Updates settings of a Cloud SQL instance. This method supports patch semantics.", 7570 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 7571 // "httpMethod": "PATCH", 7572 // "id": "sql.instances.patch", 7573 // "parameterOrder": [ 7574 // "project", 7575 // "instance" 7576 // ], 7577 // "parameters": { 7578 // "instance": { 7579 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7580 // "location": "path", 7581 // "required": true, 7582 // "type": "string" 7583 // }, 7584 // "project": { 7585 // "description": "Project ID of the project that contains the instance.", 7586 // "location": "path", 7587 // "required": true, 7588 // "type": "string" 7589 // } 7590 // }, 7591 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 7592 // "request": { 7593 // "$ref": "DatabaseInstance" 7594 // }, 7595 // "response": { 7596 // "$ref": "Operation" 7597 // }, 7598 // "scopes": [ 7599 // "https://www.googleapis.com/auth/cloud-platform", 7600 // "https://www.googleapis.com/auth/sqlservice.admin" 7601 // ] 7602 // } 7603 7604} 7605 7606// method id "sql.instances.promoteReplica": 7607 7608type InstancesPromoteReplicaCall struct { 7609 s *Service 7610 project string 7611 instance string 7612 urlParams_ gensupport.URLParams 7613 ctx_ context.Context 7614 header_ http.Header 7615} 7616 7617// PromoteReplica: Promotes the read replica instance to be a 7618// stand-alone Cloud SQL instance. Using this operation might cause your 7619// instance to restart. 7620// 7621// - instance: Cloud SQL read replica instance name. 7622// - project: ID of the project that contains the read replica. 7623func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall { 7624 c := &InstancesPromoteReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7625 c.project = project 7626 c.instance = instance 7627 return c 7628} 7629 7630// Fields allows partial responses to be retrieved. See 7631// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7632// for more information. 7633func (c *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall { 7634 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7635 return c 7636} 7637 7638// Context sets the context to be used in this call's Do method. Any 7639// pending HTTP request will be aborted if the provided context is 7640// canceled. 7641func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall { 7642 c.ctx_ = ctx 7643 return c 7644} 7645 7646// Header returns an http.Header that can be modified by the caller to 7647// add HTTP headers to the request. 7648func (c *InstancesPromoteReplicaCall) Header() http.Header { 7649 if c.header_ == nil { 7650 c.header_ = make(http.Header) 7651 } 7652 return c.header_ 7653} 7654 7655func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) { 7656 reqHeaders := make(http.Header) 7657 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 7658 for k, v := range c.header_ { 7659 reqHeaders[k] = v 7660 } 7661 reqHeaders.Set("User-Agent", c.s.userAgent()) 7662 var body io.Reader = nil 7663 c.urlParams_.Set("alt", alt) 7664 c.urlParams_.Set("prettyPrint", "false") 7665 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica") 7666 urls += "?" + c.urlParams_.Encode() 7667 req, err := http.NewRequest("POST", urls, body) 7668 if err != nil { 7669 return nil, err 7670 } 7671 req.Header = reqHeaders 7672 googleapi.Expand(req.URL, map[string]string{ 7673 "project": c.project, 7674 "instance": c.instance, 7675 }) 7676 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7677} 7678 7679// Do executes the "sql.instances.promoteReplica" call. 7680// Exactly one of *Operation or error will be non-nil. Any non-2xx 7681// status code is an error. Response headers are in either 7682// *Operation.ServerResponse.Header or (if a response was returned at 7683// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7684// to check whether the returned error was because 7685// http.StatusNotModified was returned. 7686func (c *InstancesPromoteReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7687 gensupport.SetOptions(c.urlParams_, opts...) 7688 res, err := c.doRequest("json") 7689 if res != nil && res.StatusCode == http.StatusNotModified { 7690 if res.Body != nil { 7691 res.Body.Close() 7692 } 7693 return nil, &googleapi.Error{ 7694 Code: res.StatusCode, 7695 Header: res.Header, 7696 } 7697 } 7698 if err != nil { 7699 return nil, err 7700 } 7701 defer googleapi.CloseBody(res) 7702 if err := googleapi.CheckResponse(res); err != nil { 7703 return nil, err 7704 } 7705 ret := &Operation{ 7706 ServerResponse: googleapi.ServerResponse{ 7707 Header: res.Header, 7708 HTTPStatusCode: res.StatusCode, 7709 }, 7710 } 7711 target := &ret 7712 if err := gensupport.DecodeResponse(target, res); err != nil { 7713 return nil, err 7714 } 7715 return ret, nil 7716 // { 7717 // "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance. Using this operation might cause your instance to restart.", 7718 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica", 7719 // "httpMethod": "POST", 7720 // "id": "sql.instances.promoteReplica", 7721 // "parameterOrder": [ 7722 // "project", 7723 // "instance" 7724 // ], 7725 // "parameters": { 7726 // "instance": { 7727 // "description": "Cloud SQL read replica instance name.", 7728 // "location": "path", 7729 // "required": true, 7730 // "type": "string" 7731 // }, 7732 // "project": { 7733 // "description": "ID of the project that contains the read replica.", 7734 // "location": "path", 7735 // "required": true, 7736 // "type": "string" 7737 // } 7738 // }, 7739 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica", 7740 // "response": { 7741 // "$ref": "Operation" 7742 // }, 7743 // "scopes": [ 7744 // "https://www.googleapis.com/auth/cloud-platform", 7745 // "https://www.googleapis.com/auth/sqlservice.admin" 7746 // ] 7747 // } 7748 7749} 7750 7751// method id "sql.instances.resetSslConfig": 7752 7753type InstancesResetSslConfigCall struct { 7754 s *Service 7755 project string 7756 instance string 7757 urlParams_ gensupport.URLParams 7758 ctx_ context.Context 7759 header_ http.Header 7760} 7761 7762// ResetSslConfig: Deletes all client certificates and generates a new 7763// server SSL certificate for the instance. 7764// 7765// - instance: Cloud SQL instance ID. This does not include the project 7766// ID. 7767// - project: Project ID of the project that contains the instance. 7768func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall { 7769 c := &InstancesResetSslConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7770 c.project = project 7771 c.instance = instance 7772 return c 7773} 7774 7775// Fields allows partial responses to be retrieved. See 7776// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7777// for more information. 7778func (c *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall { 7779 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7780 return c 7781} 7782 7783// Context sets the context to be used in this call's Do method. Any 7784// pending HTTP request will be aborted if the provided context is 7785// canceled. 7786func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall { 7787 c.ctx_ = ctx 7788 return c 7789} 7790 7791// Header returns an http.Header that can be modified by the caller to 7792// add HTTP headers to the request. 7793func (c *InstancesResetSslConfigCall) Header() http.Header { 7794 if c.header_ == nil { 7795 c.header_ = make(http.Header) 7796 } 7797 return c.header_ 7798} 7799 7800func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) { 7801 reqHeaders := make(http.Header) 7802 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 7803 for k, v := range c.header_ { 7804 reqHeaders[k] = v 7805 } 7806 reqHeaders.Set("User-Agent", c.s.userAgent()) 7807 var body io.Reader = nil 7808 c.urlParams_.Set("alt", alt) 7809 c.urlParams_.Set("prettyPrint", "false") 7810 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig") 7811 urls += "?" + c.urlParams_.Encode() 7812 req, err := http.NewRequest("POST", urls, body) 7813 if err != nil { 7814 return nil, err 7815 } 7816 req.Header = reqHeaders 7817 googleapi.Expand(req.URL, map[string]string{ 7818 "project": c.project, 7819 "instance": c.instance, 7820 }) 7821 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7822} 7823 7824// Do executes the "sql.instances.resetSslConfig" call. 7825// Exactly one of *Operation or error will be non-nil. Any non-2xx 7826// status code is an error. Response headers are in either 7827// *Operation.ServerResponse.Header or (if a response was returned at 7828// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7829// to check whether the returned error was because 7830// http.StatusNotModified was returned. 7831func (c *InstancesResetSslConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7832 gensupport.SetOptions(c.urlParams_, opts...) 7833 res, err := c.doRequest("json") 7834 if res != nil && res.StatusCode == http.StatusNotModified { 7835 if res.Body != nil { 7836 res.Body.Close() 7837 } 7838 return nil, &googleapi.Error{ 7839 Code: res.StatusCode, 7840 Header: res.Header, 7841 } 7842 } 7843 if err != nil { 7844 return nil, err 7845 } 7846 defer googleapi.CloseBody(res) 7847 if err := googleapi.CheckResponse(res); err != nil { 7848 return nil, err 7849 } 7850 ret := &Operation{ 7851 ServerResponse: googleapi.ServerResponse{ 7852 Header: res.Header, 7853 HTTPStatusCode: res.StatusCode, 7854 }, 7855 } 7856 target := &ret 7857 if err := gensupport.DecodeResponse(target, res); err != nil { 7858 return nil, err 7859 } 7860 return ret, nil 7861 // { 7862 // "description": "Deletes all client certificates and generates a new server SSL certificate for the instance.", 7863 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig", 7864 // "httpMethod": "POST", 7865 // "id": "sql.instances.resetSslConfig", 7866 // "parameterOrder": [ 7867 // "project", 7868 // "instance" 7869 // ], 7870 // "parameters": { 7871 // "instance": { 7872 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7873 // "location": "path", 7874 // "required": true, 7875 // "type": "string" 7876 // }, 7877 // "project": { 7878 // "description": "Project ID of the project that contains the instance.", 7879 // "location": "path", 7880 // "required": true, 7881 // "type": "string" 7882 // } 7883 // }, 7884 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig", 7885 // "response": { 7886 // "$ref": "Operation" 7887 // }, 7888 // "scopes": [ 7889 // "https://www.googleapis.com/auth/cloud-platform", 7890 // "https://www.googleapis.com/auth/sqlservice.admin" 7891 // ] 7892 // } 7893 7894} 7895 7896// method id "sql.instances.restart": 7897 7898type InstancesRestartCall struct { 7899 s *Service 7900 project string 7901 instance string 7902 urlParams_ gensupport.URLParams 7903 ctx_ context.Context 7904 header_ http.Header 7905} 7906 7907// Restart: Restarts a Cloud SQL instance. 7908// 7909// - instance: Cloud SQL instance ID. This does not include the project 7910// ID. 7911// - project: Project ID of the project that contains the instance to be 7912// restarted. 7913func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall { 7914 c := &InstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7915 c.project = project 7916 c.instance = instance 7917 return c 7918} 7919 7920// Fields allows partial responses to be retrieved. See 7921// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7922// for more information. 7923func (c *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall { 7924 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7925 return c 7926} 7927 7928// Context sets the context to be used in this call's Do method. Any 7929// pending HTTP request will be aborted if the provided context is 7930// canceled. 7931func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall { 7932 c.ctx_ = ctx 7933 return c 7934} 7935 7936// Header returns an http.Header that can be modified by the caller to 7937// add HTTP headers to the request. 7938func (c *InstancesRestartCall) Header() http.Header { 7939 if c.header_ == nil { 7940 c.header_ = make(http.Header) 7941 } 7942 return c.header_ 7943} 7944 7945func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) { 7946 reqHeaders := make(http.Header) 7947 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 7948 for k, v := range c.header_ { 7949 reqHeaders[k] = v 7950 } 7951 reqHeaders.Set("User-Agent", c.s.userAgent()) 7952 var body io.Reader = nil 7953 c.urlParams_.Set("alt", alt) 7954 c.urlParams_.Set("prettyPrint", "false") 7955 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/restart") 7956 urls += "?" + c.urlParams_.Encode() 7957 req, err := http.NewRequest("POST", urls, body) 7958 if err != nil { 7959 return nil, err 7960 } 7961 req.Header = reqHeaders 7962 googleapi.Expand(req.URL, map[string]string{ 7963 "project": c.project, 7964 "instance": c.instance, 7965 }) 7966 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7967} 7968 7969// Do executes the "sql.instances.restart" call. 7970// Exactly one of *Operation or error will be non-nil. Any non-2xx 7971// status code is an error. Response headers are in either 7972// *Operation.ServerResponse.Header or (if a response was returned at 7973// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7974// to check whether the returned error was because 7975// http.StatusNotModified was returned. 7976func (c *InstancesRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7977 gensupport.SetOptions(c.urlParams_, opts...) 7978 res, err := c.doRequest("json") 7979 if res != nil && res.StatusCode == http.StatusNotModified { 7980 if res.Body != nil { 7981 res.Body.Close() 7982 } 7983 return nil, &googleapi.Error{ 7984 Code: res.StatusCode, 7985 Header: res.Header, 7986 } 7987 } 7988 if err != nil { 7989 return nil, err 7990 } 7991 defer googleapi.CloseBody(res) 7992 if err := googleapi.CheckResponse(res); err != nil { 7993 return nil, err 7994 } 7995 ret := &Operation{ 7996 ServerResponse: googleapi.ServerResponse{ 7997 Header: res.Header, 7998 HTTPStatusCode: res.StatusCode, 7999 }, 8000 } 8001 target := &ret 8002 if err := gensupport.DecodeResponse(target, res); err != nil { 8003 return nil, err 8004 } 8005 return ret, nil 8006 // { 8007 // "description": "Restarts a Cloud SQL instance.", 8008 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/restart", 8009 // "httpMethod": "POST", 8010 // "id": "sql.instances.restart", 8011 // "parameterOrder": [ 8012 // "project", 8013 // "instance" 8014 // ], 8015 // "parameters": { 8016 // "instance": { 8017 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8018 // "location": "path", 8019 // "required": true, 8020 // "type": "string" 8021 // }, 8022 // "project": { 8023 // "description": "Project ID of the project that contains the instance to be restarted.", 8024 // "location": "path", 8025 // "required": true, 8026 // "type": "string" 8027 // } 8028 // }, 8029 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/restart", 8030 // "response": { 8031 // "$ref": "Operation" 8032 // }, 8033 // "scopes": [ 8034 // "https://www.googleapis.com/auth/cloud-platform", 8035 // "https://www.googleapis.com/auth/sqlservice.admin" 8036 // ] 8037 // } 8038 8039} 8040 8041// method id "sql.instances.restoreBackup": 8042 8043type InstancesRestoreBackupCall struct { 8044 s *Service 8045 project string 8046 instance string 8047 instancesrestorebackuprequest *InstancesRestoreBackupRequest 8048 urlParams_ gensupport.URLParams 8049 ctx_ context.Context 8050 header_ http.Header 8051} 8052 8053// RestoreBackup: Restores a backup of a Cloud SQL instance. Using this 8054// operation might cause your instance to restart. 8055// 8056// - instance: Cloud SQL instance ID. This does not include the project 8057// ID. 8058// - project: Project ID of the project that contains the instance. 8059func (r *InstancesService) RestoreBackup(project string, instance string, instancesrestorebackuprequest *InstancesRestoreBackupRequest) *InstancesRestoreBackupCall { 8060 c := &InstancesRestoreBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8061 c.project = project 8062 c.instance = instance 8063 c.instancesrestorebackuprequest = instancesrestorebackuprequest 8064 return c 8065} 8066 8067// Fields allows partial responses to be retrieved. See 8068// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8069// for more information. 8070func (c *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall { 8071 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8072 return c 8073} 8074 8075// Context sets the context to be used in this call's Do method. Any 8076// pending HTTP request will be aborted if the provided context is 8077// canceled. 8078func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall { 8079 c.ctx_ = ctx 8080 return c 8081} 8082 8083// Header returns an http.Header that can be modified by the caller to 8084// add HTTP headers to the request. 8085func (c *InstancesRestoreBackupCall) Header() http.Header { 8086 if c.header_ == nil { 8087 c.header_ = make(http.Header) 8088 } 8089 return c.header_ 8090} 8091 8092func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) { 8093 reqHeaders := make(http.Header) 8094 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 8095 for k, v := range c.header_ { 8096 reqHeaders[k] = v 8097 } 8098 reqHeaders.Set("User-Agent", c.s.userAgent()) 8099 var body io.Reader = nil 8100 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrestorebackuprequest) 8101 if err != nil { 8102 return nil, err 8103 } 8104 reqHeaders.Set("Content-Type", "application/json") 8105 c.urlParams_.Set("alt", alt) 8106 c.urlParams_.Set("prettyPrint", "false") 8107 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup") 8108 urls += "?" + c.urlParams_.Encode() 8109 req, err := http.NewRequest("POST", urls, body) 8110 if err != nil { 8111 return nil, err 8112 } 8113 req.Header = reqHeaders 8114 googleapi.Expand(req.URL, map[string]string{ 8115 "project": c.project, 8116 "instance": c.instance, 8117 }) 8118 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8119} 8120 8121// Do executes the "sql.instances.restoreBackup" call. 8122// Exactly one of *Operation or error will be non-nil. Any non-2xx 8123// status code is an error. Response headers are in either 8124// *Operation.ServerResponse.Header or (if a response was returned at 8125// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8126// to check whether the returned error was because 8127// http.StatusNotModified was returned. 8128func (c *InstancesRestoreBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8129 gensupport.SetOptions(c.urlParams_, opts...) 8130 res, err := c.doRequest("json") 8131 if res != nil && res.StatusCode == http.StatusNotModified { 8132 if res.Body != nil { 8133 res.Body.Close() 8134 } 8135 return nil, &googleapi.Error{ 8136 Code: res.StatusCode, 8137 Header: res.Header, 8138 } 8139 } 8140 if err != nil { 8141 return nil, err 8142 } 8143 defer googleapi.CloseBody(res) 8144 if err := googleapi.CheckResponse(res); err != nil { 8145 return nil, err 8146 } 8147 ret := &Operation{ 8148 ServerResponse: googleapi.ServerResponse{ 8149 Header: res.Header, 8150 HTTPStatusCode: res.StatusCode, 8151 }, 8152 } 8153 target := &ret 8154 if err := gensupport.DecodeResponse(target, res); err != nil { 8155 return nil, err 8156 } 8157 return ret, nil 8158 // { 8159 // "description": "Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.", 8160 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup", 8161 // "httpMethod": "POST", 8162 // "id": "sql.instances.restoreBackup", 8163 // "parameterOrder": [ 8164 // "project", 8165 // "instance" 8166 // ], 8167 // "parameters": { 8168 // "instance": { 8169 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8170 // "location": "path", 8171 // "required": true, 8172 // "type": "string" 8173 // }, 8174 // "project": { 8175 // "description": "Project ID of the project that contains the instance.", 8176 // "location": "path", 8177 // "required": true, 8178 // "type": "string" 8179 // } 8180 // }, 8181 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup", 8182 // "request": { 8183 // "$ref": "InstancesRestoreBackupRequest" 8184 // }, 8185 // "response": { 8186 // "$ref": "Operation" 8187 // }, 8188 // "scopes": [ 8189 // "https://www.googleapis.com/auth/cloud-platform", 8190 // "https://www.googleapis.com/auth/sqlservice.admin" 8191 // ] 8192 // } 8193 8194} 8195 8196// method id "sql.instances.rotateServerCa": 8197 8198type InstancesRotateServerCaCall struct { 8199 s *Service 8200 project string 8201 instance string 8202 instancesrotateservercarequest *InstancesRotateServerCaRequest 8203 urlParams_ gensupport.URLParams 8204 ctx_ context.Context 8205 header_ http.Header 8206} 8207 8208// RotateServerCa: Rotates the server certificate to one signed by the 8209// Certificate Authority (CA) version previously added with the 8210// addServerCA method. 8211// 8212// - instance: Cloud SQL instance ID. This does not include the project 8213// ID. 8214// - project: Project ID of the project that contains the instance. 8215func (r *InstancesService) RotateServerCa(project string, instance string, instancesrotateservercarequest *InstancesRotateServerCaRequest) *InstancesRotateServerCaCall { 8216 c := &InstancesRotateServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8217 c.project = project 8218 c.instance = instance 8219 c.instancesrotateservercarequest = instancesrotateservercarequest 8220 return c 8221} 8222 8223// Fields allows partial responses to be retrieved. See 8224// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8225// for more information. 8226func (c *InstancesRotateServerCaCall) Fields(s ...googleapi.Field) *InstancesRotateServerCaCall { 8227 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8228 return c 8229} 8230 8231// Context sets the context to be used in this call's Do method. Any 8232// pending HTTP request will be aborted if the provided context is 8233// canceled. 8234func (c *InstancesRotateServerCaCall) Context(ctx context.Context) *InstancesRotateServerCaCall { 8235 c.ctx_ = ctx 8236 return c 8237} 8238 8239// Header returns an http.Header that can be modified by the caller to 8240// add HTTP headers to the request. 8241func (c *InstancesRotateServerCaCall) Header() http.Header { 8242 if c.header_ == nil { 8243 c.header_ = make(http.Header) 8244 } 8245 return c.header_ 8246} 8247 8248func (c *InstancesRotateServerCaCall) doRequest(alt string) (*http.Response, error) { 8249 reqHeaders := make(http.Header) 8250 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 8251 for k, v := range c.header_ { 8252 reqHeaders[k] = v 8253 } 8254 reqHeaders.Set("User-Agent", c.s.userAgent()) 8255 var body io.Reader = nil 8256 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrotateservercarequest) 8257 if err != nil { 8258 return nil, err 8259 } 8260 reqHeaders.Set("Content-Type", "application/json") 8261 c.urlParams_.Set("alt", alt) 8262 c.urlParams_.Set("prettyPrint", "false") 8263 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa") 8264 urls += "?" + c.urlParams_.Encode() 8265 req, err := http.NewRequest("POST", urls, body) 8266 if err != nil { 8267 return nil, err 8268 } 8269 req.Header = reqHeaders 8270 googleapi.Expand(req.URL, map[string]string{ 8271 "project": c.project, 8272 "instance": c.instance, 8273 }) 8274 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8275} 8276 8277// Do executes the "sql.instances.rotateServerCa" call. 8278// Exactly one of *Operation or error will be non-nil. Any non-2xx 8279// status code is an error. Response headers are in either 8280// *Operation.ServerResponse.Header or (if a response was returned at 8281// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8282// to check whether the returned error was because 8283// http.StatusNotModified was returned. 8284func (c *InstancesRotateServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8285 gensupport.SetOptions(c.urlParams_, opts...) 8286 res, err := c.doRequest("json") 8287 if res != nil && res.StatusCode == http.StatusNotModified { 8288 if res.Body != nil { 8289 res.Body.Close() 8290 } 8291 return nil, &googleapi.Error{ 8292 Code: res.StatusCode, 8293 Header: res.Header, 8294 } 8295 } 8296 if err != nil { 8297 return nil, err 8298 } 8299 defer googleapi.CloseBody(res) 8300 if err := googleapi.CheckResponse(res); err != nil { 8301 return nil, err 8302 } 8303 ret := &Operation{ 8304 ServerResponse: googleapi.ServerResponse{ 8305 Header: res.Header, 8306 HTTPStatusCode: res.StatusCode, 8307 }, 8308 } 8309 target := &ret 8310 if err := gensupport.DecodeResponse(target, res); err != nil { 8311 return nil, err 8312 } 8313 return ret, nil 8314 // { 8315 // "description": "Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.", 8316 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa", 8317 // "httpMethod": "POST", 8318 // "id": "sql.instances.rotateServerCa", 8319 // "parameterOrder": [ 8320 // "project", 8321 // "instance" 8322 // ], 8323 // "parameters": { 8324 // "instance": { 8325 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8326 // "location": "path", 8327 // "required": true, 8328 // "type": "string" 8329 // }, 8330 // "project": { 8331 // "description": "Project ID of the project that contains the instance.", 8332 // "location": "path", 8333 // "required": true, 8334 // "type": "string" 8335 // } 8336 // }, 8337 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa", 8338 // "request": { 8339 // "$ref": "InstancesRotateServerCaRequest" 8340 // }, 8341 // "response": { 8342 // "$ref": "Operation" 8343 // }, 8344 // "scopes": [ 8345 // "https://www.googleapis.com/auth/cloud-platform", 8346 // "https://www.googleapis.com/auth/sqlservice.admin" 8347 // ] 8348 // } 8349 8350} 8351 8352// method id "sql.instances.startReplica": 8353 8354type InstancesStartReplicaCall struct { 8355 s *Service 8356 project string 8357 instance string 8358 urlParams_ gensupport.URLParams 8359 ctx_ context.Context 8360 header_ http.Header 8361} 8362 8363// StartReplica: Starts the replication in the read replica instance. 8364// 8365// - instance: Cloud SQL read replica instance name. 8366// - project: ID of the project that contains the read replica. 8367func (r *InstancesService) StartReplica(project string, instance string) *InstancesStartReplicaCall { 8368 c := &InstancesStartReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8369 c.project = project 8370 c.instance = instance 8371 return c 8372} 8373 8374// Fields allows partial responses to be retrieved. See 8375// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8376// for more information. 8377func (c *InstancesStartReplicaCall) Fields(s ...googleapi.Field) *InstancesStartReplicaCall { 8378 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8379 return c 8380} 8381 8382// Context sets the context to be used in this call's Do method. Any 8383// pending HTTP request will be aborted if the provided context is 8384// canceled. 8385func (c *InstancesStartReplicaCall) Context(ctx context.Context) *InstancesStartReplicaCall { 8386 c.ctx_ = ctx 8387 return c 8388} 8389 8390// Header returns an http.Header that can be modified by the caller to 8391// add HTTP headers to the request. 8392func (c *InstancesStartReplicaCall) Header() http.Header { 8393 if c.header_ == nil { 8394 c.header_ = make(http.Header) 8395 } 8396 return c.header_ 8397} 8398 8399func (c *InstancesStartReplicaCall) doRequest(alt string) (*http.Response, error) { 8400 reqHeaders := make(http.Header) 8401 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 8402 for k, v := range c.header_ { 8403 reqHeaders[k] = v 8404 } 8405 reqHeaders.Set("User-Agent", c.s.userAgent()) 8406 var body io.Reader = nil 8407 c.urlParams_.Set("alt", alt) 8408 c.urlParams_.Set("prettyPrint", "false") 8409 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/startReplica") 8410 urls += "?" + c.urlParams_.Encode() 8411 req, err := http.NewRequest("POST", urls, body) 8412 if err != nil { 8413 return nil, err 8414 } 8415 req.Header = reqHeaders 8416 googleapi.Expand(req.URL, map[string]string{ 8417 "project": c.project, 8418 "instance": c.instance, 8419 }) 8420 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8421} 8422 8423// Do executes the "sql.instances.startReplica" call. 8424// Exactly one of *Operation or error will be non-nil. Any non-2xx 8425// status code is an error. Response headers are in either 8426// *Operation.ServerResponse.Header or (if a response was returned at 8427// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8428// to check whether the returned error was because 8429// http.StatusNotModified was returned. 8430func (c *InstancesStartReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8431 gensupport.SetOptions(c.urlParams_, opts...) 8432 res, err := c.doRequest("json") 8433 if res != nil && res.StatusCode == http.StatusNotModified { 8434 if res.Body != nil { 8435 res.Body.Close() 8436 } 8437 return nil, &googleapi.Error{ 8438 Code: res.StatusCode, 8439 Header: res.Header, 8440 } 8441 } 8442 if err != nil { 8443 return nil, err 8444 } 8445 defer googleapi.CloseBody(res) 8446 if err := googleapi.CheckResponse(res); err != nil { 8447 return nil, err 8448 } 8449 ret := &Operation{ 8450 ServerResponse: googleapi.ServerResponse{ 8451 Header: res.Header, 8452 HTTPStatusCode: res.StatusCode, 8453 }, 8454 } 8455 target := &ret 8456 if err := gensupport.DecodeResponse(target, res); err != nil { 8457 return nil, err 8458 } 8459 return ret, nil 8460 // { 8461 // "description": "Starts the replication in the read replica instance.", 8462 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/startReplica", 8463 // "httpMethod": "POST", 8464 // "id": "sql.instances.startReplica", 8465 // "parameterOrder": [ 8466 // "project", 8467 // "instance" 8468 // ], 8469 // "parameters": { 8470 // "instance": { 8471 // "description": "Cloud SQL read replica instance name.", 8472 // "location": "path", 8473 // "required": true, 8474 // "type": "string" 8475 // }, 8476 // "project": { 8477 // "description": "ID of the project that contains the read replica.", 8478 // "location": "path", 8479 // "required": true, 8480 // "type": "string" 8481 // } 8482 // }, 8483 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/startReplica", 8484 // "response": { 8485 // "$ref": "Operation" 8486 // }, 8487 // "scopes": [ 8488 // "https://www.googleapis.com/auth/cloud-platform", 8489 // "https://www.googleapis.com/auth/sqlservice.admin" 8490 // ] 8491 // } 8492 8493} 8494 8495// method id "sql.instances.stopReplica": 8496 8497type InstancesStopReplicaCall struct { 8498 s *Service 8499 project string 8500 instance string 8501 urlParams_ gensupport.URLParams 8502 ctx_ context.Context 8503 header_ http.Header 8504} 8505 8506// StopReplica: Stops the replication in the read replica instance. 8507// 8508// - instance: Cloud SQL read replica instance name. 8509// - project: ID of the project that contains the read replica. 8510func (r *InstancesService) StopReplica(project string, instance string) *InstancesStopReplicaCall { 8511 c := &InstancesStopReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8512 c.project = project 8513 c.instance = instance 8514 return c 8515} 8516 8517// Fields allows partial responses to be retrieved. See 8518// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8519// for more information. 8520func (c *InstancesStopReplicaCall) Fields(s ...googleapi.Field) *InstancesStopReplicaCall { 8521 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8522 return c 8523} 8524 8525// Context sets the context to be used in this call's Do method. Any 8526// pending HTTP request will be aborted if the provided context is 8527// canceled. 8528func (c *InstancesStopReplicaCall) Context(ctx context.Context) *InstancesStopReplicaCall { 8529 c.ctx_ = ctx 8530 return c 8531} 8532 8533// Header returns an http.Header that can be modified by the caller to 8534// add HTTP headers to the request. 8535func (c *InstancesStopReplicaCall) Header() http.Header { 8536 if c.header_ == nil { 8537 c.header_ = make(http.Header) 8538 } 8539 return c.header_ 8540} 8541 8542func (c *InstancesStopReplicaCall) doRequest(alt string) (*http.Response, error) { 8543 reqHeaders := make(http.Header) 8544 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 8545 for k, v := range c.header_ { 8546 reqHeaders[k] = v 8547 } 8548 reqHeaders.Set("User-Agent", c.s.userAgent()) 8549 var body io.Reader = nil 8550 c.urlParams_.Set("alt", alt) 8551 c.urlParams_.Set("prettyPrint", "false") 8552 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica") 8553 urls += "?" + c.urlParams_.Encode() 8554 req, err := http.NewRequest("POST", urls, body) 8555 if err != nil { 8556 return nil, err 8557 } 8558 req.Header = reqHeaders 8559 googleapi.Expand(req.URL, map[string]string{ 8560 "project": c.project, 8561 "instance": c.instance, 8562 }) 8563 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8564} 8565 8566// Do executes the "sql.instances.stopReplica" call. 8567// Exactly one of *Operation or error will be non-nil. Any non-2xx 8568// status code is an error. Response headers are in either 8569// *Operation.ServerResponse.Header or (if a response was returned at 8570// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8571// to check whether the returned error was because 8572// http.StatusNotModified was returned. 8573func (c *InstancesStopReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8574 gensupport.SetOptions(c.urlParams_, opts...) 8575 res, err := c.doRequest("json") 8576 if res != nil && res.StatusCode == http.StatusNotModified { 8577 if res.Body != nil { 8578 res.Body.Close() 8579 } 8580 return nil, &googleapi.Error{ 8581 Code: res.StatusCode, 8582 Header: res.Header, 8583 } 8584 } 8585 if err != nil { 8586 return nil, err 8587 } 8588 defer googleapi.CloseBody(res) 8589 if err := googleapi.CheckResponse(res); err != nil { 8590 return nil, err 8591 } 8592 ret := &Operation{ 8593 ServerResponse: googleapi.ServerResponse{ 8594 Header: res.Header, 8595 HTTPStatusCode: res.StatusCode, 8596 }, 8597 } 8598 target := &ret 8599 if err := gensupport.DecodeResponse(target, res); err != nil { 8600 return nil, err 8601 } 8602 return ret, nil 8603 // { 8604 // "description": "Stops the replication in the read replica instance.", 8605 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica", 8606 // "httpMethod": "POST", 8607 // "id": "sql.instances.stopReplica", 8608 // "parameterOrder": [ 8609 // "project", 8610 // "instance" 8611 // ], 8612 // "parameters": { 8613 // "instance": { 8614 // "description": "Cloud SQL read replica instance name.", 8615 // "location": "path", 8616 // "required": true, 8617 // "type": "string" 8618 // }, 8619 // "project": { 8620 // "description": "ID of the project that contains the read replica.", 8621 // "location": "path", 8622 // "required": true, 8623 // "type": "string" 8624 // } 8625 // }, 8626 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica", 8627 // "response": { 8628 // "$ref": "Operation" 8629 // }, 8630 // "scopes": [ 8631 // "https://www.googleapis.com/auth/cloud-platform", 8632 // "https://www.googleapis.com/auth/sqlservice.admin" 8633 // ] 8634 // } 8635 8636} 8637 8638// method id "sql.instances.truncateLog": 8639 8640type InstancesTruncateLogCall struct { 8641 s *Service 8642 project string 8643 instance string 8644 instancestruncatelogrequest *InstancesTruncateLogRequest 8645 urlParams_ gensupport.URLParams 8646 ctx_ context.Context 8647 header_ http.Header 8648} 8649 8650// TruncateLog: Truncate MySQL general and slow query log tables MySQL 8651// only. 8652// 8653// - instance: Cloud SQL instance ID. This does not include the project 8654// ID. 8655// - project: Project ID of the Cloud SQL project. 8656func (r *InstancesService) TruncateLog(project string, instance string, instancestruncatelogrequest *InstancesTruncateLogRequest) *InstancesTruncateLogCall { 8657 c := &InstancesTruncateLogCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8658 c.project = project 8659 c.instance = instance 8660 c.instancestruncatelogrequest = instancestruncatelogrequest 8661 return c 8662} 8663 8664// Fields allows partial responses to be retrieved. See 8665// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8666// for more information. 8667func (c *InstancesTruncateLogCall) Fields(s ...googleapi.Field) *InstancesTruncateLogCall { 8668 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8669 return c 8670} 8671 8672// Context sets the context to be used in this call's Do method. Any 8673// pending HTTP request will be aborted if the provided context is 8674// canceled. 8675func (c *InstancesTruncateLogCall) Context(ctx context.Context) *InstancesTruncateLogCall { 8676 c.ctx_ = ctx 8677 return c 8678} 8679 8680// Header returns an http.Header that can be modified by the caller to 8681// add HTTP headers to the request. 8682func (c *InstancesTruncateLogCall) Header() http.Header { 8683 if c.header_ == nil { 8684 c.header_ = make(http.Header) 8685 } 8686 return c.header_ 8687} 8688 8689func (c *InstancesTruncateLogCall) doRequest(alt string) (*http.Response, error) { 8690 reqHeaders := make(http.Header) 8691 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 8692 for k, v := range c.header_ { 8693 reqHeaders[k] = v 8694 } 8695 reqHeaders.Set("User-Agent", c.s.userAgent()) 8696 var body io.Reader = nil 8697 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancestruncatelogrequest) 8698 if err != nil { 8699 return nil, err 8700 } 8701 reqHeaders.Set("Content-Type", "application/json") 8702 c.urlParams_.Set("alt", alt) 8703 c.urlParams_.Set("prettyPrint", "false") 8704 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/truncateLog") 8705 urls += "?" + c.urlParams_.Encode() 8706 req, err := http.NewRequest("POST", urls, body) 8707 if err != nil { 8708 return nil, err 8709 } 8710 req.Header = reqHeaders 8711 googleapi.Expand(req.URL, map[string]string{ 8712 "project": c.project, 8713 "instance": c.instance, 8714 }) 8715 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8716} 8717 8718// Do executes the "sql.instances.truncateLog" call. 8719// Exactly one of *Operation or error will be non-nil. Any non-2xx 8720// status code is an error. Response headers are in either 8721// *Operation.ServerResponse.Header or (if a response was returned at 8722// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8723// to check whether the returned error was because 8724// http.StatusNotModified was returned. 8725func (c *InstancesTruncateLogCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8726 gensupport.SetOptions(c.urlParams_, opts...) 8727 res, err := c.doRequest("json") 8728 if res != nil && res.StatusCode == http.StatusNotModified { 8729 if res.Body != nil { 8730 res.Body.Close() 8731 } 8732 return nil, &googleapi.Error{ 8733 Code: res.StatusCode, 8734 Header: res.Header, 8735 } 8736 } 8737 if err != nil { 8738 return nil, err 8739 } 8740 defer googleapi.CloseBody(res) 8741 if err := googleapi.CheckResponse(res); err != nil { 8742 return nil, err 8743 } 8744 ret := &Operation{ 8745 ServerResponse: googleapi.ServerResponse{ 8746 Header: res.Header, 8747 HTTPStatusCode: res.StatusCode, 8748 }, 8749 } 8750 target := &ret 8751 if err := gensupport.DecodeResponse(target, res); err != nil { 8752 return nil, err 8753 } 8754 return ret, nil 8755 // { 8756 // "description": "Truncate MySQL general and slow query log tables MySQL only.", 8757 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/truncateLog", 8758 // "httpMethod": "POST", 8759 // "id": "sql.instances.truncateLog", 8760 // "parameterOrder": [ 8761 // "project", 8762 // "instance" 8763 // ], 8764 // "parameters": { 8765 // "instance": { 8766 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8767 // "location": "path", 8768 // "required": true, 8769 // "type": "string" 8770 // }, 8771 // "project": { 8772 // "description": "Project ID of the Cloud SQL project.", 8773 // "location": "path", 8774 // "required": true, 8775 // "type": "string" 8776 // } 8777 // }, 8778 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/truncateLog", 8779 // "request": { 8780 // "$ref": "InstancesTruncateLogRequest" 8781 // }, 8782 // "response": { 8783 // "$ref": "Operation" 8784 // }, 8785 // "scopes": [ 8786 // "https://www.googleapis.com/auth/cloud-platform", 8787 // "https://www.googleapis.com/auth/sqlservice.admin" 8788 // ] 8789 // } 8790 8791} 8792 8793// method id "sql.instances.update": 8794 8795type InstancesUpdateCall struct { 8796 s *Service 8797 project string 8798 instance string 8799 databaseinstance *DatabaseInstance 8800 urlParams_ gensupport.URLParams 8801 ctx_ context.Context 8802 header_ http.Header 8803} 8804 8805// Update: Updates settings of a Cloud SQL instance. Using this 8806// operation might cause your instance to restart. 8807// 8808// - instance: Cloud SQL instance ID. This does not include the project 8809// ID. 8810// - project: Project ID of the project that contains the instance. 8811func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall { 8812 c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8813 c.project = project 8814 c.instance = instance 8815 c.databaseinstance = databaseinstance 8816 return c 8817} 8818 8819// Fields allows partial responses to be retrieved. See 8820// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8821// for more information. 8822func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall { 8823 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8824 return c 8825} 8826 8827// Context sets the context to be used in this call's Do method. Any 8828// pending HTTP request will be aborted if the provided context is 8829// canceled. 8830func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall { 8831 c.ctx_ = ctx 8832 return c 8833} 8834 8835// Header returns an http.Header that can be modified by the caller to 8836// add HTTP headers to the request. 8837func (c *InstancesUpdateCall) Header() http.Header { 8838 if c.header_ == nil { 8839 c.header_ = make(http.Header) 8840 } 8841 return c.header_ 8842} 8843 8844func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) { 8845 reqHeaders := make(http.Header) 8846 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 8847 for k, v := range c.header_ { 8848 reqHeaders[k] = v 8849 } 8850 reqHeaders.Set("User-Agent", c.s.userAgent()) 8851 var body io.Reader = nil 8852 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) 8853 if err != nil { 8854 return nil, err 8855 } 8856 reqHeaders.Set("Content-Type", "application/json") 8857 c.urlParams_.Set("alt", alt) 8858 c.urlParams_.Set("prettyPrint", "false") 8859 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 8860 urls += "?" + c.urlParams_.Encode() 8861 req, err := http.NewRequest("PUT", urls, body) 8862 if err != nil { 8863 return nil, err 8864 } 8865 req.Header = reqHeaders 8866 googleapi.Expand(req.URL, map[string]string{ 8867 "project": c.project, 8868 "instance": c.instance, 8869 }) 8870 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8871} 8872 8873// Do executes the "sql.instances.update" call. 8874// Exactly one of *Operation or error will be non-nil. Any non-2xx 8875// status code is an error. Response headers are in either 8876// *Operation.ServerResponse.Header or (if a response was returned at 8877// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8878// to check whether the returned error was because 8879// http.StatusNotModified was returned. 8880func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8881 gensupport.SetOptions(c.urlParams_, opts...) 8882 res, err := c.doRequest("json") 8883 if res != nil && res.StatusCode == http.StatusNotModified { 8884 if res.Body != nil { 8885 res.Body.Close() 8886 } 8887 return nil, &googleapi.Error{ 8888 Code: res.StatusCode, 8889 Header: res.Header, 8890 } 8891 } 8892 if err != nil { 8893 return nil, err 8894 } 8895 defer googleapi.CloseBody(res) 8896 if err := googleapi.CheckResponse(res); err != nil { 8897 return nil, err 8898 } 8899 ret := &Operation{ 8900 ServerResponse: googleapi.ServerResponse{ 8901 Header: res.Header, 8902 HTTPStatusCode: res.StatusCode, 8903 }, 8904 } 8905 target := &ret 8906 if err := gensupport.DecodeResponse(target, res); err != nil { 8907 return nil, err 8908 } 8909 return ret, nil 8910 // { 8911 // "description": "Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.", 8912 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 8913 // "httpMethod": "PUT", 8914 // "id": "sql.instances.update", 8915 // "parameterOrder": [ 8916 // "project", 8917 // "instance" 8918 // ], 8919 // "parameters": { 8920 // "instance": { 8921 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8922 // "location": "path", 8923 // "required": true, 8924 // "type": "string" 8925 // }, 8926 // "project": { 8927 // "description": "Project ID of the project that contains the instance.", 8928 // "location": "path", 8929 // "required": true, 8930 // "type": "string" 8931 // } 8932 // }, 8933 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 8934 // "request": { 8935 // "$ref": "DatabaseInstance" 8936 // }, 8937 // "response": { 8938 // "$ref": "Operation" 8939 // }, 8940 // "scopes": [ 8941 // "https://www.googleapis.com/auth/cloud-platform", 8942 // "https://www.googleapis.com/auth/sqlservice.admin" 8943 // ] 8944 // } 8945 8946} 8947 8948// method id "sql.operations.get": 8949 8950type OperationsGetCall struct { 8951 s *Service 8952 project string 8953 operation string 8954 urlParams_ gensupport.URLParams 8955 ifNoneMatch_ string 8956 ctx_ context.Context 8957 header_ http.Header 8958} 8959 8960// Get: Retrieves an instance operation that has been performed on an 8961// instance. 8962// 8963// - operation: Instance operation ID. 8964// - project: Project ID of the project that contains the instance. 8965func (r *OperationsService) Get(project string, operation string) *OperationsGetCall { 8966 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8967 c.project = project 8968 c.operation = operation 8969 return c 8970} 8971 8972// Fields allows partial responses to be retrieved. See 8973// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8974// for more information. 8975func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 8976 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8977 return c 8978} 8979 8980// IfNoneMatch sets the optional parameter which makes the operation 8981// fail if the object's ETag matches the given value. This is useful for 8982// getting updates only after the object has changed since the last 8983// request. Use googleapi.IsNotModified to check whether the response 8984// error from Do is the result of In-None-Match. 8985func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 8986 c.ifNoneMatch_ = entityTag 8987 return c 8988} 8989 8990// Context sets the context to be used in this call's Do method. Any 8991// pending HTTP request will be aborted if the provided context is 8992// canceled. 8993func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 8994 c.ctx_ = ctx 8995 return c 8996} 8997 8998// Header returns an http.Header that can be modified by the caller to 8999// add HTTP headers to the request. 9000func (c *OperationsGetCall) Header() http.Header { 9001 if c.header_ == nil { 9002 c.header_ = make(http.Header) 9003 } 9004 return c.header_ 9005} 9006 9007func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 9008 reqHeaders := make(http.Header) 9009 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 9010 for k, v := range c.header_ { 9011 reqHeaders[k] = v 9012 } 9013 reqHeaders.Set("User-Agent", c.s.userAgent()) 9014 if c.ifNoneMatch_ != "" { 9015 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9016 } 9017 var body io.Reader = nil 9018 c.urlParams_.Set("alt", alt) 9019 c.urlParams_.Set("prettyPrint", "false") 9020 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/operations/{operation}") 9021 urls += "?" + c.urlParams_.Encode() 9022 req, err := http.NewRequest("GET", urls, body) 9023 if err != nil { 9024 return nil, err 9025 } 9026 req.Header = reqHeaders 9027 googleapi.Expand(req.URL, map[string]string{ 9028 "project": c.project, 9029 "operation": c.operation, 9030 }) 9031 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9032} 9033 9034// Do executes the "sql.operations.get" call. 9035// Exactly one of *Operation or error will be non-nil. Any non-2xx 9036// status code is an error. Response headers are in either 9037// *Operation.ServerResponse.Header or (if a response was returned at 9038// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9039// to check whether the returned error was because 9040// http.StatusNotModified was returned. 9041func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9042 gensupport.SetOptions(c.urlParams_, opts...) 9043 res, err := c.doRequest("json") 9044 if res != nil && res.StatusCode == http.StatusNotModified { 9045 if res.Body != nil { 9046 res.Body.Close() 9047 } 9048 return nil, &googleapi.Error{ 9049 Code: res.StatusCode, 9050 Header: res.Header, 9051 } 9052 } 9053 if err != nil { 9054 return nil, err 9055 } 9056 defer googleapi.CloseBody(res) 9057 if err := googleapi.CheckResponse(res); err != nil { 9058 return nil, err 9059 } 9060 ret := &Operation{ 9061 ServerResponse: googleapi.ServerResponse{ 9062 Header: res.Header, 9063 HTTPStatusCode: res.StatusCode, 9064 }, 9065 } 9066 target := &ret 9067 if err := gensupport.DecodeResponse(target, res); err != nil { 9068 return nil, err 9069 } 9070 return ret, nil 9071 // { 9072 // "description": "Retrieves an instance operation that has been performed on an instance.", 9073 // "flatPath": "sql/v1beta4/projects/{project}/operations/{operation}", 9074 // "httpMethod": "GET", 9075 // "id": "sql.operations.get", 9076 // "parameterOrder": [ 9077 // "project", 9078 // "operation" 9079 // ], 9080 // "parameters": { 9081 // "operation": { 9082 // "description": "Instance operation ID.", 9083 // "location": "path", 9084 // "required": true, 9085 // "type": "string" 9086 // }, 9087 // "project": { 9088 // "description": "Project ID of the project that contains the instance.", 9089 // "location": "path", 9090 // "required": true, 9091 // "type": "string" 9092 // } 9093 // }, 9094 // "path": "sql/v1beta4/projects/{project}/operations/{operation}", 9095 // "response": { 9096 // "$ref": "Operation" 9097 // }, 9098 // "scopes": [ 9099 // "https://www.googleapis.com/auth/cloud-platform", 9100 // "https://www.googleapis.com/auth/sqlservice.admin" 9101 // ] 9102 // } 9103 9104} 9105 9106// method id "sql.operations.list": 9107 9108type OperationsListCall struct { 9109 s *Service 9110 project string 9111 urlParams_ gensupport.URLParams 9112 ifNoneMatch_ string 9113 ctx_ context.Context 9114 header_ http.Header 9115} 9116 9117// List: Lists all instance operations that have been performed on the 9118// given Cloud SQL instance in the reverse chronological order of the 9119// start time. 9120// 9121// - project: Project ID of the project that contains the instance. 9122func (r *OperationsService) List(project string) *OperationsListCall { 9123 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9124 c.project = project 9125 return c 9126} 9127 9128// Instance sets the optional parameter "instance": Cloud SQL instance 9129// ID. This does not include the project ID. 9130func (c *OperationsListCall) Instance(instance string) *OperationsListCall { 9131 c.urlParams_.Set("instance", instance) 9132 return c 9133} 9134 9135// MaxResults sets the optional parameter "maxResults": Maximum number 9136// of operations per response. 9137func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall { 9138 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 9139 return c 9140} 9141 9142// PageToken sets the optional parameter "pageToken": A 9143// previously-returned page token representing part of the larger set of 9144// results to view. 9145func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { 9146 c.urlParams_.Set("pageToken", pageToken) 9147 return c 9148} 9149 9150// Fields allows partial responses to be retrieved. See 9151// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9152// for more information. 9153func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { 9154 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9155 return c 9156} 9157 9158// IfNoneMatch sets the optional parameter which makes the operation 9159// fail if the object's ETag matches the given value. This is useful for 9160// getting updates only after the object has changed since the last 9161// request. Use googleapi.IsNotModified to check whether the response 9162// error from Do is the result of In-None-Match. 9163func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { 9164 c.ifNoneMatch_ = entityTag 9165 return c 9166} 9167 9168// Context sets the context to be used in this call's Do method. Any 9169// pending HTTP request will be aborted if the provided context is 9170// canceled. 9171func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { 9172 c.ctx_ = ctx 9173 return c 9174} 9175 9176// Header returns an http.Header that can be modified by the caller to 9177// add HTTP headers to the request. 9178func (c *OperationsListCall) Header() http.Header { 9179 if c.header_ == nil { 9180 c.header_ = make(http.Header) 9181 } 9182 return c.header_ 9183} 9184 9185func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { 9186 reqHeaders := make(http.Header) 9187 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 9188 for k, v := range c.header_ { 9189 reqHeaders[k] = v 9190 } 9191 reqHeaders.Set("User-Agent", c.s.userAgent()) 9192 if c.ifNoneMatch_ != "" { 9193 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9194 } 9195 var body io.Reader = nil 9196 c.urlParams_.Set("alt", alt) 9197 c.urlParams_.Set("prettyPrint", "false") 9198 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/operations") 9199 urls += "?" + c.urlParams_.Encode() 9200 req, err := http.NewRequest("GET", urls, body) 9201 if err != nil { 9202 return nil, err 9203 } 9204 req.Header = reqHeaders 9205 googleapi.Expand(req.URL, map[string]string{ 9206 "project": c.project, 9207 }) 9208 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9209} 9210 9211// Do executes the "sql.operations.list" call. 9212// Exactly one of *OperationsListResponse or error will be non-nil. Any 9213// non-2xx status code is an error. Response headers are in either 9214// *OperationsListResponse.ServerResponse.Header or (if a response was 9215// returned at all) in error.(*googleapi.Error).Header. Use 9216// googleapi.IsNotModified to check whether the returned error was 9217// because http.StatusNotModified was returned. 9218func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) { 9219 gensupport.SetOptions(c.urlParams_, opts...) 9220 res, err := c.doRequest("json") 9221 if res != nil && res.StatusCode == http.StatusNotModified { 9222 if res.Body != nil { 9223 res.Body.Close() 9224 } 9225 return nil, &googleapi.Error{ 9226 Code: res.StatusCode, 9227 Header: res.Header, 9228 } 9229 } 9230 if err != nil { 9231 return nil, err 9232 } 9233 defer googleapi.CloseBody(res) 9234 if err := googleapi.CheckResponse(res); err != nil { 9235 return nil, err 9236 } 9237 ret := &OperationsListResponse{ 9238 ServerResponse: googleapi.ServerResponse{ 9239 Header: res.Header, 9240 HTTPStatusCode: res.StatusCode, 9241 }, 9242 } 9243 target := &ret 9244 if err := gensupport.DecodeResponse(target, res); err != nil { 9245 return nil, err 9246 } 9247 return ret, nil 9248 // { 9249 // "description": "Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.", 9250 // "flatPath": "sql/v1beta4/projects/{project}/operations", 9251 // "httpMethod": "GET", 9252 // "id": "sql.operations.list", 9253 // "parameterOrder": [ 9254 // "project" 9255 // ], 9256 // "parameters": { 9257 // "instance": { 9258 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9259 // "location": "query", 9260 // "type": "string" 9261 // }, 9262 // "maxResults": { 9263 // "description": "Maximum number of operations per response.", 9264 // "format": "uint32", 9265 // "location": "query", 9266 // "type": "integer" 9267 // }, 9268 // "pageToken": { 9269 // "description": "A previously-returned page token representing part of the larger set of results to view.", 9270 // "location": "query", 9271 // "type": "string" 9272 // }, 9273 // "project": { 9274 // "description": "Project ID of the project that contains the instance.", 9275 // "location": "path", 9276 // "required": true, 9277 // "type": "string" 9278 // } 9279 // }, 9280 // "path": "sql/v1beta4/projects/{project}/operations", 9281 // "response": { 9282 // "$ref": "OperationsListResponse" 9283 // }, 9284 // "scopes": [ 9285 // "https://www.googleapis.com/auth/cloud-platform", 9286 // "https://www.googleapis.com/auth/sqlservice.admin" 9287 // ] 9288 // } 9289 9290} 9291 9292// Pages invokes f for each page of results. 9293// A non-nil error returned from f will halt the iteration. 9294// The provided context supersedes any context provided to the Context method. 9295func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error { 9296 c.ctx_ = ctx 9297 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9298 for { 9299 x, err := c.Do() 9300 if err != nil { 9301 return err 9302 } 9303 if err := f(x); err != nil { 9304 return err 9305 } 9306 if x.NextPageToken == "" { 9307 return nil 9308 } 9309 c.PageToken(x.NextPageToken) 9310 } 9311} 9312 9313// method id "sql.projects.instances.rescheduleMaintenance": 9314 9315type ProjectsInstancesRescheduleMaintenanceCall struct { 9316 s *Service 9317 project string 9318 instance string 9319 sqlinstancesreschedulemaintenancerequestbody *SqlInstancesRescheduleMaintenanceRequestBody 9320 urlParams_ gensupport.URLParams 9321 ctx_ context.Context 9322 header_ http.Header 9323} 9324 9325// RescheduleMaintenance: Reschedules the maintenance on the given 9326// instance. 9327// 9328// - instance: Cloud SQL instance ID. This does not include the project 9329// ID. 9330// - project: ID of the project that contains the instance. 9331func (r *ProjectsInstancesService) RescheduleMaintenance(project string, instance string, sqlinstancesreschedulemaintenancerequestbody *SqlInstancesRescheduleMaintenanceRequestBody) *ProjectsInstancesRescheduleMaintenanceCall { 9332 c := &ProjectsInstancesRescheduleMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9333 c.project = project 9334 c.instance = instance 9335 c.sqlinstancesreschedulemaintenancerequestbody = sqlinstancesreschedulemaintenancerequestbody 9336 return c 9337} 9338 9339// Fields allows partial responses to be retrieved. See 9340// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9341// for more information. 9342func (c *ProjectsInstancesRescheduleMaintenanceCall) Fields(s ...googleapi.Field) *ProjectsInstancesRescheduleMaintenanceCall { 9343 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9344 return c 9345} 9346 9347// Context sets the context to be used in this call's Do method. Any 9348// pending HTTP request will be aborted if the provided context is 9349// canceled. 9350func (c *ProjectsInstancesRescheduleMaintenanceCall) Context(ctx context.Context) *ProjectsInstancesRescheduleMaintenanceCall { 9351 c.ctx_ = ctx 9352 return c 9353} 9354 9355// Header returns an http.Header that can be modified by the caller to 9356// add HTTP headers to the request. 9357func (c *ProjectsInstancesRescheduleMaintenanceCall) Header() http.Header { 9358 if c.header_ == nil { 9359 c.header_ = make(http.Header) 9360 } 9361 return c.header_ 9362} 9363 9364func (c *ProjectsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) { 9365 reqHeaders := make(http.Header) 9366 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 9367 for k, v := range c.header_ { 9368 reqHeaders[k] = v 9369 } 9370 reqHeaders.Set("User-Agent", c.s.userAgent()) 9371 var body io.Reader = nil 9372 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesreschedulemaintenancerequestbody) 9373 if err != nil { 9374 return nil, err 9375 } 9376 reqHeaders.Set("Content-Type", "application/json") 9377 c.urlParams_.Set("alt", alt) 9378 c.urlParams_.Set("prettyPrint", "false") 9379 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance") 9380 urls += "?" + c.urlParams_.Encode() 9381 req, err := http.NewRequest("POST", urls, body) 9382 if err != nil { 9383 return nil, err 9384 } 9385 req.Header = reqHeaders 9386 googleapi.Expand(req.URL, map[string]string{ 9387 "project": c.project, 9388 "instance": c.instance, 9389 }) 9390 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9391} 9392 9393// Do executes the "sql.projects.instances.rescheduleMaintenance" call. 9394// Exactly one of *Operation or error will be non-nil. Any non-2xx 9395// status code is an error. Response headers are in either 9396// *Operation.ServerResponse.Header or (if a response was returned at 9397// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9398// to check whether the returned error was because 9399// http.StatusNotModified was returned. 9400func (c *ProjectsInstancesRescheduleMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9401 gensupport.SetOptions(c.urlParams_, opts...) 9402 res, err := c.doRequest("json") 9403 if res != nil && res.StatusCode == http.StatusNotModified { 9404 if res.Body != nil { 9405 res.Body.Close() 9406 } 9407 return nil, &googleapi.Error{ 9408 Code: res.StatusCode, 9409 Header: res.Header, 9410 } 9411 } 9412 if err != nil { 9413 return nil, err 9414 } 9415 defer googleapi.CloseBody(res) 9416 if err := googleapi.CheckResponse(res); err != nil { 9417 return nil, err 9418 } 9419 ret := &Operation{ 9420 ServerResponse: googleapi.ServerResponse{ 9421 Header: res.Header, 9422 HTTPStatusCode: res.StatusCode, 9423 }, 9424 } 9425 target := &ret 9426 if err := gensupport.DecodeResponse(target, res); err != nil { 9427 return nil, err 9428 } 9429 return ret, nil 9430 // { 9431 // "description": "Reschedules the maintenance on the given instance.", 9432 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance", 9433 // "httpMethod": "POST", 9434 // "id": "sql.projects.instances.rescheduleMaintenance", 9435 // "parameterOrder": [ 9436 // "project", 9437 // "instance" 9438 // ], 9439 // "parameters": { 9440 // "instance": { 9441 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9442 // "location": "path", 9443 // "required": true, 9444 // "type": "string" 9445 // }, 9446 // "project": { 9447 // "description": "ID of the project that contains the instance.", 9448 // "location": "path", 9449 // "required": true, 9450 // "type": "string" 9451 // } 9452 // }, 9453 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance", 9454 // "request": { 9455 // "$ref": "SqlInstancesRescheduleMaintenanceRequestBody" 9456 // }, 9457 // "response": { 9458 // "$ref": "Operation" 9459 // }, 9460 // "scopes": [ 9461 // "https://www.googleapis.com/auth/cloud-platform", 9462 // "https://www.googleapis.com/auth/sqlservice.admin" 9463 // ] 9464 // } 9465 9466} 9467 9468// method id "sql.projects.instances.startExternalSync": 9469 9470type ProjectsInstancesStartExternalSyncCall struct { 9471 s *Service 9472 project string 9473 instance string 9474 urlParams_ gensupport.URLParams 9475 ctx_ context.Context 9476 header_ http.Header 9477} 9478 9479// StartExternalSync: Start External primary instance migration. 9480// 9481// - instance: Cloud SQL instance ID. This does not include the project 9482// ID. 9483// - project: ID of the project that contains the instance. 9484func (r *ProjectsInstancesService) StartExternalSync(project string, instance string) *ProjectsInstancesStartExternalSyncCall { 9485 c := &ProjectsInstancesStartExternalSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9486 c.project = project 9487 c.instance = instance 9488 return c 9489} 9490 9491// SkipVerification sets the optional parameter "skipVerification": 9492// Whether to skip the verification step (VESS). 9493func (c *ProjectsInstancesStartExternalSyncCall) SkipVerification(skipVerification bool) *ProjectsInstancesStartExternalSyncCall { 9494 c.urlParams_.Set("skipVerification", fmt.Sprint(skipVerification)) 9495 return c 9496} 9497 9498// SyncMode sets the optional parameter "syncMode": External sync mode. 9499// 9500// Possible values: 9501// "EXTERNAL_SYNC_MODE_UNSPECIFIED" - Unknown external sync mode, will 9502// be defaulted to ONLINE mode 9503// "ONLINE" - Online external sync will set up replication after 9504// initial data external sync 9505// "OFFLINE" - Offline external sync only dumps and loads a one-time 9506// snapshot of the primary instance's data 9507func (c *ProjectsInstancesStartExternalSyncCall) SyncMode(syncMode string) *ProjectsInstancesStartExternalSyncCall { 9508 c.urlParams_.Set("syncMode", syncMode) 9509 return c 9510} 9511 9512// Fields allows partial responses to be retrieved. See 9513// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9514// for more information. 9515func (c *ProjectsInstancesStartExternalSyncCall) Fields(s ...googleapi.Field) *ProjectsInstancesStartExternalSyncCall { 9516 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9517 return c 9518} 9519 9520// Context sets the context to be used in this call's Do method. Any 9521// pending HTTP request will be aborted if the provided context is 9522// canceled. 9523func (c *ProjectsInstancesStartExternalSyncCall) Context(ctx context.Context) *ProjectsInstancesStartExternalSyncCall { 9524 c.ctx_ = ctx 9525 return c 9526} 9527 9528// Header returns an http.Header that can be modified by the caller to 9529// add HTTP headers to the request. 9530func (c *ProjectsInstancesStartExternalSyncCall) Header() http.Header { 9531 if c.header_ == nil { 9532 c.header_ = make(http.Header) 9533 } 9534 return c.header_ 9535} 9536 9537func (c *ProjectsInstancesStartExternalSyncCall) doRequest(alt string) (*http.Response, error) { 9538 reqHeaders := make(http.Header) 9539 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 9540 for k, v := range c.header_ { 9541 reqHeaders[k] = v 9542 } 9543 reqHeaders.Set("User-Agent", c.s.userAgent()) 9544 var body io.Reader = nil 9545 c.urlParams_.Set("alt", alt) 9546 c.urlParams_.Set("prettyPrint", "false") 9547 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync") 9548 urls += "?" + c.urlParams_.Encode() 9549 req, err := http.NewRequest("POST", urls, body) 9550 if err != nil { 9551 return nil, err 9552 } 9553 req.Header = reqHeaders 9554 googleapi.Expand(req.URL, map[string]string{ 9555 "project": c.project, 9556 "instance": c.instance, 9557 }) 9558 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9559} 9560 9561// Do executes the "sql.projects.instances.startExternalSync" call. 9562// Exactly one of *Operation or error will be non-nil. Any non-2xx 9563// status code is an error. Response headers are in either 9564// *Operation.ServerResponse.Header or (if a response was returned at 9565// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9566// to check whether the returned error was because 9567// http.StatusNotModified was returned. 9568func (c *ProjectsInstancesStartExternalSyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9569 gensupport.SetOptions(c.urlParams_, opts...) 9570 res, err := c.doRequest("json") 9571 if res != nil && res.StatusCode == http.StatusNotModified { 9572 if res.Body != nil { 9573 res.Body.Close() 9574 } 9575 return nil, &googleapi.Error{ 9576 Code: res.StatusCode, 9577 Header: res.Header, 9578 } 9579 } 9580 if err != nil { 9581 return nil, err 9582 } 9583 defer googleapi.CloseBody(res) 9584 if err := googleapi.CheckResponse(res); err != nil { 9585 return nil, err 9586 } 9587 ret := &Operation{ 9588 ServerResponse: googleapi.ServerResponse{ 9589 Header: res.Header, 9590 HTTPStatusCode: res.StatusCode, 9591 }, 9592 } 9593 target := &ret 9594 if err := gensupport.DecodeResponse(target, res); err != nil { 9595 return nil, err 9596 } 9597 return ret, nil 9598 // { 9599 // "description": "Start External primary instance migration.", 9600 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync", 9601 // "httpMethod": "POST", 9602 // "id": "sql.projects.instances.startExternalSync", 9603 // "parameterOrder": [ 9604 // "project", 9605 // "instance" 9606 // ], 9607 // "parameters": { 9608 // "instance": { 9609 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9610 // "location": "path", 9611 // "required": true, 9612 // "type": "string" 9613 // }, 9614 // "project": { 9615 // "description": "ID of the project that contains the instance.", 9616 // "location": "path", 9617 // "required": true, 9618 // "type": "string" 9619 // }, 9620 // "skipVerification": { 9621 // "description": "Whether to skip the verification step (VESS).", 9622 // "location": "query", 9623 // "type": "boolean" 9624 // }, 9625 // "syncMode": { 9626 // "description": "External sync mode.", 9627 // "enum": [ 9628 // "EXTERNAL_SYNC_MODE_UNSPECIFIED", 9629 // "ONLINE", 9630 // "OFFLINE" 9631 // ], 9632 // "enumDescriptions": [ 9633 // "Unknown external sync mode, will be defaulted to ONLINE mode", 9634 // "Online external sync will set up replication after initial data external sync", 9635 // "Offline external sync only dumps and loads a one-time snapshot of the primary instance's data" 9636 // ], 9637 // "location": "query", 9638 // "type": "string" 9639 // } 9640 // }, 9641 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync", 9642 // "response": { 9643 // "$ref": "Operation" 9644 // }, 9645 // "scopes": [ 9646 // "https://www.googleapis.com/auth/cloud-platform", 9647 // "https://www.googleapis.com/auth/sqlservice.admin" 9648 // ] 9649 // } 9650 9651} 9652 9653// method id "sql.projects.instances.verifyExternalSyncSettings": 9654 9655type ProjectsInstancesVerifyExternalSyncSettingsCall struct { 9656 s *Service 9657 project string 9658 instance string 9659 urlParams_ gensupport.URLParams 9660 ctx_ context.Context 9661 header_ http.Header 9662} 9663 9664// VerifyExternalSyncSettings: Verify External primary instance external 9665// sync settings. 9666// 9667// - instance: Cloud SQL instance ID. This does not include the project 9668// ID. 9669// - project: Project ID of the project that contains the instance. 9670func (r *ProjectsInstancesService) VerifyExternalSyncSettings(project string, instance string) *ProjectsInstancesVerifyExternalSyncSettingsCall { 9671 c := &ProjectsInstancesVerifyExternalSyncSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9672 c.project = project 9673 c.instance = instance 9674 return c 9675} 9676 9677// SyncMode sets the optional parameter "syncMode": External sync mode 9678// 9679// Possible values: 9680// "EXTERNAL_SYNC_MODE_UNSPECIFIED" - Unknown external sync mode, will 9681// be defaulted to ONLINE mode 9682// "ONLINE" - Online external sync will set up replication after 9683// initial data external sync 9684// "OFFLINE" - Offline external sync only dumps and loads a one-time 9685// snapshot of the primary instance's data 9686func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) SyncMode(syncMode string) *ProjectsInstancesVerifyExternalSyncSettingsCall { 9687 c.urlParams_.Set("syncMode", syncMode) 9688 return c 9689} 9690 9691// VerifyConnectionOnly sets the optional parameter 9692// "verifyConnectionOnly": Flag to enable verifying connection only 9693func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) VerifyConnectionOnly(verifyConnectionOnly bool) *ProjectsInstancesVerifyExternalSyncSettingsCall { 9694 c.urlParams_.Set("verifyConnectionOnly", fmt.Sprint(verifyConnectionOnly)) 9695 return c 9696} 9697 9698// Fields allows partial responses to be retrieved. See 9699// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9700// for more information. 9701func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Fields(s ...googleapi.Field) *ProjectsInstancesVerifyExternalSyncSettingsCall { 9702 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9703 return c 9704} 9705 9706// Context sets the context to be used in this call's Do method. Any 9707// pending HTTP request will be aborted if the provided context is 9708// canceled. 9709func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Context(ctx context.Context) *ProjectsInstancesVerifyExternalSyncSettingsCall { 9710 c.ctx_ = ctx 9711 return c 9712} 9713 9714// Header returns an http.Header that can be modified by the caller to 9715// add HTTP headers to the request. 9716func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Header() http.Header { 9717 if c.header_ == nil { 9718 c.header_ = make(http.Header) 9719 } 9720 return c.header_ 9721} 9722 9723func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) doRequest(alt string) (*http.Response, error) { 9724 reqHeaders := make(http.Header) 9725 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 9726 for k, v := range c.header_ { 9727 reqHeaders[k] = v 9728 } 9729 reqHeaders.Set("User-Agent", c.s.userAgent()) 9730 var body io.Reader = nil 9731 c.urlParams_.Set("alt", alt) 9732 c.urlParams_.Set("prettyPrint", "false") 9733 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings") 9734 urls += "?" + c.urlParams_.Encode() 9735 req, err := http.NewRequest("POST", urls, body) 9736 if err != nil { 9737 return nil, err 9738 } 9739 req.Header = reqHeaders 9740 googleapi.Expand(req.URL, map[string]string{ 9741 "project": c.project, 9742 "instance": c.instance, 9743 }) 9744 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9745} 9746 9747// Do executes the "sql.projects.instances.verifyExternalSyncSettings" call. 9748// Exactly one of *SqlInstancesVerifyExternalSyncSettingsResponse or 9749// error will be non-nil. Any non-2xx status code is an error. Response 9750// headers are in either 9751// *SqlInstancesVerifyExternalSyncSettingsResponse.ServerResponse.Header 9752// or (if a response was returned at all) in 9753// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9754// whether the returned error was because http.StatusNotModified was 9755// returned. 9756func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Do(opts ...googleapi.CallOption) (*SqlInstancesVerifyExternalSyncSettingsResponse, error) { 9757 gensupport.SetOptions(c.urlParams_, opts...) 9758 res, err := c.doRequest("json") 9759 if res != nil && res.StatusCode == http.StatusNotModified { 9760 if res.Body != nil { 9761 res.Body.Close() 9762 } 9763 return nil, &googleapi.Error{ 9764 Code: res.StatusCode, 9765 Header: res.Header, 9766 } 9767 } 9768 if err != nil { 9769 return nil, err 9770 } 9771 defer googleapi.CloseBody(res) 9772 if err := googleapi.CheckResponse(res); err != nil { 9773 return nil, err 9774 } 9775 ret := &SqlInstancesVerifyExternalSyncSettingsResponse{ 9776 ServerResponse: googleapi.ServerResponse{ 9777 Header: res.Header, 9778 HTTPStatusCode: res.StatusCode, 9779 }, 9780 } 9781 target := &ret 9782 if err := gensupport.DecodeResponse(target, res); err != nil { 9783 return nil, err 9784 } 9785 return ret, nil 9786 // { 9787 // "description": "Verify External primary instance external sync settings.", 9788 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings", 9789 // "httpMethod": "POST", 9790 // "id": "sql.projects.instances.verifyExternalSyncSettings", 9791 // "parameterOrder": [ 9792 // "project", 9793 // "instance" 9794 // ], 9795 // "parameters": { 9796 // "instance": { 9797 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9798 // "location": "path", 9799 // "required": true, 9800 // "type": "string" 9801 // }, 9802 // "project": { 9803 // "description": "Project ID of the project that contains the instance.", 9804 // "location": "path", 9805 // "required": true, 9806 // "type": "string" 9807 // }, 9808 // "syncMode": { 9809 // "description": "External sync mode", 9810 // "enum": [ 9811 // "EXTERNAL_SYNC_MODE_UNSPECIFIED", 9812 // "ONLINE", 9813 // "OFFLINE" 9814 // ], 9815 // "enumDescriptions": [ 9816 // "Unknown external sync mode, will be defaulted to ONLINE mode", 9817 // "Online external sync will set up replication after initial data external sync", 9818 // "Offline external sync only dumps and loads a one-time snapshot of the primary instance's data" 9819 // ], 9820 // "location": "query", 9821 // "type": "string" 9822 // }, 9823 // "verifyConnectionOnly": { 9824 // "description": "Flag to enable verifying connection only", 9825 // "location": "query", 9826 // "type": "boolean" 9827 // } 9828 // }, 9829 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings", 9830 // "response": { 9831 // "$ref": "SqlInstancesVerifyExternalSyncSettingsResponse" 9832 // }, 9833 // "scopes": [ 9834 // "https://www.googleapis.com/auth/cloud-platform", 9835 // "https://www.googleapis.com/auth/sqlservice.admin" 9836 // ] 9837 // } 9838 9839} 9840 9841// method id "sql.sslCerts.createEphemeral": 9842 9843type SslCertsCreateEphemeralCall struct { 9844 s *Service 9845 project string 9846 instance string 9847 sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest 9848 urlParams_ gensupport.URLParams 9849 ctx_ context.Context 9850 header_ http.Header 9851} 9852 9853// CreateEphemeral: Generates a short-lived X509 certificate containing 9854// the provided public key and signed by a private key specific to the 9855// target instance. Users may use the certificate to authenticate as 9856// themselves when connecting to the database. 9857// 9858// - instance: Cloud SQL instance ID. This does not include the project 9859// ID. 9860// - project: Project ID of the Cloud SQL project. 9861func (r *SslCertsService) CreateEphemeral(project string, instance string, sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest) *SslCertsCreateEphemeralCall { 9862 c := &SslCertsCreateEphemeralCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9863 c.project = project 9864 c.instance = instance 9865 c.sslcertscreateephemeralrequest = sslcertscreateephemeralrequest 9866 return c 9867} 9868 9869// Fields allows partial responses to be retrieved. See 9870// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9871// for more information. 9872func (c *SslCertsCreateEphemeralCall) Fields(s ...googleapi.Field) *SslCertsCreateEphemeralCall { 9873 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9874 return c 9875} 9876 9877// Context sets the context to be used in this call's Do method. Any 9878// pending HTTP request will be aborted if the provided context is 9879// canceled. 9880func (c *SslCertsCreateEphemeralCall) Context(ctx context.Context) *SslCertsCreateEphemeralCall { 9881 c.ctx_ = ctx 9882 return c 9883} 9884 9885// Header returns an http.Header that can be modified by the caller to 9886// add HTTP headers to the request. 9887func (c *SslCertsCreateEphemeralCall) Header() http.Header { 9888 if c.header_ == nil { 9889 c.header_ = make(http.Header) 9890 } 9891 return c.header_ 9892} 9893 9894func (c *SslCertsCreateEphemeralCall) doRequest(alt string) (*http.Response, error) { 9895 reqHeaders := make(http.Header) 9896 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 9897 for k, v := range c.header_ { 9898 reqHeaders[k] = v 9899 } 9900 reqHeaders.Set("User-Agent", c.s.userAgent()) 9901 var body io.Reader = nil 9902 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertscreateephemeralrequest) 9903 if err != nil { 9904 return nil, err 9905 } 9906 reqHeaders.Set("Content-Type", "application/json") 9907 c.urlParams_.Set("alt", alt) 9908 c.urlParams_.Set("prettyPrint", "false") 9909 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral") 9910 urls += "?" + c.urlParams_.Encode() 9911 req, err := http.NewRequest("POST", urls, body) 9912 if err != nil { 9913 return nil, err 9914 } 9915 req.Header = reqHeaders 9916 googleapi.Expand(req.URL, map[string]string{ 9917 "project": c.project, 9918 "instance": c.instance, 9919 }) 9920 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9921} 9922 9923// Do executes the "sql.sslCerts.createEphemeral" call. 9924// Exactly one of *SslCert or error will be non-nil. Any non-2xx status 9925// code is an error. Response headers are in either 9926// *SslCert.ServerResponse.Header or (if a response was returned at all) 9927// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9928// check whether the returned error was because http.StatusNotModified 9929// was returned. 9930func (c *SslCertsCreateEphemeralCall) Do(opts ...googleapi.CallOption) (*SslCert, error) { 9931 gensupport.SetOptions(c.urlParams_, opts...) 9932 res, err := c.doRequest("json") 9933 if res != nil && res.StatusCode == http.StatusNotModified { 9934 if res.Body != nil { 9935 res.Body.Close() 9936 } 9937 return nil, &googleapi.Error{ 9938 Code: res.StatusCode, 9939 Header: res.Header, 9940 } 9941 } 9942 if err != nil { 9943 return nil, err 9944 } 9945 defer googleapi.CloseBody(res) 9946 if err := googleapi.CheckResponse(res); err != nil { 9947 return nil, err 9948 } 9949 ret := &SslCert{ 9950 ServerResponse: googleapi.ServerResponse{ 9951 Header: res.Header, 9952 HTTPStatusCode: res.StatusCode, 9953 }, 9954 } 9955 target := &ret 9956 if err := gensupport.DecodeResponse(target, res); err != nil { 9957 return nil, err 9958 } 9959 return ret, nil 9960 // { 9961 // "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.", 9962 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral", 9963 // "httpMethod": "POST", 9964 // "id": "sql.sslCerts.createEphemeral", 9965 // "parameterOrder": [ 9966 // "project", 9967 // "instance" 9968 // ], 9969 // "parameters": { 9970 // "instance": { 9971 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9972 // "location": "path", 9973 // "required": true, 9974 // "type": "string" 9975 // }, 9976 // "project": { 9977 // "description": "Project ID of the Cloud SQL project.", 9978 // "location": "path", 9979 // "required": true, 9980 // "type": "string" 9981 // } 9982 // }, 9983 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral", 9984 // "request": { 9985 // "$ref": "SslCertsCreateEphemeralRequest" 9986 // }, 9987 // "response": { 9988 // "$ref": "SslCert" 9989 // }, 9990 // "scopes": [ 9991 // "https://www.googleapis.com/auth/cloud-platform", 9992 // "https://www.googleapis.com/auth/sqlservice.admin" 9993 // ] 9994 // } 9995 9996} 9997 9998// method id "sql.sslCerts.delete": 9999 10000type SslCertsDeleteCall struct { 10001 s *Service 10002 project string 10003 instance string 10004 sha1Fingerprint string 10005 urlParams_ gensupport.URLParams 10006 ctx_ context.Context 10007 header_ http.Header 10008} 10009 10010// Delete: Deletes the SSL certificate. For First Generation instances, 10011// the certificate remains valid until the instance is restarted. 10012// 10013// - instance: Cloud SQL instance ID. This does not include the project 10014// ID. 10015// - project: Project ID of the project that contains the instance. 10016// - sha1Fingerprint: Sha1 FingerPrint. 10017func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall { 10018 c := &SslCertsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10019 c.project = project 10020 c.instance = instance 10021 c.sha1Fingerprint = sha1Fingerprint 10022 return c 10023} 10024 10025// Fields allows partial responses to be retrieved. See 10026// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10027// for more information. 10028func (c *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall { 10029 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10030 return c 10031} 10032 10033// Context sets the context to be used in this call's Do method. Any 10034// pending HTTP request will be aborted if the provided context is 10035// canceled. 10036func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall { 10037 c.ctx_ = ctx 10038 return c 10039} 10040 10041// Header returns an http.Header that can be modified by the caller to 10042// add HTTP headers to the request. 10043func (c *SslCertsDeleteCall) Header() http.Header { 10044 if c.header_ == nil { 10045 c.header_ = make(http.Header) 10046 } 10047 return c.header_ 10048} 10049 10050func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) { 10051 reqHeaders := make(http.Header) 10052 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 10053 for k, v := range c.header_ { 10054 reqHeaders[k] = v 10055 } 10056 reqHeaders.Set("User-Agent", c.s.userAgent()) 10057 var body io.Reader = nil 10058 c.urlParams_.Set("alt", alt) 10059 c.urlParams_.Set("prettyPrint", "false") 10060 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") 10061 urls += "?" + c.urlParams_.Encode() 10062 req, err := http.NewRequest("DELETE", urls, body) 10063 if err != nil { 10064 return nil, err 10065 } 10066 req.Header = reqHeaders 10067 googleapi.Expand(req.URL, map[string]string{ 10068 "project": c.project, 10069 "instance": c.instance, 10070 "sha1Fingerprint": c.sha1Fingerprint, 10071 }) 10072 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10073} 10074 10075// Do executes the "sql.sslCerts.delete" call. 10076// Exactly one of *Operation or error will be non-nil. Any non-2xx 10077// status code is an error. Response headers are in either 10078// *Operation.ServerResponse.Header or (if a response was returned at 10079// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10080// to check whether the returned error was because 10081// http.StatusNotModified was returned. 10082func (c *SslCertsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10083 gensupport.SetOptions(c.urlParams_, opts...) 10084 res, err := c.doRequest("json") 10085 if res != nil && res.StatusCode == http.StatusNotModified { 10086 if res.Body != nil { 10087 res.Body.Close() 10088 } 10089 return nil, &googleapi.Error{ 10090 Code: res.StatusCode, 10091 Header: res.Header, 10092 } 10093 } 10094 if err != nil { 10095 return nil, err 10096 } 10097 defer googleapi.CloseBody(res) 10098 if err := googleapi.CheckResponse(res); err != nil { 10099 return nil, err 10100 } 10101 ret := &Operation{ 10102 ServerResponse: googleapi.ServerResponse{ 10103 Header: res.Header, 10104 HTTPStatusCode: res.StatusCode, 10105 }, 10106 } 10107 target := &ret 10108 if err := gensupport.DecodeResponse(target, res); err != nil { 10109 return nil, err 10110 } 10111 return ret, nil 10112 // { 10113 // "description": "Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.", 10114 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 10115 // "httpMethod": "DELETE", 10116 // "id": "sql.sslCerts.delete", 10117 // "parameterOrder": [ 10118 // "project", 10119 // "instance", 10120 // "sha1Fingerprint" 10121 // ], 10122 // "parameters": { 10123 // "instance": { 10124 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10125 // "location": "path", 10126 // "required": true, 10127 // "type": "string" 10128 // }, 10129 // "project": { 10130 // "description": "Project ID of the project that contains the instance.", 10131 // "location": "path", 10132 // "required": true, 10133 // "type": "string" 10134 // }, 10135 // "sha1Fingerprint": { 10136 // "description": "Sha1 FingerPrint.", 10137 // "location": "path", 10138 // "required": true, 10139 // "type": "string" 10140 // } 10141 // }, 10142 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 10143 // "response": { 10144 // "$ref": "Operation" 10145 // }, 10146 // "scopes": [ 10147 // "https://www.googleapis.com/auth/cloud-platform", 10148 // "https://www.googleapis.com/auth/sqlservice.admin" 10149 // ] 10150 // } 10151 10152} 10153 10154// method id "sql.sslCerts.get": 10155 10156type SslCertsGetCall struct { 10157 s *Service 10158 project string 10159 instance string 10160 sha1Fingerprint string 10161 urlParams_ gensupport.URLParams 10162 ifNoneMatch_ string 10163 ctx_ context.Context 10164 header_ http.Header 10165} 10166 10167// Get: Retrieves a particular SSL certificate. Does not include the 10168// private key (required for usage). The private key must be saved from 10169// the response to initial creation. 10170// 10171// - instance: Cloud SQL instance ID. This does not include the project 10172// ID. 10173// - project: Project ID of the project that contains the instance. 10174// - sha1Fingerprint: Sha1 FingerPrint. 10175func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall { 10176 c := &SslCertsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10177 c.project = project 10178 c.instance = instance 10179 c.sha1Fingerprint = sha1Fingerprint 10180 return c 10181} 10182 10183// Fields allows partial responses to be retrieved. See 10184// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10185// for more information. 10186func (c *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall { 10187 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10188 return c 10189} 10190 10191// IfNoneMatch sets the optional parameter which makes the operation 10192// fail if the object's ETag matches the given value. This is useful for 10193// getting updates only after the object has changed since the last 10194// request. Use googleapi.IsNotModified to check whether the response 10195// error from Do is the result of In-None-Match. 10196func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall { 10197 c.ifNoneMatch_ = entityTag 10198 return c 10199} 10200 10201// Context sets the context to be used in this call's Do method. Any 10202// pending HTTP request will be aborted if the provided context is 10203// canceled. 10204func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall { 10205 c.ctx_ = ctx 10206 return c 10207} 10208 10209// Header returns an http.Header that can be modified by the caller to 10210// add HTTP headers to the request. 10211func (c *SslCertsGetCall) Header() http.Header { 10212 if c.header_ == nil { 10213 c.header_ = make(http.Header) 10214 } 10215 return c.header_ 10216} 10217 10218func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) { 10219 reqHeaders := make(http.Header) 10220 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 10221 for k, v := range c.header_ { 10222 reqHeaders[k] = v 10223 } 10224 reqHeaders.Set("User-Agent", c.s.userAgent()) 10225 if c.ifNoneMatch_ != "" { 10226 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10227 } 10228 var body io.Reader = nil 10229 c.urlParams_.Set("alt", alt) 10230 c.urlParams_.Set("prettyPrint", "false") 10231 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") 10232 urls += "?" + c.urlParams_.Encode() 10233 req, err := http.NewRequest("GET", urls, body) 10234 if err != nil { 10235 return nil, err 10236 } 10237 req.Header = reqHeaders 10238 googleapi.Expand(req.URL, map[string]string{ 10239 "project": c.project, 10240 "instance": c.instance, 10241 "sha1Fingerprint": c.sha1Fingerprint, 10242 }) 10243 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10244} 10245 10246// Do executes the "sql.sslCerts.get" call. 10247// Exactly one of *SslCert or error will be non-nil. Any non-2xx status 10248// code is an error. Response headers are in either 10249// *SslCert.ServerResponse.Header or (if a response was returned at all) 10250// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10251// check whether the returned error was because http.StatusNotModified 10252// was returned. 10253func (c *SslCertsGetCall) Do(opts ...googleapi.CallOption) (*SslCert, error) { 10254 gensupport.SetOptions(c.urlParams_, opts...) 10255 res, err := c.doRequest("json") 10256 if res != nil && res.StatusCode == http.StatusNotModified { 10257 if res.Body != nil { 10258 res.Body.Close() 10259 } 10260 return nil, &googleapi.Error{ 10261 Code: res.StatusCode, 10262 Header: res.Header, 10263 } 10264 } 10265 if err != nil { 10266 return nil, err 10267 } 10268 defer googleapi.CloseBody(res) 10269 if err := googleapi.CheckResponse(res); err != nil { 10270 return nil, err 10271 } 10272 ret := &SslCert{ 10273 ServerResponse: googleapi.ServerResponse{ 10274 Header: res.Header, 10275 HTTPStatusCode: res.StatusCode, 10276 }, 10277 } 10278 target := &ret 10279 if err := gensupport.DecodeResponse(target, res); err != nil { 10280 return nil, err 10281 } 10282 return ret, nil 10283 // { 10284 // "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.", 10285 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 10286 // "httpMethod": "GET", 10287 // "id": "sql.sslCerts.get", 10288 // "parameterOrder": [ 10289 // "project", 10290 // "instance", 10291 // "sha1Fingerprint" 10292 // ], 10293 // "parameters": { 10294 // "instance": { 10295 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10296 // "location": "path", 10297 // "required": true, 10298 // "type": "string" 10299 // }, 10300 // "project": { 10301 // "description": "Project ID of the project that contains the instance.", 10302 // "location": "path", 10303 // "required": true, 10304 // "type": "string" 10305 // }, 10306 // "sha1Fingerprint": { 10307 // "description": "Sha1 FingerPrint.", 10308 // "location": "path", 10309 // "required": true, 10310 // "type": "string" 10311 // } 10312 // }, 10313 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 10314 // "response": { 10315 // "$ref": "SslCert" 10316 // }, 10317 // "scopes": [ 10318 // "https://www.googleapis.com/auth/cloud-platform", 10319 // "https://www.googleapis.com/auth/sqlservice.admin" 10320 // ] 10321 // } 10322 10323} 10324 10325// method id "sql.sslCerts.insert": 10326 10327type SslCertsInsertCall struct { 10328 s *Service 10329 project string 10330 instance string 10331 sslcertsinsertrequest *SslCertsInsertRequest 10332 urlParams_ gensupport.URLParams 10333 ctx_ context.Context 10334 header_ http.Header 10335} 10336 10337// Insert: Creates an SSL certificate and returns it along with the 10338// private key and server certificate authority. The new certificate 10339// will not be usable until the instance is restarted. 10340// 10341// - instance: Cloud SQL instance ID. This does not include the project 10342// ID. 10343// - project: Project ID of the project that contains the instance. 10344func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall { 10345 c := &SslCertsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10346 c.project = project 10347 c.instance = instance 10348 c.sslcertsinsertrequest = sslcertsinsertrequest 10349 return c 10350} 10351 10352// Fields allows partial responses to be retrieved. See 10353// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10354// for more information. 10355func (c *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall { 10356 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10357 return c 10358} 10359 10360// Context sets the context to be used in this call's Do method. Any 10361// pending HTTP request will be aborted if the provided context is 10362// canceled. 10363func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall { 10364 c.ctx_ = ctx 10365 return c 10366} 10367 10368// Header returns an http.Header that can be modified by the caller to 10369// add HTTP headers to the request. 10370func (c *SslCertsInsertCall) Header() http.Header { 10371 if c.header_ == nil { 10372 c.header_ = make(http.Header) 10373 } 10374 return c.header_ 10375} 10376 10377func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, error) { 10378 reqHeaders := make(http.Header) 10379 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 10380 for k, v := range c.header_ { 10381 reqHeaders[k] = v 10382 } 10383 reqHeaders.Set("User-Agent", c.s.userAgent()) 10384 var body io.Reader = nil 10385 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest) 10386 if err != nil { 10387 return nil, err 10388 } 10389 reqHeaders.Set("Content-Type", "application/json") 10390 c.urlParams_.Set("alt", alt) 10391 c.urlParams_.Set("prettyPrint", "false") 10392 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts") 10393 urls += "?" + c.urlParams_.Encode() 10394 req, err := http.NewRequest("POST", urls, body) 10395 if err != nil { 10396 return nil, err 10397 } 10398 req.Header = reqHeaders 10399 googleapi.Expand(req.URL, map[string]string{ 10400 "project": c.project, 10401 "instance": c.instance, 10402 }) 10403 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10404} 10405 10406// Do executes the "sql.sslCerts.insert" call. 10407// Exactly one of *SslCertsInsertResponse or error will be non-nil. Any 10408// non-2xx status code is an error. Response headers are in either 10409// *SslCertsInsertResponse.ServerResponse.Header or (if a response was 10410// returned at all) in error.(*googleapi.Error).Header. Use 10411// googleapi.IsNotModified to check whether the returned error was 10412// because http.StatusNotModified was returned. 10413func (c *SslCertsInsertCall) Do(opts ...googleapi.CallOption) (*SslCertsInsertResponse, error) { 10414 gensupport.SetOptions(c.urlParams_, opts...) 10415 res, err := c.doRequest("json") 10416 if res != nil && res.StatusCode == http.StatusNotModified { 10417 if res.Body != nil { 10418 res.Body.Close() 10419 } 10420 return nil, &googleapi.Error{ 10421 Code: res.StatusCode, 10422 Header: res.Header, 10423 } 10424 } 10425 if err != nil { 10426 return nil, err 10427 } 10428 defer googleapi.CloseBody(res) 10429 if err := googleapi.CheckResponse(res); err != nil { 10430 return nil, err 10431 } 10432 ret := &SslCertsInsertResponse{ 10433 ServerResponse: googleapi.ServerResponse{ 10434 Header: res.Header, 10435 HTTPStatusCode: res.StatusCode, 10436 }, 10437 } 10438 target := &ret 10439 if err := gensupport.DecodeResponse(target, res); err != nil { 10440 return nil, err 10441 } 10442 return ret, nil 10443 // { 10444 // "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.", 10445 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 10446 // "httpMethod": "POST", 10447 // "id": "sql.sslCerts.insert", 10448 // "parameterOrder": [ 10449 // "project", 10450 // "instance" 10451 // ], 10452 // "parameters": { 10453 // "instance": { 10454 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10455 // "location": "path", 10456 // "required": true, 10457 // "type": "string" 10458 // }, 10459 // "project": { 10460 // "description": "Project ID of the project that contains the instance.", 10461 // "location": "path", 10462 // "required": true, 10463 // "type": "string" 10464 // } 10465 // }, 10466 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 10467 // "request": { 10468 // "$ref": "SslCertsInsertRequest" 10469 // }, 10470 // "response": { 10471 // "$ref": "SslCertsInsertResponse" 10472 // }, 10473 // "scopes": [ 10474 // "https://www.googleapis.com/auth/cloud-platform", 10475 // "https://www.googleapis.com/auth/sqlservice.admin" 10476 // ] 10477 // } 10478 10479} 10480 10481// method id "sql.sslCerts.list": 10482 10483type SslCertsListCall struct { 10484 s *Service 10485 project string 10486 instance string 10487 urlParams_ gensupport.URLParams 10488 ifNoneMatch_ string 10489 ctx_ context.Context 10490 header_ http.Header 10491} 10492 10493// List: Lists all of the current SSL certificates for the instance. 10494// 10495// - instance: Cloud SQL instance ID. This does not include the project 10496// ID. 10497// - project: Project ID of the project that contains the instance. 10498func (r *SslCertsService) List(project string, instance string) *SslCertsListCall { 10499 c := &SslCertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10500 c.project = project 10501 c.instance = instance 10502 return c 10503} 10504 10505// Fields allows partial responses to be retrieved. See 10506// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10507// for more information. 10508func (c *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall { 10509 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10510 return c 10511} 10512 10513// IfNoneMatch sets the optional parameter which makes the operation 10514// fail if the object's ETag matches the given value. This is useful for 10515// getting updates only after the object has changed since the last 10516// request. Use googleapi.IsNotModified to check whether the response 10517// error from Do is the result of In-None-Match. 10518func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall { 10519 c.ifNoneMatch_ = entityTag 10520 return c 10521} 10522 10523// Context sets the context to be used in this call's Do method. Any 10524// pending HTTP request will be aborted if the provided context is 10525// canceled. 10526func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall { 10527 c.ctx_ = ctx 10528 return c 10529} 10530 10531// Header returns an http.Header that can be modified by the caller to 10532// add HTTP headers to the request. 10533func (c *SslCertsListCall) Header() http.Header { 10534 if c.header_ == nil { 10535 c.header_ = make(http.Header) 10536 } 10537 return c.header_ 10538} 10539 10540func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) { 10541 reqHeaders := make(http.Header) 10542 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 10543 for k, v := range c.header_ { 10544 reqHeaders[k] = v 10545 } 10546 reqHeaders.Set("User-Agent", c.s.userAgent()) 10547 if c.ifNoneMatch_ != "" { 10548 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10549 } 10550 var body io.Reader = nil 10551 c.urlParams_.Set("alt", alt) 10552 c.urlParams_.Set("prettyPrint", "false") 10553 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts") 10554 urls += "?" + c.urlParams_.Encode() 10555 req, err := http.NewRequest("GET", urls, body) 10556 if err != nil { 10557 return nil, err 10558 } 10559 req.Header = reqHeaders 10560 googleapi.Expand(req.URL, map[string]string{ 10561 "project": c.project, 10562 "instance": c.instance, 10563 }) 10564 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10565} 10566 10567// Do executes the "sql.sslCerts.list" call. 10568// Exactly one of *SslCertsListResponse or error will be non-nil. Any 10569// non-2xx status code is an error. Response headers are in either 10570// *SslCertsListResponse.ServerResponse.Header or (if a response was 10571// returned at all) in error.(*googleapi.Error).Header. Use 10572// googleapi.IsNotModified to check whether the returned error was 10573// because http.StatusNotModified was returned. 10574func (c *SslCertsListCall) Do(opts ...googleapi.CallOption) (*SslCertsListResponse, error) { 10575 gensupport.SetOptions(c.urlParams_, opts...) 10576 res, err := c.doRequest("json") 10577 if res != nil && res.StatusCode == http.StatusNotModified { 10578 if res.Body != nil { 10579 res.Body.Close() 10580 } 10581 return nil, &googleapi.Error{ 10582 Code: res.StatusCode, 10583 Header: res.Header, 10584 } 10585 } 10586 if err != nil { 10587 return nil, err 10588 } 10589 defer googleapi.CloseBody(res) 10590 if err := googleapi.CheckResponse(res); err != nil { 10591 return nil, err 10592 } 10593 ret := &SslCertsListResponse{ 10594 ServerResponse: googleapi.ServerResponse{ 10595 Header: res.Header, 10596 HTTPStatusCode: res.StatusCode, 10597 }, 10598 } 10599 target := &ret 10600 if err := gensupport.DecodeResponse(target, res); err != nil { 10601 return nil, err 10602 } 10603 return ret, nil 10604 // { 10605 // "description": "Lists all of the current SSL certificates for the instance.", 10606 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 10607 // "httpMethod": "GET", 10608 // "id": "sql.sslCerts.list", 10609 // "parameterOrder": [ 10610 // "project", 10611 // "instance" 10612 // ], 10613 // "parameters": { 10614 // "instance": { 10615 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10616 // "location": "path", 10617 // "required": true, 10618 // "type": "string" 10619 // }, 10620 // "project": { 10621 // "description": "Project ID of the project that contains the instance.", 10622 // "location": "path", 10623 // "required": true, 10624 // "type": "string" 10625 // } 10626 // }, 10627 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 10628 // "response": { 10629 // "$ref": "SslCertsListResponse" 10630 // }, 10631 // "scopes": [ 10632 // "https://www.googleapis.com/auth/cloud-platform", 10633 // "https://www.googleapis.com/auth/sqlservice.admin" 10634 // ] 10635 // } 10636 10637} 10638 10639// method id "sql.tiers.list": 10640 10641type TiersListCall struct { 10642 s *Service 10643 project string 10644 urlParams_ gensupport.URLParams 10645 ifNoneMatch_ string 10646 ctx_ context.Context 10647 header_ http.Header 10648} 10649 10650// List: Lists all available machine types (tiers) for Cloud SQL, for 10651// example, db-custom-1-3840. For related information, see Pricing. 10652// 10653// - project: Project ID of the project for which to list tiers. 10654func (r *TiersService) List(project string) *TiersListCall { 10655 c := &TiersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10656 c.project = project 10657 return c 10658} 10659 10660// Fields allows partial responses to be retrieved. See 10661// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10662// for more information. 10663func (c *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall { 10664 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10665 return c 10666} 10667 10668// IfNoneMatch sets the optional parameter which makes the operation 10669// fail if the object's ETag matches the given value. This is useful for 10670// getting updates only after the object has changed since the last 10671// request. Use googleapi.IsNotModified to check whether the response 10672// error from Do is the result of In-None-Match. 10673func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall { 10674 c.ifNoneMatch_ = entityTag 10675 return c 10676} 10677 10678// Context sets the context to be used in this call's Do method. Any 10679// pending HTTP request will be aborted if the provided context is 10680// canceled. 10681func (c *TiersListCall) Context(ctx context.Context) *TiersListCall { 10682 c.ctx_ = ctx 10683 return c 10684} 10685 10686// Header returns an http.Header that can be modified by the caller to 10687// add HTTP headers to the request. 10688func (c *TiersListCall) Header() http.Header { 10689 if c.header_ == nil { 10690 c.header_ = make(http.Header) 10691 } 10692 return c.header_ 10693} 10694 10695func (c *TiersListCall) doRequest(alt string) (*http.Response, error) { 10696 reqHeaders := make(http.Header) 10697 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 10698 for k, v := range c.header_ { 10699 reqHeaders[k] = v 10700 } 10701 reqHeaders.Set("User-Agent", c.s.userAgent()) 10702 if c.ifNoneMatch_ != "" { 10703 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10704 } 10705 var body io.Reader = nil 10706 c.urlParams_.Set("alt", alt) 10707 c.urlParams_.Set("prettyPrint", "false") 10708 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/tiers") 10709 urls += "?" + c.urlParams_.Encode() 10710 req, err := http.NewRequest("GET", urls, body) 10711 if err != nil { 10712 return nil, err 10713 } 10714 req.Header = reqHeaders 10715 googleapi.Expand(req.URL, map[string]string{ 10716 "project": c.project, 10717 }) 10718 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10719} 10720 10721// Do executes the "sql.tiers.list" call. 10722// Exactly one of *TiersListResponse or error will be non-nil. Any 10723// non-2xx status code is an error. Response headers are in either 10724// *TiersListResponse.ServerResponse.Header or (if a response was 10725// returned at all) in error.(*googleapi.Error).Header. Use 10726// googleapi.IsNotModified to check whether the returned error was 10727// because http.StatusNotModified was returned. 10728func (c *TiersListCall) Do(opts ...googleapi.CallOption) (*TiersListResponse, error) { 10729 gensupport.SetOptions(c.urlParams_, opts...) 10730 res, err := c.doRequest("json") 10731 if res != nil && res.StatusCode == http.StatusNotModified { 10732 if res.Body != nil { 10733 res.Body.Close() 10734 } 10735 return nil, &googleapi.Error{ 10736 Code: res.StatusCode, 10737 Header: res.Header, 10738 } 10739 } 10740 if err != nil { 10741 return nil, err 10742 } 10743 defer googleapi.CloseBody(res) 10744 if err := googleapi.CheckResponse(res); err != nil { 10745 return nil, err 10746 } 10747 ret := &TiersListResponse{ 10748 ServerResponse: googleapi.ServerResponse{ 10749 Header: res.Header, 10750 HTTPStatusCode: res.StatusCode, 10751 }, 10752 } 10753 target := &ret 10754 if err := gensupport.DecodeResponse(target, res); err != nil { 10755 return nil, err 10756 } 10757 return ret, nil 10758 // { 10759 // "description": "Lists all available machine types (tiers) for Cloud SQL, for example, db-custom-1-3840. For related information, see Pricing.", 10760 // "flatPath": "sql/v1beta4/projects/{project}/tiers", 10761 // "httpMethod": "GET", 10762 // "id": "sql.tiers.list", 10763 // "parameterOrder": [ 10764 // "project" 10765 // ], 10766 // "parameters": { 10767 // "project": { 10768 // "description": "Project ID of the project for which to list tiers.", 10769 // "location": "path", 10770 // "required": true, 10771 // "type": "string" 10772 // } 10773 // }, 10774 // "path": "sql/v1beta4/projects/{project}/tiers", 10775 // "response": { 10776 // "$ref": "TiersListResponse" 10777 // }, 10778 // "scopes": [ 10779 // "https://www.googleapis.com/auth/cloud-platform", 10780 // "https://www.googleapis.com/auth/sqlservice.admin" 10781 // ] 10782 // } 10783 10784} 10785 10786// method id "sql.users.delete": 10787 10788type UsersDeleteCall struct { 10789 s *Service 10790 project string 10791 instance string 10792 urlParams_ gensupport.URLParams 10793 ctx_ context.Context 10794 header_ http.Header 10795} 10796 10797// Delete: Deletes a user from a Cloud SQL instance. 10798// 10799// - instance: Database instance ID. This does not include the project 10800// ID. 10801// - project: Project ID of the project that contains the instance. 10802func (r *UsersService) Delete(project string, instance string) *UsersDeleteCall { 10803 c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10804 c.project = project 10805 c.instance = instance 10806 return c 10807} 10808 10809// Host sets the optional parameter "host": Host of the user in the 10810// instance. 10811func (c *UsersDeleteCall) Host(host string) *UsersDeleteCall { 10812 c.urlParams_.Set("host", host) 10813 return c 10814} 10815 10816// Name sets the optional parameter "name": Name of the user in the 10817// instance. 10818func (c *UsersDeleteCall) Name(name string) *UsersDeleteCall { 10819 c.urlParams_.Set("name", name) 10820 return c 10821} 10822 10823// Fields allows partial responses to be retrieved. See 10824// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10825// for more information. 10826func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { 10827 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10828 return c 10829} 10830 10831// Context sets the context to be used in this call's Do method. Any 10832// pending HTTP request will be aborted if the provided context is 10833// canceled. 10834func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { 10835 c.ctx_ = ctx 10836 return c 10837} 10838 10839// Header returns an http.Header that can be modified by the caller to 10840// add HTTP headers to the request. 10841func (c *UsersDeleteCall) Header() http.Header { 10842 if c.header_ == nil { 10843 c.header_ = make(http.Header) 10844 } 10845 return c.header_ 10846} 10847 10848func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { 10849 reqHeaders := make(http.Header) 10850 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 10851 for k, v := range c.header_ { 10852 reqHeaders[k] = v 10853 } 10854 reqHeaders.Set("User-Agent", c.s.userAgent()) 10855 var body io.Reader = nil 10856 c.urlParams_.Set("alt", alt) 10857 c.urlParams_.Set("prettyPrint", "false") 10858 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 10859 urls += "?" + c.urlParams_.Encode() 10860 req, err := http.NewRequest("DELETE", urls, body) 10861 if err != nil { 10862 return nil, err 10863 } 10864 req.Header = reqHeaders 10865 googleapi.Expand(req.URL, map[string]string{ 10866 "project": c.project, 10867 "instance": c.instance, 10868 }) 10869 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10870} 10871 10872// Do executes the "sql.users.delete" call. 10873// Exactly one of *Operation or error will be non-nil. Any non-2xx 10874// status code is an error. Response headers are in either 10875// *Operation.ServerResponse.Header or (if a response was returned at 10876// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10877// to check whether the returned error was because 10878// http.StatusNotModified was returned. 10879func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10880 gensupport.SetOptions(c.urlParams_, opts...) 10881 res, err := c.doRequest("json") 10882 if res != nil && res.StatusCode == http.StatusNotModified { 10883 if res.Body != nil { 10884 res.Body.Close() 10885 } 10886 return nil, &googleapi.Error{ 10887 Code: res.StatusCode, 10888 Header: res.Header, 10889 } 10890 } 10891 if err != nil { 10892 return nil, err 10893 } 10894 defer googleapi.CloseBody(res) 10895 if err := googleapi.CheckResponse(res); err != nil { 10896 return nil, err 10897 } 10898 ret := &Operation{ 10899 ServerResponse: googleapi.ServerResponse{ 10900 Header: res.Header, 10901 HTTPStatusCode: res.StatusCode, 10902 }, 10903 } 10904 target := &ret 10905 if err := gensupport.DecodeResponse(target, res); err != nil { 10906 return nil, err 10907 } 10908 return ret, nil 10909 // { 10910 // "description": "Deletes a user from a Cloud SQL instance.", 10911 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 10912 // "httpMethod": "DELETE", 10913 // "id": "sql.users.delete", 10914 // "parameterOrder": [ 10915 // "project", 10916 // "instance" 10917 // ], 10918 // "parameters": { 10919 // "host": { 10920 // "description": "Host of the user in the instance.", 10921 // "location": "query", 10922 // "type": "string" 10923 // }, 10924 // "instance": { 10925 // "description": "Database instance ID. This does not include the project ID.", 10926 // "location": "path", 10927 // "required": true, 10928 // "type": "string" 10929 // }, 10930 // "name": { 10931 // "description": "Name of the user in the instance.", 10932 // "location": "query", 10933 // "type": "string" 10934 // }, 10935 // "project": { 10936 // "description": "Project ID of the project that contains the instance.", 10937 // "location": "path", 10938 // "required": true, 10939 // "type": "string" 10940 // } 10941 // }, 10942 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 10943 // "response": { 10944 // "$ref": "Operation" 10945 // }, 10946 // "scopes": [ 10947 // "https://www.googleapis.com/auth/cloud-platform", 10948 // "https://www.googleapis.com/auth/sqlservice.admin" 10949 // ] 10950 // } 10951 10952} 10953 10954// method id "sql.users.insert": 10955 10956type UsersInsertCall struct { 10957 s *Service 10958 project string 10959 instance string 10960 user *User 10961 urlParams_ gensupport.URLParams 10962 ctx_ context.Context 10963 header_ http.Header 10964} 10965 10966// Insert: Creates a new user in a Cloud SQL instance. 10967// 10968// - instance: Database instance ID. This does not include the project 10969// ID. 10970// - project: Project ID of the project that contains the instance. 10971func (r *UsersService) Insert(project string, instance string, user *User) *UsersInsertCall { 10972 c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10973 c.project = project 10974 c.instance = instance 10975 c.user = user 10976 return c 10977} 10978 10979// Fields allows partial responses to be retrieved. See 10980// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10981// for more information. 10982func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { 10983 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10984 return c 10985} 10986 10987// Context sets the context to be used in this call's Do method. Any 10988// pending HTTP request will be aborted if the provided context is 10989// canceled. 10990func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { 10991 c.ctx_ = ctx 10992 return c 10993} 10994 10995// Header returns an http.Header that can be modified by the caller to 10996// add HTTP headers to the request. 10997func (c *UsersInsertCall) Header() http.Header { 10998 if c.header_ == nil { 10999 c.header_ = make(http.Header) 11000 } 11001 return c.header_ 11002} 11003 11004func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) { 11005 reqHeaders := make(http.Header) 11006 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 11007 for k, v := range c.header_ { 11008 reqHeaders[k] = v 11009 } 11010 reqHeaders.Set("User-Agent", c.s.userAgent()) 11011 var body io.Reader = nil 11012 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 11013 if err != nil { 11014 return nil, err 11015 } 11016 reqHeaders.Set("Content-Type", "application/json") 11017 c.urlParams_.Set("alt", alt) 11018 c.urlParams_.Set("prettyPrint", "false") 11019 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 11020 urls += "?" + c.urlParams_.Encode() 11021 req, err := http.NewRequest("POST", urls, body) 11022 if err != nil { 11023 return nil, err 11024 } 11025 req.Header = reqHeaders 11026 googleapi.Expand(req.URL, map[string]string{ 11027 "project": c.project, 11028 "instance": c.instance, 11029 }) 11030 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11031} 11032 11033// Do executes the "sql.users.insert" call. 11034// Exactly one of *Operation or error will be non-nil. Any non-2xx 11035// status code is an error. Response headers are in either 11036// *Operation.ServerResponse.Header or (if a response was returned at 11037// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11038// to check whether the returned error was because 11039// http.StatusNotModified was returned. 11040func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 11041 gensupport.SetOptions(c.urlParams_, opts...) 11042 res, err := c.doRequest("json") 11043 if res != nil && res.StatusCode == http.StatusNotModified { 11044 if res.Body != nil { 11045 res.Body.Close() 11046 } 11047 return nil, &googleapi.Error{ 11048 Code: res.StatusCode, 11049 Header: res.Header, 11050 } 11051 } 11052 if err != nil { 11053 return nil, err 11054 } 11055 defer googleapi.CloseBody(res) 11056 if err := googleapi.CheckResponse(res); err != nil { 11057 return nil, err 11058 } 11059 ret := &Operation{ 11060 ServerResponse: googleapi.ServerResponse{ 11061 Header: res.Header, 11062 HTTPStatusCode: res.StatusCode, 11063 }, 11064 } 11065 target := &ret 11066 if err := gensupport.DecodeResponse(target, res); err != nil { 11067 return nil, err 11068 } 11069 return ret, nil 11070 // { 11071 // "description": "Creates a new user in a Cloud SQL instance.", 11072 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11073 // "httpMethod": "POST", 11074 // "id": "sql.users.insert", 11075 // "parameterOrder": [ 11076 // "project", 11077 // "instance" 11078 // ], 11079 // "parameters": { 11080 // "instance": { 11081 // "description": "Database instance ID. This does not include the project ID.", 11082 // "location": "path", 11083 // "required": true, 11084 // "type": "string" 11085 // }, 11086 // "project": { 11087 // "description": "Project ID of the project that contains the instance.", 11088 // "location": "path", 11089 // "required": true, 11090 // "type": "string" 11091 // } 11092 // }, 11093 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11094 // "request": { 11095 // "$ref": "User" 11096 // }, 11097 // "response": { 11098 // "$ref": "Operation" 11099 // }, 11100 // "scopes": [ 11101 // "https://www.googleapis.com/auth/cloud-platform", 11102 // "https://www.googleapis.com/auth/sqlservice.admin" 11103 // ] 11104 // } 11105 11106} 11107 11108// method id "sql.users.list": 11109 11110type UsersListCall struct { 11111 s *Service 11112 project string 11113 instance string 11114 urlParams_ gensupport.URLParams 11115 ifNoneMatch_ string 11116 ctx_ context.Context 11117 header_ http.Header 11118} 11119 11120// List: Lists users in the specified Cloud SQL instance. 11121// 11122// - instance: Database instance ID. This does not include the project 11123// ID. 11124// - project: Project ID of the project that contains the instance. 11125func (r *UsersService) List(project string, instance string) *UsersListCall { 11126 c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11127 c.project = project 11128 c.instance = instance 11129 return c 11130} 11131 11132// Fields allows partial responses to be retrieved. See 11133// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11134// for more information. 11135func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { 11136 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11137 return c 11138} 11139 11140// IfNoneMatch sets the optional parameter which makes the operation 11141// fail if the object's ETag matches the given value. This is useful for 11142// getting updates only after the object has changed since the last 11143// request. Use googleapi.IsNotModified to check whether the response 11144// error from Do is the result of In-None-Match. 11145func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { 11146 c.ifNoneMatch_ = entityTag 11147 return c 11148} 11149 11150// Context sets the context to be used in this call's Do method. Any 11151// pending HTTP request will be aborted if the provided context is 11152// canceled. 11153func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { 11154 c.ctx_ = ctx 11155 return c 11156} 11157 11158// Header returns an http.Header that can be modified by the caller to 11159// add HTTP headers to the request. 11160func (c *UsersListCall) Header() http.Header { 11161 if c.header_ == nil { 11162 c.header_ = make(http.Header) 11163 } 11164 return c.header_ 11165} 11166 11167func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { 11168 reqHeaders := make(http.Header) 11169 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 11170 for k, v := range c.header_ { 11171 reqHeaders[k] = v 11172 } 11173 reqHeaders.Set("User-Agent", c.s.userAgent()) 11174 if c.ifNoneMatch_ != "" { 11175 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11176 } 11177 var body io.Reader = nil 11178 c.urlParams_.Set("alt", alt) 11179 c.urlParams_.Set("prettyPrint", "false") 11180 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 11181 urls += "?" + c.urlParams_.Encode() 11182 req, err := http.NewRequest("GET", urls, body) 11183 if err != nil { 11184 return nil, err 11185 } 11186 req.Header = reqHeaders 11187 googleapi.Expand(req.URL, map[string]string{ 11188 "project": c.project, 11189 "instance": c.instance, 11190 }) 11191 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11192} 11193 11194// Do executes the "sql.users.list" call. 11195// Exactly one of *UsersListResponse or error will be non-nil. Any 11196// non-2xx status code is an error. Response headers are in either 11197// *UsersListResponse.ServerResponse.Header or (if a response was 11198// returned at all) in error.(*googleapi.Error).Header. Use 11199// googleapi.IsNotModified to check whether the returned error was 11200// because http.StatusNotModified was returned. 11201func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) { 11202 gensupport.SetOptions(c.urlParams_, opts...) 11203 res, err := c.doRequest("json") 11204 if res != nil && res.StatusCode == http.StatusNotModified { 11205 if res.Body != nil { 11206 res.Body.Close() 11207 } 11208 return nil, &googleapi.Error{ 11209 Code: res.StatusCode, 11210 Header: res.Header, 11211 } 11212 } 11213 if err != nil { 11214 return nil, err 11215 } 11216 defer googleapi.CloseBody(res) 11217 if err := googleapi.CheckResponse(res); err != nil { 11218 return nil, err 11219 } 11220 ret := &UsersListResponse{ 11221 ServerResponse: googleapi.ServerResponse{ 11222 Header: res.Header, 11223 HTTPStatusCode: res.StatusCode, 11224 }, 11225 } 11226 target := &ret 11227 if err := gensupport.DecodeResponse(target, res); err != nil { 11228 return nil, err 11229 } 11230 return ret, nil 11231 // { 11232 // "description": "Lists users in the specified Cloud SQL instance.", 11233 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11234 // "httpMethod": "GET", 11235 // "id": "sql.users.list", 11236 // "parameterOrder": [ 11237 // "project", 11238 // "instance" 11239 // ], 11240 // "parameters": { 11241 // "instance": { 11242 // "description": "Database instance ID. This does not include the project ID.", 11243 // "location": "path", 11244 // "required": true, 11245 // "type": "string" 11246 // }, 11247 // "project": { 11248 // "description": "Project ID of the project that contains the instance.", 11249 // "location": "path", 11250 // "required": true, 11251 // "type": "string" 11252 // } 11253 // }, 11254 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11255 // "response": { 11256 // "$ref": "UsersListResponse" 11257 // }, 11258 // "scopes": [ 11259 // "https://www.googleapis.com/auth/cloud-platform", 11260 // "https://www.googleapis.com/auth/sqlservice.admin" 11261 // ] 11262 // } 11263 11264} 11265 11266// method id "sql.users.update": 11267 11268type UsersUpdateCall struct { 11269 s *Service 11270 project string 11271 instance string 11272 user *User 11273 urlParams_ gensupport.URLParams 11274 ctx_ context.Context 11275 header_ http.Header 11276} 11277 11278// Update: Updates an existing user in a Cloud SQL instance. 11279// 11280// - instance: Database instance ID. This does not include the project 11281// ID. 11282// - project: Project ID of the project that contains the instance. 11283func (r *UsersService) Update(project string, instance string, user *User) *UsersUpdateCall { 11284 c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11285 c.project = project 11286 c.instance = instance 11287 c.user = user 11288 return c 11289} 11290 11291// Host sets the optional parameter "host": Host of the user in the 11292// instance. 11293func (c *UsersUpdateCall) Host(host string) *UsersUpdateCall { 11294 c.urlParams_.Set("host", host) 11295 return c 11296} 11297 11298// Name sets the optional parameter "name": Name of the user in the 11299// instance. 11300func (c *UsersUpdateCall) Name(name string) *UsersUpdateCall { 11301 c.urlParams_.Set("name", name) 11302 return c 11303} 11304 11305// Fields allows partial responses to be retrieved. See 11306// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11307// for more information. 11308func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall { 11309 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11310 return c 11311} 11312 11313// Context sets the context to be used in this call's Do method. Any 11314// pending HTTP request will be aborted if the provided context is 11315// canceled. 11316func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall { 11317 c.ctx_ = ctx 11318 return c 11319} 11320 11321// Header returns an http.Header that can be modified by the caller to 11322// add HTTP headers to the request. 11323func (c *UsersUpdateCall) Header() http.Header { 11324 if c.header_ == nil { 11325 c.header_ = make(http.Header) 11326 } 11327 return c.header_ 11328} 11329 11330func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) { 11331 reqHeaders := make(http.Header) 11332 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210628") 11333 for k, v := range c.header_ { 11334 reqHeaders[k] = v 11335 } 11336 reqHeaders.Set("User-Agent", c.s.userAgent()) 11337 var body io.Reader = nil 11338 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 11339 if err != nil { 11340 return nil, err 11341 } 11342 reqHeaders.Set("Content-Type", "application/json") 11343 c.urlParams_.Set("alt", alt) 11344 c.urlParams_.Set("prettyPrint", "false") 11345 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 11346 urls += "?" + c.urlParams_.Encode() 11347 req, err := http.NewRequest("PUT", urls, body) 11348 if err != nil { 11349 return nil, err 11350 } 11351 req.Header = reqHeaders 11352 googleapi.Expand(req.URL, map[string]string{ 11353 "project": c.project, 11354 "instance": c.instance, 11355 }) 11356 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11357} 11358 11359// Do executes the "sql.users.update" call. 11360// Exactly one of *Operation or error will be non-nil. Any non-2xx 11361// status code is an error. Response headers are in either 11362// *Operation.ServerResponse.Header or (if a response was returned at 11363// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11364// to check whether the returned error was because 11365// http.StatusNotModified was returned. 11366func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 11367 gensupport.SetOptions(c.urlParams_, opts...) 11368 res, err := c.doRequest("json") 11369 if res != nil && res.StatusCode == http.StatusNotModified { 11370 if res.Body != nil { 11371 res.Body.Close() 11372 } 11373 return nil, &googleapi.Error{ 11374 Code: res.StatusCode, 11375 Header: res.Header, 11376 } 11377 } 11378 if err != nil { 11379 return nil, err 11380 } 11381 defer googleapi.CloseBody(res) 11382 if err := googleapi.CheckResponse(res); err != nil { 11383 return nil, err 11384 } 11385 ret := &Operation{ 11386 ServerResponse: googleapi.ServerResponse{ 11387 Header: res.Header, 11388 HTTPStatusCode: res.StatusCode, 11389 }, 11390 } 11391 target := &ret 11392 if err := gensupport.DecodeResponse(target, res); err != nil { 11393 return nil, err 11394 } 11395 return ret, nil 11396 // { 11397 // "description": "Updates an existing user in a Cloud SQL instance.", 11398 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11399 // "httpMethod": "PUT", 11400 // "id": "sql.users.update", 11401 // "parameterOrder": [ 11402 // "project", 11403 // "instance" 11404 // ], 11405 // "parameters": { 11406 // "host": { 11407 // "description": "Optional. Host of the user in the instance.", 11408 // "location": "query", 11409 // "type": "string" 11410 // }, 11411 // "instance": { 11412 // "description": "Database instance ID. This does not include the project ID.", 11413 // "location": "path", 11414 // "required": true, 11415 // "type": "string" 11416 // }, 11417 // "name": { 11418 // "description": "Name of the user in the instance.", 11419 // "location": "query", 11420 // "type": "string" 11421 // }, 11422 // "project": { 11423 // "description": "Project ID of the project that contains the instance.", 11424 // "location": "path", 11425 // "required": true, 11426 // "type": "string" 11427 // } 11428 // }, 11429 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11430 // "request": { 11431 // "$ref": "User" 11432 // }, 11433 // "response": { 11434 // "$ref": "Operation" 11435 // }, 11436 // "scopes": [ 11437 // "https://www.googleapis.com/auth/cloud-platform", 11438 // "https://www.googleapis.com/auth/sqlservice.admin" 11439 // ] 11440 // } 11441 11442} 11443