1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package sqladmin provides access to the Cloud SQL Admin API. 8// 9// For product documentation, see: https://developers.google.com/cloud-sql/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/sqladmin/v1beta4" 16// ... 17// ctx := context.Background() 18// sqladminService, err := sqladmin.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 27// 28// sqladminService, err := sqladmin.NewService(ctx, option.WithScopes(sqladmin.SqlserviceAdminScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// sqladminService, err := sqladmin.NewService(ctx, option.WithAPIKey("AIza...")) 33// 34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 35// 36// config := &oauth2.Config{...} 37// // ... 38// token, err := config.Exchange(ctx, ...) 39// sqladminService, err := sqladmin.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package sqladmin // import "google.golang.org/api/sqladmin/v1beta4" 43 44import ( 45 "bytes" 46 "context" 47 "encoding/json" 48 "errors" 49 "fmt" 50 "io" 51 "net/http" 52 "net/url" 53 "strconv" 54 "strings" 55 56 googleapi "google.golang.org/api/googleapi" 57 gensupport "google.golang.org/api/internal/gensupport" 58 option "google.golang.org/api/option" 59 internaloption "google.golang.org/api/option/internaloption" 60 htransport "google.golang.org/api/transport/http" 61) 62 63// Always reference these packages, just in case the auto-generated code 64// below doesn't. 65var _ = bytes.NewBuffer 66var _ = strconv.Itoa 67var _ = fmt.Sprintf 68var _ = json.NewDecoder 69var _ = io.Copy 70var _ = url.Parse 71var _ = gensupport.MarshalJSON 72var _ = googleapi.Version 73var _ = errors.New 74var _ = strings.Replace 75var _ = context.Canceled 76var _ = internaloption.WithDefaultEndpoint 77 78const apiId = "sqladmin:v1beta4" 79const apiName = "sqladmin" 80const apiVersion = "v1beta4" 81const basePath = "https://sqladmin.googleapis.com/" 82const mtlsBasePath = "https://sqladmin.mtls.googleapis.com/" 83 84// OAuth2 scopes used by this API. 85const ( 86 // See, edit, configure, and delete your Google Cloud data and see the 87 // email address for your Google Account. 88 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 89 90 // Manage your Google SQL Service instances 91 SqlserviceAdminScope = "https://www.googleapis.com/auth/sqlservice.admin" 92) 93 94// NewService creates a new Service. 95func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 96 scopesOption := option.WithScopes( 97 "https://www.googleapis.com/auth/cloud-platform", 98 "https://www.googleapis.com/auth/sqlservice.admin", 99 ) 100 // NOTE: prepend, so we don't override user-specified scopes. 101 opts = append([]option.ClientOption{scopesOption}, opts...) 102 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 103 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 104 client, endpoint, err := htransport.NewClient(ctx, opts...) 105 if err != nil { 106 return nil, err 107 } 108 s, err := New(client) 109 if err != nil { 110 return nil, err 111 } 112 if endpoint != "" { 113 s.BasePath = endpoint 114 } 115 return s, nil 116} 117 118// New creates a new Service. It uses the provided http.Client for requests. 119// 120// Deprecated: please use NewService instead. 121// To provide a custom HTTP client, use option.WithHTTPClient. 122// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 123func New(client *http.Client) (*Service, error) { 124 if client == nil { 125 return nil, errors.New("client is nil") 126 } 127 s := &Service{client: client, BasePath: basePath} 128 s.BackupRuns = NewBackupRunsService(s) 129 s.Connect = NewConnectService(s) 130 s.Databases = NewDatabasesService(s) 131 s.Flags = NewFlagsService(s) 132 s.Instances = NewInstancesService(s) 133 s.Operations = NewOperationsService(s) 134 s.Projects = NewProjectsService(s) 135 s.SslCerts = NewSslCertsService(s) 136 s.Tiers = NewTiersService(s) 137 s.Users = NewUsersService(s) 138 return s, nil 139} 140 141type Service struct { 142 client *http.Client 143 BasePath string // API endpoint base URL 144 UserAgent string // optional additional User-Agent fragment 145 146 BackupRuns *BackupRunsService 147 148 Connect *ConnectService 149 150 Databases *DatabasesService 151 152 Flags *FlagsService 153 154 Instances *InstancesService 155 156 Operations *OperationsService 157 158 Projects *ProjectsService 159 160 SslCerts *SslCertsService 161 162 Tiers *TiersService 163 164 Users *UsersService 165} 166 167func (s *Service) userAgent() string { 168 if s.UserAgent == "" { 169 return googleapi.UserAgent 170 } 171 return googleapi.UserAgent + " " + s.UserAgent 172} 173 174func NewBackupRunsService(s *Service) *BackupRunsService { 175 rs := &BackupRunsService{s: s} 176 return rs 177} 178 179type BackupRunsService struct { 180 s *Service 181} 182 183func NewConnectService(s *Service) *ConnectService { 184 rs := &ConnectService{s: s} 185 return rs 186} 187 188type ConnectService struct { 189 s *Service 190} 191 192func NewDatabasesService(s *Service) *DatabasesService { 193 rs := &DatabasesService{s: s} 194 return rs 195} 196 197type DatabasesService struct { 198 s *Service 199} 200 201func NewFlagsService(s *Service) *FlagsService { 202 rs := &FlagsService{s: s} 203 return rs 204} 205 206type FlagsService struct { 207 s *Service 208} 209 210func NewInstancesService(s *Service) *InstancesService { 211 rs := &InstancesService{s: s} 212 return rs 213} 214 215type InstancesService struct { 216 s *Service 217} 218 219func NewOperationsService(s *Service) *OperationsService { 220 rs := &OperationsService{s: s} 221 return rs 222} 223 224type OperationsService struct { 225 s *Service 226} 227 228func NewProjectsService(s *Service) *ProjectsService { 229 rs := &ProjectsService{s: s} 230 rs.Instances = NewProjectsInstancesService(s) 231 return rs 232} 233 234type ProjectsService struct { 235 s *Service 236 237 Instances *ProjectsInstancesService 238} 239 240func NewProjectsInstancesService(s *Service) *ProjectsInstancesService { 241 rs := &ProjectsInstancesService{s: s} 242 return rs 243} 244 245type ProjectsInstancesService struct { 246 s *Service 247} 248 249func NewSslCertsService(s *Service) *SslCertsService { 250 rs := &SslCertsService{s: s} 251 return rs 252} 253 254type SslCertsService struct { 255 s *Service 256} 257 258func NewTiersService(s *Service) *TiersService { 259 rs := &TiersService{s: s} 260 return rs 261} 262 263type TiersService struct { 264 s *Service 265} 266 267func NewUsersService(s *Service) *UsersService { 268 rs := &UsersService{s: s} 269 return rs 270} 271 272type UsersService struct { 273 s *Service 274} 275 276// AclEntry: An entry for an Access Control list. 277type AclEntry struct { 278 // ExpirationTime: The time when this access control entry expires in 279 // RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example 280 // **2012-11-15T16:19:00.094Z**. 281 ExpirationTime string `json:"expirationTime,omitempty"` 282 283 // Kind: This is always **sql#aclEntry**. 284 Kind string `json:"kind,omitempty"` 285 286 // Name: Optional. A label to identify this entry. 287 Name string `json:"name,omitempty"` 288 289 // Value: The allowlisted value for the access control list. 290 Value string `json:"value,omitempty"` 291 292 // ForceSendFields is a list of field names (e.g. "ExpirationTime") to 293 // unconditionally include in API requests. By default, fields with 294 // empty or default values are omitted from API requests. However, any 295 // non-pointer, non-interface field appearing in ForceSendFields will be 296 // sent to the server regardless of whether the field is empty or not. 297 // This may be used to include empty fields in Patch requests. 298 ForceSendFields []string `json:"-"` 299 300 // NullFields is a list of field names (e.g. "ExpirationTime") to 301 // include in API requests with the JSON null value. By default, fields 302 // with empty values are omitted from API requests. However, any field 303 // with an empty value appearing in NullFields will be sent to the 304 // server as null. It is an error if a field in this list has a 305 // non-empty value. This may be used to include null fields in Patch 306 // requests. 307 NullFields []string `json:"-"` 308} 309 310func (s *AclEntry) MarshalJSON() ([]byte, error) { 311 type NoMethod AclEntry 312 raw := NoMethod(*s) 313 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 314} 315 316// ApiWarning: An Admin API warning message. 317type ApiWarning struct { 318 // Code: Code to uniquely identify the warning type. 319 // 320 // Possible values: 321 // "SQL_API_WARNING_CODE_UNSPECIFIED" - An unknown or unset warning 322 // type from Cloud SQL API. 323 // "REGION_UNREACHABLE" - Warning when one or more regions are not 324 // reachable. The returned result set may be incomplete. 325 Code string `json:"code,omitempty"` 326 327 // Message: The warning message. 328 Message string `json:"message,omitempty"` 329 330 // Region: The region name for REGION_UNREACHABLE warning. 331 Region string `json:"region,omitempty"` 332 333 // ForceSendFields is a list of field names (e.g. "Code") to 334 // unconditionally include in API requests. By default, fields with 335 // empty or default values are omitted from API requests. However, any 336 // non-pointer, non-interface field appearing in ForceSendFields will be 337 // sent to the server regardless of whether the field is empty or not. 338 // This may be used to include empty fields in Patch requests. 339 ForceSendFields []string `json:"-"` 340 341 // NullFields is a list of field names (e.g. "Code") to include in API 342 // requests with the JSON null value. By default, fields with empty 343 // values are omitted from API requests. However, any field with an 344 // empty value appearing in NullFields will be sent to the server as 345 // null. It is an error if a field in this list has a non-empty value. 346 // This may be used to include null fields in Patch requests. 347 NullFields []string `json:"-"` 348} 349 350func (s *ApiWarning) MarshalJSON() ([]byte, error) { 351 type NoMethod ApiWarning 352 raw := NoMethod(*s) 353 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 354} 355 356// BackupConfiguration: Database instance backup configuration. 357type BackupConfiguration struct { 358 // BackupRetentionSettings: Backup retention settings. 359 BackupRetentionSettings *BackupRetentionSettings `json:"backupRetentionSettings,omitempty"` 360 361 // BinaryLogEnabled: (MySQL only) Whether binary log is enabled. If 362 // backup configuration is disabled, binarylog must be disabled as well. 363 BinaryLogEnabled bool `json:"binaryLogEnabled,omitempty"` 364 365 // Enabled: Whether this configuration is enabled. 366 Enabled bool `json:"enabled,omitempty"` 367 368 // Kind: This is always **sql#backupConfiguration**. 369 Kind string `json:"kind,omitempty"` 370 371 // Location: Location of the backup 372 Location string `json:"location,omitempty"` 373 374 // PointInTimeRecoveryEnabled: (Postgres only) Whether point in time 375 // recovery is enabled. 376 PointInTimeRecoveryEnabled bool `json:"pointInTimeRecoveryEnabled,omitempty"` 377 378 // ReplicationLogArchivingEnabled: Reserved for future use. 379 ReplicationLogArchivingEnabled bool `json:"replicationLogArchivingEnabled,omitempty"` 380 381 // StartTime: Start time for the daily backup configuration in UTC 382 // timezone in the 24 hour format - **HH:MM**. 383 StartTime string `json:"startTime,omitempty"` 384 385 // TransactionLogRetentionDays: The number of days of transaction logs 386 // we retain for point in time restore, from 1-7. 387 TransactionLogRetentionDays int64 `json:"transactionLogRetentionDays,omitempty"` 388 389 // ForceSendFields is a list of field names (e.g. 390 // "BackupRetentionSettings") to unconditionally include in API 391 // requests. By default, fields with empty or default values are omitted 392 // from API requests. However, any non-pointer, non-interface field 393 // appearing in ForceSendFields will be sent to the server regardless of 394 // whether the field is empty or not. This may be used to include empty 395 // fields in Patch requests. 396 ForceSendFields []string `json:"-"` 397 398 // NullFields is a list of field names (e.g. "BackupRetentionSettings") 399 // to include in API requests with the JSON null value. By default, 400 // fields with empty values are omitted from API requests. However, any 401 // field with an empty value appearing in NullFields will be sent to the 402 // server as null. It is an error if a field in this list has a 403 // non-empty value. This may be used to include null fields in Patch 404 // requests. 405 NullFields []string `json:"-"` 406} 407 408func (s *BackupConfiguration) MarshalJSON() ([]byte, error) { 409 type NoMethod BackupConfiguration 410 raw := NoMethod(*s) 411 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 412} 413 414// BackupContext: Backup context. 415type BackupContext struct { 416 // BackupId: The identifier of the backup. 417 BackupId int64 `json:"backupId,omitempty,string"` 418 419 // Kind: This is always **sql#backupContext**. 420 Kind string `json:"kind,omitempty"` 421 422 // ForceSendFields is a list of field names (e.g. "BackupId") to 423 // unconditionally include in API requests. By default, fields with 424 // empty or default values are omitted from API requests. However, any 425 // non-pointer, non-interface field appearing in ForceSendFields will be 426 // sent to the server regardless of whether the field is empty or not. 427 // This may be used to include empty fields in Patch requests. 428 ForceSendFields []string `json:"-"` 429 430 // NullFields is a list of field names (e.g. "BackupId") to include in 431 // API requests with the JSON null value. By default, fields with empty 432 // values are omitted from API requests. However, any field with an 433 // empty value appearing in NullFields will be sent to the server as 434 // null. It is an error if a field in this list has a non-empty value. 435 // This may be used to include null fields in Patch requests. 436 NullFields []string `json:"-"` 437} 438 439func (s *BackupContext) MarshalJSON() ([]byte, error) { 440 type NoMethod BackupContext 441 raw := NoMethod(*s) 442 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 443} 444 445// BackupRetentionSettings: We currently only support backup retention 446// by specifying the number of backups we will retain. 447type BackupRetentionSettings struct { 448 // RetainedBackups: Depending on the value of retention_unit, this is 449 // used to determine if a backup needs to be deleted. If retention_unit 450 // is 'COUNT', we will retain this many backups. 451 RetainedBackups int64 `json:"retainedBackups,omitempty"` 452 453 // RetentionUnit: The unit that 'retained_backups' represents. 454 // 455 // Possible values: 456 // "RETENTION_UNIT_UNSPECIFIED" - Backup retention unit is 457 // unspecified, will be treated as COUNT. 458 // "COUNT" - Retention will be by count, eg. "retain the most recent 7 459 // backups". 460 RetentionUnit string `json:"retentionUnit,omitempty"` 461 462 // ForceSendFields is a list of field names (e.g. "RetainedBackups") to 463 // unconditionally include in API requests. By default, fields with 464 // empty or default values are omitted from API requests. However, any 465 // non-pointer, non-interface field appearing in ForceSendFields will be 466 // sent to the server regardless of whether the field is empty or not. 467 // This may be used to include empty fields in Patch requests. 468 ForceSendFields []string `json:"-"` 469 470 // NullFields is a list of field names (e.g. "RetainedBackups") to 471 // include in API requests with the JSON null value. By default, fields 472 // with empty values are omitted from API requests. However, any field 473 // with an empty value appearing in NullFields will be sent to the 474 // server as null. It is an error if a field in this list has a 475 // non-empty value. This may be used to include null fields in Patch 476 // requests. 477 NullFields []string `json:"-"` 478} 479 480func (s *BackupRetentionSettings) MarshalJSON() ([]byte, error) { 481 type NoMethod BackupRetentionSettings 482 raw := NoMethod(*s) 483 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 484} 485 486// BackupRun: A BackupRun resource. 487type BackupRun struct { 488 // BackupKind: Specifies the kind of backup, PHYSICAL or 489 // DEFAULT_SNAPSHOT. 490 // 491 // Possible values: 492 // "SQL_BACKUP_KIND_UNSPECIFIED" - This is an unknown BackupKind. 493 // "SNAPSHOT" - The snapshot based backups 494 // "PHYSICAL" - Physical backups 495 BackupKind string `json:"backupKind,omitempty"` 496 497 // Description: The description of this run, only applicable to 498 // on-demand backups. 499 Description string `json:"description,omitempty"` 500 501 // DiskEncryptionConfiguration: Encryption configuration specific to a 502 // backup. 503 DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"` 504 505 // DiskEncryptionStatus: Encryption status specific to a backup. 506 DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"` 507 508 // EndTime: The time the backup operation completed in UTC timezone in 509 // RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example 510 // **2012-11-15T16:19:00.094Z**. 511 EndTime string `json:"endTime,omitempty"` 512 513 // EnqueuedTime: The time the run was enqueued in UTC timezone in RFC 514 // 3339 (https://tools.ietf.org/html/rfc3339) format, for example 515 // **2012-11-15T16:19:00.094Z**. 516 EnqueuedTime string `json:"enqueuedTime,omitempty"` 517 518 // Error: Information about why the backup operation failed. This is 519 // only present if the run has the FAILED status. 520 Error *OperationError `json:"error,omitempty"` 521 522 // Id: The identifier for this backup run. Unique only for a specific 523 // Cloud SQL instance. 524 Id int64 `json:"id,omitempty,string"` 525 526 // Instance: Name of the database instance. 527 Instance string `json:"instance,omitempty"` 528 529 // Kind: This is always **sql#backupRun**. 530 Kind string `json:"kind,omitempty"` 531 532 // Location: Location of the backups. 533 Location string `json:"location,omitempty"` 534 535 // SelfLink: The URI of this resource. 536 SelfLink string `json:"selfLink,omitempty"` 537 538 // StartTime: The time the backup operation actually started in UTC 539 // timezone in RFC 3339 (https://tools.ietf.org/html/rfc3339) format, 540 // for example **2012-11-15T16:19:00.094Z**. 541 StartTime string `json:"startTime,omitempty"` 542 543 // Status: The status of this run. 544 // 545 // Possible values: 546 // "SQL_BACKUP_RUN_STATUS_UNSPECIFIED" - The status of the run is 547 // unknown. 548 // "ENQUEUED" - The backup operation was enqueued. 549 // "OVERDUE" - The backup is overdue across a given backup window. 550 // Indicates a problem. Example: Long-running operation in progress 551 // during the whole window. 552 // "RUNNING" - The backup is in progress. 553 // "FAILED" - The backup failed. 554 // "SUCCESSFUL" - The backup was successful. 555 // "SKIPPED" - The backup was skipped (without problems) for a given 556 // backup window. Example: Instance was idle. 557 // "DELETION_PENDING" - The backup is about to be deleted. 558 // "DELETION_FAILED" - The backup deletion failed. 559 // "DELETED" - The backup has been deleted. 560 Status string `json:"status,omitempty"` 561 562 // Type: The type of this run; can be either "AUTOMATED" or "ON_DEMAND". 563 // This field defaults to "ON_DEMAND" and is ignored, when specified for 564 // insert requests. 565 // 566 // Possible values: 567 // "SQL_BACKUP_RUN_TYPE_UNSPECIFIED" - This is an unknown BackupRun 568 // type. 569 // "AUTOMATED" - The backup schedule automatically triggers a backup. 570 // "ON_DEMAND" - The user manually triggers a backup. 571 Type string `json:"type,omitempty"` 572 573 // WindowStartTime: The start time of the backup window during which 574 // this the backup was attempted in RFC 3339 575 // (https://tools.ietf.org/html/rfc3339) format, for example 576 // **2012-11-15T16:19:00.094Z**. 577 WindowStartTime string `json:"windowStartTime,omitempty"` 578 579 // ServerResponse contains the HTTP response code and headers from the 580 // server. 581 googleapi.ServerResponse `json:"-"` 582 583 // ForceSendFields is a list of field names (e.g. "BackupKind") to 584 // unconditionally include in API requests. By default, fields with 585 // empty or default values are omitted from API requests. However, any 586 // non-pointer, non-interface field appearing in ForceSendFields will be 587 // sent to the server regardless of whether the field is empty or not. 588 // This may be used to include empty fields in Patch requests. 589 ForceSendFields []string `json:"-"` 590 591 // NullFields is a list of field names (e.g. "BackupKind") to include in 592 // API requests with the JSON null value. By default, fields with empty 593 // values are omitted from API requests. However, any field with an 594 // empty value appearing in NullFields will be sent to the server as 595 // null. It is an error if a field in this list has a non-empty value. 596 // This may be used to include null fields in Patch requests. 597 NullFields []string `json:"-"` 598} 599 600func (s *BackupRun) MarshalJSON() ([]byte, error) { 601 type NoMethod BackupRun 602 raw := NoMethod(*s) 603 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 604} 605 606// BackupRunsListResponse: Backup run list results. 607type BackupRunsListResponse struct { 608 // Items: A list of backup runs in reverse chronological order of the 609 // enqueued time. 610 Items []*BackupRun `json:"items,omitempty"` 611 612 // Kind: This is always **sql#backupRunsList**. 613 Kind string `json:"kind,omitempty"` 614 615 // NextPageToken: The continuation token, used to page through large 616 // result sets. Provide this value in a subsequent request to return the 617 // next page of results. 618 NextPageToken string `json:"nextPageToken,omitempty"` 619 620 // ServerResponse contains the HTTP response code and headers from the 621 // server. 622 googleapi.ServerResponse `json:"-"` 623 624 // ForceSendFields is a list of field names (e.g. "Items") to 625 // unconditionally include in API requests. By default, fields with 626 // empty or default values are omitted from API requests. However, any 627 // non-pointer, non-interface field appearing in ForceSendFields will be 628 // sent to the server regardless of whether the field is empty or not. 629 // This may be used to include empty fields in Patch requests. 630 ForceSendFields []string `json:"-"` 631 632 // NullFields is a list of field names (e.g. "Items") to include in API 633 // requests with the JSON null value. By default, fields with empty 634 // values are omitted from API requests. However, any field with an 635 // empty value appearing in NullFields will be sent to the server as 636 // null. It is an error if a field in this list has a non-empty value. 637 // This may be used to include null fields in Patch requests. 638 NullFields []string `json:"-"` 639} 640 641func (s *BackupRunsListResponse) MarshalJSON() ([]byte, error) { 642 type NoMethod BackupRunsListResponse 643 raw := NoMethod(*s) 644 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 645} 646 647// BinLogCoordinates: Binary log coordinates. 648type BinLogCoordinates struct { 649 // BinLogFileName: Name of the binary log file for a Cloud SQL instance. 650 BinLogFileName string `json:"binLogFileName,omitempty"` 651 652 // BinLogPosition: Position (offset) within the binary log file. 653 BinLogPosition int64 `json:"binLogPosition,omitempty,string"` 654 655 // Kind: This is always **sql#binLogCoordinates**. 656 Kind string `json:"kind,omitempty"` 657 658 // ForceSendFields is a list of field names (e.g. "BinLogFileName") to 659 // unconditionally include in API requests. By default, fields with 660 // empty or default values are omitted from API requests. However, any 661 // non-pointer, non-interface field appearing in ForceSendFields will be 662 // sent to the server regardless of whether the field is empty or not. 663 // This may be used to include empty fields in Patch requests. 664 ForceSendFields []string `json:"-"` 665 666 // NullFields is a list of field names (e.g. "BinLogFileName") to 667 // include in API requests with the JSON null value. By default, fields 668 // with empty values are omitted from API requests. However, any field 669 // with an empty value appearing in NullFields will be sent to the 670 // server as null. It is an error if a field in this list has a 671 // non-empty value. This may be used to include null fields in Patch 672 // requests. 673 NullFields []string `json:"-"` 674} 675 676func (s *BinLogCoordinates) MarshalJSON() ([]byte, error) { 677 type NoMethod BinLogCoordinates 678 raw := NoMethod(*s) 679 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 680} 681 682// CloneContext: Database instance clone context. 683type CloneContext struct { 684 // BinLogCoordinates: Binary log coordinates, if specified, identify the 685 // position up to which the source instance is cloned. If not specified, 686 // the source instance is cloned up to the most recent binary log 687 // coordinates. 688 BinLogCoordinates *BinLogCoordinates `json:"binLogCoordinates,omitempty"` 689 690 // DestinationInstanceName: Name of the Cloud SQL instance to be created 691 // as a clone. 692 DestinationInstanceName string `json:"destinationInstanceName,omitempty"` 693 694 // Kind: This is always **sql#cloneContext**. 695 Kind string `json:"kind,omitempty"` 696 697 // PitrTimestampMs: Reserved for future use. 698 PitrTimestampMs int64 `json:"pitrTimestampMs,omitempty,string"` 699 700 // PointInTime: Timestamp, if specified, identifies the time to which 701 // the source instance is cloned. 702 PointInTime string `json:"pointInTime,omitempty"` 703 704 // ForceSendFields is a list of field names (e.g. "BinLogCoordinates") 705 // to unconditionally include in API requests. By default, fields with 706 // empty or default values are omitted from API requests. However, any 707 // non-pointer, non-interface field appearing in ForceSendFields will be 708 // sent to the server regardless of whether the field is empty or not. 709 // This may be used to include empty fields in Patch requests. 710 ForceSendFields []string `json:"-"` 711 712 // NullFields is a list of field names (e.g. "BinLogCoordinates") to 713 // include in API requests with the JSON null value. By default, fields 714 // with empty values are omitted from API requests. However, any field 715 // with an empty value appearing in NullFields will be sent to the 716 // server as null. It is an error if a field in this list has a 717 // non-empty value. This may be used to include null fields in Patch 718 // requests. 719 NullFields []string `json:"-"` 720} 721 722func (s *CloneContext) MarshalJSON() ([]byte, error) { 723 type NoMethod CloneContext 724 raw := NoMethod(*s) 725 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 726} 727 728// ConnectSettings: Connect settings retrieval response. 729type ConnectSettings struct { 730 // BackendType: **SECOND_GEN**: Cloud SQL database instance. 731 // **EXTERNAL**: A database server that is not managed by Google. This 732 // property is read-only; use the **tier** property in the **settings** 733 // object to determine the database type. 734 // 735 // Possible values: 736 // "SQL_BACKEND_TYPE_UNSPECIFIED" - This is an unknown backend type 737 // for instance. 738 // "FIRST_GEN" - V1 speckle instance. 739 // "SECOND_GEN" - V2 speckle instance. 740 // "EXTERNAL" - On premises instance. 741 BackendType string `json:"backendType,omitempty"` 742 743 // DatabaseVersion: The database engine type and version. The 744 // **databaseVersion** field cannot be changed after instance creation. 745 // MySQL instances: **MYSQL_8_0**, **MYSQL_5_7** (default), or 746 // **MYSQL_5_6**. PostgreSQL instances: **POSTGRES_9_6**, 747 // **POSTGRES_10**, **POSTGRES_11** or **POSTGRES_12** (default). SQL 748 // Server instances: **SQLSERVER_2017_STANDARD** (default), 749 // **SQLSERVER_2017_ENTERPRISE**, **SQLSERVER_2017_EXPRESS**, or 750 // **SQLSERVER_2017_WEB**. 751 // 752 // Possible values: 753 // "SQL_DATABASE_VERSION_UNSPECIFIED" - This is an unknown database 754 // version. 755 // "MYSQL_5_1" - The database version is MySQL 5.1. 756 // "MYSQL_5_5" - The database version is MySQL 5.5. 757 // "MYSQL_5_6" - The database version is MySQL 5.6. 758 // "MYSQL_5_7" - The database version is MySQL 5.7. 759 // "POSTGRES_9_6" - The database version is PostgreSQL 9.6. 760 // "POSTGRES_11" - The database version is PostgreSQL 11. 761 // "SQLSERVER_2017_STANDARD" - The database version is SQL Server 2017 762 // Standard. 763 // "SQLSERVER_2017_ENTERPRISE" - The database version is SQL Server 764 // 2017 Enterprise. 765 // "SQLSERVER_2017_EXPRESS" - The database version is SQL Server 2017 766 // Express. 767 // "SQLSERVER_2017_WEB" - The database version is SQL Server 2017 Web. 768 // "POSTGRES_10" - The database version is PostgreSQL 10. 769 // "POSTGRES_12" - The database version is PostgreSQL 12. 770 // "MYSQL_8_0" - The database version is MySQL 8. 771 // "POSTGRES_13" - The database version is PostgreSQL 13. 772 // "SQLSERVER_2019_STANDARD" - The database version is SQL Server 2019 773 // Standard. 774 // "SQLSERVER_2019_ENTERPRISE" - The database version is SQL Server 775 // 2019 Enterprise. 776 // "SQLSERVER_2019_EXPRESS" - The database version is SQL Server 2019 777 // Express. 778 // "SQLSERVER_2019_WEB" - The database version is SQL Server 2019 Web. 779 DatabaseVersion string `json:"databaseVersion,omitempty"` 780 781 // IpAddresses: The assigned IP addresses for the instance. 782 IpAddresses []*IpMapping `json:"ipAddresses,omitempty"` 783 784 // Kind: This is always `sql#connectSettings`. 785 Kind string `json:"kind,omitempty"` 786 787 // Region: The cloud region for the instance. e.g. **us-central1**, 788 // **europe-west1**. The region cannot be changed after instance 789 // creation. 790 Region string `json:"region,omitempty"` 791 792 // ServerCaCert: SSL configuration. 793 ServerCaCert *SslCert `json:"serverCaCert,omitempty"` 794 795 // ServerResponse contains the HTTP response code and headers from the 796 // server. 797 googleapi.ServerResponse `json:"-"` 798 799 // ForceSendFields is a list of field names (e.g. "BackendType") to 800 // unconditionally include in API requests. By default, fields with 801 // empty or default values are omitted from API requests. However, any 802 // non-pointer, non-interface field appearing in ForceSendFields will be 803 // sent to the server regardless of whether the field is empty or not. 804 // This may be used to include empty fields in Patch requests. 805 ForceSendFields []string `json:"-"` 806 807 // NullFields is a list of field names (e.g. "BackendType") to include 808 // in API requests with the JSON null value. By default, fields with 809 // empty values are omitted from API requests. However, any field with 810 // an empty value appearing in NullFields will be sent to the server as 811 // null. It is an error if a field in this list has a non-empty value. 812 // This may be used to include null fields in Patch requests. 813 NullFields []string `json:"-"` 814} 815 816func (s *ConnectSettings) MarshalJSON() ([]byte, error) { 817 type NoMethod ConnectSettings 818 raw := NoMethod(*s) 819 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 820} 821 822// Database: Represents a SQL database on the Cloud SQL instance. 823type Database struct { 824 // Charset: The Cloud SQL charset value. 825 Charset string `json:"charset,omitempty"` 826 827 // Collation: The Cloud SQL collation value. 828 Collation string `json:"collation,omitempty"` 829 830 // Etag: This field is deprecated and will be removed from a future 831 // version of the API. 832 Etag string `json:"etag,omitempty"` 833 834 // Instance: The name of the Cloud SQL instance. This does not include 835 // the project ID. 836 Instance string `json:"instance,omitempty"` 837 838 // Kind: This is always **sql#database**. 839 Kind string `json:"kind,omitempty"` 840 841 // Name: The name of the database in the Cloud SQL instance. This does 842 // not include the project ID or instance name. 843 Name string `json:"name,omitempty"` 844 845 // Project: The project ID of the project containing the Cloud SQL 846 // database. The Google apps domain is prefixed if applicable. 847 Project string `json:"project,omitempty"` 848 849 // SelfLink: The URI of this resource. 850 SelfLink string `json:"selfLink,omitempty"` 851 852 SqlserverDatabaseDetails *SqlServerDatabaseDetails `json:"sqlserverDatabaseDetails,omitempty"` 853 854 // ServerResponse contains the HTTP response code and headers from the 855 // server. 856 googleapi.ServerResponse `json:"-"` 857 858 // ForceSendFields is a list of field names (e.g. "Charset") to 859 // unconditionally include in API requests. By default, fields with 860 // empty or default values are omitted from API requests. However, any 861 // non-pointer, non-interface field appearing in ForceSendFields will be 862 // sent to the server regardless of whether the field is empty or not. 863 // This may be used to include empty fields in Patch requests. 864 ForceSendFields []string `json:"-"` 865 866 // NullFields is a list of field names (e.g. "Charset") to include in 867 // API requests with the JSON null value. By default, fields with empty 868 // values are omitted from API requests. However, any field with an 869 // empty value appearing in NullFields will be sent to the server as 870 // null. It is an error if a field in this list has a non-empty value. 871 // This may be used to include null fields in Patch requests. 872 NullFields []string `json:"-"` 873} 874 875func (s *Database) MarshalJSON() ([]byte, error) { 876 type NoMethod Database 877 raw := NoMethod(*s) 878 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 879} 880 881// DatabaseFlags: Database flags for Cloud SQL instances. 882type DatabaseFlags struct { 883 // Name: The name of the flag. These flags are passed at instance 884 // startup, so include both server options and system variables. Flags 885 // are specified with underscores, not hyphens. For more information, 886 // see Configuring Database Flags 887 // (https://cloud.google.com/sql/docs/mysql/flags) in the Cloud SQL 888 // documentation. 889 Name string `json:"name,omitempty"` 890 891 // Value: The value of the flag. Booleans are set to **on** for true and 892 // **off** for false. This field must be omitted if the flag doesn't 893 // take a value. 894 Value string `json:"value,omitempty"` 895 896 // ForceSendFields is a list of field names (e.g. "Name") to 897 // unconditionally include in API requests. By default, fields with 898 // empty or default values are omitted from API requests. However, any 899 // non-pointer, non-interface field appearing in ForceSendFields will be 900 // sent to the server regardless of whether the field is empty or not. 901 // This may be used to include empty fields in Patch requests. 902 ForceSendFields []string `json:"-"` 903 904 // NullFields is a list of field names (e.g. "Name") to include in API 905 // requests with the JSON null value. By default, fields with empty 906 // values are omitted from API requests. However, any field with an 907 // empty value appearing in NullFields will be sent to the server as 908 // null. It is an error if a field in this list has a non-empty value. 909 // This may be used to include null fields in Patch requests. 910 NullFields []string `json:"-"` 911} 912 913func (s *DatabaseFlags) MarshalJSON() ([]byte, error) { 914 type NoMethod DatabaseFlags 915 raw := NoMethod(*s) 916 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 917} 918 919// DatabaseInstance: A Cloud SQL instance resource. 920type DatabaseInstance struct { 921 // BackendType: The backend type. **SECOND_GEN**: Cloud SQL database 922 // instance. **EXTERNAL**: A database server that is not managed by 923 // Google. This property is read-only; use the **tier** property in the 924 // **settings** object to determine the database type. 925 // 926 // Possible values: 927 // "SQL_BACKEND_TYPE_UNSPECIFIED" - This is an unknown backend type 928 // for instance. 929 // "FIRST_GEN" - V1 speckle instance. 930 // "SECOND_GEN" - V2 speckle instance. 931 // "EXTERNAL" - On premises instance. 932 BackendType string `json:"backendType,omitempty"` 933 934 // ConnectionName: Connection name of the Cloud SQL instance used in 935 // connection strings. 936 ConnectionName string `json:"connectionName,omitempty"` 937 938 // CreateTime: Output only. The time when the instance was created in 939 // RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example 940 // **2012-11-15T16:19:00.094Z**. 941 CreateTime string `json:"createTime,omitempty"` 942 943 // CurrentDiskSize: The current disk usage of the instance in bytes. 944 // This property has been deprecated. Use the 945 // "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud 946 // Monitoring API instead. Please see this announcement 947 // (https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ) 948 // for details. 949 CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"` 950 951 // DatabaseVersion: The database engine type and version. The 952 // **databaseVersion** field cannot be changed after instance creation. 953 // * **MySQL instances**: MYSQL_8_0, MYSQL_5_7 (default), or MYSQL_5_6. 954 // * **PostgreSQL instances**: POSTGRES_9_6, POSTGRES_10, POSTGRES_11, 955 // POSTGRES_12, POSTGRES_13 (default), POSTGRES_14. * **SQL Server 956 // instances**: SQLSERVER_2019_STANDARD, SQLSERVER_2019_ENTERPRISE, 957 // SQLSERVER_2019_EXPRESS, or SQLSERVER_2019_WEB, 958 // SQLSERVER_2017_STANDARD (default), SQLSERVER_2017_ENTERPRISE, 959 // SQLSERVER_2017_EXPRESS, or SQLSERVER_2017_WEB. 960 // 961 // Possible values: 962 // "SQL_DATABASE_VERSION_UNSPECIFIED" - This is an unknown database 963 // version. 964 // "MYSQL_5_1" - The database version is MySQL 5.1. 965 // "MYSQL_5_5" - The database version is MySQL 5.5. 966 // "MYSQL_5_6" - The database version is MySQL 5.6. 967 // "MYSQL_5_7" - The database version is MySQL 5.7. 968 // "POSTGRES_9_6" - The database version is PostgreSQL 9.6. 969 // "POSTGRES_11" - The database version is PostgreSQL 11. 970 // "SQLSERVER_2017_STANDARD" - The database version is SQL Server 2017 971 // Standard. 972 // "SQLSERVER_2017_ENTERPRISE" - The database version is SQL Server 973 // 2017 Enterprise. 974 // "SQLSERVER_2017_EXPRESS" - The database version is SQL Server 2017 975 // Express. 976 // "SQLSERVER_2017_WEB" - The database version is SQL Server 2017 Web. 977 // "POSTGRES_10" - The database version is PostgreSQL 10. 978 // "POSTGRES_12" - The database version is PostgreSQL 12. 979 // "MYSQL_8_0" - The database version is MySQL 8. 980 // "POSTGRES_13" - The database version is PostgreSQL 13. 981 // "SQLSERVER_2019_STANDARD" - The database version is SQL Server 2019 982 // Standard. 983 // "SQLSERVER_2019_ENTERPRISE" - The database version is SQL Server 984 // 2019 Enterprise. 985 // "SQLSERVER_2019_EXPRESS" - The database version is SQL Server 2019 986 // Express. 987 // "SQLSERVER_2019_WEB" - The database version is SQL Server 2019 Web. 988 DatabaseVersion string `json:"databaseVersion,omitempty"` 989 990 // DiskEncryptionConfiguration: Disk encryption configuration specific 991 // to an instance. 992 DiskEncryptionConfiguration *DiskEncryptionConfiguration `json:"diskEncryptionConfiguration,omitempty"` 993 994 // DiskEncryptionStatus: Disk encryption status specific to an instance. 995 DiskEncryptionStatus *DiskEncryptionStatus `json:"diskEncryptionStatus,omitempty"` 996 997 // Etag: This field is deprecated and will be removed from a future 998 // version of the API. Use the **settings.settingsVersion** field 999 // instead. 1000 Etag string `json:"etag,omitempty"` 1001 1002 // FailoverReplica: The name and status of the failover replica. 1003 FailoverReplica *DatabaseInstanceFailoverReplica `json:"failoverReplica,omitempty"` 1004 1005 // GceZone: The Compute Engine zone that the instance is currently 1006 // serving from. This value could be different from the zone that was 1007 // specified when the instance was created if the instance has failed 1008 // over to its secondary zone. 1009 GceZone string `json:"gceZone,omitempty"` 1010 1011 // InstanceType: The instance type. This can be one of the following: * 1012 // **CLOUD_SQL_INSTANCE**: A Cloud SQL instance that is not replicating 1013 // from a primary instance. * **ON_PREMISES_INSTANCE**: An instance 1014 // running on the customer's premises. * **READ_REPLICA_INSTANCE**: A 1015 // Cloud SQL instance configured as a read-replica. 1016 // 1017 // Possible values: 1018 // "SQL_INSTANCE_TYPE_UNSPECIFIED" - This is an unknown Cloud SQL 1019 // instance type. 1020 // "CLOUD_SQL_INSTANCE" - A regular Cloud SQL instance. 1021 // "ON_PREMISES_INSTANCE" - An instance running on the customer's 1022 // premises that is not managed by Cloud SQL. 1023 // "READ_REPLICA_INSTANCE" - A Cloud SQL instance acting as a 1024 // read-replica. 1025 InstanceType string `json:"instanceType,omitempty"` 1026 1027 // IpAddresses: The assigned IP addresses for the instance. 1028 IpAddresses []*IpMapping `json:"ipAddresses,omitempty"` 1029 1030 // Ipv6Address: The IPv6 address assigned to the instance. (Deprecated) 1031 // This property was applicable only to First Generation instances. 1032 Ipv6Address string `json:"ipv6Address,omitempty"` 1033 1034 // Kind: This is always **sql#instance**. 1035 Kind string `json:"kind,omitempty"` 1036 1037 // MasterInstanceName: The name of the instance which will act as 1038 // primary in the replication setup. 1039 MasterInstanceName string `json:"masterInstanceName,omitempty"` 1040 1041 // MaxDiskSize: The maximum disk size of the instance in bytes. 1042 MaxDiskSize int64 `json:"maxDiskSize,omitempty,string"` 1043 1044 // Name: Name of the Cloud SQL instance. This does not include the 1045 // project ID. 1046 Name string `json:"name,omitempty"` 1047 1048 // OnPremisesConfiguration: Configuration specific to on-premises 1049 // instances. 1050 OnPremisesConfiguration *OnPremisesConfiguration `json:"onPremisesConfiguration,omitempty"` 1051 1052 // OutOfDiskReport: This field represents the report generated by the 1053 // proactive database wellness job for OutOfDisk issues. * Writers: * 1054 // the proactive database wellness job for OOD. * Readers: * the 1055 // proactive database wellness job 1056 OutOfDiskReport *SqlOutOfDiskReport `json:"outOfDiskReport,omitempty"` 1057 1058 // Project: The project ID of the project containing the Cloud SQL 1059 // instance. The Google apps domain is prefixed if applicable. 1060 Project string `json:"project,omitempty"` 1061 1062 // Region: The geographical region. Can be: * **us-central** 1063 // (**FIRST_GEN** instances only) * **us-central1** (**SECOND_GEN** 1064 // instances only) * **asia-east1** or **europe-west1**. Defaults to 1065 // **us-central** or **us-central1** depending on the instance type. The 1066 // region cannot be changed after instance creation. 1067 Region string `json:"region,omitempty"` 1068 1069 // ReplicaConfiguration: Configuration specific to failover replicas and 1070 // read replicas. 1071 ReplicaConfiguration *ReplicaConfiguration `json:"replicaConfiguration,omitempty"` 1072 1073 // ReplicaNames: The replicas of the instance. 1074 ReplicaNames []string `json:"replicaNames,omitempty"` 1075 1076 // RootPassword: Initial root password. Use only on creation. 1077 RootPassword string `json:"rootPassword,omitempty"` 1078 1079 // SatisfiesPzs: The status indicating if instance satisfiesPzs. 1080 // Reserved for future use. 1081 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"` 1082 1083 // ScheduledMaintenance: The start time of any upcoming scheduled 1084 // maintenance for this instance. 1085 ScheduledMaintenance *SqlScheduledMaintenance `json:"scheduledMaintenance,omitempty"` 1086 1087 // SecondaryGceZone: The Compute Engine zone that the failover instance 1088 // is currently serving from for a regional instance. This value could 1089 // be different from the zone that was specified when the instance was 1090 // created if the instance has failed over to its secondary/failover 1091 // zone. Reserved for future use. 1092 SecondaryGceZone string `json:"secondaryGceZone,omitempty"` 1093 1094 // SelfLink: The URI of this resource. 1095 SelfLink string `json:"selfLink,omitempty"` 1096 1097 // ServerCaCert: SSL configuration. 1098 ServerCaCert *SslCert `json:"serverCaCert,omitempty"` 1099 1100 // ServiceAccountEmailAddress: The service account email address 1101 // assigned to the instance. This property is read-only. 1102 ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,omitempty"` 1103 1104 // Settings: The user settings. 1105 Settings *Settings `json:"settings,omitempty"` 1106 1107 // State: The current serving state of the Cloud SQL instance. This can 1108 // be one of the following: * **SQL_INSTANCE_STATE_UNSPECIFIED**: The 1109 // state of the instance is unknown. * **RUNNABLE**: The instance is 1110 // running, or has been stopped by owner. * **SUSPENDED**: The instance 1111 // is not available, for example due to problems with billing. * 1112 // **PENDING_DELETE**: The instance is being deleted. * 1113 // **PENDING_CREATE**: The instance is being created. * **MAINTENANCE**: 1114 // The instance is down for maintenance. * **FAILED**: The instance 1115 // creation failed. 1116 // 1117 // Possible values: 1118 // "SQL_INSTANCE_STATE_UNSPECIFIED" - The state of the instance is 1119 // unknown. 1120 // "RUNNABLE" - The instance is running, or has been stopped by owner. 1121 // "SUSPENDED" - The instance is not available, for example due to 1122 // problems with billing. 1123 // "PENDING_DELETE" - The instance is being deleted. 1124 // "PENDING_CREATE" - The instance is being created. 1125 // "MAINTENANCE" - The instance is down for maintenance. 1126 // "FAILED" - The creation of the instance failed or a fatal error 1127 // occurred during maintenance. 1128 // "ONLINE_MAINTENANCE" - The instance is under maintenance operations 1129 // and the database is available. 1130 State string `json:"state,omitempty"` 1131 1132 // SuspensionReason: If the instance state is SUSPENDED, the reason for 1133 // the suspension. 1134 // 1135 // Possible values: 1136 // "SQL_SUSPENSION_REASON_UNSPECIFIED" - This is an unknown suspension 1137 // reason. 1138 // "BILLING_ISSUE" - The instance is suspended due to billing issues 1139 // (for example:, GCP account issue) 1140 // "LEGAL_ISSUE" - The instance is suspended due to illegal content 1141 // (for example:, child pornography, copyrighted material, etc.). 1142 // "OPERATIONAL_ISSUE" - The instance is causing operational issues 1143 // (for example:, causing the database to crash). 1144 // "KMS_KEY_ISSUE" - The KMS key used by the instance is either 1145 // revoked or denied access to 1146 SuspensionReason []string `json:"suspensionReason,omitempty"` 1147 1148 // ServerResponse contains the HTTP response code and headers from the 1149 // server. 1150 googleapi.ServerResponse `json:"-"` 1151 1152 // ForceSendFields is a list of field names (e.g. "BackendType") to 1153 // unconditionally include in API requests. By default, fields with 1154 // empty or default values are omitted from API requests. However, any 1155 // non-pointer, non-interface field appearing in ForceSendFields will be 1156 // sent to the server regardless of whether the field is empty or not. 1157 // This may be used to include empty fields in Patch requests. 1158 ForceSendFields []string `json:"-"` 1159 1160 // NullFields is a list of field names (e.g. "BackendType") to include 1161 // in API requests with the JSON null value. By default, fields with 1162 // empty values are omitted from API requests. However, any field with 1163 // an empty value appearing in NullFields will be sent to the server as 1164 // null. It is an error if a field in this list has a non-empty value. 1165 // This may be used to include null fields in Patch requests. 1166 NullFields []string `json:"-"` 1167} 1168 1169func (s *DatabaseInstance) MarshalJSON() ([]byte, error) { 1170 type NoMethod DatabaseInstance 1171 raw := NoMethod(*s) 1172 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1173} 1174 1175// DatabaseInstanceFailoverReplica: The name and status of the failover 1176// replica. 1177type DatabaseInstanceFailoverReplica struct { 1178 // Available: The availability status of the failover replica. A false 1179 // status indicates that the failover replica is out of sync. The 1180 // primary instance can only failover to the failover replica when the 1181 // status is true. 1182 Available bool `json:"available,omitempty"` 1183 1184 // Name: The name of the failover replica. If specified at instance 1185 // creation, a failover replica is created for the instance. The name 1186 // doesn't include the project ID. 1187 Name string `json:"name,omitempty"` 1188 1189 // ForceSendFields is a list of field names (e.g. "Available") to 1190 // unconditionally include in API requests. By default, fields with 1191 // empty or default values are omitted from API requests. However, any 1192 // non-pointer, non-interface field appearing in ForceSendFields will be 1193 // sent to the server regardless of whether the field is empty or not. 1194 // This may be used to include empty fields in Patch requests. 1195 ForceSendFields []string `json:"-"` 1196 1197 // NullFields is a list of field names (e.g. "Available") to include in 1198 // API requests with the JSON null value. By default, fields with empty 1199 // values are omitted from API requests. However, any field with an 1200 // empty value appearing in NullFields will be sent to the server as 1201 // null. It is an error if a field in this list has a non-empty value. 1202 // This may be used to include null fields in Patch requests. 1203 NullFields []string `json:"-"` 1204} 1205 1206func (s *DatabaseInstanceFailoverReplica) MarshalJSON() ([]byte, error) { 1207 type NoMethod DatabaseInstanceFailoverReplica 1208 raw := NoMethod(*s) 1209 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1210} 1211 1212// DatabasesListResponse: Database list response. 1213type DatabasesListResponse struct { 1214 // Items: List of database resources in the instance. 1215 Items []*Database `json:"items,omitempty"` 1216 1217 // Kind: This is always **sql#databasesList**. 1218 Kind string `json:"kind,omitempty"` 1219 1220 // ServerResponse contains the HTTP response code and headers from the 1221 // server. 1222 googleapi.ServerResponse `json:"-"` 1223 1224 // ForceSendFields is a list of field names (e.g. "Items") to 1225 // unconditionally include in API requests. By default, fields with 1226 // empty or default values are omitted from API requests. However, any 1227 // non-pointer, non-interface field appearing in ForceSendFields will be 1228 // sent to the server regardless of whether the field is empty or not. 1229 // This may be used to include empty fields in Patch requests. 1230 ForceSendFields []string `json:"-"` 1231 1232 // NullFields is a list of field names (e.g. "Items") to include in API 1233 // requests with the JSON null value. By default, fields with empty 1234 // values are omitted from API requests. However, any field with an 1235 // empty value appearing in NullFields will be sent to the server as 1236 // null. It is an error if a field in this list has a non-empty value. 1237 // This may be used to include null fields in Patch requests. 1238 NullFields []string `json:"-"` 1239} 1240 1241func (s *DatabasesListResponse) MarshalJSON() ([]byte, error) { 1242 type NoMethod DatabasesListResponse 1243 raw := NoMethod(*s) 1244 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1245} 1246 1247// DemoteMasterConfiguration: Read-replica configuration for connecting 1248// to the on-premises primary instance. 1249type DemoteMasterConfiguration struct { 1250 // Kind: This is always **sql#demoteMasterConfiguration**. 1251 Kind string `json:"kind,omitempty"` 1252 1253 // MysqlReplicaConfiguration: MySQL specific configuration when 1254 // replicating from a MySQL on-premises primary instance. Replication 1255 // configuration information such as the username, password, 1256 // certificates, and keys are not stored in the instance metadata. The 1257 // configuration information is used only to set up the replication 1258 // connection and is stored by MySQL in a file named **master.info** in 1259 // the data directory. 1260 MysqlReplicaConfiguration *DemoteMasterMySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"` 1261 1262 // ForceSendFields is a list of field names (e.g. "Kind") to 1263 // unconditionally include in API requests. By default, fields with 1264 // empty or default values are omitted from API requests. However, any 1265 // non-pointer, non-interface field appearing in ForceSendFields will be 1266 // sent to the server regardless of whether the field is empty or not. 1267 // This may be used to include empty fields in Patch requests. 1268 ForceSendFields []string `json:"-"` 1269 1270 // NullFields is a list of field names (e.g. "Kind") to include in API 1271 // requests with the JSON null value. By default, fields with empty 1272 // values are omitted from API requests. However, any field with an 1273 // empty value appearing in NullFields will be sent to the server as 1274 // null. It is an error if a field in this list has a non-empty value. 1275 // This may be used to include null fields in Patch requests. 1276 NullFields []string `json:"-"` 1277} 1278 1279func (s *DemoteMasterConfiguration) MarshalJSON() ([]byte, error) { 1280 type NoMethod DemoteMasterConfiguration 1281 raw := NoMethod(*s) 1282 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1283} 1284 1285// DemoteMasterContext: Database instance demote primary instance 1286// context. 1287type DemoteMasterContext struct { 1288 // Kind: This is always **sql#demoteMasterContext**. 1289 Kind string `json:"kind,omitempty"` 1290 1291 // MasterInstanceName: The name of the instance which will act as 1292 // on-premises primary instance in the replication setup. 1293 MasterInstanceName string `json:"masterInstanceName,omitempty"` 1294 1295 // ReplicaConfiguration: Configuration specific to read-replicas 1296 // replicating from the on-premises primary instance. 1297 ReplicaConfiguration *DemoteMasterConfiguration `json:"replicaConfiguration,omitempty"` 1298 1299 // SkipReplicationSetup: Flag to skip replication setup on the instance. 1300 SkipReplicationSetup bool `json:"skipReplicationSetup,omitempty"` 1301 1302 // VerifyGtidConsistency: Verify GTID consistency for demote operation. 1303 // Default value: **True**. Setting this flag to false enables you to 1304 // bypass GTID consistency check between on-premises primary instance 1305 // and Cloud SQL instance during the demotion operation but also exposes 1306 // you to the risk of future replication failures. Change the value only 1307 // if you know the reason for the GTID divergence and are confident that 1308 // doing so will not cause any replication issues. 1309 VerifyGtidConsistency bool `json:"verifyGtidConsistency,omitempty"` 1310 1311 // ForceSendFields is a list of field names (e.g. "Kind") to 1312 // unconditionally include in API requests. By default, fields with 1313 // empty or default values are omitted from API requests. However, any 1314 // non-pointer, non-interface field appearing in ForceSendFields will be 1315 // sent to the server regardless of whether the field is empty or not. 1316 // This may be used to include empty fields in Patch requests. 1317 ForceSendFields []string `json:"-"` 1318 1319 // NullFields is a list of field names (e.g. "Kind") to include in API 1320 // requests with the JSON null value. By default, fields with empty 1321 // values are omitted from API requests. However, any field with an 1322 // empty value appearing in NullFields will be sent to the server as 1323 // null. It is an error if a field in this list has a non-empty value. 1324 // This may be used to include null fields in Patch requests. 1325 NullFields []string `json:"-"` 1326} 1327 1328func (s *DemoteMasterContext) MarshalJSON() ([]byte, error) { 1329 type NoMethod DemoteMasterContext 1330 raw := NoMethod(*s) 1331 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1332} 1333 1334// DemoteMasterMySqlReplicaConfiguration: Read-replica configuration 1335// specific to MySQL databases. 1336type DemoteMasterMySqlReplicaConfiguration struct { 1337 // CaCertificate: PEM representation of the trusted CA's x509 1338 // certificate. 1339 CaCertificate string `json:"caCertificate,omitempty"` 1340 1341 // ClientCertificate: PEM representation of the replica's x509 1342 // certificate. 1343 ClientCertificate string `json:"clientCertificate,omitempty"` 1344 1345 // ClientKey: PEM representation of the replica's private key. The 1346 // corresponsing public key is encoded in the client's certificate. The 1347 // format of the replica's private key can be either PKCS #1 or PKCS #8. 1348 ClientKey string `json:"clientKey,omitempty"` 1349 1350 // Kind: This is always **sql#demoteMasterMysqlReplicaConfiguration**. 1351 Kind string `json:"kind,omitempty"` 1352 1353 // Password: The password for the replication connection. 1354 Password string `json:"password,omitempty"` 1355 1356 // Username: The username for the replication connection. 1357 Username string `json:"username,omitempty"` 1358 1359 // ForceSendFields is a list of field names (e.g. "CaCertificate") to 1360 // unconditionally include in API requests. By default, fields with 1361 // empty or default values are omitted from API requests. However, any 1362 // non-pointer, non-interface field appearing in ForceSendFields will be 1363 // sent to the server regardless of whether the field is empty or not. 1364 // This may be used to include empty fields in Patch requests. 1365 ForceSendFields []string `json:"-"` 1366 1367 // NullFields is a list of field names (e.g. "CaCertificate") to include 1368 // in API requests with the JSON null value. By default, fields with 1369 // empty values are omitted from API requests. However, any field with 1370 // an empty value appearing in NullFields will be sent to the server as 1371 // null. It is an error if a field in this list has a non-empty value. 1372 // This may be used to include null fields in Patch requests. 1373 NullFields []string `json:"-"` 1374} 1375 1376func (s *DemoteMasterMySqlReplicaConfiguration) MarshalJSON() ([]byte, error) { 1377 type NoMethod DemoteMasterMySqlReplicaConfiguration 1378 raw := NoMethod(*s) 1379 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1380} 1381 1382// DenyMaintenancePeriod: Deny Maintenance Periods. This specifies a 1383// date range during when all CSA rollout will be denied. 1384type DenyMaintenancePeriod struct { 1385 // EndDate: "deny maintenance period" end date. If the year of the end 1386 // date is empty, the year of the start date also must be empty. In this 1387 // case, it means the deny maintenance period recurs every year. The 1388 // date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 11-01 1389 EndDate string `json:"endDate,omitempty"` 1390 1391 // StartDate: "deny maintenance period" start date. If the year of the 1392 // start date is empty, the year of the end date also must be empty. In 1393 // this case, it means the deny maintenance period recurs every year. 1394 // The date is in format yyyy-mm-dd i.e., 2020-11-01, or mm-dd, i.e., 1395 // 11-01 1396 StartDate string `json:"startDate,omitempty"` 1397 1398 // Time: Time in UTC when the "deny maintenance period" starts on 1399 // start_date and ends on end_date. The time is in format: HH:mm:SS, 1400 // i.e., 00:00:00 1401 Time string `json:"time,omitempty"` 1402 1403 // ForceSendFields is a list of field names (e.g. "EndDate") to 1404 // unconditionally include in API requests. By default, fields with 1405 // empty or default values are omitted from API requests. However, any 1406 // non-pointer, non-interface field appearing in ForceSendFields will be 1407 // sent to the server regardless of whether the field is empty or not. 1408 // This may be used to include empty fields in Patch requests. 1409 ForceSendFields []string `json:"-"` 1410 1411 // NullFields is a list of field names (e.g. "EndDate") to include in 1412 // API requests with the JSON null value. By default, fields with empty 1413 // values are omitted from API requests. However, any field with an 1414 // empty value appearing in NullFields will be sent to the server as 1415 // null. It is an error if a field in this list has a non-empty value. 1416 // This may be used to include null fields in Patch requests. 1417 NullFields []string `json:"-"` 1418} 1419 1420func (s *DenyMaintenancePeriod) MarshalJSON() ([]byte, error) { 1421 type NoMethod DenyMaintenancePeriod 1422 raw := NoMethod(*s) 1423 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1424} 1425 1426// DiskEncryptionConfiguration: Disk encryption configuration for an 1427// instance. 1428type DiskEncryptionConfiguration struct { 1429 // Kind: This is always **sql#diskEncryptionConfiguration**. 1430 Kind string `json:"kind,omitempty"` 1431 1432 // KmsKeyName: Resource name of KMS key for disk encryption 1433 KmsKeyName string `json:"kmsKeyName,omitempty"` 1434 1435 // ForceSendFields is a list of field names (e.g. "Kind") to 1436 // unconditionally include in API requests. By default, fields with 1437 // empty or default values are omitted from API requests. However, any 1438 // non-pointer, non-interface field appearing in ForceSendFields will be 1439 // sent to the server regardless of whether the field is empty or not. 1440 // This may be used to include empty fields in Patch requests. 1441 ForceSendFields []string `json:"-"` 1442 1443 // NullFields is a list of field names (e.g. "Kind") to include in API 1444 // requests with the JSON null value. By default, fields with empty 1445 // values are omitted from API requests. However, any field with an 1446 // empty value appearing in NullFields will be sent to the server as 1447 // null. It is an error if a field in this list has a non-empty value. 1448 // This may be used to include null fields in Patch requests. 1449 NullFields []string `json:"-"` 1450} 1451 1452func (s *DiskEncryptionConfiguration) MarshalJSON() ([]byte, error) { 1453 type NoMethod DiskEncryptionConfiguration 1454 raw := NoMethod(*s) 1455 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1456} 1457 1458// DiskEncryptionStatus: Disk encryption status for an instance. 1459type DiskEncryptionStatus struct { 1460 // Kind: This is always **sql#diskEncryptionStatus**. 1461 Kind string `json:"kind,omitempty"` 1462 1463 // KmsKeyVersionName: KMS key version used to encrypt the Cloud SQL 1464 // instance resource 1465 KmsKeyVersionName string `json:"kmsKeyVersionName,omitempty"` 1466 1467 // ForceSendFields is a list of field names (e.g. "Kind") to 1468 // unconditionally include in API requests. By default, fields with 1469 // empty or default values are omitted from API requests. However, any 1470 // non-pointer, non-interface field appearing in ForceSendFields will be 1471 // sent to the server regardless of whether the field is empty or not. 1472 // This may be used to include empty fields in Patch requests. 1473 ForceSendFields []string `json:"-"` 1474 1475 // NullFields is a list of field names (e.g. "Kind") to include in API 1476 // requests with the JSON null value. By default, fields with empty 1477 // values are omitted from API requests. However, any field with an 1478 // empty value appearing in NullFields will be sent to the server as 1479 // null. It is an error if a field in this list has a non-empty value. 1480 // This may be used to include null fields in Patch requests. 1481 NullFields []string `json:"-"` 1482} 1483 1484func (s *DiskEncryptionStatus) MarshalJSON() ([]byte, error) { 1485 type NoMethod DiskEncryptionStatus 1486 raw := NoMethod(*s) 1487 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1488} 1489 1490// ExportContext: Database instance export context. 1491type ExportContext struct { 1492 // CsvExportOptions: Options for exporting data as CSV. **MySQL** and 1493 // **PostgreSQL** instances only. 1494 CsvExportOptions *ExportContextCsvExportOptions `json:"csvExportOptions,omitempty"` 1495 1496 // Databases: Databases to be exported. * **MySQL instances:** If 1497 // **fileType** is **SQL** and no database is specified, all databases 1498 // are exported, except for the **mysql** system database. If 1499 // **fileType** is **CSV**, you can specify one database, either by 1500 // using this property or by using the **csvExportOptions.selectQuery** 1501 // property, which takes precedence over this property. * **PostgreSQL 1502 // instances:** You must specify one database to be exported. If 1503 // **fileType** is **CSV**, this database must match the one specified 1504 // in the **csvExportOptions.selectQuery** property. * **SQL Server 1505 // instances:** You must specify one database to be exported, and the 1506 // **fileType** must be **BAK**. 1507 Databases []string `json:"databases,omitempty"` 1508 1509 // FileType: The file type for the specified uri. * **SQL**: The file 1510 // contains SQL statements. * **CSV**: The file contains CSV data. * 1511 // **BAK**: The file contains backup data for a SQL Server instance. 1512 // 1513 // Possible values: 1514 // "SQL_FILE_TYPE_UNSPECIFIED" - Unknown file type. 1515 // "SQL" - File containing SQL statements. 1516 // "CSV" - File in CSV format. 1517 // "BAK" 1518 FileType string `json:"fileType,omitempty"` 1519 1520 // Kind: This is always **sql#exportContext**. 1521 Kind string `json:"kind,omitempty"` 1522 1523 // Offload: Option for export offload. 1524 Offload bool `json:"offload,omitempty"` 1525 1526 // SqlExportOptions: Options for exporting data as SQL statements. 1527 SqlExportOptions *ExportContextSqlExportOptions `json:"sqlExportOptions,omitempty"` 1528 1529 // Uri: The path to the file in Google Cloud Storage where the export 1530 // will be stored. The URI is in the form **gs://bucketName/fileName**. 1531 // If the file already exists, the request succeeds, but the operation 1532 // fails. If **fileType** is **SQL** and the filename ends with .gz, the 1533 // contents are compressed. 1534 Uri string `json:"uri,omitempty"` 1535 1536 // ForceSendFields is a list of field names (e.g. "CsvExportOptions") to 1537 // unconditionally include in API requests. By default, fields with 1538 // empty or default values are omitted from API requests. However, any 1539 // non-pointer, non-interface field appearing in ForceSendFields will be 1540 // sent to the server regardless of whether the field is empty or not. 1541 // This may be used to include empty fields in Patch requests. 1542 ForceSendFields []string `json:"-"` 1543 1544 // NullFields is a list of field names (e.g. "CsvExportOptions") to 1545 // include in API requests with the JSON null value. By default, fields 1546 // with empty values are omitted from API requests. However, any field 1547 // with an empty value appearing in NullFields will be sent to the 1548 // server as null. It is an error if a field in this list has a 1549 // non-empty value. This may be used to include null fields in Patch 1550 // requests. 1551 NullFields []string `json:"-"` 1552} 1553 1554func (s *ExportContext) MarshalJSON() ([]byte, error) { 1555 type NoMethod ExportContext 1556 raw := NoMethod(*s) 1557 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1558} 1559 1560// ExportContextCsvExportOptions: Options for exporting data as CSV. 1561// **MySQL** and **PostgreSQL** instances only. 1562type ExportContextCsvExportOptions struct { 1563 // EscapeCharacter: Specifies the character that should appear before a 1564 // data character that needs to be escaped. 1565 EscapeCharacter string `json:"escapeCharacter,omitempty"` 1566 1567 // FieldsTerminatedBy: Specifies the character that separates columns 1568 // within each row (line) of the file. 1569 FieldsTerminatedBy string `json:"fieldsTerminatedBy,omitempty"` 1570 1571 // LinesTerminatedBy: This is used to separate lines. If a line does not 1572 // contain all fields, the rest of the columns are set to their default 1573 // values. 1574 LinesTerminatedBy string `json:"linesTerminatedBy,omitempty"` 1575 1576 // QuoteCharacter: Specifies the quoting character to be used when a 1577 // data value is quoted. 1578 QuoteCharacter string `json:"quoteCharacter,omitempty"` 1579 1580 // SelectQuery: The select query used to extract the data. 1581 SelectQuery string `json:"selectQuery,omitempty"` 1582 1583 // ForceSendFields is a list of field names (e.g. "EscapeCharacter") to 1584 // unconditionally include in API requests. By default, fields with 1585 // empty or default values are omitted from API requests. However, any 1586 // non-pointer, non-interface field appearing in ForceSendFields will be 1587 // sent to the server regardless of whether the field is empty or not. 1588 // This may be used to include empty fields in Patch requests. 1589 ForceSendFields []string `json:"-"` 1590 1591 // NullFields is a list of field names (e.g. "EscapeCharacter") to 1592 // include in API requests with the JSON null value. By default, fields 1593 // with empty values are omitted from API requests. However, any field 1594 // with an empty value appearing in NullFields will be sent to the 1595 // server as null. It is an error if a field in this list has a 1596 // non-empty value. This may be used to include null fields in Patch 1597 // requests. 1598 NullFields []string `json:"-"` 1599} 1600 1601func (s *ExportContextCsvExportOptions) MarshalJSON() ([]byte, error) { 1602 type NoMethod ExportContextCsvExportOptions 1603 raw := NoMethod(*s) 1604 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1605} 1606 1607// ExportContextSqlExportOptions: Options for exporting data as SQL 1608// statements. 1609type ExportContextSqlExportOptions struct { 1610 // MysqlExportOptions: Options for exporting from MySQL. 1611 MysqlExportOptions *ExportContextSqlExportOptionsMysqlExportOptions `json:"mysqlExportOptions,omitempty"` 1612 1613 // SchemaOnly: Export only schemas. 1614 SchemaOnly bool `json:"schemaOnly,omitempty"` 1615 1616 // Tables: Tables to export, or that were exported, from the specified 1617 // database. If you specify tables, specify one and only one database. 1618 // For PostgreSQL instances, you can specify only one table. 1619 Tables []string `json:"tables,omitempty"` 1620 1621 // ForceSendFields is a list of field names (e.g. "MysqlExportOptions") 1622 // to unconditionally include in API requests. By default, fields with 1623 // empty or default values are omitted from API requests. However, any 1624 // non-pointer, non-interface field appearing in ForceSendFields will be 1625 // sent to the server regardless of whether the field is empty or not. 1626 // This may be used to include empty fields in Patch requests. 1627 ForceSendFields []string `json:"-"` 1628 1629 // NullFields is a list of field names (e.g. "MysqlExportOptions") to 1630 // include in API requests with the JSON null value. By default, fields 1631 // with empty values are omitted from API requests. However, any field 1632 // with an empty value appearing in NullFields will be sent to the 1633 // server as null. It is an error if a field in this list has a 1634 // non-empty value. This may be used to include null fields in Patch 1635 // requests. 1636 NullFields []string `json:"-"` 1637} 1638 1639func (s *ExportContextSqlExportOptions) MarshalJSON() ([]byte, error) { 1640 type NoMethod ExportContextSqlExportOptions 1641 raw := NoMethod(*s) 1642 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1643} 1644 1645// ExportContextSqlExportOptionsMysqlExportOptions: Options for 1646// exporting from MySQL. 1647type ExportContextSqlExportOptionsMysqlExportOptions struct { 1648 // MasterData: Option to include SQL statement required to set up 1649 // replication. * If set to **1**, the dump file includes a CHANGE 1650 // MASTER TO statement with the binary log coordinates, and 1651 // --set-gtid-purged is set to ON. * If set to **2**, the CHANGE MASTER 1652 // TO statement is written as a SQL comment and has no effect. * If set 1653 // to any value other than **1**, --set-gtid-purged is set to OFF. 1654 MasterData int64 `json:"masterData,omitempty"` 1655 1656 // ForceSendFields is a list of field names (e.g. "MasterData") to 1657 // unconditionally include in API requests. By default, fields with 1658 // empty or default values are omitted from API requests. However, any 1659 // non-pointer, non-interface field appearing in ForceSendFields will be 1660 // sent to the server regardless of whether the field is empty or not. 1661 // This may be used to include empty fields in Patch requests. 1662 ForceSendFields []string `json:"-"` 1663 1664 // NullFields is a list of field names (e.g. "MasterData") to include in 1665 // API requests with the JSON null value. By default, fields with empty 1666 // values are omitted from API requests. However, any field with an 1667 // empty value appearing in NullFields will be sent to the server as 1668 // null. It is an error if a field in this list has a non-empty value. 1669 // This may be used to include null fields in Patch requests. 1670 NullFields []string `json:"-"` 1671} 1672 1673func (s *ExportContextSqlExportOptionsMysqlExportOptions) MarshalJSON() ([]byte, error) { 1674 type NoMethod ExportContextSqlExportOptionsMysqlExportOptions 1675 raw := NoMethod(*s) 1676 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1677} 1678 1679// FailoverContext: Database instance failover context. 1680type FailoverContext struct { 1681 // Kind: This is always **sql#failoverContext**. 1682 Kind string `json:"kind,omitempty"` 1683 1684 // SettingsVersion: The current settings version of this instance. 1685 // Request will be rejected if this version doesn't match the current 1686 // settings version. 1687 SettingsVersion int64 `json:"settingsVersion,omitempty,string"` 1688 1689 // ForceSendFields is a list of field names (e.g. "Kind") to 1690 // unconditionally include in API requests. By default, fields with 1691 // empty or default values are omitted from API requests. However, any 1692 // non-pointer, non-interface field appearing in ForceSendFields will be 1693 // sent to the server regardless of whether the field is empty or not. 1694 // This may be used to include empty fields in Patch requests. 1695 ForceSendFields []string `json:"-"` 1696 1697 // NullFields is a list of field names (e.g. "Kind") to include in API 1698 // requests with the JSON null value. By default, fields with empty 1699 // values are omitted from API requests. However, any field with an 1700 // empty value appearing in NullFields will be sent to the server as 1701 // null. It is an error if a field in this list has a non-empty value. 1702 // This may be used to include null fields in Patch requests. 1703 NullFields []string `json:"-"` 1704} 1705 1706func (s *FailoverContext) MarshalJSON() ([]byte, error) { 1707 type NoMethod FailoverContext 1708 raw := NoMethod(*s) 1709 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1710} 1711 1712// Flag: A flag resource. 1713type Flag struct { 1714 // AllowedIntValues: Use this field if only certain integers are 1715 // accepted. Can be combined with min_value and max_value to add 1716 // additional values. 1717 AllowedIntValues googleapi.Int64s `json:"allowedIntValues,omitempty"` 1718 1719 // AllowedStringValues: For **STRING** flags, a list of strings that the 1720 // value can be set to. 1721 AllowedStringValues []string `json:"allowedStringValues,omitempty"` 1722 1723 // AppliesTo: The database version this flag applies to. Can be 1724 // **MYSQL_8_0**, **MYSQL_5_6**, or **MYSQL_5_7**. 1725 // 1726 // Possible values: 1727 // "SQL_DATABASE_VERSION_UNSPECIFIED" - This is an unknown database 1728 // version. 1729 // "MYSQL_5_1" - The database version is MySQL 5.1. 1730 // "MYSQL_5_5" - The database version is MySQL 5.5. 1731 // "MYSQL_5_6" - The database version is MySQL 5.6. 1732 // "MYSQL_5_7" - The database version is MySQL 5.7. 1733 // "POSTGRES_9_6" - The database version is PostgreSQL 9.6. 1734 // "POSTGRES_11" - The database version is PostgreSQL 11. 1735 // "SQLSERVER_2017_STANDARD" - The database version is SQL Server 2017 1736 // Standard. 1737 // "SQLSERVER_2017_ENTERPRISE" - The database version is SQL Server 1738 // 2017 Enterprise. 1739 // "SQLSERVER_2017_EXPRESS" - The database version is SQL Server 2017 1740 // Express. 1741 // "SQLSERVER_2017_WEB" - The database version is SQL Server 2017 Web. 1742 // "POSTGRES_10" - The database version is PostgreSQL 10. 1743 // "POSTGRES_12" - The database version is PostgreSQL 12. 1744 // "MYSQL_8_0" - The database version is MySQL 8. 1745 // "POSTGRES_13" - The database version is PostgreSQL 13. 1746 // "SQLSERVER_2019_STANDARD" - The database version is SQL Server 2019 1747 // Standard. 1748 // "SQLSERVER_2019_ENTERPRISE" - The database version is SQL Server 1749 // 2019 Enterprise. 1750 // "SQLSERVER_2019_EXPRESS" - The database version is SQL Server 2019 1751 // Express. 1752 // "SQLSERVER_2019_WEB" - The database version is SQL Server 2019 Web. 1753 AppliesTo []string `json:"appliesTo,omitempty"` 1754 1755 // InBeta: Whether or not the flag is considered in beta. 1756 InBeta bool `json:"inBeta,omitempty"` 1757 1758 // Kind: This is always **sql#flag**. 1759 Kind string `json:"kind,omitempty"` 1760 1761 // MaxValue: For **INTEGER** flags, the maximum allowed value. 1762 MaxValue int64 `json:"maxValue,omitempty,string"` 1763 1764 // MinValue: For **INTEGER** flags, the minimum allowed value. 1765 MinValue int64 `json:"minValue,omitempty,string"` 1766 1767 // Name: This is the name of the flag. Flag names always use 1768 // underscores, not hyphens, for example: **max_allowed_packet** 1769 Name string `json:"name,omitempty"` 1770 1771 // RequiresRestart: Indicates whether changing this flag will trigger a 1772 // database restart. Only applicable to Second Generation instances. 1773 RequiresRestart bool `json:"requiresRestart,omitempty"` 1774 1775 // Type: The type of the flag. Flags are typed to being **BOOLEAN**, 1776 // **STRING**, **INTEGER** or **NONE**. **NONE** is used for flags which 1777 // do not take a value, such as **skip_grant_tables**. 1778 // 1779 // Possible values: 1780 // "SQL_FLAG_TYPE_UNSPECIFIED" - This is an unknown flag type. 1781 // "BOOLEAN" - Boolean type flag. 1782 // "STRING" - String type flag. 1783 // "INTEGER" - Integer type flag. 1784 // "NONE" - Flag type used for a server startup option. 1785 // "MYSQL_TIMEZONE_OFFSET" - Type introduced specially for MySQL 1786 // TimeZone offset. Accept a string value with the format [-12:59, 1787 // 13:00]. 1788 // "FLOAT" - Float type flag. 1789 // "REPEATED_STRING" - Comma-separated list of the strings in a 1790 // SqlFlagType enum. 1791 Type string `json:"type,omitempty"` 1792 1793 // ForceSendFields is a list of field names (e.g. "AllowedIntValues") to 1794 // unconditionally include in API requests. By default, fields with 1795 // empty or default values are omitted from API requests. However, any 1796 // non-pointer, non-interface field appearing in ForceSendFields will be 1797 // sent to the server regardless of whether the field is empty or not. 1798 // This may be used to include empty fields in Patch requests. 1799 ForceSendFields []string `json:"-"` 1800 1801 // NullFields is a list of field names (e.g. "AllowedIntValues") to 1802 // include in API requests with the JSON null value. By default, fields 1803 // with empty values are omitted from API requests. However, any field 1804 // with an empty value appearing in NullFields will be sent to the 1805 // server as null. It is an error if a field in this list has a 1806 // non-empty value. This may be used to include null fields in Patch 1807 // requests. 1808 NullFields []string `json:"-"` 1809} 1810 1811func (s *Flag) MarshalJSON() ([]byte, error) { 1812 type NoMethod Flag 1813 raw := NoMethod(*s) 1814 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1815} 1816 1817// FlagsListResponse: Flags list response. 1818type FlagsListResponse struct { 1819 // Items: List of flags. 1820 Items []*Flag `json:"items,omitempty"` 1821 1822 // Kind: This is always **sql#flagsList**. 1823 Kind string `json:"kind,omitempty"` 1824 1825 // ServerResponse contains the HTTP response code and headers from the 1826 // server. 1827 googleapi.ServerResponse `json:"-"` 1828 1829 // ForceSendFields is a list of field names (e.g. "Items") to 1830 // unconditionally include in API requests. By default, fields with 1831 // empty or default values are omitted from API requests. However, any 1832 // non-pointer, non-interface field appearing in ForceSendFields will be 1833 // sent to the server regardless of whether the field is empty or not. 1834 // This may be used to include empty fields in Patch requests. 1835 ForceSendFields []string `json:"-"` 1836 1837 // NullFields is a list of field names (e.g. "Items") to include in API 1838 // requests with the JSON null value. By default, fields with empty 1839 // values are omitted from API requests. However, any field with an 1840 // empty value appearing in NullFields will be sent to the server as 1841 // null. It is an error if a field in this list has a non-empty value. 1842 // This may be used to include null fields in Patch requests. 1843 NullFields []string `json:"-"` 1844} 1845 1846func (s *FlagsListResponse) MarshalJSON() ([]byte, error) { 1847 type NoMethod FlagsListResponse 1848 raw := NoMethod(*s) 1849 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1850} 1851 1852// GenerateEphemeralCertRequest: Ephemeral certificate creation request. 1853type GenerateEphemeralCertRequest struct { 1854 // AccessToken: Optional. Access token to include in the signed 1855 // certificate. 1856 AccessToken string `json:"access_token,omitempty"` 1857 1858 // PublicKey: PEM encoded public key to include in the signed 1859 // certificate. 1860 PublicKey string `json:"public_key,omitempty"` 1861 1862 // ReadTime: Optional. Optional snapshot read timestamp to trade 1863 // freshness for performance. 1864 ReadTime string `json:"readTime,omitempty"` 1865 1866 // ValidDuration: Optional. If set, it will contain the cert valid 1867 // duration. 1868 ValidDuration string `json:"validDuration,omitempty"` 1869 1870 // ForceSendFields is a list of field names (e.g. "AccessToken") to 1871 // unconditionally include in API requests. By default, fields with 1872 // empty or default values are omitted from API requests. However, any 1873 // non-pointer, non-interface field appearing in ForceSendFields will be 1874 // sent to the server regardless of whether the field is empty or not. 1875 // This may be used to include empty fields in Patch requests. 1876 ForceSendFields []string `json:"-"` 1877 1878 // NullFields is a list of field names (e.g. "AccessToken") to include 1879 // in API requests with the JSON null value. By default, fields with 1880 // empty values are omitted from API requests. However, any field with 1881 // an empty value appearing in NullFields will be sent to the server as 1882 // null. It is an error if a field in this list has a non-empty value. 1883 // This may be used to include null fields in Patch requests. 1884 NullFields []string `json:"-"` 1885} 1886 1887func (s *GenerateEphemeralCertRequest) MarshalJSON() ([]byte, error) { 1888 type NoMethod GenerateEphemeralCertRequest 1889 raw := NoMethod(*s) 1890 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1891} 1892 1893// GenerateEphemeralCertResponse: Ephemeral certificate creation 1894// request. 1895type GenerateEphemeralCertResponse struct { 1896 // EphemeralCert: Generated cert 1897 EphemeralCert *SslCert `json:"ephemeralCert,omitempty"` 1898 1899 // ServerResponse contains the HTTP response code and headers from the 1900 // server. 1901 googleapi.ServerResponse `json:"-"` 1902 1903 // ForceSendFields is a list of field names (e.g. "EphemeralCert") to 1904 // unconditionally include in API requests. By default, fields with 1905 // empty or default values are omitted from API requests. However, any 1906 // non-pointer, non-interface field appearing in ForceSendFields will be 1907 // sent to the server regardless of whether the field is empty or not. 1908 // This may be used to include empty fields in Patch requests. 1909 ForceSendFields []string `json:"-"` 1910 1911 // NullFields is a list of field names (e.g. "EphemeralCert") to include 1912 // in API requests with the JSON null value. By default, fields with 1913 // empty values are omitted from API requests. However, any field with 1914 // an empty value appearing in NullFields will be sent to the server as 1915 // null. It is an error if a field in this list has a non-empty value. 1916 // This may be used to include null fields in Patch requests. 1917 NullFields []string `json:"-"` 1918} 1919 1920func (s *GenerateEphemeralCertResponse) MarshalJSON() ([]byte, error) { 1921 type NoMethod GenerateEphemeralCertResponse 1922 raw := NoMethod(*s) 1923 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1924} 1925 1926// ImportContext: Database instance import context. 1927type ImportContext struct { 1928 // BakImportOptions: Import parameters specific to SQL Server .BAK files 1929 BakImportOptions *ImportContextBakImportOptions `json:"bakImportOptions,omitempty"` 1930 1931 // CsvImportOptions: Options for importing data as CSV. 1932 CsvImportOptions *ImportContextCsvImportOptions `json:"csvImportOptions,omitempty"` 1933 1934 // Database: The target database for the import. If **fileType** is 1935 // **SQL**, this field is required only if the import file does not 1936 // specify a database, and is overridden by any database specification 1937 // in the import file. If **fileType** is **CSV**, one database must be 1938 // specified. 1939 Database string `json:"database,omitempty"` 1940 1941 // FileType: The file type for the specified uri. * **SQL**: The file 1942 // contains SQL statements. * **CSV**: The file contains CSV data. * 1943 // **BAK**: The file contains backup data for a SQL Server instance. 1944 // 1945 // Possible values: 1946 // "SQL_FILE_TYPE_UNSPECIFIED" - Unknown file type. 1947 // "SQL" - File containing SQL statements. 1948 // "CSV" - File in CSV format. 1949 // "BAK" 1950 FileType string `json:"fileType,omitempty"` 1951 1952 // ImportUser: The PostgreSQL user for this import operation. PostgreSQL 1953 // instances only. 1954 ImportUser string `json:"importUser,omitempty"` 1955 1956 // Kind: This is always **sql#importContext**. 1957 Kind string `json:"kind,omitempty"` 1958 1959 // Uri: Path to the import file in Cloud Storage, in the form 1960 // **gs://bucketName/fileName**. Compressed gzip files (.gz) are 1961 // supported when **fileType** is **SQL**. The instance must have write 1962 // permissions to the bucket and read access to the file. 1963 Uri string `json:"uri,omitempty"` 1964 1965 // ForceSendFields is a list of field names (e.g. "BakImportOptions") to 1966 // unconditionally include in API requests. By default, fields with 1967 // empty or default values are omitted from API requests. However, any 1968 // non-pointer, non-interface field appearing in ForceSendFields will be 1969 // sent to the server regardless of whether the field is empty or not. 1970 // This may be used to include empty fields in Patch requests. 1971 ForceSendFields []string `json:"-"` 1972 1973 // NullFields is a list of field names (e.g. "BakImportOptions") to 1974 // include in API requests with the JSON null value. By default, fields 1975 // with empty values are omitted from API requests. However, any field 1976 // with an empty value appearing in NullFields will be sent to the 1977 // server as null. It is an error if a field in this list has a 1978 // non-empty value. This may be used to include null fields in Patch 1979 // requests. 1980 NullFields []string `json:"-"` 1981} 1982 1983func (s *ImportContext) MarshalJSON() ([]byte, error) { 1984 type NoMethod ImportContext 1985 raw := NoMethod(*s) 1986 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1987} 1988 1989// ImportContextBakImportOptions: Import parameters specific to SQL 1990// Server .BAK files 1991type ImportContextBakImportOptions struct { 1992 EncryptionOptions *ImportContextBakImportOptionsEncryptionOptions `json:"encryptionOptions,omitempty"` 1993 1994 // ForceSendFields is a list of field names (e.g. "EncryptionOptions") 1995 // to unconditionally include in API requests. By default, fields with 1996 // empty or default values are omitted from API requests. However, any 1997 // non-pointer, non-interface field appearing in ForceSendFields will be 1998 // sent to the server regardless of whether the field is empty or not. 1999 // This may be used to include empty fields in Patch requests. 2000 ForceSendFields []string `json:"-"` 2001 2002 // NullFields is a list of field names (e.g. "EncryptionOptions") to 2003 // include in API requests with the JSON null value. By default, fields 2004 // with empty values are omitted from API requests. However, any field 2005 // with an empty value appearing in NullFields will be sent to the 2006 // server as null. It is an error if a field in this list has a 2007 // non-empty value. This may be used to include null fields in Patch 2008 // requests. 2009 NullFields []string `json:"-"` 2010} 2011 2012func (s *ImportContextBakImportOptions) MarshalJSON() ([]byte, error) { 2013 type NoMethod ImportContextBakImportOptions 2014 raw := NoMethod(*s) 2015 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2016} 2017 2018type ImportContextBakImportOptionsEncryptionOptions struct { 2019 // CertPath: Path to the Certificate (.cer) in Cloud Storage, in the 2020 // form **gs://bucketName/fileName**. The instance must have write 2021 // permissions to the bucket and read access to the file. 2022 CertPath string `json:"certPath,omitempty"` 2023 2024 // PvkPassword: Password that encrypts the private key 2025 PvkPassword string `json:"pvkPassword,omitempty"` 2026 2027 // PvkPath: Path to the Certificate Private Key (.pvk) in Cloud Storage, 2028 // in the form **gs://bucketName/fileName**. The instance must have 2029 // write permissions to the bucket and read access to the file. 2030 PvkPath string `json:"pvkPath,omitempty"` 2031 2032 // ForceSendFields is a list of field names (e.g. "CertPath") to 2033 // unconditionally include in API requests. By default, fields with 2034 // empty or default values are omitted from API requests. However, any 2035 // non-pointer, non-interface field appearing in ForceSendFields will be 2036 // sent to the server regardless of whether the field is empty or not. 2037 // This may be used to include empty fields in Patch requests. 2038 ForceSendFields []string `json:"-"` 2039 2040 // NullFields is a list of field names (e.g. "CertPath") to include in 2041 // API requests with the JSON null value. By default, fields with empty 2042 // values are omitted from API requests. However, any field with an 2043 // empty value appearing in NullFields will be sent to the server as 2044 // null. It is an error if a field in this list has a non-empty value. 2045 // This may be used to include null fields in Patch requests. 2046 NullFields []string `json:"-"` 2047} 2048 2049func (s *ImportContextBakImportOptionsEncryptionOptions) MarshalJSON() ([]byte, error) { 2050 type NoMethod ImportContextBakImportOptionsEncryptionOptions 2051 raw := NoMethod(*s) 2052 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2053} 2054 2055// ImportContextCsvImportOptions: Options for importing data as CSV. 2056type ImportContextCsvImportOptions struct { 2057 // Columns: The columns to which CSV data is imported. If not specified, 2058 // all columns of the database table are loaded with CSV data. 2059 Columns []string `json:"columns,omitempty"` 2060 2061 // EscapeCharacter: Specifies the character that should appear before a 2062 // data character that needs to be escaped. 2063 EscapeCharacter string `json:"escapeCharacter,omitempty"` 2064 2065 // FieldsTerminatedBy: Specifies the character that separates columns 2066 // within each row (line) of the file. 2067 FieldsTerminatedBy string `json:"fieldsTerminatedBy,omitempty"` 2068 2069 // LinesTerminatedBy: This is used to separate lines. If a line does not 2070 // contain all fields, the rest of the columns are set to their default 2071 // values. 2072 LinesTerminatedBy string `json:"linesTerminatedBy,omitempty"` 2073 2074 // QuoteCharacter: Specifies the quoting character to be used when a 2075 // data value is quoted. 2076 QuoteCharacter string `json:"quoteCharacter,omitempty"` 2077 2078 // Table: The table to which CSV data is imported. 2079 Table string `json:"table,omitempty"` 2080 2081 // ForceSendFields is a list of field names (e.g. "Columns") to 2082 // unconditionally include in API requests. By default, fields with 2083 // empty or default values are omitted from API requests. However, any 2084 // non-pointer, non-interface field appearing in ForceSendFields will be 2085 // sent to the server regardless of whether the field is empty or not. 2086 // This may be used to include empty fields in Patch requests. 2087 ForceSendFields []string `json:"-"` 2088 2089 // NullFields is a list of field names (e.g. "Columns") to include in 2090 // API 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 *ImportContextCsvImportOptions) MarshalJSON() ([]byte, error) { 2099 type NoMethod ImportContextCsvImportOptions 2100 raw := NoMethod(*s) 2101 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2102} 2103 2104// InsightsConfig: Insights configuration. This specifies when Cloud SQL 2105// Insights feature is enabled and optional configuration. 2106type InsightsConfig struct { 2107 // QueryInsightsEnabled: Whether Query Insights feature is enabled. 2108 QueryInsightsEnabled bool `json:"queryInsightsEnabled,omitempty"` 2109 2110 // QueryPlansPerMinute: Number of query execution plans captured by 2111 // Insights per minute for all queries combined. Default is 5. 2112 QueryPlansPerMinute int64 `json:"queryPlansPerMinute,omitempty"` 2113 2114 // QueryStringLength: Maximum query length stored in bytes. Default 2115 // value: 1024 bytes. Range: 256-4500 bytes. Query length more than this 2116 // field value will be truncated to this value. When unset, query length 2117 // will be the default value. Changing query length will restart the 2118 // database. 2119 QueryStringLength int64 `json:"queryStringLength,omitempty"` 2120 2121 // RecordApplicationTags: Whether Query Insights will record application 2122 // tags from query when enabled. 2123 RecordApplicationTags bool `json:"recordApplicationTags,omitempty"` 2124 2125 // RecordClientAddress: Whether Query Insights will record client 2126 // address when enabled. 2127 RecordClientAddress bool `json:"recordClientAddress,omitempty"` 2128 2129 // ForceSendFields is a list of field names (e.g. 2130 // "QueryInsightsEnabled") to unconditionally include in API requests. 2131 // By default, fields with empty or default values are omitted from API 2132 // requests. However, any non-pointer, non-interface field appearing in 2133 // ForceSendFields will be sent to the server regardless of whether the 2134 // field is empty or not. This may be used to include empty fields in 2135 // Patch requests. 2136 ForceSendFields []string `json:"-"` 2137 2138 // NullFields is a list of field names (e.g. "QueryInsightsEnabled") to 2139 // include in API requests with the JSON null value. By default, fields 2140 // with empty values are omitted from API requests. However, any field 2141 // with an empty value appearing in NullFields will be sent to the 2142 // server as null. It is an error if a field in this list has a 2143 // non-empty value. This may be used to include null fields in Patch 2144 // requests. 2145 NullFields []string `json:"-"` 2146} 2147 2148func (s *InsightsConfig) MarshalJSON() ([]byte, error) { 2149 type NoMethod InsightsConfig 2150 raw := NoMethod(*s) 2151 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2152} 2153 2154// InstanceReference: Reference to another Cloud SQL instance. 2155type InstanceReference struct { 2156 // Name: The name of the Cloud SQL instance being referenced. This does 2157 // not include the project ID. 2158 Name string `json:"name,omitempty"` 2159 2160 // Project: The project ID of the Cloud SQL instance being referenced. 2161 // The default is the same project ID as the instance references it. 2162 Project string `json:"project,omitempty"` 2163 2164 // Region: The region of the Cloud SQL instance being referenced. 2165 Region string `json:"region,omitempty"` 2166 2167 // ForceSendFields is a list of field names (e.g. "Name") to 2168 // unconditionally include in API requests. By default, fields with 2169 // empty or default values are omitted from API requests. However, any 2170 // non-pointer, non-interface field appearing in ForceSendFields will be 2171 // sent to the server regardless of whether the field is empty or not. 2172 // This may be used to include empty fields in Patch requests. 2173 ForceSendFields []string `json:"-"` 2174 2175 // NullFields is a list of field names (e.g. "Name") to include in API 2176 // requests with the JSON null value. By default, fields with empty 2177 // values are omitted from API requests. However, any field with an 2178 // empty value appearing in NullFields will be sent to the server as 2179 // null. It is an error if a field in this list has a non-empty value. 2180 // This may be used to include null fields in Patch requests. 2181 NullFields []string `json:"-"` 2182} 2183 2184func (s *InstanceReference) MarshalJSON() ([]byte, error) { 2185 type NoMethod InstanceReference 2186 raw := NoMethod(*s) 2187 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2188} 2189 2190// InstancesCloneRequest: Database instance clone request. 2191type InstancesCloneRequest struct { 2192 // CloneContext: Contains details about the clone operation. 2193 CloneContext *CloneContext `json:"cloneContext,omitempty"` 2194 2195 // ForceSendFields is a list of field names (e.g. "CloneContext") to 2196 // unconditionally include in API requests. By default, fields with 2197 // empty or default values are omitted from API requests. However, any 2198 // non-pointer, non-interface field appearing in ForceSendFields will be 2199 // sent to the server regardless of whether the field is empty or not. 2200 // This may be used to include empty fields in Patch requests. 2201 ForceSendFields []string `json:"-"` 2202 2203 // NullFields is a list of field names (e.g. "CloneContext") to include 2204 // in API requests with the JSON null value. By default, fields with 2205 // empty values are omitted from API requests. However, any field with 2206 // an empty value appearing in NullFields will be sent to the server as 2207 // null. It is an error if a field in this list has a non-empty value. 2208 // This may be used to include null fields in Patch requests. 2209 NullFields []string `json:"-"` 2210} 2211 2212func (s *InstancesCloneRequest) MarshalJSON() ([]byte, error) { 2213 type NoMethod InstancesCloneRequest 2214 raw := NoMethod(*s) 2215 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2216} 2217 2218// InstancesDemoteMasterRequest: Database demote primary instance 2219// request. 2220type InstancesDemoteMasterRequest struct { 2221 // DemoteMasterContext: Contains details about the demoteMaster 2222 // operation. 2223 DemoteMasterContext *DemoteMasterContext `json:"demoteMasterContext,omitempty"` 2224 2225 // ForceSendFields is a list of field names (e.g. "DemoteMasterContext") 2226 // to unconditionally include in API requests. By default, fields with 2227 // empty or default values are omitted from API requests. However, any 2228 // non-pointer, non-interface field appearing in ForceSendFields will be 2229 // sent to the server regardless of whether the field is empty or not. 2230 // This may be used to include empty fields in Patch requests. 2231 ForceSendFields []string `json:"-"` 2232 2233 // NullFields is a list of field names (e.g. "DemoteMasterContext") to 2234 // include in API requests with the JSON null value. By default, fields 2235 // with empty values are omitted from API requests. However, any field 2236 // with an empty value appearing in NullFields will be sent to the 2237 // server as null. It is an error if a field in this list has a 2238 // non-empty value. This may be used to include null fields in Patch 2239 // requests. 2240 NullFields []string `json:"-"` 2241} 2242 2243func (s *InstancesDemoteMasterRequest) MarshalJSON() ([]byte, error) { 2244 type NoMethod InstancesDemoteMasterRequest 2245 raw := NoMethod(*s) 2246 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2247} 2248 2249// InstancesExportRequest: Database instance export request. 2250type InstancesExportRequest struct { 2251 // ExportContext: Contains details about the export operation. 2252 ExportContext *ExportContext `json:"exportContext,omitempty"` 2253 2254 // ForceSendFields is a list of field names (e.g. "ExportContext") to 2255 // unconditionally include in API requests. By default, fields with 2256 // empty or default values are omitted from API requests. However, any 2257 // non-pointer, non-interface field appearing in ForceSendFields will be 2258 // sent to the server regardless of whether the field is empty or not. 2259 // This may be used to include empty fields in Patch requests. 2260 ForceSendFields []string `json:"-"` 2261 2262 // NullFields is a list of field names (e.g. "ExportContext") to include 2263 // in API requests with the JSON null value. By default, fields with 2264 // empty values are omitted from API requests. However, any field with 2265 // an empty value appearing in NullFields will be sent to the server as 2266 // null. It is an error if a field in this list has a non-empty value. 2267 // This may be used to include null fields in Patch requests. 2268 NullFields []string `json:"-"` 2269} 2270 2271func (s *InstancesExportRequest) MarshalJSON() ([]byte, error) { 2272 type NoMethod InstancesExportRequest 2273 raw := NoMethod(*s) 2274 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2275} 2276 2277// InstancesFailoverRequest: Instance failover request. 2278type InstancesFailoverRequest struct { 2279 // FailoverContext: Failover Context. 2280 FailoverContext *FailoverContext `json:"failoverContext,omitempty"` 2281 2282 // ForceSendFields is a list of field names (e.g. "FailoverContext") to 2283 // unconditionally include in API requests. By default, fields with 2284 // empty or default values are omitted from API requests. However, any 2285 // non-pointer, non-interface field appearing in ForceSendFields will be 2286 // sent to the server regardless of whether the field is empty or not. 2287 // This may be used to include empty fields in Patch requests. 2288 ForceSendFields []string `json:"-"` 2289 2290 // NullFields is a list of field names (e.g. "FailoverContext") to 2291 // include in API requests with the JSON null value. By default, fields 2292 // with empty values are omitted from API requests. However, any field 2293 // with an empty value appearing in NullFields will be sent to the 2294 // server as null. It is an error if a field in this list has a 2295 // non-empty value. This may be used to include null fields in Patch 2296 // requests. 2297 NullFields []string `json:"-"` 2298} 2299 2300func (s *InstancesFailoverRequest) MarshalJSON() ([]byte, error) { 2301 type NoMethod InstancesFailoverRequest 2302 raw := NoMethod(*s) 2303 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2304} 2305 2306// InstancesImportRequest: Database instance import request. 2307type InstancesImportRequest struct { 2308 // ImportContext: Contains details about the import operation. 2309 ImportContext *ImportContext `json:"importContext,omitempty"` 2310 2311 // ForceSendFields is a list of field names (e.g. "ImportContext") to 2312 // unconditionally include in API requests. By default, fields with 2313 // empty or default values are omitted from API requests. However, any 2314 // non-pointer, non-interface field appearing in ForceSendFields will be 2315 // sent to the server regardless of whether the field is empty or not. 2316 // This may be used to include empty fields in Patch requests. 2317 ForceSendFields []string `json:"-"` 2318 2319 // NullFields is a list of field names (e.g. "ImportContext") to include 2320 // in API requests with the JSON null value. By default, fields with 2321 // empty values are omitted from API requests. However, any field with 2322 // an empty value appearing in NullFields will be sent to the server as 2323 // null. It is an error if a field in this list has a non-empty value. 2324 // This may be used to include null fields in Patch requests. 2325 NullFields []string `json:"-"` 2326} 2327 2328func (s *InstancesImportRequest) MarshalJSON() ([]byte, error) { 2329 type NoMethod InstancesImportRequest 2330 raw := NoMethod(*s) 2331 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2332} 2333 2334// InstancesListResponse: Database instances list response. 2335type InstancesListResponse struct { 2336 // Items: List of database instance resources. 2337 Items []*DatabaseInstance `json:"items,omitempty"` 2338 2339 // Kind: This is always **sql#instancesList**. 2340 Kind string `json:"kind,omitempty"` 2341 2342 // NextPageToken: The continuation token, used to page through large 2343 // result sets. Provide this value in a subsequent request to return the 2344 // next page of results. 2345 NextPageToken string `json:"nextPageToken,omitempty"` 2346 2347 // Warnings: List of warnings that occurred while handling the request. 2348 Warnings []*ApiWarning `json:"warnings,omitempty"` 2349 2350 // ServerResponse contains the HTTP response code and headers from the 2351 // server. 2352 googleapi.ServerResponse `json:"-"` 2353 2354 // ForceSendFields is a list of field names (e.g. "Items") to 2355 // unconditionally include in API requests. By default, fields with 2356 // empty or default values are omitted from API requests. However, any 2357 // non-pointer, non-interface field appearing in ForceSendFields will be 2358 // sent to the server regardless of whether the field is empty or not. 2359 // This may be used to include empty fields in Patch requests. 2360 ForceSendFields []string `json:"-"` 2361 2362 // NullFields is a list of field names (e.g. "Items") to include in API 2363 // requests with the JSON null value. By default, fields with empty 2364 // values are omitted from API requests. However, any field with an 2365 // empty value appearing in NullFields will be sent to the server as 2366 // null. It is an error if a field in this list has a non-empty value. 2367 // This may be used to include null fields in Patch requests. 2368 NullFields []string `json:"-"` 2369} 2370 2371func (s *InstancesListResponse) MarshalJSON() ([]byte, error) { 2372 type NoMethod InstancesListResponse 2373 raw := NoMethod(*s) 2374 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2375} 2376 2377// InstancesListServerCasResponse: Instances ListServerCas response. 2378type InstancesListServerCasResponse struct { 2379 ActiveVersion string `json:"activeVersion,omitempty"` 2380 2381 // Certs: List of server CA certificates for the instance. 2382 Certs []*SslCert `json:"certs,omitempty"` 2383 2384 // Kind: This is always **sql#instancesListServerCas**. 2385 Kind string `json:"kind,omitempty"` 2386 2387 // ServerResponse contains the HTTP response code and headers from the 2388 // server. 2389 googleapi.ServerResponse `json:"-"` 2390 2391 // ForceSendFields is a list of field names (e.g. "ActiveVersion") to 2392 // unconditionally include in API requests. By default, fields with 2393 // empty or default values are omitted from API requests. However, any 2394 // non-pointer, non-interface field appearing in ForceSendFields will be 2395 // sent to the server regardless of whether the field is empty or not. 2396 // This may be used to include empty fields in Patch requests. 2397 ForceSendFields []string `json:"-"` 2398 2399 // NullFields is a list of field names (e.g. "ActiveVersion") to include 2400 // in API requests with the JSON null value. By default, fields with 2401 // empty values are omitted from API requests. However, any field with 2402 // an empty value appearing in NullFields will be sent to the server as 2403 // null. It is an error if a field in this list has a non-empty value. 2404 // This may be used to include null fields in Patch requests. 2405 NullFields []string `json:"-"` 2406} 2407 2408func (s *InstancesListServerCasResponse) MarshalJSON() ([]byte, error) { 2409 type NoMethod InstancesListServerCasResponse 2410 raw := NoMethod(*s) 2411 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2412} 2413 2414// InstancesRestoreBackupRequest: Database instance restore backup 2415// request. 2416type InstancesRestoreBackupRequest struct { 2417 // RestoreBackupContext: Parameters required to perform the restore 2418 // backup operation. 2419 RestoreBackupContext *RestoreBackupContext `json:"restoreBackupContext,omitempty"` 2420 2421 // ForceSendFields is a list of field names (e.g. 2422 // "RestoreBackupContext") to unconditionally include in API requests. 2423 // By default, fields with empty or default values are omitted from API 2424 // requests. However, any non-pointer, non-interface field appearing in 2425 // ForceSendFields will be sent to the server regardless of whether the 2426 // field is empty or not. This may be used to include empty fields in 2427 // Patch requests. 2428 ForceSendFields []string `json:"-"` 2429 2430 // NullFields is a list of field names (e.g. "RestoreBackupContext") to 2431 // include in API requests with the JSON null value. By default, fields 2432 // with empty values are omitted from API requests. However, any field 2433 // with an empty value appearing in NullFields will be sent to the 2434 // server as null. It is an error if a field in this list has a 2435 // non-empty value. This may be used to include null fields in Patch 2436 // requests. 2437 NullFields []string `json:"-"` 2438} 2439 2440func (s *InstancesRestoreBackupRequest) MarshalJSON() ([]byte, error) { 2441 type NoMethod InstancesRestoreBackupRequest 2442 raw := NoMethod(*s) 2443 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2444} 2445 2446// InstancesRotateServerCaRequest: Rotate Server CA request. 2447type InstancesRotateServerCaRequest struct { 2448 // RotateServerCaContext: Contains details about the rotate server CA 2449 // operation. 2450 RotateServerCaContext *RotateServerCaContext `json:"rotateServerCaContext,omitempty"` 2451 2452 // ForceSendFields is a list of field names (e.g. 2453 // "RotateServerCaContext") to unconditionally include in API requests. 2454 // By default, fields with empty or default values are omitted from API 2455 // requests. However, any non-pointer, non-interface field appearing in 2456 // ForceSendFields will be sent to the server regardless of whether the 2457 // field is empty or not. This may be used to include empty fields in 2458 // Patch requests. 2459 ForceSendFields []string `json:"-"` 2460 2461 // NullFields is a list of field names (e.g. "RotateServerCaContext") to 2462 // include in API requests with the JSON null value. By default, fields 2463 // with empty values are omitted from API requests. However, any field 2464 // with an empty value appearing in NullFields will be sent to the 2465 // server as null. It is an error if a field in this list has a 2466 // non-empty value. This may be used to include null fields in Patch 2467 // requests. 2468 NullFields []string `json:"-"` 2469} 2470 2471func (s *InstancesRotateServerCaRequest) MarshalJSON() ([]byte, error) { 2472 type NoMethod InstancesRotateServerCaRequest 2473 raw := NoMethod(*s) 2474 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2475} 2476 2477// InstancesTruncateLogRequest: Instance truncate log request. 2478type InstancesTruncateLogRequest struct { 2479 // TruncateLogContext: Contains details about the truncate log 2480 // operation. 2481 TruncateLogContext *TruncateLogContext `json:"truncateLogContext,omitempty"` 2482 2483 // ForceSendFields is a list of field names (e.g. "TruncateLogContext") 2484 // to unconditionally include in API requests. By default, fields with 2485 // empty or default values are omitted from API requests. However, any 2486 // non-pointer, non-interface field appearing in ForceSendFields will be 2487 // sent to the server regardless of whether the field is empty or not. 2488 // This may be used to include empty fields in Patch requests. 2489 ForceSendFields []string `json:"-"` 2490 2491 // NullFields is a list of field names (e.g. "TruncateLogContext") to 2492 // include in API requests with the JSON null value. By default, fields 2493 // with empty values are omitted from API requests. However, any field 2494 // with an empty value appearing in NullFields will be sent to the 2495 // server as null. It is an error if a field in this list has a 2496 // non-empty value. This may be used to include null fields in Patch 2497 // requests. 2498 NullFields []string `json:"-"` 2499} 2500 2501func (s *InstancesTruncateLogRequest) MarshalJSON() ([]byte, error) { 2502 type NoMethod InstancesTruncateLogRequest 2503 raw := NoMethod(*s) 2504 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2505} 2506 2507// IpConfiguration: IP Management configuration. 2508type IpConfiguration struct { 2509 // AllocatedIpRange: The name of the allocated ip range for the private 2510 // ip CloudSQL instance. For example: "google-managed-services-default". 2511 // If set, the instance ip will be created in the allocated range. The 2512 // range name must comply with RFC 1035 2513 // (https://tools.ietf.org/html/rfc1035). Specifically, the name must be 2514 // 1-63 characters long and match the regular expression 2515 // `[a-z]([-a-z0-9]*[a-z0-9])?.` Reserved for future use. 2516 AllocatedIpRange string `json:"allocatedIpRange,omitempty"` 2517 2518 // AuthorizedNetworks: The list of external networks that are allowed to 2519 // connect to the instance using the IP. In 'CIDR' notation, also known 2520 // as 'slash' notation (for example: **192.168.100.0/24**). 2521 AuthorizedNetworks []*AclEntry `json:"authorizedNetworks,omitempty"` 2522 2523 // Ipv4Enabled: Whether the instance is assigned a public IP address or 2524 // not. 2525 Ipv4Enabled bool `json:"ipv4Enabled,omitempty"` 2526 2527 // PrivateNetwork: The resource link for the VPC network from which the 2528 // Cloud SQL instance is accessible for private IP. For example, 2529 // **/projects/myProject/global/networks/default**. This setting can be 2530 // updated, but it cannot be removed after it is set. 2531 PrivateNetwork string `json:"privateNetwork,omitempty"` 2532 2533 // RequireSsl: Whether SSL connections over IP are enforced or not. 2534 RequireSsl bool `json:"requireSsl,omitempty"` 2535 2536 // ForceSendFields is a list of field names (e.g. "AllocatedIpRange") to 2537 // unconditionally include in API requests. By default, fields with 2538 // empty or default values are omitted from API requests. However, any 2539 // non-pointer, non-interface field appearing in ForceSendFields will be 2540 // sent to the server regardless of whether the field is empty or not. 2541 // This may be used to include empty fields in Patch requests. 2542 ForceSendFields []string `json:"-"` 2543 2544 // NullFields is a list of field names (e.g. "AllocatedIpRange") to 2545 // include in API requests with the JSON null value. By default, fields 2546 // with empty values are omitted from API requests. However, any field 2547 // with an empty value appearing in NullFields will be sent to the 2548 // server as null. It is an error if a field in this list has a 2549 // non-empty value. This may be used to include null fields in Patch 2550 // requests. 2551 NullFields []string `json:"-"` 2552} 2553 2554func (s *IpConfiguration) MarshalJSON() ([]byte, error) { 2555 type NoMethod IpConfiguration 2556 raw := NoMethod(*s) 2557 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2558} 2559 2560// IpMapping: Database instance IP Mapping. 2561type IpMapping struct { 2562 // IpAddress: The IP address assigned. 2563 IpAddress string `json:"ipAddress,omitempty"` 2564 2565 // TimeToRetire: The due time for this IP to be retired in RFC 3339 2566 // (https://tools.ietf.org/html/rfc3339) format, for example 2567 // **2012-11-15T16:19:00.094Z**. This field is only available when the 2568 // IP is scheduled to be retired. 2569 TimeToRetire string `json:"timeToRetire,omitempty"` 2570 2571 // Type: The type of this IP address. A **PRIMARY** address is a public 2572 // address that can accept incoming connections. A **PRIVATE** address 2573 // is a private address that can accept incoming connections. An 2574 // **OUTGOING** address is the source address of connections originating 2575 // from the instance, if supported. 2576 // 2577 // Possible values: 2578 // "SQL_IP_ADDRESS_TYPE_UNSPECIFIED" - This is an unknown IP address 2579 // type. 2580 // "PRIMARY" - IP address the customer is supposed to connect to. 2581 // Usually this is the load balancer's IP address 2582 // "OUTGOING" - Source IP address of the connection a read replica 2583 // establishes to its external primary instance. This IP address can be 2584 // allowlisted by the customer in case it has a firewall that filters 2585 // incoming connection to its on premises primary instance. 2586 // "PRIVATE" - Private IP used when using private IPs and network 2587 // peering. 2588 // "MIGRATED_1ST_GEN" - V1 IP of a migrated instance. We want the user 2589 // to decommission this IP as soon as the migration is complete. Note: 2590 // V1 instances with V1 ip addresses will be counted as PRIMARY. 2591 Type string `json:"type,omitempty"` 2592 2593 // ForceSendFields is a list of field names (e.g. "IpAddress") to 2594 // unconditionally include in API requests. By default, fields with 2595 // empty or default values are omitted from API requests. However, any 2596 // non-pointer, non-interface field appearing in ForceSendFields will be 2597 // sent to the server regardless of whether the field is empty or not. 2598 // This may be used to include empty fields in Patch requests. 2599 ForceSendFields []string `json:"-"` 2600 2601 // NullFields is a list of field names (e.g. "IpAddress") to include in 2602 // API requests with the JSON null value. By default, fields with empty 2603 // values are omitted from API requests. However, any field with an 2604 // empty value appearing in NullFields will be sent to the server as 2605 // null. It is an error if a field in this list has a non-empty value. 2606 // This may be used to include null fields in Patch requests. 2607 NullFields []string `json:"-"` 2608} 2609 2610func (s *IpMapping) MarshalJSON() ([]byte, error) { 2611 type NoMethod IpMapping 2612 raw := NoMethod(*s) 2613 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2614} 2615 2616// LocationPreference: Preferred location. This specifies where a Cloud 2617// SQL instance is located. Note that if the preferred location is not 2618// available, the instance will be located as close as possible within 2619// the region. Only one location may be specified. 2620type LocationPreference struct { 2621 // FollowGaeApplication: The App Engine application to follow, it must 2622 // be in the same region as the Cloud SQL instance. 2623 FollowGaeApplication string `json:"followGaeApplication,omitempty"` 2624 2625 // Kind: This is always **sql#locationPreference**. 2626 Kind string `json:"kind,omitempty"` 2627 2628 // SecondaryZone: The preferred Compute Engine zone for the 2629 // secondary/failover (for example: us-central1-a, us-central1-b, etc.). 2630 // Reserved for future use. 2631 SecondaryZone string `json:"secondaryZone,omitempty"` 2632 2633 // Zone: The preferred Compute Engine zone (for example: us-central1-a, 2634 // us-central1-b, etc.). 2635 Zone string `json:"zone,omitempty"` 2636 2637 // ForceSendFields is a list of field names (e.g. 2638 // "FollowGaeApplication") to unconditionally include in API requests. 2639 // By default, fields with empty or default values are omitted from API 2640 // requests. However, any non-pointer, non-interface field appearing in 2641 // ForceSendFields will be sent to the server regardless of whether the 2642 // field is empty or not. This may be used to include empty fields in 2643 // Patch requests. 2644 ForceSendFields []string `json:"-"` 2645 2646 // NullFields is a list of field names (e.g. "FollowGaeApplication") to 2647 // include in API requests with the JSON null value. By default, fields 2648 // with empty values are omitted from API requests. However, any field 2649 // with an empty value appearing in NullFields will be sent to the 2650 // server as null. It is an error if a field in this list has a 2651 // non-empty value. This may be used to include null fields in Patch 2652 // requests. 2653 NullFields []string `json:"-"` 2654} 2655 2656func (s *LocationPreference) MarshalJSON() ([]byte, error) { 2657 type NoMethod LocationPreference 2658 raw := NoMethod(*s) 2659 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2660} 2661 2662// MaintenanceWindow: Maintenance window. This specifies when a Cloud 2663// SQL instance is restarted for system maintenance purposes. 2664type MaintenanceWindow struct { 2665 // Day: day of week (1-7), starting on Monday. 2666 Day int64 `json:"day,omitempty"` 2667 2668 // Hour: hour of day - 0 to 23. 2669 Hour int64 `json:"hour,omitempty"` 2670 2671 // Kind: This is always **sql#maintenanceWindow**. 2672 Kind string `json:"kind,omitempty"` 2673 2674 // UpdateTrack: Maintenance timing setting: **canary** (Earlier) or 2675 // **stable** (Later). Learn more 2676 // (https://cloud.google.com/sql/docs/mysql/instance-settings#maintenance-timing-2ndgen). 2677 // 2678 // Possible values: 2679 // "SQL_UPDATE_TRACK_UNSPECIFIED" - This is an unknown maintenance 2680 // timing preference. 2681 // "canary" - For instance update that requires a restart, this update 2682 // track indicates your instance prefer to restart for new version early 2683 // in maintenance window. 2684 // "stable" - For instance update that requires a restart, this update 2685 // track indicates your instance prefer to let Cloud SQL choose the 2686 // timing of restart (within its Maintenance window, if applicable). 2687 UpdateTrack string `json:"updateTrack,omitempty"` 2688 2689 // ForceSendFields is a list of field names (e.g. "Day") to 2690 // unconditionally include in API requests. By default, fields with 2691 // empty or default values are omitted from API requests. However, any 2692 // non-pointer, non-interface field appearing in ForceSendFields will be 2693 // sent to the server regardless of whether the field is empty or not. 2694 // This may be used to include empty fields in Patch requests. 2695 ForceSendFields []string `json:"-"` 2696 2697 // NullFields is a list of field names (e.g. "Day") to include in API 2698 // requests with the JSON null value. By default, fields with empty 2699 // values are omitted from API requests. However, any field with an 2700 // empty value appearing in NullFields will be sent to the server as 2701 // null. It is an error if a field in this list has a non-empty value. 2702 // This may be used to include null fields in Patch requests. 2703 NullFields []string `json:"-"` 2704} 2705 2706func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) { 2707 type NoMethod MaintenanceWindow 2708 raw := NoMethod(*s) 2709 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2710} 2711 2712// MySqlReplicaConfiguration: Read-replica configuration specific to 2713// MySQL databases. 2714type MySqlReplicaConfiguration struct { 2715 // CaCertificate: PEM representation of the trusted CA's x509 2716 // certificate. 2717 CaCertificate string `json:"caCertificate,omitempty"` 2718 2719 // ClientCertificate: PEM representation of the replica's x509 2720 // certificate. 2721 ClientCertificate string `json:"clientCertificate,omitempty"` 2722 2723 // ClientKey: PEM representation of the replica's private key. The 2724 // corresponsing public key is encoded in the client's certificate. 2725 ClientKey string `json:"clientKey,omitempty"` 2726 2727 // ConnectRetryInterval: Seconds to wait between connect retries. 2728 // MySQL's default is 60 seconds. 2729 ConnectRetryInterval int64 `json:"connectRetryInterval,omitempty"` 2730 2731 // DumpFilePath: Path to a SQL dump file in Google Cloud Storage from 2732 // which the replica instance is to be created. The URI is in the form 2733 // gs://bucketName/fileName. Compressed gzip files (.gz) are also 2734 // supported. Dumps have the binlog co-ordinates from which replication 2735 // begins. This can be accomplished by setting --master-data to 1 when 2736 // using mysqldump. 2737 DumpFilePath string `json:"dumpFilePath,omitempty"` 2738 2739 // Kind: This is always **sql#mysqlReplicaConfiguration**. 2740 Kind string `json:"kind,omitempty"` 2741 2742 // MasterHeartbeatPeriod: Interval in milliseconds between replication 2743 // heartbeats. 2744 MasterHeartbeatPeriod int64 `json:"masterHeartbeatPeriod,omitempty,string"` 2745 2746 // Password: The password for the replication connection. 2747 Password string `json:"password,omitempty"` 2748 2749 // SslCipher: A list of permissible ciphers to use for SSL encryption. 2750 SslCipher string `json:"sslCipher,omitempty"` 2751 2752 // Username: The username for the replication connection. 2753 Username string `json:"username,omitempty"` 2754 2755 // VerifyServerCertificate: Whether or not to check the primary 2756 // instance's Common Name value in the certificate that it sends during 2757 // the SSL handshake. 2758 VerifyServerCertificate bool `json:"verifyServerCertificate,omitempty"` 2759 2760 // ForceSendFields is a list of field names (e.g. "CaCertificate") to 2761 // unconditionally include in API requests. By default, fields with 2762 // empty or default values are omitted from API requests. However, any 2763 // non-pointer, non-interface field appearing in ForceSendFields will be 2764 // sent to the server regardless of whether the field is empty or not. 2765 // This may be used to include empty fields in Patch requests. 2766 ForceSendFields []string `json:"-"` 2767 2768 // NullFields is a list of field names (e.g. "CaCertificate") to include 2769 // in API requests with the JSON null value. By default, fields with 2770 // empty values are omitted from API requests. However, any field with 2771 // an empty value appearing in NullFields will be sent to the server as 2772 // null. It is an error if a field in this list has a non-empty value. 2773 // This may be used to include null fields in Patch requests. 2774 NullFields []string `json:"-"` 2775} 2776 2777func (s *MySqlReplicaConfiguration) MarshalJSON() ([]byte, error) { 2778 type NoMethod MySqlReplicaConfiguration 2779 raw := NoMethod(*s) 2780 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2781} 2782 2783// MySqlSyncConfig: MySQL-specific external server sync settings. 2784type MySqlSyncConfig struct { 2785 // InitialSyncFlags: Flags to use for the initial dump. 2786 InitialSyncFlags []*SyncFlags `json:"initialSyncFlags,omitempty"` 2787 2788 // ForceSendFields is a list of field names (e.g. "InitialSyncFlags") to 2789 // unconditionally include in API requests. By default, fields with 2790 // empty or default values are omitted from API requests. However, any 2791 // non-pointer, non-interface field appearing in ForceSendFields will be 2792 // sent to the server regardless of whether the field is empty or not. 2793 // This may be used to include empty fields in Patch requests. 2794 ForceSendFields []string `json:"-"` 2795 2796 // NullFields is a list of field names (e.g. "InitialSyncFlags") to 2797 // include in API requests with the JSON null value. By default, fields 2798 // with empty values are omitted from API requests. However, any field 2799 // with an empty value appearing in NullFields will be sent to the 2800 // server as null. It is an error if a field in this list has a 2801 // non-empty value. This may be used to include null fields in Patch 2802 // requests. 2803 NullFields []string `json:"-"` 2804} 2805 2806func (s *MySqlSyncConfig) MarshalJSON() ([]byte, error) { 2807 type NoMethod MySqlSyncConfig 2808 raw := NoMethod(*s) 2809 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2810} 2811 2812// OnPremisesConfiguration: On-premises instance configuration. 2813type OnPremisesConfiguration struct { 2814 // CaCertificate: PEM representation of the trusted CA's x509 2815 // certificate. 2816 CaCertificate string `json:"caCertificate,omitempty"` 2817 2818 // ClientCertificate: PEM representation of the replica's x509 2819 // certificate. 2820 ClientCertificate string `json:"clientCertificate,omitempty"` 2821 2822 // ClientKey: PEM representation of the replica's private key. The 2823 // corresponsing public key is encoded in the client's certificate. 2824 ClientKey string `json:"clientKey,omitempty"` 2825 2826 // DumpFilePath: The dump file to create the Cloud SQL replica. 2827 DumpFilePath string `json:"dumpFilePath,omitempty"` 2828 2829 // HostPort: The host and port of the on-premises instance in host:port 2830 // format 2831 HostPort string `json:"hostPort,omitempty"` 2832 2833 // Kind: This is always **sql#onPremisesConfiguration**. 2834 Kind string `json:"kind,omitempty"` 2835 2836 // Password: The password for connecting to on-premises instance. 2837 Password string `json:"password,omitempty"` 2838 2839 // SourceInstance: The reference to Cloud SQL instance if the source is 2840 // Cloud SQL. 2841 SourceInstance *InstanceReference `json:"sourceInstance,omitempty"` 2842 2843 // Username: The username for connecting to on-premises instance. 2844 Username string `json:"username,omitempty"` 2845 2846 // ForceSendFields is a list of field names (e.g. "CaCertificate") to 2847 // unconditionally include in API requests. By default, fields with 2848 // empty or default values are omitted from API requests. However, any 2849 // non-pointer, non-interface field appearing in ForceSendFields will be 2850 // sent to the server regardless of whether the field is empty or not. 2851 // This may be used to include empty fields in Patch requests. 2852 ForceSendFields []string `json:"-"` 2853 2854 // NullFields is a list of field names (e.g. "CaCertificate") to include 2855 // in API requests with the JSON null value. By default, fields with 2856 // empty values are omitted from API requests. However, any field with 2857 // an empty value appearing in NullFields will be sent to the server as 2858 // null. It is an error if a field in this list has a non-empty value. 2859 // This may be used to include null fields in Patch requests. 2860 NullFields []string `json:"-"` 2861} 2862 2863func (s *OnPremisesConfiguration) MarshalJSON() ([]byte, error) { 2864 type NoMethod OnPremisesConfiguration 2865 raw := NoMethod(*s) 2866 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2867} 2868 2869// Operation: An Operation resource. For successful operations that 2870// return an Operation resource, only the fields relevant to the 2871// operation are populated in the resource. 2872type Operation struct { 2873 // BackupContext: The context for backup operation, if applicable. 2874 BackupContext *BackupContext `json:"backupContext,omitempty"` 2875 2876 // EndTime: The time this operation finished in UTC timezone in RFC 3339 2877 // (https://tools.ietf.org/html/rfc3339) format, for example 2878 // **2012-11-15T16:19:00.094Z**. 2879 EndTime string `json:"endTime,omitempty"` 2880 2881 // Error: If errors occurred during processing of this operation, this 2882 // field will be populated. 2883 Error *OperationErrors `json:"error,omitempty"` 2884 2885 // ExportContext: The context for export operation, if applicable. 2886 ExportContext *ExportContext `json:"exportContext,omitempty"` 2887 2888 // ImportContext: The context for import operation, if applicable. 2889 ImportContext *ImportContext `json:"importContext,omitempty"` 2890 2891 // InsertTime: The time this operation was enqueued in UTC timezone in 2892 // RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example 2893 // **2012-11-15T16:19:00.094Z**. 2894 InsertTime string `json:"insertTime,omitempty"` 2895 2896 // Kind: This is always **sql#operation**. 2897 Kind string `json:"kind,omitempty"` 2898 2899 // Name: An identifier that uniquely identifies the operation. You can 2900 // use this identifier to retrieve the Operations resource that has 2901 // information about the operation. 2902 Name string `json:"name,omitempty"` 2903 2904 // OperationType: The type of the operation. Valid values are: * 2905 // **CREATE** * **DELETE** * **UPDATE** * **RESTART** * **IMPORT** * 2906 // **EXPORT** * **BACKUP_VOLUME** * **RESTORE_VOLUME** * **CREATE_USER** 2907 // * **DELETE_USER** * **CREATE_DATABASE** * **DELETE_DATABASE** 2908 // 2909 // Possible values: 2910 // "SQL_OPERATION_TYPE_UNSPECIFIED" - Unknown operation type. 2911 // "IMPORT" - Imports data into a Cloud SQL instance. 2912 // "EXPORT" - Exports data from a Cloud SQL instance to a Cloud 2913 // Storage bucket. 2914 // "CREATE" - Creates a new Cloud SQL instance. 2915 // "UPDATE" - Updates the settings of a Cloud SQL instance. 2916 // "DELETE" - Deletes a Cloud SQL instance. 2917 // "RESTART" - Restarts the Cloud SQL instance. 2918 // "BACKUP" 2919 // "SNAPSHOT" 2920 // "BACKUP_VOLUME" - Performs instance backup. 2921 // "DELETE_VOLUME" - Deletes an instance backup. 2922 // "RESTORE_VOLUME" - Restores an instance backup. 2923 // "INJECT_USER" - Injects a privileged user in mysql for MOB 2924 // instances. 2925 // "CLONE" - Clones a Cloud SQL instance. 2926 // "STOP_REPLICA" - Stops replication on a Cloud SQL read replica 2927 // instance. 2928 // "START_REPLICA" - Starts replication on a Cloud SQL read replica 2929 // instance. 2930 // "PROMOTE_REPLICA" - Promotes a Cloud SQL replica instance. 2931 // "CREATE_REPLICA" - Creates a Cloud SQL replica instance. 2932 // "CREATE_USER" - Creates a new user in a Cloud SQL instance. 2933 // "DELETE_USER" - Deletes a user from a Cloud SQL instance. 2934 // "UPDATE_USER" - Updates an existing user in a Cloud SQL instance. 2935 // "CREATE_DATABASE" - Creates a database in the Cloud SQL instance. 2936 // "DELETE_DATABASE" - Deletes a database in the Cloud SQL instance. 2937 // "UPDATE_DATABASE" - Updates a database in the Cloud SQL instance. 2938 // "FAILOVER" - Performs failover of an HA-enabled Cloud SQL failover 2939 // replica. 2940 // "DELETE_BACKUP" - Deletes the backup taken by a backup run. 2941 // "RECREATE_REPLICA" 2942 // "TRUNCATE_LOG" - Truncates a general or slow log table in MySQL. 2943 // "DEMOTE_MASTER" - Demotes the stand-alone instance to be a Cloud 2944 // SQL read replica for an external database server. 2945 // "MAINTENANCE" - Indicates that the instance is currently in 2946 // maintenance. Maintenance typically causes the instance to be 2947 // unavailable for 1-3 minutes. 2948 // "ENABLE_PRIVATE_IP" - This field is deprecated, and will be removed 2949 // in future version of API. 2950 // "DEFER_MAINTENANCE" 2951 // "CREATE_CLONE" - Creates clone instance. 2952 // "RESCHEDULE_MAINTENANCE" - Reschedule maintenance to another time. 2953 // "START_EXTERNAL_SYNC" - Starts external sync of a Cloud SQL EM 2954 // replica to an external primary instance. 2955 OperationType string `json:"operationType,omitempty"` 2956 2957 // SelfLink: The URI of this resource. 2958 SelfLink string `json:"selfLink,omitempty"` 2959 2960 // StartTime: The time this operation actually started in UTC timezone 2961 // in RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example 2962 // **2012-11-15T16:19:00.094Z**. 2963 StartTime string `json:"startTime,omitempty"` 2964 2965 // Status: The status of an operation. Valid values are: * **PENDING** * 2966 // **RUNNING** * **DONE** * **SQL_OPERATION_STATUS_UNSPECIFIED** 2967 // 2968 // Possible values: 2969 // "SQL_OPERATION_STATUS_UNSPECIFIED" - The state of the operation is 2970 // unknown. 2971 // "PENDING" - The operation has been queued, but has not started yet. 2972 // "RUNNING" - The operation is running. 2973 // "DONE" - The operation completed. 2974 Status string `json:"status,omitempty"` 2975 2976 // TargetId: Name of the database instance related to this operation. 2977 TargetId string `json:"targetId,omitempty"` 2978 2979 TargetLink string `json:"targetLink,omitempty"` 2980 2981 // TargetProject: The project ID of the target instance related to this 2982 // operation. 2983 TargetProject string `json:"targetProject,omitempty"` 2984 2985 // User: The email address of the user who initiated this operation. 2986 User string `json:"user,omitempty"` 2987 2988 // ServerResponse contains the HTTP response code and headers from the 2989 // server. 2990 googleapi.ServerResponse `json:"-"` 2991 2992 // ForceSendFields is a list of field names (e.g. "BackupContext") to 2993 // unconditionally include in API requests. By default, fields with 2994 // empty or default values are omitted from API requests. However, any 2995 // non-pointer, non-interface field appearing in ForceSendFields will be 2996 // sent to the server regardless of whether the field is empty or not. 2997 // This may be used to include empty fields in Patch requests. 2998 ForceSendFields []string `json:"-"` 2999 3000 // NullFields is a list of field names (e.g. "BackupContext") to include 3001 // in API requests with the JSON null value. By default, fields with 3002 // empty values are omitted from API requests. However, any field with 3003 // an empty value appearing in NullFields will be sent to the server as 3004 // null. It is an error if a field in this list has a non-empty value. 3005 // This may be used to include null fields in Patch requests. 3006 NullFields []string `json:"-"` 3007} 3008 3009func (s *Operation) MarshalJSON() ([]byte, error) { 3010 type NoMethod Operation 3011 raw := NoMethod(*s) 3012 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3013} 3014 3015// OperationError: Database instance operation error. 3016type OperationError struct { 3017 // Code: Identifies the specific error that occurred. 3018 Code string `json:"code,omitempty"` 3019 3020 // Kind: This is always **sql#operationError**. 3021 Kind string `json:"kind,omitempty"` 3022 3023 // Message: Additional information about the error encountered. 3024 Message string `json:"message,omitempty"` 3025 3026 // ForceSendFields is a list of field names (e.g. "Code") to 3027 // unconditionally include in API requests. By default, fields with 3028 // empty or default values are omitted from API requests. However, any 3029 // non-pointer, non-interface field appearing in ForceSendFields will be 3030 // sent to the server regardless of whether the field is empty or not. 3031 // This may be used to include empty fields in Patch requests. 3032 ForceSendFields []string `json:"-"` 3033 3034 // NullFields is a list of field names (e.g. "Code") to include in API 3035 // requests with the JSON null value. By default, fields with empty 3036 // values are omitted from API requests. However, any field with an 3037 // empty value appearing in NullFields will be sent to the server as 3038 // null. It is an error if a field in this list has a non-empty value. 3039 // This may be used to include null fields in Patch requests. 3040 NullFields []string `json:"-"` 3041} 3042 3043func (s *OperationError) MarshalJSON() ([]byte, error) { 3044 type NoMethod OperationError 3045 raw := NoMethod(*s) 3046 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3047} 3048 3049// OperationErrors: Database instance operation errors list wrapper. 3050type OperationErrors struct { 3051 // Errors: The list of errors encountered while processing this 3052 // operation. 3053 Errors []*OperationError `json:"errors,omitempty"` 3054 3055 // Kind: This is always **sql#operationErrors**. 3056 Kind string `json:"kind,omitempty"` 3057 3058 // ForceSendFields is a list of field names (e.g. "Errors") to 3059 // unconditionally include in API requests. By default, fields with 3060 // empty or default values are omitted from API requests. However, any 3061 // non-pointer, non-interface field appearing in ForceSendFields will be 3062 // sent to the server regardless of whether the field is empty or not. 3063 // This may be used to include empty fields in Patch requests. 3064 ForceSendFields []string `json:"-"` 3065 3066 // NullFields is a list of field names (e.g. "Errors") to include in API 3067 // requests with the JSON null value. By default, fields with empty 3068 // values are omitted from API requests. However, any field with an 3069 // empty value appearing in NullFields will be sent to the server as 3070 // null. It is an error if a field in this list has a non-empty value. 3071 // This may be used to include null fields in Patch requests. 3072 NullFields []string `json:"-"` 3073} 3074 3075func (s *OperationErrors) MarshalJSON() ([]byte, error) { 3076 type NoMethod OperationErrors 3077 raw := NoMethod(*s) 3078 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3079} 3080 3081// OperationsListResponse: Operations list response. 3082type OperationsListResponse struct { 3083 // Items: List of operation resources. 3084 Items []*Operation `json:"items,omitempty"` 3085 3086 // Kind: This is always **sql#operationsList**. 3087 Kind string `json:"kind,omitempty"` 3088 3089 // NextPageToken: The continuation token, used to page through large 3090 // result sets. Provide this value in a subsequent request to return the 3091 // next page of results. 3092 NextPageToken string `json:"nextPageToken,omitempty"` 3093 3094 // ServerResponse contains the HTTP response code and headers from the 3095 // server. 3096 googleapi.ServerResponse `json:"-"` 3097 3098 // ForceSendFields is a list of field names (e.g. "Items") to 3099 // unconditionally include in API requests. By default, fields with 3100 // empty or default values are omitted from API requests. However, any 3101 // non-pointer, non-interface field appearing in ForceSendFields will be 3102 // sent to the server regardless of whether the field is empty or not. 3103 // This may be used to include empty fields in Patch requests. 3104 ForceSendFields []string `json:"-"` 3105 3106 // NullFields is a list of field names (e.g. "Items") to include in API 3107 // requests with the JSON null value. By default, fields with empty 3108 // values are omitted from API requests. However, any field with an 3109 // empty value appearing in NullFields will be sent to the server as 3110 // null. It is an error if a field in this list has a non-empty value. 3111 // This may be used to include null fields in Patch requests. 3112 NullFields []string `json:"-"` 3113} 3114 3115func (s *OperationsListResponse) MarshalJSON() ([]byte, error) { 3116 type NoMethod OperationsListResponse 3117 raw := NoMethod(*s) 3118 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3119} 3120 3121// ReplicaConfiguration: Read-replica configuration for connecting to 3122// the primary instance. 3123type ReplicaConfiguration struct { 3124 // FailoverTarget: Specifies if the replica is the failover target. If 3125 // the field is set to **true** the replica will be designated as a 3126 // failover replica. In case the primary instance fails, the replica 3127 // instance will be promoted as the new primary instance. Only one 3128 // replica can be specified as failover target, and the replica has to 3129 // be in different zone with the primary instance. 3130 FailoverTarget bool `json:"failoverTarget,omitempty"` 3131 3132 // Kind: This is always **sql#replicaConfiguration**. 3133 Kind string `json:"kind,omitempty"` 3134 3135 // MysqlReplicaConfiguration: MySQL specific configuration when 3136 // replicating from a MySQL on-premises primary instance. Replication 3137 // configuration information such as the username, password, 3138 // certificates, and keys are not stored in the instance metadata. The 3139 // configuration information is used only to set up the replication 3140 // connection and is stored by MySQL in a file named **master.info** in 3141 // the data directory. 3142 MysqlReplicaConfiguration *MySqlReplicaConfiguration `json:"mysqlReplicaConfiguration,omitempty"` 3143 3144 // ForceSendFields is a list of field names (e.g. "FailoverTarget") to 3145 // unconditionally include in API requests. By default, fields with 3146 // empty or default values are omitted from API requests. However, any 3147 // non-pointer, non-interface field appearing in ForceSendFields will be 3148 // sent to the server regardless of whether the field is empty or not. 3149 // This may be used to include empty fields in Patch requests. 3150 ForceSendFields []string `json:"-"` 3151 3152 // NullFields is a list of field names (e.g. "FailoverTarget") to 3153 // include in API requests with the JSON null value. By default, fields 3154 // with empty values are omitted from API requests. However, any field 3155 // with an empty value appearing in NullFields will be sent to the 3156 // server as null. It is an error if a field in this list has a 3157 // non-empty value. This may be used to include null fields in Patch 3158 // requests. 3159 NullFields []string `json:"-"` 3160} 3161 3162func (s *ReplicaConfiguration) MarshalJSON() ([]byte, error) { 3163 type NoMethod ReplicaConfiguration 3164 raw := NoMethod(*s) 3165 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3166} 3167 3168type Reschedule struct { 3169 // RescheduleType: Required. The type of the reschedule. 3170 // 3171 // Possible values: 3172 // "RESCHEDULE_TYPE_UNSPECIFIED" 3173 // "IMMEDIATE" - Reschedules maintenance to happen now (within 5 3174 // minutes). 3175 // "NEXT_AVAILABLE_WINDOW" - Reschedules maintenance to occur within 3176 // one week from the originally scheduled day and time. 3177 // "SPECIFIC_TIME" - Reschedules maintenance to a specific time and 3178 // day. 3179 RescheduleType string `json:"rescheduleType,omitempty"` 3180 3181 // ScheduleTime: Optional. Timestamp when the maintenance shall be 3182 // rescheduled to if reschedule_type=SPECIFIC_TIME, in RFC 3339 3183 // (https://tools.ietf.org/html/rfc3339) format, for example 3184 // **2012-11-15T16:19:00.094Z**. 3185 ScheduleTime string `json:"scheduleTime,omitempty"` 3186 3187 // ForceSendFields is a list of field names (e.g. "RescheduleType") to 3188 // unconditionally include in API requests. By default, fields with 3189 // empty or default values are omitted from API requests. However, any 3190 // non-pointer, non-interface field appearing in ForceSendFields will be 3191 // sent to the server regardless of whether the field is empty or not. 3192 // This may be used to include empty fields in Patch requests. 3193 ForceSendFields []string `json:"-"` 3194 3195 // NullFields is a list of field names (e.g. "RescheduleType") to 3196 // include in API requests with the JSON null value. By default, fields 3197 // with empty values are omitted from API requests. However, any field 3198 // with an empty value appearing in NullFields will be sent to the 3199 // server as null. It is an error if a field in this list has a 3200 // non-empty value. This may be used to include null fields in Patch 3201 // requests. 3202 NullFields []string `json:"-"` 3203} 3204 3205func (s *Reschedule) MarshalJSON() ([]byte, error) { 3206 type NoMethod Reschedule 3207 raw := NoMethod(*s) 3208 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3209} 3210 3211// RestoreBackupContext: Database instance restore from backup context. 3212// Backup context contains source instance id and project id. 3213type RestoreBackupContext struct { 3214 // BackupRunId: The ID of the backup run to restore from. 3215 BackupRunId int64 `json:"backupRunId,omitempty,string"` 3216 3217 // InstanceId: The ID of the instance that the backup was taken from. 3218 InstanceId string `json:"instanceId,omitempty"` 3219 3220 // Kind: This is always **sql#restoreBackupContext**. 3221 Kind string `json:"kind,omitempty"` 3222 3223 // Project: The full project ID of the source instance. 3224 Project string `json:"project,omitempty"` 3225 3226 // ForceSendFields is a list of field names (e.g. "BackupRunId") to 3227 // unconditionally include in API requests. By default, fields with 3228 // empty or default values are omitted from API requests. However, any 3229 // non-pointer, non-interface field appearing in ForceSendFields will be 3230 // sent to the server regardless of whether the field is empty or not. 3231 // This may be used to include empty fields in Patch requests. 3232 ForceSendFields []string `json:"-"` 3233 3234 // NullFields is a list of field names (e.g. "BackupRunId") to include 3235 // in API requests with the JSON null value. By default, fields with 3236 // empty values are omitted from API requests. However, any field with 3237 // an empty value appearing in NullFields will be sent to the server as 3238 // null. It is an error if a field in this list has a non-empty value. 3239 // This may be used to include null fields in Patch requests. 3240 NullFields []string `json:"-"` 3241} 3242 3243func (s *RestoreBackupContext) MarshalJSON() ([]byte, error) { 3244 type NoMethod RestoreBackupContext 3245 raw := NoMethod(*s) 3246 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3247} 3248 3249// RotateServerCaContext: Instance rotate server CA context. 3250type RotateServerCaContext struct { 3251 // Kind: This is always **sql#rotateServerCaContext**. 3252 Kind string `json:"kind,omitempty"` 3253 3254 // NextVersion: The fingerprint of the next version to be rotated to. If 3255 // left unspecified, will be rotated to the most recently added server 3256 // CA version. 3257 NextVersion string `json:"nextVersion,omitempty"` 3258 3259 // ForceSendFields is a list of field names (e.g. "Kind") to 3260 // unconditionally include in API requests. By default, fields with 3261 // empty or default values are omitted from API requests. However, any 3262 // non-pointer, non-interface field appearing in ForceSendFields will be 3263 // sent to the server regardless of whether the field is empty or not. 3264 // This may be used to include empty fields in Patch requests. 3265 ForceSendFields []string `json:"-"` 3266 3267 // NullFields is a list of field names (e.g. "Kind") to include in API 3268 // requests with the JSON null value. By default, fields with empty 3269 // values are omitted from API requests. However, any field with an 3270 // empty value appearing in NullFields will be sent to the server as 3271 // null. It is an error if a field in this list has a non-empty value. 3272 // This may be used to include null fields in Patch requests. 3273 NullFields []string `json:"-"` 3274} 3275 3276func (s *RotateServerCaContext) MarshalJSON() ([]byte, error) { 3277 type NoMethod RotateServerCaContext 3278 raw := NoMethod(*s) 3279 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3280} 3281 3282// Settings: Database instance settings. 3283type Settings struct { 3284 // ActivationPolicy: The activation policy specifies when the instance 3285 // is activated; it is applicable only when the instance state is 3286 // RUNNABLE. Valid values: * **ALWAYS**: The instance is on, and remains 3287 // so even in the absence of connection requests. * **NEVER**: The 3288 // instance is off; it is not activated, even if a connection request 3289 // arrives. 3290 // 3291 // Possible values: 3292 // "SQL_ACTIVATION_POLICY_UNSPECIFIED" - Unknown activation plan. 3293 // "ALWAYS" - The instance is always up and running. 3294 // "NEVER" - The instance never starts. 3295 // "ON_DEMAND" - The instance starts upon receiving requests. 3296 ActivationPolicy string `json:"activationPolicy,omitempty"` 3297 3298 // ActiveDirectoryConfig: Active Directory configuration, relevant only 3299 // for Cloud SQL for SQL Server. 3300 ActiveDirectoryConfig *SqlActiveDirectoryConfig `json:"activeDirectoryConfig,omitempty"` 3301 3302 // AuthorizedGaeApplications: The App Engine app IDs that can access 3303 // this instance. (Deprecated) Applied to First Generation instances 3304 // only. 3305 AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"` 3306 3307 // AvailabilityType: Availability type. Potential values: * **ZONAL**: 3308 // The instance serves data from only one zone. Outages in that zone 3309 // affect data accessibility. * **REGIONAL**: The instance can serve 3310 // data from more than one zone in a region (it is highly available)./ 3311 // For more information, see Overview of the High Availability 3312 // Configuration 3313 // (https://cloud.google.com/sql/docs/mysql/high-availability). 3314 // 3315 // Possible values: 3316 // "SQL_AVAILABILITY_TYPE_UNSPECIFIED" - This is an unknown 3317 // Availability type. 3318 // "ZONAL" - Zonal available instance. 3319 // "REGIONAL" - Regional available instance. 3320 AvailabilityType string `json:"availabilityType,omitempty"` 3321 3322 // BackupConfiguration: The daily backup configuration for the instance. 3323 BackupConfiguration *BackupConfiguration `json:"backupConfiguration,omitempty"` 3324 3325 // Collation: The name of server Instance collation. 3326 Collation string `json:"collation,omitempty"` 3327 3328 // CrashSafeReplicationEnabled: Configuration specific to read replica 3329 // instances. Indicates whether database flags for crash-safe 3330 // replication are enabled. This property was only applicable to First 3331 // Generation instances. 3332 CrashSafeReplicationEnabled bool `json:"crashSafeReplicationEnabled,omitempty"` 3333 3334 // DataDiskSizeGb: The size of data disk, in GB. The data disk size 3335 // minimum is 10GB. 3336 DataDiskSizeGb int64 `json:"dataDiskSizeGb,omitempty,string"` 3337 3338 // DataDiskType: The type of data disk: **PD_SSD** (default) or 3339 // **PD_HDD**. Not used for First Generation instances. 3340 // 3341 // Possible values: 3342 // "SQL_DATA_DISK_TYPE_UNSPECIFIED" - This is an unknown data disk 3343 // type. 3344 // "PD_SSD" - An SSD data disk. 3345 // "PD_HDD" - An HDD data disk. 3346 // "OBSOLETE_LOCAL_SSD" - This field is deprecated and will be removed 3347 // from a future version of the API. 3348 DataDiskType string `json:"dataDiskType,omitempty"` 3349 3350 // DatabaseFlags: The database flags passed to the instance at startup. 3351 DatabaseFlags []*DatabaseFlags `json:"databaseFlags,omitempty"` 3352 3353 // DatabaseReplicationEnabled: Configuration specific to read replica 3354 // instances. Indicates whether replication is enabled or not. 3355 DatabaseReplicationEnabled bool `json:"databaseReplicationEnabled,omitempty"` 3356 3357 // DenyMaintenancePeriods: Deny maintenance periods 3358 DenyMaintenancePeriods []*DenyMaintenancePeriod `json:"denyMaintenancePeriods,omitempty"` 3359 3360 // InsightsConfig: Insights configuration, for now relevant only for 3361 // Postgres. 3362 InsightsConfig *InsightsConfig `json:"insightsConfig,omitempty"` 3363 3364 // IpConfiguration: The settings for IP Management. This allows to 3365 // enable or disable the instance IP and manage which external networks 3366 // can connect to the instance. The IPv4 address cannot be disabled for 3367 // Second Generation instances. 3368 IpConfiguration *IpConfiguration `json:"ipConfiguration,omitempty"` 3369 3370 // Kind: This is always **sql#settings**. 3371 Kind string `json:"kind,omitempty"` 3372 3373 // LocationPreference: The location preference settings. This allows the 3374 // instance to be located as near as possible to either an App Engine 3375 // app or Compute Engine zone for better performance. App Engine 3376 // co-location was only applicable to First Generation instances. 3377 LocationPreference *LocationPreference `json:"locationPreference,omitempty"` 3378 3379 // MaintenanceWindow: The maintenance window for this instance. This 3380 // specifies when the instance can be restarted for maintenance 3381 // purposes. 3382 MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` 3383 3384 // PricingPlan: The pricing plan for this instance. This can be either 3385 // **PER_USE** or **PACKAGE**. Only **PER_USE** is supported for Second 3386 // Generation instances. 3387 // 3388 // Possible values: 3389 // "SQL_PRICING_PLAN_UNSPECIFIED" - This is an unknown pricing plan 3390 // for this instance. 3391 // "PACKAGE" - The instance is billed at a monthly flat rate. 3392 // "PER_USE" - The instance is billed per usage. 3393 PricingPlan string `json:"pricingPlan,omitempty"` 3394 3395 // ReplicationType: The type of replication this instance uses. This can 3396 // be either **ASYNCHRONOUS** or **SYNCHRONOUS**. (Deprecated) This 3397 // property was only applicable to First Generation instances. 3398 // 3399 // Possible values: 3400 // "SQL_REPLICATION_TYPE_UNSPECIFIED" - This is an unknown replication 3401 // type for a Cloud SQL instance. 3402 // "SYNCHRONOUS" - The synchronous replication mode for First 3403 // Generation instances. It is the default value. 3404 // "ASYNCHRONOUS" - The asynchronous replication mode for First 3405 // Generation instances. It provides a slight performance gain, but if 3406 // an outage occurs while this option is set to asynchronous, you can 3407 // lose up to a few seconds of updates to your data. 3408 ReplicationType string `json:"replicationType,omitempty"` 3409 3410 // SettingsVersion: The version of instance settings. This is a required 3411 // field for update method to make sure concurrent updates are handled 3412 // properly. During update, use the most recent settingsVersion value 3413 // for this instance and do not try to update this value. 3414 SettingsVersion int64 `json:"settingsVersion,omitempty,string"` 3415 3416 // SqlServerAuditConfig: SQL Server specific audit configuration. 3417 SqlServerAuditConfig *SqlServerAuditConfig `json:"sqlServerAuditConfig,omitempty"` 3418 3419 // StorageAutoResize: Configuration to increase storage size 3420 // automatically. The default value is true. 3421 StorageAutoResize *bool `json:"storageAutoResize,omitempty"` 3422 3423 // StorageAutoResizeLimit: The maximum size to which storage capacity 3424 // can be automatically increased. The default value is 0, which 3425 // specifies that there is no limit. 3426 StorageAutoResizeLimit int64 `json:"storageAutoResizeLimit,omitempty,string"` 3427 3428 // Tier: The tier (or machine type) for this instance, for example 3429 // **db-custom-1-3840**. 3430 Tier string `json:"tier,omitempty"` 3431 3432 // UserLabels: User-provided labels, represented as a dictionary where 3433 // each label is a single key value pair. 3434 UserLabels map[string]string `json:"userLabels,omitempty"` 3435 3436 // ForceSendFields is a list of field names (e.g. "ActivationPolicy") to 3437 // unconditionally include in API requests. By default, fields with 3438 // empty or default values are omitted from API requests. However, any 3439 // non-pointer, non-interface field appearing in ForceSendFields will be 3440 // sent to the server regardless of whether the field is empty or not. 3441 // This may be used to include empty fields in Patch requests. 3442 ForceSendFields []string `json:"-"` 3443 3444 // NullFields is a list of field names (e.g. "ActivationPolicy") to 3445 // include in API requests with the JSON null value. By default, fields 3446 // with empty values are omitted from API requests. However, any field 3447 // with an empty value appearing in NullFields will be sent to the 3448 // server as null. It is an error if a field in this list has a 3449 // non-empty value. This may be used to include null fields in Patch 3450 // requests. 3451 NullFields []string `json:"-"` 3452} 3453 3454func (s *Settings) MarshalJSON() ([]byte, error) { 3455 type NoMethod Settings 3456 raw := NoMethod(*s) 3457 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3458} 3459 3460// SqlActiveDirectoryConfig: Active Directory configuration, relevant 3461// only for Cloud SQL for SQL Server. 3462type SqlActiveDirectoryConfig struct { 3463 // Domain: The name of the domain (e.g., mydomain.com). 3464 Domain string `json:"domain,omitempty"` 3465 3466 // Kind: This is always sql#activeDirectoryConfig. 3467 Kind string `json:"kind,omitempty"` 3468 3469 // ForceSendFields is a list of field names (e.g. "Domain") to 3470 // unconditionally include in API requests. By default, fields with 3471 // empty or default values are omitted from API requests. However, any 3472 // non-pointer, non-interface field appearing in ForceSendFields will be 3473 // sent to the server regardless of whether the field is empty or not. 3474 // This may be used to include empty fields in Patch requests. 3475 ForceSendFields []string `json:"-"` 3476 3477 // NullFields is a list of field names (e.g. "Domain") to include in API 3478 // requests with the JSON null value. By default, fields with empty 3479 // values are omitted from API requests. However, any field with an 3480 // empty value appearing in NullFields will be sent to the server as 3481 // null. It is an error if a field in this list has a non-empty value. 3482 // This may be used to include null fields in Patch requests. 3483 NullFields []string `json:"-"` 3484} 3485 3486func (s *SqlActiveDirectoryConfig) MarshalJSON() ([]byte, error) { 3487 type NoMethod SqlActiveDirectoryConfig 3488 raw := NoMethod(*s) 3489 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3490} 3491 3492// SqlExternalSyncSettingError: External primary instance migration 3493// setting error/warning. 3494type SqlExternalSyncSettingError struct { 3495 // Detail: Additional information about the error encountered. 3496 Detail string `json:"detail,omitempty"` 3497 3498 // Kind: Can be **sql#externalSyncSettingError** or 3499 // **sql#externalSyncSettingWarning**. 3500 Kind string `json:"kind,omitempty"` 3501 3502 // Type: Identifies the specific error that occurred. 3503 // 3504 // Possible values: 3505 // "SQL_EXTERNAL_SYNC_SETTING_ERROR_TYPE_UNSPECIFIED" 3506 // "CONNECTION_FAILURE" 3507 // "BINLOG_NOT_ENABLED" 3508 // "INCOMPATIBLE_DATABASE_VERSION" 3509 // "REPLICA_ALREADY_SETUP" 3510 // "INSUFFICIENT_PRIVILEGE" 3511 // "UNSUPPORTED_MIGRATION_TYPE" - Unsupported migration type. 3512 // "NO_PGLOGICAL_INSTALLED" - No pglogical extension installed on 3513 // databases, applicable for postgres. 3514 // "PGLOGICAL_NODE_ALREADY_EXISTS" - pglogical node already exists on 3515 // databases, applicable for postgres. 3516 // "INVALID_WAL_LEVEL" - The value of parameter wal_level is not set 3517 // to logical. 3518 // "INVALID_SHARED_PRELOAD_LIBRARY" - The value of parameter 3519 // shared_preload_libraries does not include pglogical. 3520 // "INSUFFICIENT_MAX_REPLICATION_SLOTS" - The value of parameter 3521 // max_replication_slots is not sufficient. 3522 // "INSUFFICIENT_MAX_WAL_SENDERS" - The value of parameter 3523 // max_wal_senders is not sufficient. 3524 // "INSUFFICIENT_MAX_WORKER_PROCESSES" - The value of parameter 3525 // max_worker_processes is not sufficient. 3526 // "UNSUPPORTED_EXTENSIONS" - Extensions installed are either not 3527 // supported or having unsupported versions 3528 // "INVALID_RDS_LOGICAL_REPLICATION" - The value of parameter 3529 // rds.logical_replication is not set to 1. 3530 // "INVALID_LOGGING_SETUP" - The primary instance logging setup 3531 // doesn't allow EM sync. 3532 // "INVALID_DB_PARAM" - The primary instance database parameter setup 3533 // doesn't allow EM sync. 3534 // "UNSUPPORTED_GTID_MODE" - The gtid_mode is not supported, 3535 // applicable for MySQL. 3536 // "SQLSERVER_AGENT_NOT_RUNNING" - SQL Server Agent is not running. 3537 // "UNSUPPORTED_TABLE_DEFINITION" - The table definition is not 3538 // support due to missing primary key or replica identity, applicable 3539 // for postgres. 3540 // "UNSUPPORTED_DEFINER" - The customer has a definer that will break 3541 // EM setup. 3542 // "SQLSERVER_SERVERNAME_MISMATCH" - SQL Server @@SERVERNAME does not 3543 // match actual host name 3544 // "PRIMARY_ALREADY_SETUP" - The primary instance has been setup and 3545 // will fail the setup. 3546 // "UNSUPPORTED_BINLOG_FORMAT" - The primary instance has unsupported 3547 // binary log format. 3548 // "BINLOG_RETENTION_SETTING" - The primary instance's binary log 3549 // retention setting. 3550 Type string `json:"type,omitempty"` 3551 3552 // ForceSendFields is a list of field names (e.g. "Detail") to 3553 // unconditionally include in API requests. By default, fields with 3554 // empty or default values are omitted from API requests. However, any 3555 // non-pointer, non-interface field appearing in ForceSendFields will be 3556 // sent to the server regardless of whether the field is empty or not. 3557 // This may be used to include empty fields in Patch requests. 3558 ForceSendFields []string `json:"-"` 3559 3560 // NullFields is a list of field names (e.g. "Detail") to include in API 3561 // requests with the JSON null value. By default, fields with empty 3562 // values are omitted from API requests. However, any field with an 3563 // empty value appearing in NullFields will be sent to the server as 3564 // null. It is an error if a field in this list has a non-empty value. 3565 // This may be used to include null fields in Patch requests. 3566 NullFields []string `json:"-"` 3567} 3568 3569func (s *SqlExternalSyncSettingError) MarshalJSON() ([]byte, error) { 3570 type NoMethod SqlExternalSyncSettingError 3571 raw := NoMethod(*s) 3572 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3573} 3574 3575// SqlInstancesRescheduleMaintenanceRequestBody: Reschedule options for 3576// maintenance windows. 3577type SqlInstancesRescheduleMaintenanceRequestBody struct { 3578 // Reschedule: Required. The type of the reschedule the user wants. 3579 Reschedule *Reschedule `json:"reschedule,omitempty"` 3580 3581 // ForceSendFields is a list of field names (e.g. "Reschedule") to 3582 // unconditionally include in API requests. By default, fields with 3583 // empty or default values are omitted from API requests. However, any 3584 // non-pointer, non-interface field appearing in ForceSendFields will be 3585 // sent to the server regardless of whether the field is empty or not. 3586 // This may be used to include empty fields in Patch requests. 3587 ForceSendFields []string `json:"-"` 3588 3589 // NullFields is a list of field names (e.g. "Reschedule") to include in 3590 // API requests with the JSON null value. By default, fields with empty 3591 // values are omitted from API requests. However, any field with an 3592 // empty value appearing in NullFields will be sent to the server as 3593 // null. It is an error if a field in this list has a non-empty value. 3594 // This may be used to include null fields in Patch requests. 3595 NullFields []string `json:"-"` 3596} 3597 3598func (s *SqlInstancesRescheduleMaintenanceRequestBody) MarshalJSON() ([]byte, error) { 3599 type NoMethod SqlInstancesRescheduleMaintenanceRequestBody 3600 raw := NoMethod(*s) 3601 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3602} 3603 3604type SqlInstancesStartExternalSyncRequest struct { 3605 // MysqlSyncConfig: MySQL-specific settings for start external sync. 3606 MysqlSyncConfig *MySqlSyncConfig `json:"mysqlSyncConfig,omitempty"` 3607 3608 // SkipVerification: Whether to skip the verification step (VESS). 3609 SkipVerification bool `json:"skipVerification,omitempty"` 3610 3611 // SyncMode: External sync mode. 3612 // 3613 // Possible values: 3614 // "EXTERNAL_SYNC_MODE_UNSPECIFIED" - Unknown external sync mode, will 3615 // be defaulted to ONLINE mode 3616 // "ONLINE" - Online external sync will set up replication after 3617 // initial data external sync 3618 // "OFFLINE" - Offline external sync only dumps and loads a one-time 3619 // snapshot of the primary instance's data 3620 SyncMode string `json:"syncMode,omitempty"` 3621 3622 // ForceSendFields is a list of field names (e.g. "MysqlSyncConfig") to 3623 // unconditionally include in API requests. By default, fields with 3624 // empty or default values are omitted from API requests. However, any 3625 // non-pointer, non-interface field appearing in ForceSendFields will be 3626 // sent to the server regardless of whether the field is empty or not. 3627 // This may be used to include empty fields in Patch requests. 3628 ForceSendFields []string `json:"-"` 3629 3630 // NullFields is a list of field names (e.g. "MysqlSyncConfig") to 3631 // include in API requests with the JSON null value. By default, fields 3632 // with empty values are omitted from API requests. However, any field 3633 // with an empty value appearing in NullFields will be sent to the 3634 // server as null. It is an error if a field in this list has a 3635 // non-empty value. This may be used to include null fields in Patch 3636 // requests. 3637 NullFields []string `json:"-"` 3638} 3639 3640func (s *SqlInstancesStartExternalSyncRequest) MarshalJSON() ([]byte, error) { 3641 type NoMethod SqlInstancesStartExternalSyncRequest 3642 raw := NoMethod(*s) 3643 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3644} 3645 3646type SqlInstancesVerifyExternalSyncSettingsRequest struct { 3647 // MysqlSyncConfig: Optional. MySQL-specific settings for start external 3648 // sync. 3649 MysqlSyncConfig *MySqlSyncConfig `json:"mysqlSyncConfig,omitempty"` 3650 3651 // SyncMode: External sync mode 3652 // 3653 // Possible values: 3654 // "EXTERNAL_SYNC_MODE_UNSPECIFIED" - Unknown external sync mode, will 3655 // be defaulted to ONLINE mode 3656 // "ONLINE" - Online external sync will set up replication after 3657 // initial data external sync 3658 // "OFFLINE" - Offline external sync only dumps and loads a one-time 3659 // snapshot of the primary instance's data 3660 SyncMode string `json:"syncMode,omitempty"` 3661 3662 // VerifyConnectionOnly: Flag to enable verifying connection only 3663 VerifyConnectionOnly bool `json:"verifyConnectionOnly,omitempty"` 3664 3665 // VerifyReplicationOnly: Optional. Flag to verify settings required by 3666 // replication setup only 3667 VerifyReplicationOnly bool `json:"verifyReplicationOnly,omitempty"` 3668 3669 // ForceSendFields is a list of field names (e.g. "MysqlSyncConfig") to 3670 // unconditionally include in API requests. By default, fields with 3671 // empty or default values are omitted from API requests. However, any 3672 // non-pointer, non-interface field appearing in ForceSendFields will be 3673 // sent to the server regardless of whether the field is empty or not. 3674 // This may be used to include empty fields in Patch requests. 3675 ForceSendFields []string `json:"-"` 3676 3677 // NullFields is a list of field names (e.g. "MysqlSyncConfig") to 3678 // include in API requests with the JSON null value. By default, fields 3679 // with empty values are omitted from API requests. However, any field 3680 // with an empty value appearing in NullFields will be sent to the 3681 // server as null. It is an error if a field in this list has a 3682 // non-empty value. This may be used to include null fields in Patch 3683 // requests. 3684 NullFields []string `json:"-"` 3685} 3686 3687func (s *SqlInstancesVerifyExternalSyncSettingsRequest) MarshalJSON() ([]byte, error) { 3688 type NoMethod SqlInstancesVerifyExternalSyncSettingsRequest 3689 raw := NoMethod(*s) 3690 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3691} 3692 3693// SqlInstancesVerifyExternalSyncSettingsResponse: Instance verify 3694// external sync settings response. 3695type SqlInstancesVerifyExternalSyncSettingsResponse struct { 3696 // Errors: List of migration violations. 3697 Errors []*SqlExternalSyncSettingError `json:"errors,omitempty"` 3698 3699 // Kind: This is always **sql#migrationSettingErrorList**. 3700 Kind string `json:"kind,omitempty"` 3701 3702 // Warnings: List of migration warnings. 3703 Warnings []*SqlExternalSyncSettingError `json:"warnings,omitempty"` 3704 3705 // ServerResponse contains the HTTP response code and headers from the 3706 // server. 3707 googleapi.ServerResponse `json:"-"` 3708 3709 // ForceSendFields is a list of field names (e.g. "Errors") to 3710 // unconditionally include in API requests. By default, fields with 3711 // empty or default values are omitted from API requests. However, any 3712 // non-pointer, non-interface field appearing in ForceSendFields will be 3713 // sent to the server regardless of whether the field is empty or not. 3714 // This may be used to include empty fields in Patch requests. 3715 ForceSendFields []string `json:"-"` 3716 3717 // NullFields is a list of field names (e.g. "Errors") to include in API 3718 // requests with the JSON null value. By default, fields with empty 3719 // values are omitted from API requests. However, any field with an 3720 // empty value appearing in NullFields will be sent to the server as 3721 // null. It is an error if a field in this list has a non-empty value. 3722 // This may be used to include null fields in Patch requests. 3723 NullFields []string `json:"-"` 3724} 3725 3726func (s *SqlInstancesVerifyExternalSyncSettingsResponse) MarshalJSON() ([]byte, error) { 3727 type NoMethod SqlInstancesVerifyExternalSyncSettingsResponse 3728 raw := NoMethod(*s) 3729 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3730} 3731 3732// SqlOutOfDiskReport: This message wraps up the information written by 3733// out-of-disk detection job. 3734type SqlOutOfDiskReport struct { 3735 // SqlMinRecommendedIncreaseSizeGb: The minimum recommended increase 3736 // size in GigaBytes This field is consumed by the frontend * Writers: * 3737 // the proactive database wellness job for OOD. * Readers: 3738 SqlMinRecommendedIncreaseSizeGb int64 `json:"sqlMinRecommendedIncreaseSizeGb,omitempty"` 3739 3740 // SqlOutOfDiskState: This field represents the state generated by the 3741 // proactive database wellness job for OutOfDisk issues. * Writers: * 3742 // the proactive database wellness job for OOD. * Readers: * the 3743 // proactive database wellness job 3744 // 3745 // Possible values: 3746 // "SQL_OUT_OF_DISK_STATE_UNSPECIFIED" - Unspecified state 3747 // "NORMAL" - The instance has plenty space on data disk 3748 // "SOFT_SHUTDOWN" - Data disk is almost used up. It is shutdown to 3749 // prevent data corruption. 3750 SqlOutOfDiskState string `json:"sqlOutOfDiskState,omitempty"` 3751 3752 // ForceSendFields is a list of field names (e.g. 3753 // "SqlMinRecommendedIncreaseSizeGb") to unconditionally include in API 3754 // requests. By default, fields with empty or default values are omitted 3755 // from API requests. However, any non-pointer, non-interface field 3756 // appearing in ForceSendFields will be sent to the server regardless of 3757 // whether the field is empty or not. This may be used to include empty 3758 // fields in Patch requests. 3759 ForceSendFields []string `json:"-"` 3760 3761 // NullFields is a list of field names (e.g. 3762 // "SqlMinRecommendedIncreaseSizeGb") to include in API requests with 3763 // the JSON null value. By default, fields with empty values are omitted 3764 // from API requests. However, any field with an empty value appearing 3765 // in NullFields will be sent to the server as null. It is an error if a 3766 // field in this list has a non-empty value. This may be used to include 3767 // null fields in Patch requests. 3768 NullFields []string `json:"-"` 3769} 3770 3771func (s *SqlOutOfDiskReport) MarshalJSON() ([]byte, error) { 3772 type NoMethod SqlOutOfDiskReport 3773 raw := NoMethod(*s) 3774 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3775} 3776 3777// SqlScheduledMaintenance: Any scheduled maintenancce for this 3778// instance. 3779type SqlScheduledMaintenance struct { 3780 CanDefer bool `json:"canDefer,omitempty"` 3781 3782 // CanReschedule: If the scheduled maintenance can be rescheduled. 3783 CanReschedule bool `json:"canReschedule,omitempty"` 3784 3785 // ScheduleDeadlineTime: Maintenance cannot be rescheduled to start 3786 // beyond this deadline. 3787 ScheduleDeadlineTime string `json:"scheduleDeadlineTime,omitempty"` 3788 3789 // StartTime: The start time of any upcoming scheduled maintenance for 3790 // this instance. 3791 StartTime string `json:"startTime,omitempty"` 3792 3793 // ForceSendFields is a list of field names (e.g. "CanDefer") to 3794 // unconditionally include in API requests. By default, fields with 3795 // empty or default values are omitted from API requests. However, any 3796 // non-pointer, non-interface field appearing in ForceSendFields will be 3797 // sent to the server regardless of whether the field is empty or not. 3798 // This may be used to include empty fields in Patch requests. 3799 ForceSendFields []string `json:"-"` 3800 3801 // NullFields is a list of field names (e.g. "CanDefer") to include in 3802 // API requests with the JSON null value. By default, fields with empty 3803 // values are omitted from API requests. However, any field with an 3804 // empty value appearing in NullFields will be sent to the server as 3805 // null. It is an error if a field in this list has a non-empty value. 3806 // This may be used to include null fields in Patch requests. 3807 NullFields []string `json:"-"` 3808} 3809 3810func (s *SqlScheduledMaintenance) MarshalJSON() ([]byte, error) { 3811 type NoMethod SqlScheduledMaintenance 3812 raw := NoMethod(*s) 3813 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3814} 3815 3816// SqlServerAuditConfig: SQL Server specific audit configuration. 3817type SqlServerAuditConfig struct { 3818 // Bucket: The name of the destination bucket (e.g., gs://mybucket). 3819 Bucket string `json:"bucket,omitempty"` 3820 3821 // Kind: This is always sql#sqlServerAuditConfig 3822 Kind string `json:"kind,omitempty"` 3823 3824 // ForceSendFields is a list of field names (e.g. "Bucket") to 3825 // unconditionally include in API requests. By default, fields with 3826 // empty or default values are omitted from API requests. However, any 3827 // non-pointer, non-interface field appearing in ForceSendFields will be 3828 // sent to the server regardless of whether the field is empty or not. 3829 // This may be used to include empty fields in Patch requests. 3830 ForceSendFields []string `json:"-"` 3831 3832 // NullFields is a list of field names (e.g. "Bucket") to include in API 3833 // requests with the JSON null value. By default, fields with empty 3834 // values are omitted from API requests. However, any field with an 3835 // empty value appearing in NullFields will be sent to the server as 3836 // null. It is an error if a field in this list has a non-empty value. 3837 // This may be used to include null fields in Patch requests. 3838 NullFields []string `json:"-"` 3839} 3840 3841func (s *SqlServerAuditConfig) MarshalJSON() ([]byte, error) { 3842 type NoMethod SqlServerAuditConfig 3843 raw := NoMethod(*s) 3844 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3845} 3846 3847// SqlServerDatabaseDetails: Represents a Sql Server database on the 3848// Cloud SQL instance. 3849type SqlServerDatabaseDetails struct { 3850 // CompatibilityLevel: The version of SQL Server with which the database 3851 // is to be made compatible 3852 CompatibilityLevel int64 `json:"compatibilityLevel,omitempty"` 3853 3854 // RecoveryModel: The recovery model of a SQL Server database 3855 RecoveryModel string `json:"recoveryModel,omitempty"` 3856 3857 // ForceSendFields is a list of field names (e.g. "CompatibilityLevel") 3858 // to unconditionally include in API requests. By default, fields with 3859 // empty or default values are omitted from API requests. However, any 3860 // non-pointer, non-interface field appearing in ForceSendFields will be 3861 // sent to the server regardless of whether the field is empty or not. 3862 // This may be used to include empty fields in Patch requests. 3863 ForceSendFields []string `json:"-"` 3864 3865 // NullFields is a list of field names (e.g. "CompatibilityLevel") to 3866 // include in API requests with the JSON null value. By default, fields 3867 // with empty values are omitted from API requests. However, any field 3868 // with an empty value appearing in NullFields will be sent to the 3869 // server as null. It is an error if a field in this list has a 3870 // non-empty value. This may be used to include null fields in Patch 3871 // requests. 3872 NullFields []string `json:"-"` 3873} 3874 3875func (s *SqlServerDatabaseDetails) MarshalJSON() ([]byte, error) { 3876 type NoMethod SqlServerDatabaseDetails 3877 raw := NoMethod(*s) 3878 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3879} 3880 3881// SqlServerUserDetails: Represents a Sql Server user on the Cloud SQL 3882// instance. 3883type SqlServerUserDetails struct { 3884 // Disabled: If the user has been disabled 3885 Disabled bool `json:"disabled,omitempty"` 3886 3887 // ServerRoles: The server roles for this user 3888 ServerRoles []string `json:"serverRoles,omitempty"` 3889 3890 // ForceSendFields is a list of field names (e.g. "Disabled") to 3891 // unconditionally include in API requests. By default, fields with 3892 // empty or default values are omitted from API requests. However, any 3893 // non-pointer, non-interface field appearing in ForceSendFields will be 3894 // sent to the server regardless of whether the field is empty or not. 3895 // This may be used to include empty fields in Patch requests. 3896 ForceSendFields []string `json:"-"` 3897 3898 // NullFields is a list of field names (e.g. "Disabled") to include in 3899 // API requests with the JSON null value. By default, fields with empty 3900 // values are omitted from API requests. However, any field with an 3901 // empty value appearing in NullFields will be sent to the server as 3902 // null. It is an error if a field in this list has a non-empty value. 3903 // This may be used to include null fields in Patch requests. 3904 NullFields []string `json:"-"` 3905} 3906 3907func (s *SqlServerUserDetails) MarshalJSON() ([]byte, error) { 3908 type NoMethod SqlServerUserDetails 3909 raw := NoMethod(*s) 3910 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3911} 3912 3913// SslCert: SslCerts Resource 3914type SslCert struct { 3915 // Cert: PEM representation. 3916 Cert string `json:"cert,omitempty"` 3917 3918 // CertSerialNumber: Serial number, as extracted from the certificate. 3919 CertSerialNumber string `json:"certSerialNumber,omitempty"` 3920 3921 // CommonName: User supplied name. Constrained to [a-zA-Z.-_ ]+. 3922 CommonName string `json:"commonName,omitempty"` 3923 3924 // CreateTime: The time when the certificate was created in RFC 3339 3925 // (https://tools.ietf.org/html/rfc3339) format, for example 3926 // **2012-11-15T16:19:00.094Z**. 3927 CreateTime string `json:"createTime,omitempty"` 3928 3929 // ExpirationTime: The time when the certificate expires in RFC 3339 3930 // (https://tools.ietf.org/html/rfc3339) format, for example 3931 // **2012-11-15T16:19:00.094Z**. 3932 ExpirationTime string `json:"expirationTime,omitempty"` 3933 3934 // Instance: Name of the database instance. 3935 Instance string `json:"instance,omitempty"` 3936 3937 // Kind: This is always **sql#sslCert**. 3938 Kind string `json:"kind,omitempty"` 3939 3940 // SelfLink: The URI of this resource. 3941 SelfLink string `json:"selfLink,omitempty"` 3942 3943 // Sha1Fingerprint: Sha1 Fingerprint. 3944 Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"` 3945 3946 // ServerResponse contains the HTTP response code and headers from the 3947 // server. 3948 googleapi.ServerResponse `json:"-"` 3949 3950 // ForceSendFields is a list of field names (e.g. "Cert") to 3951 // unconditionally include in API requests. By default, fields with 3952 // empty or default values are omitted from API requests. However, any 3953 // non-pointer, non-interface field appearing in ForceSendFields will be 3954 // sent to the server regardless of whether the field is empty or not. 3955 // This may be used to include empty fields in Patch requests. 3956 ForceSendFields []string `json:"-"` 3957 3958 // NullFields is a list of field names (e.g. "Cert") to include in API 3959 // requests with the JSON null value. By default, fields with empty 3960 // values are omitted from API requests. However, any field with an 3961 // empty value appearing in NullFields will be sent to the server as 3962 // null. It is an error if a field in this list has a non-empty value. 3963 // This may be used to include null fields in Patch requests. 3964 NullFields []string `json:"-"` 3965} 3966 3967func (s *SslCert) MarshalJSON() ([]byte, error) { 3968 type NoMethod SslCert 3969 raw := NoMethod(*s) 3970 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3971} 3972 3973// SslCertDetail: SslCertDetail. 3974type SslCertDetail struct { 3975 // CertInfo: The public information about the cert. 3976 CertInfo *SslCert `json:"certInfo,omitempty"` 3977 3978 // CertPrivateKey: The private key for the client cert, in pem format. 3979 // Keep private in order to protect your security. 3980 CertPrivateKey string `json:"certPrivateKey,omitempty"` 3981 3982 // ForceSendFields is a list of field names (e.g. "CertInfo") to 3983 // unconditionally include in API requests. By default, fields with 3984 // empty or default values are omitted from API requests. However, any 3985 // non-pointer, non-interface field appearing in ForceSendFields will be 3986 // sent to the server regardless of whether the field is empty or not. 3987 // This may be used to include empty fields in Patch requests. 3988 ForceSendFields []string `json:"-"` 3989 3990 // NullFields is a list of field names (e.g. "CertInfo") to include in 3991 // API requests with the JSON null value. By default, fields with empty 3992 // values are omitted from API requests. However, any field with an 3993 // empty value appearing in NullFields will be sent to the server as 3994 // null. It is an error if a field in this list has a non-empty value. 3995 // This may be used to include null fields in Patch requests. 3996 NullFields []string `json:"-"` 3997} 3998 3999func (s *SslCertDetail) MarshalJSON() ([]byte, error) { 4000 type NoMethod SslCertDetail 4001 raw := NoMethod(*s) 4002 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4003} 4004 4005// SslCertsCreateEphemeralRequest: SslCerts create ephemeral certificate 4006// request. 4007type SslCertsCreateEphemeralRequest struct { 4008 // AccessToken: Access token to include in the signed certificate. 4009 AccessToken string `json:"access_token,omitempty"` 4010 4011 // PublicKey: PEM encoded public key to include in the signed 4012 // certificate. 4013 PublicKey string `json:"public_key,omitempty"` 4014 4015 // ForceSendFields is a list of field names (e.g. "AccessToken") to 4016 // unconditionally include in API requests. By default, fields with 4017 // empty or default values are omitted from API requests. However, any 4018 // non-pointer, non-interface field appearing in ForceSendFields will be 4019 // sent to the server regardless of whether the field is empty or not. 4020 // This may be used to include empty fields in Patch requests. 4021 ForceSendFields []string `json:"-"` 4022 4023 // NullFields is a list of field names (e.g. "AccessToken") to include 4024 // in API requests with the JSON null value. By default, fields with 4025 // empty values are omitted from API requests. However, any field with 4026 // an empty value appearing in NullFields will be sent to the server as 4027 // null. It is an error if a field in this list has a non-empty value. 4028 // This may be used to include null fields in Patch requests. 4029 NullFields []string `json:"-"` 4030} 4031 4032func (s *SslCertsCreateEphemeralRequest) MarshalJSON() ([]byte, error) { 4033 type NoMethod SslCertsCreateEphemeralRequest 4034 raw := NoMethod(*s) 4035 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4036} 4037 4038// SslCertsInsertRequest: SslCerts insert request. 4039type SslCertsInsertRequest struct { 4040 // CommonName: User supplied name. Must be a distinct name from the 4041 // other certificates for this instance. 4042 CommonName string `json:"commonName,omitempty"` 4043 4044 // ForceSendFields is a list of field names (e.g. "CommonName") to 4045 // unconditionally include in API requests. By default, fields with 4046 // empty or default values are omitted from API requests. However, any 4047 // non-pointer, non-interface field appearing in ForceSendFields will be 4048 // sent to the server regardless of whether the field is empty or not. 4049 // This may be used to include empty fields in Patch requests. 4050 ForceSendFields []string `json:"-"` 4051 4052 // NullFields is a list of field names (e.g. "CommonName") to include in 4053 // API requests with the JSON null value. By default, fields with empty 4054 // values are omitted from API requests. However, any field with an 4055 // empty value appearing in NullFields will be sent to the server as 4056 // null. It is an error if a field in this list has a non-empty value. 4057 // This may be used to include null fields in Patch requests. 4058 NullFields []string `json:"-"` 4059} 4060 4061func (s *SslCertsInsertRequest) MarshalJSON() ([]byte, error) { 4062 type NoMethod SslCertsInsertRequest 4063 raw := NoMethod(*s) 4064 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4065} 4066 4067// SslCertsInsertResponse: SslCert insert response. 4068type SslCertsInsertResponse struct { 4069 // ClientCert: The new client certificate and private key. 4070 ClientCert *SslCertDetail `json:"clientCert,omitempty"` 4071 4072 // Kind: This is always **sql#sslCertsInsert**. 4073 Kind string `json:"kind,omitempty"` 4074 4075 // Operation: The operation to track the ssl certs insert request. 4076 Operation *Operation `json:"operation,omitempty"` 4077 4078 // ServerCaCert: The server Certificate Authority's certificate. If this 4079 // is missing you can force a new one to be generated by calling 4080 // resetSslConfig method on instances resource. 4081 ServerCaCert *SslCert `json:"serverCaCert,omitempty"` 4082 4083 // ServerResponse contains the HTTP response code and headers from the 4084 // server. 4085 googleapi.ServerResponse `json:"-"` 4086 4087 // ForceSendFields is a list of field names (e.g. "ClientCert") to 4088 // unconditionally include in API requests. By default, fields with 4089 // empty or default values are omitted from API requests. However, any 4090 // non-pointer, non-interface field appearing in ForceSendFields will be 4091 // sent to the server regardless of whether the field is empty or not. 4092 // This may be used to include empty fields in Patch requests. 4093 ForceSendFields []string `json:"-"` 4094 4095 // NullFields is a list of field names (e.g. "ClientCert") to include in 4096 // API requests with the JSON null value. By default, fields with empty 4097 // values are omitted from API requests. However, any field with an 4098 // empty value appearing in NullFields will be sent to the server as 4099 // null. It is an error if a field in this list has a non-empty value. 4100 // This may be used to include null fields in Patch requests. 4101 NullFields []string `json:"-"` 4102} 4103 4104func (s *SslCertsInsertResponse) MarshalJSON() ([]byte, error) { 4105 type NoMethod SslCertsInsertResponse 4106 raw := NoMethod(*s) 4107 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4108} 4109 4110// SslCertsListResponse: SslCerts list response. 4111type SslCertsListResponse struct { 4112 // Items: List of client certificates for the instance. 4113 Items []*SslCert `json:"items,omitempty"` 4114 4115 // Kind: This is always **sql#sslCertsList**. 4116 Kind string `json:"kind,omitempty"` 4117 4118 // ServerResponse contains the HTTP response code and headers from the 4119 // server. 4120 googleapi.ServerResponse `json:"-"` 4121 4122 // ForceSendFields is a list of field names (e.g. "Items") to 4123 // unconditionally include in API requests. By default, fields with 4124 // empty or default values are omitted from API requests. However, any 4125 // non-pointer, non-interface field appearing in ForceSendFields will be 4126 // sent to the server regardless of whether the field is empty or not. 4127 // This may be used to include empty fields in Patch requests. 4128 ForceSendFields []string `json:"-"` 4129 4130 // NullFields is a list of field names (e.g. "Items") to include in API 4131 // requests with the JSON null value. By default, fields with empty 4132 // values are omitted from API requests. However, any field with an 4133 // empty value appearing in NullFields will be sent to the server as 4134 // null. It is an error if a field in this list has a non-empty value. 4135 // This may be used to include null fields in Patch requests. 4136 NullFields []string `json:"-"` 4137} 4138 4139func (s *SslCertsListResponse) MarshalJSON() ([]byte, error) { 4140 type NoMethod SslCertsListResponse 4141 raw := NoMethod(*s) 4142 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4143} 4144 4145// SyncFlags: Initial sync flags for certain Cloud SQL APIs. Currently 4146// used for the MySQL external server initial dump. 4147type SyncFlags struct { 4148 // Name: The name of the flag. 4149 Name string `json:"name,omitempty"` 4150 4151 // Value: The value of the flag. This field must be omitted if the flag 4152 // doesn't take a value. 4153 Value string `json:"value,omitempty"` 4154 4155 // ForceSendFields is a list of field names (e.g. "Name") to 4156 // unconditionally include in API requests. By default, fields with 4157 // empty or default values are omitted from API requests. However, any 4158 // non-pointer, non-interface field appearing in ForceSendFields will be 4159 // sent to the server regardless of whether the field is empty or not. 4160 // This may be used to include empty fields in Patch requests. 4161 ForceSendFields []string `json:"-"` 4162 4163 // NullFields is a list of field names (e.g. "Name") to include in API 4164 // requests with the JSON null value. By default, fields with empty 4165 // values are omitted from API requests. However, any field with an 4166 // empty value appearing in NullFields will be sent to the server as 4167 // null. It is an error if a field in this list has a non-empty value. 4168 // This may be used to include null fields in Patch requests. 4169 NullFields []string `json:"-"` 4170} 4171 4172func (s *SyncFlags) MarshalJSON() ([]byte, error) { 4173 type NoMethod SyncFlags 4174 raw := NoMethod(*s) 4175 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4176} 4177 4178// Tier: A Google Cloud SQL service tier resource. 4179type Tier struct { 4180 // DiskQuota: The maximum disk size of this tier in bytes. 4181 DiskQuota int64 `json:"DiskQuota,omitempty,string"` 4182 4183 // RAM: The maximum RAM usage of this tier in bytes. 4184 RAM int64 `json:"RAM,omitempty,string"` 4185 4186 // Kind: This is always *sql#tier*. 4187 Kind string `json:"kind,omitempty"` 4188 4189 // Region: The applicable regions for this tier. 4190 Region []string `json:"region,omitempty"` 4191 4192 // Tier: An identifier for the machine type, for example, 4193 // db-custom-1-3840. For related information, see Pricing. 4194 Tier string `json:"tier,omitempty"` 4195 4196 // ForceSendFields is a list of field names (e.g. "DiskQuota") to 4197 // unconditionally include in API requests. By default, fields with 4198 // empty or default values are omitted from API requests. However, any 4199 // non-pointer, non-interface field appearing in ForceSendFields will be 4200 // sent to the server regardless of whether the field is empty or not. 4201 // This may be used to include empty fields in Patch requests. 4202 ForceSendFields []string `json:"-"` 4203 4204 // NullFields is a list of field names (e.g. "DiskQuota") to include in 4205 // API requests with the JSON null value. By default, fields with empty 4206 // values are omitted from API requests. However, any field with an 4207 // empty value appearing in NullFields will be sent to the server as 4208 // null. It is an error if a field in this list has a non-empty value. 4209 // This may be used to include null fields in Patch requests. 4210 NullFields []string `json:"-"` 4211} 4212 4213func (s *Tier) MarshalJSON() ([]byte, error) { 4214 type NoMethod Tier 4215 raw := NoMethod(*s) 4216 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4217} 4218 4219// TiersListResponse: Tiers list response. 4220type TiersListResponse struct { 4221 // Items: List of tiers. 4222 Items []*Tier `json:"items,omitempty"` 4223 4224 // Kind: This is always *sql#tiersList*. 4225 Kind string `json:"kind,omitempty"` 4226 4227 // ServerResponse contains the HTTP response code and headers from the 4228 // server. 4229 googleapi.ServerResponse `json:"-"` 4230 4231 // ForceSendFields is a list of field names (e.g. "Items") to 4232 // unconditionally include in API requests. By default, fields with 4233 // empty or default values are omitted from API requests. However, any 4234 // non-pointer, non-interface field appearing in ForceSendFields will be 4235 // sent to the server regardless of whether the field is empty or not. 4236 // This may be used to include empty fields in Patch requests. 4237 ForceSendFields []string `json:"-"` 4238 4239 // NullFields is a list of field names (e.g. "Items") to include in API 4240 // requests with the JSON null value. By default, fields with empty 4241 // values are omitted from API requests. However, any field with an 4242 // empty value appearing in NullFields will be sent to the server as 4243 // null. It is an error if a field in this list has a non-empty value. 4244 // This may be used to include null fields in Patch requests. 4245 NullFields []string `json:"-"` 4246} 4247 4248func (s *TiersListResponse) MarshalJSON() ([]byte, error) { 4249 type NoMethod TiersListResponse 4250 raw := NoMethod(*s) 4251 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4252} 4253 4254// TruncateLogContext: Database Instance truncate log context. 4255type TruncateLogContext struct { 4256 // Kind: This is always **sql#truncateLogContext**. 4257 Kind string `json:"kind,omitempty"` 4258 4259 // LogType: The type of log to truncate. Valid values are 4260 // **MYSQL_GENERAL_TABLE** and **MYSQL_SLOW_TABLE**. 4261 LogType string `json:"logType,omitempty"` 4262 4263 // ForceSendFields is a list of field names (e.g. "Kind") to 4264 // unconditionally include in API requests. By default, fields with 4265 // empty or default values are omitted from API requests. However, any 4266 // non-pointer, non-interface field appearing in ForceSendFields will be 4267 // sent to the server regardless of whether the field is empty or not. 4268 // This may be used to include empty fields in Patch requests. 4269 ForceSendFields []string `json:"-"` 4270 4271 // NullFields is a list of field names (e.g. "Kind") to include in API 4272 // requests with the JSON null value. By default, fields with empty 4273 // values are omitted from API requests. However, any field with an 4274 // empty value appearing in NullFields will be sent to the server as 4275 // null. It is an error if a field in this list has a non-empty value. 4276 // This may be used to include null fields in Patch requests. 4277 NullFields []string `json:"-"` 4278} 4279 4280func (s *TruncateLogContext) MarshalJSON() ([]byte, error) { 4281 type NoMethod TruncateLogContext 4282 raw := NoMethod(*s) 4283 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4284} 4285 4286// User: A Cloud SQL user resource. 4287type User struct { 4288 // Etag: This field is deprecated and will be removed from a future 4289 // version of the API. 4290 Etag string `json:"etag,omitempty"` 4291 4292 // Host: The host name from which the user can connect. For *insert* 4293 // operations, host defaults to an empty string. For *update* 4294 // operations, host is specified as part of the request URL. The host 4295 // name cannot be updated after insertion. 4296 Host string `json:"host,omitempty"` 4297 4298 // Instance: The name of the Cloud SQL instance. This does not include 4299 // the project ID. Can be omitted for *update* since it is already 4300 // specified on the URL. 4301 Instance string `json:"instance,omitempty"` 4302 4303 // Kind: This is always *sql#user*. 4304 Kind string `json:"kind,omitempty"` 4305 4306 // Name: The name of the user in the Cloud SQL instance. Can be omitted 4307 // for *update* since it is already specified in the URL. 4308 Name string `json:"name,omitempty"` 4309 4310 // Password: The password for the user. 4311 Password string `json:"password,omitempty"` 4312 4313 // Project: The project ID of the project containing the Cloud SQL 4314 // database. The Google apps domain is prefixed if applicable. Can be 4315 // omitted for *update* since it is already specified on the URL. 4316 Project string `json:"project,omitempty"` 4317 4318 SqlserverUserDetails *SqlServerUserDetails `json:"sqlserverUserDetails,omitempty"` 4319 4320 // Type: The user type. It determines the method to authenticate the 4321 // user during login. The default is the database's built-in user type. 4322 // 4323 // Possible values: 4324 // "BUILT_IN" - The database's built-in user type. 4325 // "CLOUD_IAM_USER" - Cloud IAM user. 4326 // "CLOUD_IAM_SERVICE_ACCOUNT" - Cloud IAM service account. 4327 Type string `json:"type,omitempty"` 4328 4329 // ForceSendFields is a list of field names (e.g. "Etag") to 4330 // unconditionally include in API requests. By default, fields with 4331 // empty or default values are omitted from API requests. However, any 4332 // non-pointer, non-interface field appearing in ForceSendFields will be 4333 // sent to the server regardless of whether the field is empty or not. 4334 // This may be used to include empty fields in Patch requests. 4335 ForceSendFields []string `json:"-"` 4336 4337 // NullFields is a list of field names (e.g. "Etag") to include in API 4338 // requests with the JSON null value. By default, fields with empty 4339 // values are omitted from API requests. However, any field with an 4340 // empty value appearing in NullFields will be sent to the server as 4341 // null. It is an error if a field in this list has a non-empty value. 4342 // This may be used to include null fields in Patch requests. 4343 NullFields []string `json:"-"` 4344} 4345 4346func (s *User) MarshalJSON() ([]byte, error) { 4347 type NoMethod User 4348 raw := NoMethod(*s) 4349 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4350} 4351 4352// UsersListResponse: User list response. 4353type UsersListResponse struct { 4354 // Items: List of user resources in the instance. 4355 Items []*User `json:"items,omitempty"` 4356 4357 // Kind: This is always *sql#usersList*. 4358 Kind string `json:"kind,omitempty"` 4359 4360 // NextPageToken: An identifier that uniquely identifies the operation. 4361 // You can use this identifier to retrieve the Operations resource that 4362 // has information about the operation. 4363 NextPageToken string `json:"nextPageToken,omitempty"` 4364 4365 // ServerResponse contains the HTTP response code and headers from the 4366 // server. 4367 googleapi.ServerResponse `json:"-"` 4368 4369 // ForceSendFields is a list of field names (e.g. "Items") to 4370 // unconditionally include in API requests. By default, fields with 4371 // empty or default values are omitted from API requests. However, any 4372 // non-pointer, non-interface field appearing in ForceSendFields will be 4373 // sent to the server regardless of whether the field is empty or not. 4374 // This may be used to include empty fields in Patch requests. 4375 ForceSendFields []string `json:"-"` 4376 4377 // NullFields is a list of field names (e.g. "Items") to include in API 4378 // requests with the JSON null value. By default, fields with empty 4379 // values are omitted from API requests. However, any field with an 4380 // empty value appearing in NullFields will be sent to the server as 4381 // null. It is an error if a field in this list has a non-empty value. 4382 // This may be used to include null fields in Patch requests. 4383 NullFields []string `json:"-"` 4384} 4385 4386func (s *UsersListResponse) MarshalJSON() ([]byte, error) { 4387 type NoMethod UsersListResponse 4388 raw := NoMethod(*s) 4389 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4390} 4391 4392// method id "sql.backupRuns.delete": 4393 4394type BackupRunsDeleteCall struct { 4395 s *Service 4396 project string 4397 instance string 4398 id int64 4399 urlParams_ gensupport.URLParams 4400 ctx_ context.Context 4401 header_ http.Header 4402} 4403 4404// Delete: Deletes the backup taken by a backup run. 4405// 4406// - id: The ID of the backup run to delete. To find a backup run ID, 4407// use the list 4408// (https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/backupRuns/list) 4409// method. 4410// - instance: Cloud SQL instance ID. This does not include the project 4411// ID. 4412// - project: Project ID of the project that contains the instance. 4413func (r *BackupRunsService) Delete(project string, instance string, id int64) *BackupRunsDeleteCall { 4414 c := &BackupRunsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4415 c.project = project 4416 c.instance = instance 4417 c.id = id 4418 return c 4419} 4420 4421// Fields allows partial responses to be retrieved. See 4422// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4423// for more information. 4424func (c *BackupRunsDeleteCall) Fields(s ...googleapi.Field) *BackupRunsDeleteCall { 4425 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4426 return c 4427} 4428 4429// Context sets the context to be used in this call's Do method. Any 4430// pending HTTP request will be aborted if the provided context is 4431// canceled. 4432func (c *BackupRunsDeleteCall) Context(ctx context.Context) *BackupRunsDeleteCall { 4433 c.ctx_ = ctx 4434 return c 4435} 4436 4437// Header returns an http.Header that can be modified by the caller to 4438// add HTTP headers to the request. 4439func (c *BackupRunsDeleteCall) Header() http.Header { 4440 if c.header_ == nil { 4441 c.header_ = make(http.Header) 4442 } 4443 return c.header_ 4444} 4445 4446func (c *BackupRunsDeleteCall) doRequest(alt string) (*http.Response, error) { 4447 reqHeaders := make(http.Header) 4448 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4449 for k, v := range c.header_ { 4450 reqHeaders[k] = v 4451 } 4452 reqHeaders.Set("User-Agent", c.s.userAgent()) 4453 var body io.Reader = nil 4454 c.urlParams_.Set("alt", alt) 4455 c.urlParams_.Set("prettyPrint", "false") 4456 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}") 4457 urls += "?" + c.urlParams_.Encode() 4458 req, err := http.NewRequest("DELETE", urls, body) 4459 if err != nil { 4460 return nil, err 4461 } 4462 req.Header = reqHeaders 4463 googleapi.Expand(req.URL, map[string]string{ 4464 "project": c.project, 4465 "instance": c.instance, 4466 "id": strconv.FormatInt(c.id, 10), 4467 }) 4468 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4469} 4470 4471// Do executes the "sql.backupRuns.delete" call. 4472// Exactly one of *Operation or error will be non-nil. Any non-2xx 4473// status code is an error. Response headers are in either 4474// *Operation.ServerResponse.Header or (if a response was returned at 4475// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4476// to check whether the returned error was because 4477// http.StatusNotModified was returned. 4478func (c *BackupRunsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4479 gensupport.SetOptions(c.urlParams_, opts...) 4480 res, err := c.doRequest("json") 4481 if res != nil && res.StatusCode == http.StatusNotModified { 4482 if res.Body != nil { 4483 res.Body.Close() 4484 } 4485 return nil, &googleapi.Error{ 4486 Code: res.StatusCode, 4487 Header: res.Header, 4488 } 4489 } 4490 if err != nil { 4491 return nil, err 4492 } 4493 defer googleapi.CloseBody(res) 4494 if err := googleapi.CheckResponse(res); err != nil { 4495 return nil, err 4496 } 4497 ret := &Operation{ 4498 ServerResponse: googleapi.ServerResponse{ 4499 Header: res.Header, 4500 HTTPStatusCode: res.StatusCode, 4501 }, 4502 } 4503 target := &ret 4504 if err := gensupport.DecodeResponse(target, res); err != nil { 4505 return nil, err 4506 } 4507 return ret, nil 4508 // { 4509 // "description": "Deletes the backup taken by a backup run.", 4510 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4511 // "httpMethod": "DELETE", 4512 // "id": "sql.backupRuns.delete", 4513 // "parameterOrder": [ 4514 // "project", 4515 // "instance", 4516 // "id" 4517 // ], 4518 // "parameters": { 4519 // "id": { 4520 // "description": "The ID of the backup run to delete. To find a backup run ID, use the [list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/backupRuns/list) method.", 4521 // "format": "int64", 4522 // "location": "path", 4523 // "required": true, 4524 // "type": "string" 4525 // }, 4526 // "instance": { 4527 // "description": "Cloud SQL instance ID. This does not include the project ID.", 4528 // "location": "path", 4529 // "required": true, 4530 // "type": "string" 4531 // }, 4532 // "project": { 4533 // "description": "Project ID of the project that contains the instance.", 4534 // "location": "path", 4535 // "required": true, 4536 // "type": "string" 4537 // } 4538 // }, 4539 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4540 // "response": { 4541 // "$ref": "Operation" 4542 // }, 4543 // "scopes": [ 4544 // "https://www.googleapis.com/auth/cloud-platform", 4545 // "https://www.googleapis.com/auth/sqlservice.admin" 4546 // ] 4547 // } 4548 4549} 4550 4551// method id "sql.backupRuns.get": 4552 4553type BackupRunsGetCall struct { 4554 s *Service 4555 project string 4556 instance string 4557 id int64 4558 urlParams_ gensupport.URLParams 4559 ifNoneMatch_ string 4560 ctx_ context.Context 4561 header_ http.Header 4562} 4563 4564// Get: Retrieves a resource containing information about a backup run. 4565// 4566// - id: The ID of this backup run. 4567// - instance: Cloud SQL instance ID. This does not include the project 4568// ID. 4569// - project: Project ID of the project that contains the instance. 4570func (r *BackupRunsService) Get(project string, instance string, id int64) *BackupRunsGetCall { 4571 c := &BackupRunsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4572 c.project = project 4573 c.instance = instance 4574 c.id = id 4575 return c 4576} 4577 4578// Fields allows partial responses to be retrieved. See 4579// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4580// for more information. 4581func (c *BackupRunsGetCall) Fields(s ...googleapi.Field) *BackupRunsGetCall { 4582 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4583 return c 4584} 4585 4586// IfNoneMatch sets the optional parameter which makes the operation 4587// fail if the object's ETag matches the given value. This is useful for 4588// getting updates only after the object has changed since the last 4589// request. Use googleapi.IsNotModified to check whether the response 4590// error from Do is the result of In-None-Match. 4591func (c *BackupRunsGetCall) IfNoneMatch(entityTag string) *BackupRunsGetCall { 4592 c.ifNoneMatch_ = entityTag 4593 return c 4594} 4595 4596// Context sets the context to be used in this call's Do method. Any 4597// pending HTTP request will be aborted if the provided context is 4598// canceled. 4599func (c *BackupRunsGetCall) Context(ctx context.Context) *BackupRunsGetCall { 4600 c.ctx_ = ctx 4601 return c 4602} 4603 4604// Header returns an http.Header that can be modified by the caller to 4605// add HTTP headers to the request. 4606func (c *BackupRunsGetCall) Header() http.Header { 4607 if c.header_ == nil { 4608 c.header_ = make(http.Header) 4609 } 4610 return c.header_ 4611} 4612 4613func (c *BackupRunsGetCall) doRequest(alt string) (*http.Response, error) { 4614 reqHeaders := make(http.Header) 4615 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4616 for k, v := range c.header_ { 4617 reqHeaders[k] = v 4618 } 4619 reqHeaders.Set("User-Agent", c.s.userAgent()) 4620 if c.ifNoneMatch_ != "" { 4621 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4622 } 4623 var body io.Reader = nil 4624 c.urlParams_.Set("alt", alt) 4625 c.urlParams_.Set("prettyPrint", "false") 4626 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}") 4627 urls += "?" + c.urlParams_.Encode() 4628 req, err := http.NewRequest("GET", urls, body) 4629 if err != nil { 4630 return nil, err 4631 } 4632 req.Header = reqHeaders 4633 googleapi.Expand(req.URL, map[string]string{ 4634 "project": c.project, 4635 "instance": c.instance, 4636 "id": strconv.FormatInt(c.id, 10), 4637 }) 4638 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4639} 4640 4641// Do executes the "sql.backupRuns.get" call. 4642// Exactly one of *BackupRun or error will be non-nil. Any non-2xx 4643// status code is an error. Response headers are in either 4644// *BackupRun.ServerResponse.Header or (if a response was returned at 4645// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4646// to check whether the returned error was because 4647// http.StatusNotModified was returned. 4648func (c *BackupRunsGetCall) Do(opts ...googleapi.CallOption) (*BackupRun, error) { 4649 gensupport.SetOptions(c.urlParams_, opts...) 4650 res, err := c.doRequest("json") 4651 if res != nil && res.StatusCode == http.StatusNotModified { 4652 if res.Body != nil { 4653 res.Body.Close() 4654 } 4655 return nil, &googleapi.Error{ 4656 Code: res.StatusCode, 4657 Header: res.Header, 4658 } 4659 } 4660 if err != nil { 4661 return nil, err 4662 } 4663 defer googleapi.CloseBody(res) 4664 if err := googleapi.CheckResponse(res); err != nil { 4665 return nil, err 4666 } 4667 ret := &BackupRun{ 4668 ServerResponse: googleapi.ServerResponse{ 4669 Header: res.Header, 4670 HTTPStatusCode: res.StatusCode, 4671 }, 4672 } 4673 target := &ret 4674 if err := gensupport.DecodeResponse(target, res); err != nil { 4675 return nil, err 4676 } 4677 return ret, nil 4678 // { 4679 // "description": "Retrieves a resource containing information about a backup run.", 4680 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4681 // "httpMethod": "GET", 4682 // "id": "sql.backupRuns.get", 4683 // "parameterOrder": [ 4684 // "project", 4685 // "instance", 4686 // "id" 4687 // ], 4688 // "parameters": { 4689 // "id": { 4690 // "description": "The ID of this backup run.", 4691 // "format": "int64", 4692 // "location": "path", 4693 // "required": true, 4694 // "type": "string" 4695 // }, 4696 // "instance": { 4697 // "description": "Cloud SQL instance ID. This does not include the project ID.", 4698 // "location": "path", 4699 // "required": true, 4700 // "type": "string" 4701 // }, 4702 // "project": { 4703 // "description": "Project ID of the project that contains the instance.", 4704 // "location": "path", 4705 // "required": true, 4706 // "type": "string" 4707 // } 4708 // }, 4709 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}", 4710 // "response": { 4711 // "$ref": "BackupRun" 4712 // }, 4713 // "scopes": [ 4714 // "https://www.googleapis.com/auth/cloud-platform", 4715 // "https://www.googleapis.com/auth/sqlservice.admin" 4716 // ] 4717 // } 4718 4719} 4720 4721// method id "sql.backupRuns.insert": 4722 4723type BackupRunsInsertCall struct { 4724 s *Service 4725 project string 4726 instance string 4727 backuprun *BackupRun 4728 urlParams_ gensupport.URLParams 4729 ctx_ context.Context 4730 header_ http.Header 4731} 4732 4733// Insert: Creates a new backup run on demand. 4734// 4735// - instance: Cloud SQL instance ID. This does not include the project 4736// ID. 4737// - project: Project ID of the project that contains the instance. 4738func (r *BackupRunsService) Insert(project string, instance string, backuprun *BackupRun) *BackupRunsInsertCall { 4739 c := &BackupRunsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4740 c.project = project 4741 c.instance = instance 4742 c.backuprun = backuprun 4743 return c 4744} 4745 4746// Fields allows partial responses to be retrieved. See 4747// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4748// for more information. 4749func (c *BackupRunsInsertCall) Fields(s ...googleapi.Field) *BackupRunsInsertCall { 4750 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4751 return c 4752} 4753 4754// Context sets the context to be used in this call's Do method. Any 4755// pending HTTP request will be aborted if the provided context is 4756// canceled. 4757func (c *BackupRunsInsertCall) Context(ctx context.Context) *BackupRunsInsertCall { 4758 c.ctx_ = ctx 4759 return c 4760} 4761 4762// Header returns an http.Header that can be modified by the caller to 4763// add HTTP headers to the request. 4764func (c *BackupRunsInsertCall) Header() http.Header { 4765 if c.header_ == nil { 4766 c.header_ = make(http.Header) 4767 } 4768 return c.header_ 4769} 4770 4771func (c *BackupRunsInsertCall) doRequest(alt string) (*http.Response, error) { 4772 reqHeaders := make(http.Header) 4773 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4774 for k, v := range c.header_ { 4775 reqHeaders[k] = v 4776 } 4777 reqHeaders.Set("User-Agent", c.s.userAgent()) 4778 var body io.Reader = nil 4779 body, err := googleapi.WithoutDataWrapper.JSONReader(c.backuprun) 4780 if err != nil { 4781 return nil, err 4782 } 4783 reqHeaders.Set("Content-Type", "application/json") 4784 c.urlParams_.Set("alt", alt) 4785 c.urlParams_.Set("prettyPrint", "false") 4786 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns") 4787 urls += "?" + c.urlParams_.Encode() 4788 req, err := http.NewRequest("POST", urls, body) 4789 if err != nil { 4790 return nil, err 4791 } 4792 req.Header = reqHeaders 4793 googleapi.Expand(req.URL, map[string]string{ 4794 "project": c.project, 4795 "instance": c.instance, 4796 }) 4797 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4798} 4799 4800// Do executes the "sql.backupRuns.insert" call. 4801// Exactly one of *Operation or error will be non-nil. Any non-2xx 4802// status code is an error. Response headers are in either 4803// *Operation.ServerResponse.Header or (if a response was returned at 4804// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4805// to check whether the returned error was because 4806// http.StatusNotModified was returned. 4807func (c *BackupRunsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4808 gensupport.SetOptions(c.urlParams_, opts...) 4809 res, err := c.doRequest("json") 4810 if res != nil && res.StatusCode == http.StatusNotModified { 4811 if res.Body != nil { 4812 res.Body.Close() 4813 } 4814 return nil, &googleapi.Error{ 4815 Code: res.StatusCode, 4816 Header: res.Header, 4817 } 4818 } 4819 if err != nil { 4820 return nil, err 4821 } 4822 defer googleapi.CloseBody(res) 4823 if err := googleapi.CheckResponse(res); err != nil { 4824 return nil, err 4825 } 4826 ret := &Operation{ 4827 ServerResponse: googleapi.ServerResponse{ 4828 Header: res.Header, 4829 HTTPStatusCode: res.StatusCode, 4830 }, 4831 } 4832 target := &ret 4833 if err := gensupport.DecodeResponse(target, res); err != nil { 4834 return nil, err 4835 } 4836 return ret, nil 4837 // { 4838 // "description": "Creates a new backup run on demand.", 4839 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 4840 // "httpMethod": "POST", 4841 // "id": "sql.backupRuns.insert", 4842 // "parameterOrder": [ 4843 // "project", 4844 // "instance" 4845 // ], 4846 // "parameters": { 4847 // "instance": { 4848 // "description": "Cloud SQL instance ID. This does not include the project ID.", 4849 // "location": "path", 4850 // "required": true, 4851 // "type": "string" 4852 // }, 4853 // "project": { 4854 // "description": "Project ID of the project that contains the instance.", 4855 // "location": "path", 4856 // "required": true, 4857 // "type": "string" 4858 // } 4859 // }, 4860 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 4861 // "request": { 4862 // "$ref": "BackupRun" 4863 // }, 4864 // "response": { 4865 // "$ref": "Operation" 4866 // }, 4867 // "scopes": [ 4868 // "https://www.googleapis.com/auth/cloud-platform", 4869 // "https://www.googleapis.com/auth/sqlservice.admin" 4870 // ] 4871 // } 4872 4873} 4874 4875// method id "sql.backupRuns.list": 4876 4877type BackupRunsListCall struct { 4878 s *Service 4879 project string 4880 instance string 4881 urlParams_ gensupport.URLParams 4882 ifNoneMatch_ string 4883 ctx_ context.Context 4884 header_ http.Header 4885} 4886 4887// List: Lists all backup runs associated with the project or a given 4888// instance and configuration in the reverse chronological order of the 4889// backup initiation time. 4890// 4891// - instance: Cloud SQL instance ID, or "-" for all instances. This 4892// does not include the project ID. 4893// - project: Project ID of the project that contains the instance. 4894func (r *BackupRunsService) List(project string, instance string) *BackupRunsListCall { 4895 c := &BackupRunsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4896 c.project = project 4897 c.instance = instance 4898 return c 4899} 4900 4901// MaxResults sets the optional parameter "maxResults": Maximum number 4902// of backup runs per response. 4903func (c *BackupRunsListCall) MaxResults(maxResults int64) *BackupRunsListCall { 4904 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 4905 return c 4906} 4907 4908// PageToken sets the optional parameter "pageToken": A 4909// previously-returned page token representing part of the larger set of 4910// results to view. 4911func (c *BackupRunsListCall) PageToken(pageToken string) *BackupRunsListCall { 4912 c.urlParams_.Set("pageToken", pageToken) 4913 return c 4914} 4915 4916// Fields allows partial responses to be retrieved. See 4917// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4918// for more information. 4919func (c *BackupRunsListCall) Fields(s ...googleapi.Field) *BackupRunsListCall { 4920 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4921 return c 4922} 4923 4924// IfNoneMatch sets the optional parameter which makes the operation 4925// fail if the object's ETag matches the given value. This is useful for 4926// getting updates only after the object has changed since the last 4927// request. Use googleapi.IsNotModified to check whether the response 4928// error from Do is the result of In-None-Match. 4929func (c *BackupRunsListCall) IfNoneMatch(entityTag string) *BackupRunsListCall { 4930 c.ifNoneMatch_ = entityTag 4931 return c 4932} 4933 4934// Context sets the context to be used in this call's Do method. Any 4935// pending HTTP request will be aborted if the provided context is 4936// canceled. 4937func (c *BackupRunsListCall) Context(ctx context.Context) *BackupRunsListCall { 4938 c.ctx_ = ctx 4939 return c 4940} 4941 4942// Header returns an http.Header that can be modified by the caller to 4943// add HTTP headers to the request. 4944func (c *BackupRunsListCall) Header() http.Header { 4945 if c.header_ == nil { 4946 c.header_ = make(http.Header) 4947 } 4948 return c.header_ 4949} 4950 4951func (c *BackupRunsListCall) doRequest(alt string) (*http.Response, error) { 4952 reqHeaders := make(http.Header) 4953 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 4954 for k, v := range c.header_ { 4955 reqHeaders[k] = v 4956 } 4957 reqHeaders.Set("User-Agent", c.s.userAgent()) 4958 if c.ifNoneMatch_ != "" { 4959 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4960 } 4961 var body io.Reader = nil 4962 c.urlParams_.Set("alt", alt) 4963 c.urlParams_.Set("prettyPrint", "false") 4964 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns") 4965 urls += "?" + c.urlParams_.Encode() 4966 req, err := http.NewRequest("GET", urls, body) 4967 if err != nil { 4968 return nil, err 4969 } 4970 req.Header = reqHeaders 4971 googleapi.Expand(req.URL, map[string]string{ 4972 "project": c.project, 4973 "instance": c.instance, 4974 }) 4975 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4976} 4977 4978// Do executes the "sql.backupRuns.list" call. 4979// Exactly one of *BackupRunsListResponse or error will be non-nil. Any 4980// non-2xx status code is an error. Response headers are in either 4981// *BackupRunsListResponse.ServerResponse.Header or (if a response was 4982// returned at all) in error.(*googleapi.Error).Header. Use 4983// googleapi.IsNotModified to check whether the returned error was 4984// because http.StatusNotModified was returned. 4985func (c *BackupRunsListCall) Do(opts ...googleapi.CallOption) (*BackupRunsListResponse, error) { 4986 gensupport.SetOptions(c.urlParams_, opts...) 4987 res, err := c.doRequest("json") 4988 if res != nil && res.StatusCode == http.StatusNotModified { 4989 if res.Body != nil { 4990 res.Body.Close() 4991 } 4992 return nil, &googleapi.Error{ 4993 Code: res.StatusCode, 4994 Header: res.Header, 4995 } 4996 } 4997 if err != nil { 4998 return nil, err 4999 } 5000 defer googleapi.CloseBody(res) 5001 if err := googleapi.CheckResponse(res); err != nil { 5002 return nil, err 5003 } 5004 ret := &BackupRunsListResponse{ 5005 ServerResponse: googleapi.ServerResponse{ 5006 Header: res.Header, 5007 HTTPStatusCode: res.StatusCode, 5008 }, 5009 } 5010 target := &ret 5011 if err := gensupport.DecodeResponse(target, res); err != nil { 5012 return nil, err 5013 } 5014 return ret, nil 5015 // { 5016 // "description": "Lists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.", 5017 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 5018 // "httpMethod": "GET", 5019 // "id": "sql.backupRuns.list", 5020 // "parameterOrder": [ 5021 // "project", 5022 // "instance" 5023 // ], 5024 // "parameters": { 5025 // "instance": { 5026 // "description": "Cloud SQL instance ID, or \"-\" for all instances. This does not include the project ID.", 5027 // "location": "path", 5028 // "required": true, 5029 // "type": "string" 5030 // }, 5031 // "maxResults": { 5032 // "description": "Maximum number of backup runs per response.", 5033 // "format": "int32", 5034 // "location": "query", 5035 // "type": "integer" 5036 // }, 5037 // "pageToken": { 5038 // "description": "A previously-returned page token representing part of the larger set of results to view.", 5039 // "location": "query", 5040 // "type": "string" 5041 // }, 5042 // "project": { 5043 // "description": "Project ID of the project that contains the instance.", 5044 // "location": "path", 5045 // "required": true, 5046 // "type": "string" 5047 // } 5048 // }, 5049 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/backupRuns", 5050 // "response": { 5051 // "$ref": "BackupRunsListResponse" 5052 // }, 5053 // "scopes": [ 5054 // "https://www.googleapis.com/auth/cloud-platform", 5055 // "https://www.googleapis.com/auth/sqlservice.admin" 5056 // ] 5057 // } 5058 5059} 5060 5061// Pages invokes f for each page of results. 5062// A non-nil error returned from f will halt the iteration. 5063// The provided context supersedes any context provided to the Context method. 5064func (c *BackupRunsListCall) Pages(ctx context.Context, f func(*BackupRunsListResponse) error) error { 5065 c.ctx_ = ctx 5066 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5067 for { 5068 x, err := c.Do() 5069 if err != nil { 5070 return err 5071 } 5072 if err := f(x); err != nil { 5073 return err 5074 } 5075 if x.NextPageToken == "" { 5076 return nil 5077 } 5078 c.PageToken(x.NextPageToken) 5079 } 5080} 5081 5082// method id "sql.connect.generateEphemeral": 5083 5084type ConnectGenerateEphemeralCertCall struct { 5085 s *Service 5086 project string 5087 instance string 5088 generateephemeralcertrequest *GenerateEphemeralCertRequest 5089 urlParams_ gensupport.URLParams 5090 ctx_ context.Context 5091 header_ http.Header 5092} 5093 5094// GenerateEphemeralCert: Generates a short-lived X509 certificate 5095// containing the provided public key and signed by a private key 5096// specific to the target instance. Users may use the certificate to 5097// authenticate as themselves when connecting to the database. 5098// 5099// - instance: Cloud SQL instance ID. This does not include the project 5100// ID. 5101// - project: Project ID of the project that contains the instance. 5102func (r *ConnectService) GenerateEphemeralCert(project string, instance string, generateephemeralcertrequest *GenerateEphemeralCertRequest) *ConnectGenerateEphemeralCertCall { 5103 c := &ConnectGenerateEphemeralCertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5104 c.project = project 5105 c.instance = instance 5106 c.generateephemeralcertrequest = generateephemeralcertrequest 5107 return c 5108} 5109 5110// Fields allows partial responses to be retrieved. See 5111// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5112// for more information. 5113func (c *ConnectGenerateEphemeralCertCall) Fields(s ...googleapi.Field) *ConnectGenerateEphemeralCertCall { 5114 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5115 return c 5116} 5117 5118// Context sets the context to be used in this call's Do method. Any 5119// pending HTTP request will be aborted if the provided context is 5120// canceled. 5121func (c *ConnectGenerateEphemeralCertCall) Context(ctx context.Context) *ConnectGenerateEphemeralCertCall { 5122 c.ctx_ = ctx 5123 return c 5124} 5125 5126// Header returns an http.Header that can be modified by the caller to 5127// add HTTP headers to the request. 5128func (c *ConnectGenerateEphemeralCertCall) Header() http.Header { 5129 if c.header_ == nil { 5130 c.header_ = make(http.Header) 5131 } 5132 return c.header_ 5133} 5134 5135func (c *ConnectGenerateEphemeralCertCall) doRequest(alt string) (*http.Response, error) { 5136 reqHeaders := make(http.Header) 5137 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5138 for k, v := range c.header_ { 5139 reqHeaders[k] = v 5140 } 5141 reqHeaders.Set("User-Agent", c.s.userAgent()) 5142 var body io.Reader = nil 5143 body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateephemeralcertrequest) 5144 if err != nil { 5145 return nil, err 5146 } 5147 reqHeaders.Set("Content-Type", "application/json") 5148 c.urlParams_.Set("alt", alt) 5149 c.urlParams_.Set("prettyPrint", "false") 5150 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}:generateEphemeralCert") 5151 urls += "?" + c.urlParams_.Encode() 5152 req, err := http.NewRequest("POST", urls, body) 5153 if err != nil { 5154 return nil, err 5155 } 5156 req.Header = reqHeaders 5157 googleapi.Expand(req.URL, map[string]string{ 5158 "project": c.project, 5159 "instance": c.instance, 5160 }) 5161 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5162} 5163 5164// Do executes the "sql.connect.generateEphemeral" call. 5165// Exactly one of *GenerateEphemeralCertResponse or error will be 5166// non-nil. Any non-2xx status code is an error. Response headers are in 5167// either *GenerateEphemeralCertResponse.ServerResponse.Header or (if a 5168// response was returned at all) in error.(*googleapi.Error).Header. Use 5169// googleapi.IsNotModified to check whether the returned error was 5170// because http.StatusNotModified was returned. 5171func (c *ConnectGenerateEphemeralCertCall) Do(opts ...googleapi.CallOption) (*GenerateEphemeralCertResponse, error) { 5172 gensupport.SetOptions(c.urlParams_, opts...) 5173 res, err := c.doRequest("json") 5174 if res != nil && res.StatusCode == http.StatusNotModified { 5175 if res.Body != nil { 5176 res.Body.Close() 5177 } 5178 return nil, &googleapi.Error{ 5179 Code: res.StatusCode, 5180 Header: res.Header, 5181 } 5182 } 5183 if err != nil { 5184 return nil, err 5185 } 5186 defer googleapi.CloseBody(res) 5187 if err := googleapi.CheckResponse(res); err != nil { 5188 return nil, err 5189 } 5190 ret := &GenerateEphemeralCertResponse{ 5191 ServerResponse: googleapi.ServerResponse{ 5192 Header: res.Header, 5193 HTTPStatusCode: res.StatusCode, 5194 }, 5195 } 5196 target := &ret 5197 if err := gensupport.DecodeResponse(target, res); err != nil { 5198 return nil, err 5199 } 5200 return ret, nil 5201 // { 5202 // "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.", 5203 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}:generateEphemeralCert", 5204 // "httpMethod": "POST", 5205 // "id": "sql.connect.generateEphemeral", 5206 // "parameterOrder": [ 5207 // "project", 5208 // "instance" 5209 // ], 5210 // "parameters": { 5211 // "instance": { 5212 // "description": "Cloud SQL instance ID. This does not include the project ID.", 5213 // "location": "path", 5214 // "required": true, 5215 // "type": "string" 5216 // }, 5217 // "project": { 5218 // "description": "Project ID of the project that contains the instance.", 5219 // "location": "path", 5220 // "required": true, 5221 // "type": "string" 5222 // } 5223 // }, 5224 // "path": "sql/v1beta4/projects/{project}/instances/{instance}:generateEphemeralCert", 5225 // "request": { 5226 // "$ref": "GenerateEphemeralCertRequest" 5227 // }, 5228 // "response": { 5229 // "$ref": "GenerateEphemeralCertResponse" 5230 // }, 5231 // "scopes": [ 5232 // "https://www.googleapis.com/auth/cloud-platform", 5233 // "https://www.googleapis.com/auth/sqlservice.admin" 5234 // ] 5235 // } 5236 5237} 5238 5239// method id "sql.connect.get": 5240 5241type ConnectGetCall struct { 5242 s *Service 5243 project string 5244 instance string 5245 urlParams_ gensupport.URLParams 5246 ifNoneMatch_ string 5247 ctx_ context.Context 5248 header_ http.Header 5249} 5250 5251// Get: Retrieves connect settings about a Cloud SQL instance. 5252// 5253// - instance: Cloud SQL instance ID. This does not include the project 5254// ID. 5255// - project: Project ID of the project that contains the instance. 5256func (r *ConnectService) Get(project string, instance string) *ConnectGetCall { 5257 c := &ConnectGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5258 c.project = project 5259 c.instance = instance 5260 return c 5261} 5262 5263// ReadTime sets the optional parameter "readTime": Optional snapshot 5264// read timestamp to trade freshness for performance. 5265func (c *ConnectGetCall) ReadTime(readTime string) *ConnectGetCall { 5266 c.urlParams_.Set("readTime", readTime) 5267 return c 5268} 5269 5270// Fields allows partial responses to be retrieved. See 5271// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5272// for more information. 5273func (c *ConnectGetCall) Fields(s ...googleapi.Field) *ConnectGetCall { 5274 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5275 return c 5276} 5277 5278// IfNoneMatch sets the optional parameter which makes the operation 5279// fail if the object's ETag matches the given value. This is useful for 5280// getting updates only after the object has changed since the last 5281// request. Use googleapi.IsNotModified to check whether the response 5282// error from Do is the result of In-None-Match. 5283func (c *ConnectGetCall) IfNoneMatch(entityTag string) *ConnectGetCall { 5284 c.ifNoneMatch_ = entityTag 5285 return c 5286} 5287 5288// Context sets the context to be used in this call's Do method. Any 5289// pending HTTP request will be aborted if the provided context is 5290// canceled. 5291func (c *ConnectGetCall) Context(ctx context.Context) *ConnectGetCall { 5292 c.ctx_ = ctx 5293 return c 5294} 5295 5296// Header returns an http.Header that can be modified by the caller to 5297// add HTTP headers to the request. 5298func (c *ConnectGetCall) Header() http.Header { 5299 if c.header_ == nil { 5300 c.header_ = make(http.Header) 5301 } 5302 return c.header_ 5303} 5304 5305func (c *ConnectGetCall) doRequest(alt string) (*http.Response, error) { 5306 reqHeaders := make(http.Header) 5307 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5308 for k, v := range c.header_ { 5309 reqHeaders[k] = v 5310 } 5311 reqHeaders.Set("User-Agent", c.s.userAgent()) 5312 if c.ifNoneMatch_ != "" { 5313 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5314 } 5315 var body io.Reader = nil 5316 c.urlParams_.Set("alt", alt) 5317 c.urlParams_.Set("prettyPrint", "false") 5318 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/connectSettings") 5319 urls += "?" + c.urlParams_.Encode() 5320 req, err := http.NewRequest("GET", urls, body) 5321 if err != nil { 5322 return nil, err 5323 } 5324 req.Header = reqHeaders 5325 googleapi.Expand(req.URL, map[string]string{ 5326 "project": c.project, 5327 "instance": c.instance, 5328 }) 5329 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5330} 5331 5332// Do executes the "sql.connect.get" call. 5333// Exactly one of *ConnectSettings or error will be non-nil. Any non-2xx 5334// status code is an error. Response headers are in either 5335// *ConnectSettings.ServerResponse.Header or (if a response was returned 5336// at all) in error.(*googleapi.Error).Header. Use 5337// googleapi.IsNotModified to check whether the returned error was 5338// because http.StatusNotModified was returned. 5339func (c *ConnectGetCall) Do(opts ...googleapi.CallOption) (*ConnectSettings, error) { 5340 gensupport.SetOptions(c.urlParams_, opts...) 5341 res, err := c.doRequest("json") 5342 if res != nil && res.StatusCode == http.StatusNotModified { 5343 if res.Body != nil { 5344 res.Body.Close() 5345 } 5346 return nil, &googleapi.Error{ 5347 Code: res.StatusCode, 5348 Header: res.Header, 5349 } 5350 } 5351 if err != nil { 5352 return nil, err 5353 } 5354 defer googleapi.CloseBody(res) 5355 if err := googleapi.CheckResponse(res); err != nil { 5356 return nil, err 5357 } 5358 ret := &ConnectSettings{ 5359 ServerResponse: googleapi.ServerResponse{ 5360 Header: res.Header, 5361 HTTPStatusCode: res.StatusCode, 5362 }, 5363 } 5364 target := &ret 5365 if err := gensupport.DecodeResponse(target, res); err != nil { 5366 return nil, err 5367 } 5368 return ret, nil 5369 // { 5370 // "description": "Retrieves connect settings about a Cloud SQL instance.", 5371 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/connectSettings", 5372 // "httpMethod": "GET", 5373 // "id": "sql.connect.get", 5374 // "parameterOrder": [ 5375 // "project", 5376 // "instance" 5377 // ], 5378 // "parameters": { 5379 // "instance": { 5380 // "description": "Cloud SQL instance ID. This does not include the project ID.", 5381 // "location": "path", 5382 // "required": true, 5383 // "type": "string" 5384 // }, 5385 // "project": { 5386 // "description": "Project ID of the project that contains the instance.", 5387 // "location": "path", 5388 // "required": true, 5389 // "type": "string" 5390 // }, 5391 // "readTime": { 5392 // "description": "Optional. Optional snapshot read timestamp to trade freshness for performance.", 5393 // "format": "google-datetime", 5394 // "location": "query", 5395 // "type": "string" 5396 // } 5397 // }, 5398 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/connectSettings", 5399 // "response": { 5400 // "$ref": "ConnectSettings" 5401 // }, 5402 // "scopes": [ 5403 // "https://www.googleapis.com/auth/cloud-platform", 5404 // "https://www.googleapis.com/auth/sqlservice.admin" 5405 // ] 5406 // } 5407 5408} 5409 5410// method id "sql.databases.delete": 5411 5412type DatabasesDeleteCall struct { 5413 s *Service 5414 project string 5415 instance string 5416 database string 5417 urlParams_ gensupport.URLParams 5418 ctx_ context.Context 5419 header_ http.Header 5420} 5421 5422// Delete: Deletes a database from a Cloud SQL instance. 5423// 5424// - database: Name of the database to be deleted in the instance. 5425// - instance: Database instance ID. This does not include the project 5426// ID. 5427// - project: Project ID of the project that contains the instance. 5428func (r *DatabasesService) Delete(project string, instance string, database string) *DatabasesDeleteCall { 5429 c := &DatabasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5430 c.project = project 5431 c.instance = instance 5432 c.database = database 5433 return c 5434} 5435 5436// Fields allows partial responses to be retrieved. See 5437// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5438// for more information. 5439func (c *DatabasesDeleteCall) Fields(s ...googleapi.Field) *DatabasesDeleteCall { 5440 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5441 return c 5442} 5443 5444// Context sets the context to be used in this call's Do method. Any 5445// pending HTTP request will be aborted if the provided context is 5446// canceled. 5447func (c *DatabasesDeleteCall) Context(ctx context.Context) *DatabasesDeleteCall { 5448 c.ctx_ = ctx 5449 return c 5450} 5451 5452// Header returns an http.Header that can be modified by the caller to 5453// add HTTP headers to the request. 5454func (c *DatabasesDeleteCall) Header() http.Header { 5455 if c.header_ == nil { 5456 c.header_ = make(http.Header) 5457 } 5458 return c.header_ 5459} 5460 5461func (c *DatabasesDeleteCall) doRequest(alt string) (*http.Response, error) { 5462 reqHeaders := make(http.Header) 5463 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5464 for k, v := range c.header_ { 5465 reqHeaders[k] = v 5466 } 5467 reqHeaders.Set("User-Agent", c.s.userAgent()) 5468 var body io.Reader = nil 5469 c.urlParams_.Set("alt", alt) 5470 c.urlParams_.Set("prettyPrint", "false") 5471 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 5472 urls += "?" + c.urlParams_.Encode() 5473 req, err := http.NewRequest("DELETE", urls, body) 5474 if err != nil { 5475 return nil, err 5476 } 5477 req.Header = reqHeaders 5478 googleapi.Expand(req.URL, map[string]string{ 5479 "project": c.project, 5480 "instance": c.instance, 5481 "database": c.database, 5482 }) 5483 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5484} 5485 5486// Do executes the "sql.databases.delete" call. 5487// Exactly one of *Operation or error will be non-nil. Any non-2xx 5488// status code is an error. Response headers are in either 5489// *Operation.ServerResponse.Header or (if a response was returned at 5490// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5491// to check whether the returned error was because 5492// http.StatusNotModified was returned. 5493func (c *DatabasesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5494 gensupport.SetOptions(c.urlParams_, opts...) 5495 res, err := c.doRequest("json") 5496 if res != nil && res.StatusCode == http.StatusNotModified { 5497 if res.Body != nil { 5498 res.Body.Close() 5499 } 5500 return nil, &googleapi.Error{ 5501 Code: res.StatusCode, 5502 Header: res.Header, 5503 } 5504 } 5505 if err != nil { 5506 return nil, err 5507 } 5508 defer googleapi.CloseBody(res) 5509 if err := googleapi.CheckResponse(res); err != nil { 5510 return nil, err 5511 } 5512 ret := &Operation{ 5513 ServerResponse: googleapi.ServerResponse{ 5514 Header: res.Header, 5515 HTTPStatusCode: res.StatusCode, 5516 }, 5517 } 5518 target := &ret 5519 if err := gensupport.DecodeResponse(target, res); err != nil { 5520 return nil, err 5521 } 5522 return ret, nil 5523 // { 5524 // "description": "Deletes a database from a Cloud SQL instance.", 5525 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5526 // "httpMethod": "DELETE", 5527 // "id": "sql.databases.delete", 5528 // "parameterOrder": [ 5529 // "project", 5530 // "instance", 5531 // "database" 5532 // ], 5533 // "parameters": { 5534 // "database": { 5535 // "description": "Name of the database to be deleted in the instance.", 5536 // "location": "path", 5537 // "required": true, 5538 // "type": "string" 5539 // }, 5540 // "instance": { 5541 // "description": "Database instance ID. This does not include the project ID.", 5542 // "location": "path", 5543 // "required": true, 5544 // "type": "string" 5545 // }, 5546 // "project": { 5547 // "description": "Project ID of the project that contains the instance.", 5548 // "location": "path", 5549 // "required": true, 5550 // "type": "string" 5551 // } 5552 // }, 5553 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5554 // "response": { 5555 // "$ref": "Operation" 5556 // }, 5557 // "scopes": [ 5558 // "https://www.googleapis.com/auth/cloud-platform", 5559 // "https://www.googleapis.com/auth/sqlservice.admin" 5560 // ] 5561 // } 5562 5563} 5564 5565// method id "sql.databases.get": 5566 5567type DatabasesGetCall struct { 5568 s *Service 5569 project string 5570 instance string 5571 database string 5572 urlParams_ gensupport.URLParams 5573 ifNoneMatch_ string 5574 ctx_ context.Context 5575 header_ http.Header 5576} 5577 5578// Get: Retrieves a resource containing information about a database 5579// inside a Cloud SQL instance. 5580// 5581// - database: Name of the database in the instance. 5582// - instance: Database instance ID. This does not include the project 5583// ID. 5584// - project: Project ID of the project that contains the instance. 5585func (r *DatabasesService) Get(project string, instance string, database string) *DatabasesGetCall { 5586 c := &DatabasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5587 c.project = project 5588 c.instance = instance 5589 c.database = database 5590 return c 5591} 5592 5593// Fields allows partial responses to be retrieved. See 5594// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5595// for more information. 5596func (c *DatabasesGetCall) Fields(s ...googleapi.Field) *DatabasesGetCall { 5597 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5598 return c 5599} 5600 5601// IfNoneMatch sets the optional parameter which makes the operation 5602// fail if the object's ETag matches the given value. This is useful for 5603// getting updates only after the object has changed since the last 5604// request. Use googleapi.IsNotModified to check whether the response 5605// error from Do is the result of In-None-Match. 5606func (c *DatabasesGetCall) IfNoneMatch(entityTag string) *DatabasesGetCall { 5607 c.ifNoneMatch_ = entityTag 5608 return c 5609} 5610 5611// Context sets the context to be used in this call's Do method. Any 5612// pending HTTP request will be aborted if the provided context is 5613// canceled. 5614func (c *DatabasesGetCall) Context(ctx context.Context) *DatabasesGetCall { 5615 c.ctx_ = ctx 5616 return c 5617} 5618 5619// Header returns an http.Header that can be modified by the caller to 5620// add HTTP headers to the request. 5621func (c *DatabasesGetCall) Header() http.Header { 5622 if c.header_ == nil { 5623 c.header_ = make(http.Header) 5624 } 5625 return c.header_ 5626} 5627 5628func (c *DatabasesGetCall) doRequest(alt string) (*http.Response, error) { 5629 reqHeaders := make(http.Header) 5630 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5631 for k, v := range c.header_ { 5632 reqHeaders[k] = v 5633 } 5634 reqHeaders.Set("User-Agent", c.s.userAgent()) 5635 if c.ifNoneMatch_ != "" { 5636 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5637 } 5638 var body io.Reader = nil 5639 c.urlParams_.Set("alt", alt) 5640 c.urlParams_.Set("prettyPrint", "false") 5641 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 5642 urls += "?" + c.urlParams_.Encode() 5643 req, err := http.NewRequest("GET", urls, body) 5644 if err != nil { 5645 return nil, err 5646 } 5647 req.Header = reqHeaders 5648 googleapi.Expand(req.URL, map[string]string{ 5649 "project": c.project, 5650 "instance": c.instance, 5651 "database": c.database, 5652 }) 5653 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5654} 5655 5656// Do executes the "sql.databases.get" call. 5657// Exactly one of *Database or error will be non-nil. Any non-2xx status 5658// code is an error. Response headers are in either 5659// *Database.ServerResponse.Header or (if a response was returned at 5660// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5661// to check whether the returned error was because 5662// http.StatusNotModified was returned. 5663func (c *DatabasesGetCall) Do(opts ...googleapi.CallOption) (*Database, error) { 5664 gensupport.SetOptions(c.urlParams_, opts...) 5665 res, err := c.doRequest("json") 5666 if res != nil && res.StatusCode == http.StatusNotModified { 5667 if res.Body != nil { 5668 res.Body.Close() 5669 } 5670 return nil, &googleapi.Error{ 5671 Code: res.StatusCode, 5672 Header: res.Header, 5673 } 5674 } 5675 if err != nil { 5676 return nil, err 5677 } 5678 defer googleapi.CloseBody(res) 5679 if err := googleapi.CheckResponse(res); err != nil { 5680 return nil, err 5681 } 5682 ret := &Database{ 5683 ServerResponse: googleapi.ServerResponse{ 5684 Header: res.Header, 5685 HTTPStatusCode: res.StatusCode, 5686 }, 5687 } 5688 target := &ret 5689 if err := gensupport.DecodeResponse(target, res); err != nil { 5690 return nil, err 5691 } 5692 return ret, nil 5693 // { 5694 // "description": "Retrieves a resource containing information about a database inside a Cloud SQL instance.", 5695 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5696 // "httpMethod": "GET", 5697 // "id": "sql.databases.get", 5698 // "parameterOrder": [ 5699 // "project", 5700 // "instance", 5701 // "database" 5702 // ], 5703 // "parameters": { 5704 // "database": { 5705 // "description": "Name of the database in the instance.", 5706 // "location": "path", 5707 // "required": true, 5708 // "type": "string" 5709 // }, 5710 // "instance": { 5711 // "description": "Database instance ID. This does not include the project ID.", 5712 // "location": "path", 5713 // "required": true, 5714 // "type": "string" 5715 // }, 5716 // "project": { 5717 // "description": "Project ID of the project that contains the instance.", 5718 // "location": "path", 5719 // "required": true, 5720 // "type": "string" 5721 // } 5722 // }, 5723 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 5724 // "response": { 5725 // "$ref": "Database" 5726 // }, 5727 // "scopes": [ 5728 // "https://www.googleapis.com/auth/cloud-platform", 5729 // "https://www.googleapis.com/auth/sqlservice.admin" 5730 // ] 5731 // } 5732 5733} 5734 5735// method id "sql.databases.insert": 5736 5737type DatabasesInsertCall struct { 5738 s *Service 5739 project string 5740 instance string 5741 database *Database 5742 urlParams_ gensupport.URLParams 5743 ctx_ context.Context 5744 header_ http.Header 5745} 5746 5747// Insert: Inserts a resource containing information about a database 5748// inside a Cloud SQL instance. 5749// 5750// - instance: Database instance ID. This does not include the project 5751// ID. 5752// - project: Project ID of the project that contains the instance. 5753func (r *DatabasesService) Insert(project string, instance string, database *Database) *DatabasesInsertCall { 5754 c := &DatabasesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5755 c.project = project 5756 c.instance = instance 5757 c.database = database 5758 return c 5759} 5760 5761// Fields allows partial responses to be retrieved. See 5762// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5763// for more information. 5764func (c *DatabasesInsertCall) Fields(s ...googleapi.Field) *DatabasesInsertCall { 5765 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5766 return c 5767} 5768 5769// Context sets the context to be used in this call's Do method. Any 5770// pending HTTP request will be aborted if the provided context is 5771// canceled. 5772func (c *DatabasesInsertCall) Context(ctx context.Context) *DatabasesInsertCall { 5773 c.ctx_ = ctx 5774 return c 5775} 5776 5777// Header returns an http.Header that can be modified by the caller to 5778// add HTTP headers to the request. 5779func (c *DatabasesInsertCall) Header() http.Header { 5780 if c.header_ == nil { 5781 c.header_ = make(http.Header) 5782 } 5783 return c.header_ 5784} 5785 5786func (c *DatabasesInsertCall) doRequest(alt string) (*http.Response, error) { 5787 reqHeaders := make(http.Header) 5788 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5789 for k, v := range c.header_ { 5790 reqHeaders[k] = v 5791 } 5792 reqHeaders.Set("User-Agent", c.s.userAgent()) 5793 var body io.Reader = nil 5794 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database) 5795 if err != nil { 5796 return nil, err 5797 } 5798 reqHeaders.Set("Content-Type", "application/json") 5799 c.urlParams_.Set("alt", alt) 5800 c.urlParams_.Set("prettyPrint", "false") 5801 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases") 5802 urls += "?" + c.urlParams_.Encode() 5803 req, err := http.NewRequest("POST", urls, body) 5804 if err != nil { 5805 return nil, err 5806 } 5807 req.Header = reqHeaders 5808 googleapi.Expand(req.URL, map[string]string{ 5809 "project": c.project, 5810 "instance": c.instance, 5811 }) 5812 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5813} 5814 5815// Do executes the "sql.databases.insert" call. 5816// Exactly one of *Operation or error will be non-nil. Any non-2xx 5817// status code is an error. Response headers are in either 5818// *Operation.ServerResponse.Header or (if a response was returned at 5819// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5820// to check whether the returned error was because 5821// http.StatusNotModified was returned. 5822func (c *DatabasesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5823 gensupport.SetOptions(c.urlParams_, opts...) 5824 res, err := c.doRequest("json") 5825 if res != nil && res.StatusCode == http.StatusNotModified { 5826 if res.Body != nil { 5827 res.Body.Close() 5828 } 5829 return nil, &googleapi.Error{ 5830 Code: res.StatusCode, 5831 Header: res.Header, 5832 } 5833 } 5834 if err != nil { 5835 return nil, err 5836 } 5837 defer googleapi.CloseBody(res) 5838 if err := googleapi.CheckResponse(res); err != nil { 5839 return nil, err 5840 } 5841 ret := &Operation{ 5842 ServerResponse: googleapi.ServerResponse{ 5843 Header: res.Header, 5844 HTTPStatusCode: res.StatusCode, 5845 }, 5846 } 5847 target := &ret 5848 if err := gensupport.DecodeResponse(target, res); err != nil { 5849 return nil, err 5850 } 5851 return ret, nil 5852 // { 5853 // "description": "Inserts a resource containing information about a database inside a Cloud SQL instance.", 5854 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 5855 // "httpMethod": "POST", 5856 // "id": "sql.databases.insert", 5857 // "parameterOrder": [ 5858 // "project", 5859 // "instance" 5860 // ], 5861 // "parameters": { 5862 // "instance": { 5863 // "description": "Database instance ID. This does not include the project ID.", 5864 // "location": "path", 5865 // "required": true, 5866 // "type": "string" 5867 // }, 5868 // "project": { 5869 // "description": "Project ID of the project that contains the instance.", 5870 // "location": "path", 5871 // "required": true, 5872 // "type": "string" 5873 // } 5874 // }, 5875 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 5876 // "request": { 5877 // "$ref": "Database" 5878 // }, 5879 // "response": { 5880 // "$ref": "Operation" 5881 // }, 5882 // "scopes": [ 5883 // "https://www.googleapis.com/auth/cloud-platform", 5884 // "https://www.googleapis.com/auth/sqlservice.admin" 5885 // ] 5886 // } 5887 5888} 5889 5890// method id "sql.databases.list": 5891 5892type DatabasesListCall struct { 5893 s *Service 5894 project string 5895 instance string 5896 urlParams_ gensupport.URLParams 5897 ifNoneMatch_ string 5898 ctx_ context.Context 5899 header_ http.Header 5900} 5901 5902// List: Lists databases in the specified Cloud SQL instance. 5903// 5904// - instance: Cloud SQL instance ID. This does not include the project 5905// ID. 5906// - project: Project ID of the project that contains the instance. 5907func (r *DatabasesService) List(project string, instance string) *DatabasesListCall { 5908 c := &DatabasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5909 c.project = project 5910 c.instance = instance 5911 return c 5912} 5913 5914// Fields allows partial responses to be retrieved. See 5915// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5916// for more information. 5917func (c *DatabasesListCall) Fields(s ...googleapi.Field) *DatabasesListCall { 5918 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5919 return c 5920} 5921 5922// IfNoneMatch sets the optional parameter which makes the operation 5923// fail if the object's ETag matches the given value. This is useful for 5924// getting updates only after the object has changed since the last 5925// request. Use googleapi.IsNotModified to check whether the response 5926// error from Do is the result of In-None-Match. 5927func (c *DatabasesListCall) IfNoneMatch(entityTag string) *DatabasesListCall { 5928 c.ifNoneMatch_ = entityTag 5929 return c 5930} 5931 5932// Context sets the context to be used in this call's Do method. Any 5933// pending HTTP request will be aborted if the provided context is 5934// canceled. 5935func (c *DatabasesListCall) Context(ctx context.Context) *DatabasesListCall { 5936 c.ctx_ = ctx 5937 return c 5938} 5939 5940// Header returns an http.Header that can be modified by the caller to 5941// add HTTP headers to the request. 5942func (c *DatabasesListCall) Header() http.Header { 5943 if c.header_ == nil { 5944 c.header_ = make(http.Header) 5945 } 5946 return c.header_ 5947} 5948 5949func (c *DatabasesListCall) doRequest(alt string) (*http.Response, error) { 5950 reqHeaders := make(http.Header) 5951 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 5952 for k, v := range c.header_ { 5953 reqHeaders[k] = v 5954 } 5955 reqHeaders.Set("User-Agent", c.s.userAgent()) 5956 if c.ifNoneMatch_ != "" { 5957 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5958 } 5959 var body io.Reader = nil 5960 c.urlParams_.Set("alt", alt) 5961 c.urlParams_.Set("prettyPrint", "false") 5962 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases") 5963 urls += "?" + c.urlParams_.Encode() 5964 req, err := http.NewRequest("GET", urls, body) 5965 if err != nil { 5966 return nil, err 5967 } 5968 req.Header = reqHeaders 5969 googleapi.Expand(req.URL, map[string]string{ 5970 "project": c.project, 5971 "instance": c.instance, 5972 }) 5973 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5974} 5975 5976// Do executes the "sql.databases.list" call. 5977// Exactly one of *DatabasesListResponse or error will be non-nil. Any 5978// non-2xx status code is an error. Response headers are in either 5979// *DatabasesListResponse.ServerResponse.Header or (if a response was 5980// returned at all) in error.(*googleapi.Error).Header. Use 5981// googleapi.IsNotModified to check whether the returned error was 5982// because http.StatusNotModified was returned. 5983func (c *DatabasesListCall) Do(opts ...googleapi.CallOption) (*DatabasesListResponse, error) { 5984 gensupport.SetOptions(c.urlParams_, opts...) 5985 res, err := c.doRequest("json") 5986 if res != nil && res.StatusCode == http.StatusNotModified { 5987 if res.Body != nil { 5988 res.Body.Close() 5989 } 5990 return nil, &googleapi.Error{ 5991 Code: res.StatusCode, 5992 Header: res.Header, 5993 } 5994 } 5995 if err != nil { 5996 return nil, err 5997 } 5998 defer googleapi.CloseBody(res) 5999 if err := googleapi.CheckResponse(res); err != nil { 6000 return nil, err 6001 } 6002 ret := &DatabasesListResponse{ 6003 ServerResponse: googleapi.ServerResponse{ 6004 Header: res.Header, 6005 HTTPStatusCode: res.StatusCode, 6006 }, 6007 } 6008 target := &ret 6009 if err := gensupport.DecodeResponse(target, res); err != nil { 6010 return nil, err 6011 } 6012 return ret, nil 6013 // { 6014 // "description": "Lists databases in the specified Cloud SQL instance.", 6015 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 6016 // "httpMethod": "GET", 6017 // "id": "sql.databases.list", 6018 // "parameterOrder": [ 6019 // "project", 6020 // "instance" 6021 // ], 6022 // "parameters": { 6023 // "instance": { 6024 // "description": "Cloud SQL instance ID. This does not include the project ID.", 6025 // "location": "path", 6026 // "required": true, 6027 // "type": "string" 6028 // }, 6029 // "project": { 6030 // "description": "Project ID of the project that contains the instance.", 6031 // "location": "path", 6032 // "required": true, 6033 // "type": "string" 6034 // } 6035 // }, 6036 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases", 6037 // "response": { 6038 // "$ref": "DatabasesListResponse" 6039 // }, 6040 // "scopes": [ 6041 // "https://www.googleapis.com/auth/cloud-platform", 6042 // "https://www.googleapis.com/auth/sqlservice.admin" 6043 // ] 6044 // } 6045 6046} 6047 6048// method id "sql.databases.patch": 6049 6050type DatabasesPatchCall struct { 6051 s *Service 6052 project string 6053 instance string 6054 database string 6055 database2 *Database 6056 urlParams_ gensupport.URLParams 6057 ctx_ context.Context 6058 header_ http.Header 6059} 6060 6061// Patch: Partially updates a resource containing information about a 6062// database inside a Cloud SQL instance. This method supports patch 6063// semantics. 6064// 6065// - database: Name of the database to be updated in the instance. 6066// - instance: Database instance ID. This does not include the project 6067// ID. 6068// - project: Project ID of the project that contains the instance. 6069func (r *DatabasesService) Patch(project string, instance string, database string, database2 *Database) *DatabasesPatchCall { 6070 c := &DatabasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6071 c.project = project 6072 c.instance = instance 6073 c.database = database 6074 c.database2 = database2 6075 return c 6076} 6077 6078// Fields allows partial responses to be retrieved. See 6079// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6080// for more information. 6081func (c *DatabasesPatchCall) Fields(s ...googleapi.Field) *DatabasesPatchCall { 6082 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6083 return c 6084} 6085 6086// Context sets the context to be used in this call's Do method. Any 6087// pending HTTP request will be aborted if the provided context is 6088// canceled. 6089func (c *DatabasesPatchCall) Context(ctx context.Context) *DatabasesPatchCall { 6090 c.ctx_ = ctx 6091 return c 6092} 6093 6094// Header returns an http.Header that can be modified by the caller to 6095// add HTTP headers to the request. 6096func (c *DatabasesPatchCall) Header() http.Header { 6097 if c.header_ == nil { 6098 c.header_ = make(http.Header) 6099 } 6100 return c.header_ 6101} 6102 6103func (c *DatabasesPatchCall) doRequest(alt string) (*http.Response, error) { 6104 reqHeaders := make(http.Header) 6105 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6106 for k, v := range c.header_ { 6107 reqHeaders[k] = v 6108 } 6109 reqHeaders.Set("User-Agent", c.s.userAgent()) 6110 var body io.Reader = nil 6111 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) 6112 if err != nil { 6113 return nil, err 6114 } 6115 reqHeaders.Set("Content-Type", "application/json") 6116 c.urlParams_.Set("alt", alt) 6117 c.urlParams_.Set("prettyPrint", "false") 6118 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 6119 urls += "?" + c.urlParams_.Encode() 6120 req, err := http.NewRequest("PATCH", urls, body) 6121 if err != nil { 6122 return nil, err 6123 } 6124 req.Header = reqHeaders 6125 googleapi.Expand(req.URL, map[string]string{ 6126 "project": c.project, 6127 "instance": c.instance, 6128 "database": c.database, 6129 }) 6130 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6131} 6132 6133// Do executes the "sql.databases.patch" call. 6134// Exactly one of *Operation or error will be non-nil. Any non-2xx 6135// status code is an error. Response headers are in either 6136// *Operation.ServerResponse.Header or (if a response was returned at 6137// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6138// to check whether the returned error was because 6139// http.StatusNotModified was returned. 6140func (c *DatabasesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6141 gensupport.SetOptions(c.urlParams_, opts...) 6142 res, err := c.doRequest("json") 6143 if res != nil && res.StatusCode == http.StatusNotModified { 6144 if res.Body != nil { 6145 res.Body.Close() 6146 } 6147 return nil, &googleapi.Error{ 6148 Code: res.StatusCode, 6149 Header: res.Header, 6150 } 6151 } 6152 if err != nil { 6153 return nil, err 6154 } 6155 defer googleapi.CloseBody(res) 6156 if err := googleapi.CheckResponse(res); err != nil { 6157 return nil, err 6158 } 6159 ret := &Operation{ 6160 ServerResponse: googleapi.ServerResponse{ 6161 Header: res.Header, 6162 HTTPStatusCode: res.StatusCode, 6163 }, 6164 } 6165 target := &ret 6166 if err := gensupport.DecodeResponse(target, res); err != nil { 6167 return nil, err 6168 } 6169 return ret, nil 6170 // { 6171 // "description": "Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.", 6172 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 6173 // "httpMethod": "PATCH", 6174 // "id": "sql.databases.patch", 6175 // "parameterOrder": [ 6176 // "project", 6177 // "instance", 6178 // "database" 6179 // ], 6180 // "parameters": { 6181 // "database": { 6182 // "description": "Name of the database to be updated in the instance.", 6183 // "location": "path", 6184 // "required": true, 6185 // "type": "string" 6186 // }, 6187 // "instance": { 6188 // "description": "Database instance ID. This does not include the project ID.", 6189 // "location": "path", 6190 // "required": true, 6191 // "type": "string" 6192 // }, 6193 // "project": { 6194 // "description": "Project ID of the project that contains the instance.", 6195 // "location": "path", 6196 // "required": true, 6197 // "type": "string" 6198 // } 6199 // }, 6200 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 6201 // "request": { 6202 // "$ref": "Database" 6203 // }, 6204 // "response": { 6205 // "$ref": "Operation" 6206 // }, 6207 // "scopes": [ 6208 // "https://www.googleapis.com/auth/cloud-platform", 6209 // "https://www.googleapis.com/auth/sqlservice.admin" 6210 // ] 6211 // } 6212 6213} 6214 6215// method id "sql.databases.update": 6216 6217type DatabasesUpdateCall struct { 6218 s *Service 6219 project string 6220 instance string 6221 database string 6222 database2 *Database 6223 urlParams_ gensupport.URLParams 6224 ctx_ context.Context 6225 header_ http.Header 6226} 6227 6228// Update: Updates a resource containing information about a database 6229// inside a Cloud SQL instance. 6230// 6231// - database: Name of the database to be updated in the instance. 6232// - instance: Database instance ID. This does not include the project 6233// ID. 6234// - project: Project ID of the project that contains the instance. 6235func (r *DatabasesService) Update(project string, instance string, database string, database2 *Database) *DatabasesUpdateCall { 6236 c := &DatabasesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6237 c.project = project 6238 c.instance = instance 6239 c.database = database 6240 c.database2 = database2 6241 return c 6242} 6243 6244// Fields allows partial responses to be retrieved. See 6245// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6246// for more information. 6247func (c *DatabasesUpdateCall) Fields(s ...googleapi.Field) *DatabasesUpdateCall { 6248 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6249 return c 6250} 6251 6252// Context sets the context to be used in this call's Do method. Any 6253// pending HTTP request will be aborted if the provided context is 6254// canceled. 6255func (c *DatabasesUpdateCall) Context(ctx context.Context) *DatabasesUpdateCall { 6256 c.ctx_ = ctx 6257 return c 6258} 6259 6260// Header returns an http.Header that can be modified by the caller to 6261// add HTTP headers to the request. 6262func (c *DatabasesUpdateCall) Header() http.Header { 6263 if c.header_ == nil { 6264 c.header_ = make(http.Header) 6265 } 6266 return c.header_ 6267} 6268 6269func (c *DatabasesUpdateCall) doRequest(alt string) (*http.Response, error) { 6270 reqHeaders := make(http.Header) 6271 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6272 for k, v := range c.header_ { 6273 reqHeaders[k] = v 6274 } 6275 reqHeaders.Set("User-Agent", c.s.userAgent()) 6276 var body io.Reader = nil 6277 body, err := googleapi.WithoutDataWrapper.JSONReader(c.database2) 6278 if err != nil { 6279 return nil, err 6280 } 6281 reqHeaders.Set("Content-Type", "application/json") 6282 c.urlParams_.Set("alt", alt) 6283 c.urlParams_.Set("prettyPrint", "false") 6284 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}") 6285 urls += "?" + c.urlParams_.Encode() 6286 req, err := http.NewRequest("PUT", urls, body) 6287 if err != nil { 6288 return nil, err 6289 } 6290 req.Header = reqHeaders 6291 googleapi.Expand(req.URL, map[string]string{ 6292 "project": c.project, 6293 "instance": c.instance, 6294 "database": c.database, 6295 }) 6296 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6297} 6298 6299// Do executes the "sql.databases.update" call. 6300// Exactly one of *Operation or error will be non-nil. Any non-2xx 6301// status code is an error. Response headers are in either 6302// *Operation.ServerResponse.Header or (if a response was returned at 6303// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6304// to check whether the returned error was because 6305// http.StatusNotModified was returned. 6306func (c *DatabasesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6307 gensupport.SetOptions(c.urlParams_, opts...) 6308 res, err := c.doRequest("json") 6309 if res != nil && res.StatusCode == http.StatusNotModified { 6310 if res.Body != nil { 6311 res.Body.Close() 6312 } 6313 return nil, &googleapi.Error{ 6314 Code: res.StatusCode, 6315 Header: res.Header, 6316 } 6317 } 6318 if err != nil { 6319 return nil, err 6320 } 6321 defer googleapi.CloseBody(res) 6322 if err := googleapi.CheckResponse(res); err != nil { 6323 return nil, err 6324 } 6325 ret := &Operation{ 6326 ServerResponse: googleapi.ServerResponse{ 6327 Header: res.Header, 6328 HTTPStatusCode: res.StatusCode, 6329 }, 6330 } 6331 target := &ret 6332 if err := gensupport.DecodeResponse(target, res); err != nil { 6333 return nil, err 6334 } 6335 return ret, nil 6336 // { 6337 // "description": "Updates a resource containing information about a database inside a Cloud SQL instance.", 6338 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 6339 // "httpMethod": "PUT", 6340 // "id": "sql.databases.update", 6341 // "parameterOrder": [ 6342 // "project", 6343 // "instance", 6344 // "database" 6345 // ], 6346 // "parameters": { 6347 // "database": { 6348 // "description": "Name of the database to be updated in the instance.", 6349 // "location": "path", 6350 // "required": true, 6351 // "type": "string" 6352 // }, 6353 // "instance": { 6354 // "description": "Database instance ID. This does not include the project ID.", 6355 // "location": "path", 6356 // "required": true, 6357 // "type": "string" 6358 // }, 6359 // "project": { 6360 // "description": "Project ID of the project that contains the instance.", 6361 // "location": "path", 6362 // "required": true, 6363 // "type": "string" 6364 // } 6365 // }, 6366 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}", 6367 // "request": { 6368 // "$ref": "Database" 6369 // }, 6370 // "response": { 6371 // "$ref": "Operation" 6372 // }, 6373 // "scopes": [ 6374 // "https://www.googleapis.com/auth/cloud-platform", 6375 // "https://www.googleapis.com/auth/sqlservice.admin" 6376 // ] 6377 // } 6378 6379} 6380 6381// method id "sql.flags.list": 6382 6383type FlagsListCall struct { 6384 s *Service 6385 urlParams_ gensupport.URLParams 6386 ifNoneMatch_ string 6387 ctx_ context.Context 6388 header_ http.Header 6389} 6390 6391// List: Lists all available database flags for Cloud SQL instances. 6392func (r *FlagsService) List() *FlagsListCall { 6393 c := &FlagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6394 return c 6395} 6396 6397// DatabaseVersion sets the optional parameter "databaseVersion": 6398// Database type and version you want to retrieve flags for. By default, 6399// this method returns flags for all database types and versions. 6400func (c *FlagsListCall) DatabaseVersion(databaseVersion string) *FlagsListCall { 6401 c.urlParams_.Set("databaseVersion", databaseVersion) 6402 return c 6403} 6404 6405// Fields allows partial responses to be retrieved. See 6406// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6407// for more information. 6408func (c *FlagsListCall) Fields(s ...googleapi.Field) *FlagsListCall { 6409 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6410 return c 6411} 6412 6413// IfNoneMatch sets the optional parameter which makes the operation 6414// fail if the object's ETag matches the given value. This is useful for 6415// getting updates only after the object has changed since the last 6416// request. Use googleapi.IsNotModified to check whether the response 6417// error from Do is the result of In-None-Match. 6418func (c *FlagsListCall) IfNoneMatch(entityTag string) *FlagsListCall { 6419 c.ifNoneMatch_ = entityTag 6420 return c 6421} 6422 6423// Context sets the context to be used in this call's Do method. Any 6424// pending HTTP request will be aborted if the provided context is 6425// canceled. 6426func (c *FlagsListCall) Context(ctx context.Context) *FlagsListCall { 6427 c.ctx_ = ctx 6428 return c 6429} 6430 6431// Header returns an http.Header that can be modified by the caller to 6432// add HTTP headers to the request. 6433func (c *FlagsListCall) Header() http.Header { 6434 if c.header_ == nil { 6435 c.header_ = make(http.Header) 6436 } 6437 return c.header_ 6438} 6439 6440func (c *FlagsListCall) doRequest(alt string) (*http.Response, error) { 6441 reqHeaders := make(http.Header) 6442 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6443 for k, v := range c.header_ { 6444 reqHeaders[k] = v 6445 } 6446 reqHeaders.Set("User-Agent", c.s.userAgent()) 6447 if c.ifNoneMatch_ != "" { 6448 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6449 } 6450 var body io.Reader = nil 6451 c.urlParams_.Set("alt", alt) 6452 c.urlParams_.Set("prettyPrint", "false") 6453 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/flags") 6454 urls += "?" + c.urlParams_.Encode() 6455 req, err := http.NewRequest("GET", urls, body) 6456 if err != nil { 6457 return nil, err 6458 } 6459 req.Header = reqHeaders 6460 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6461} 6462 6463// Do executes the "sql.flags.list" call. 6464// Exactly one of *FlagsListResponse or error will be non-nil. Any 6465// non-2xx status code is an error. Response headers are in either 6466// *FlagsListResponse.ServerResponse.Header or (if a response was 6467// returned at all) in error.(*googleapi.Error).Header. Use 6468// googleapi.IsNotModified to check whether the returned error was 6469// because http.StatusNotModified was returned. 6470func (c *FlagsListCall) Do(opts ...googleapi.CallOption) (*FlagsListResponse, error) { 6471 gensupport.SetOptions(c.urlParams_, opts...) 6472 res, err := c.doRequest("json") 6473 if res != nil && res.StatusCode == http.StatusNotModified { 6474 if res.Body != nil { 6475 res.Body.Close() 6476 } 6477 return nil, &googleapi.Error{ 6478 Code: res.StatusCode, 6479 Header: res.Header, 6480 } 6481 } 6482 if err != nil { 6483 return nil, err 6484 } 6485 defer googleapi.CloseBody(res) 6486 if err := googleapi.CheckResponse(res); err != nil { 6487 return nil, err 6488 } 6489 ret := &FlagsListResponse{ 6490 ServerResponse: googleapi.ServerResponse{ 6491 Header: res.Header, 6492 HTTPStatusCode: res.StatusCode, 6493 }, 6494 } 6495 target := &ret 6496 if err := gensupport.DecodeResponse(target, res); err != nil { 6497 return nil, err 6498 } 6499 return ret, nil 6500 // { 6501 // "description": "Lists all available database flags for Cloud SQL instances.", 6502 // "flatPath": "sql/v1beta4/flags", 6503 // "httpMethod": "GET", 6504 // "id": "sql.flags.list", 6505 // "parameterOrder": [], 6506 // "parameters": { 6507 // "databaseVersion": { 6508 // "description": "Database type and version you want to retrieve flags for. By default, this method returns flags for all database types and versions.", 6509 // "location": "query", 6510 // "type": "string" 6511 // } 6512 // }, 6513 // "path": "sql/v1beta4/flags", 6514 // "response": { 6515 // "$ref": "FlagsListResponse" 6516 // }, 6517 // "scopes": [ 6518 // "https://www.googleapis.com/auth/cloud-platform", 6519 // "https://www.googleapis.com/auth/sqlservice.admin" 6520 // ] 6521 // } 6522 6523} 6524 6525// method id "sql.instances.addServerCa": 6526 6527type InstancesAddServerCaCall struct { 6528 s *Service 6529 project string 6530 instance string 6531 urlParams_ gensupport.URLParams 6532 ctx_ context.Context 6533 header_ http.Header 6534} 6535 6536// AddServerCa: Add a new trusted Certificate Authority (CA) version for 6537// the specified instance. Required to prepare for a certificate 6538// rotation. If a CA version was previously added but never used in a 6539// certificate rotation, this operation replaces that version. There 6540// cannot be more than one CA version waiting to be rotated in. 6541// 6542// - instance: Cloud SQL instance ID. This does not include the project 6543// ID. 6544// - project: Project ID of the project that contains the instance. 6545func (r *InstancesService) AddServerCa(project string, instance string) *InstancesAddServerCaCall { 6546 c := &InstancesAddServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6547 c.project = project 6548 c.instance = instance 6549 return c 6550} 6551 6552// Fields allows partial responses to be retrieved. See 6553// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6554// for more information. 6555func (c *InstancesAddServerCaCall) Fields(s ...googleapi.Field) *InstancesAddServerCaCall { 6556 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6557 return c 6558} 6559 6560// Context sets the context to be used in this call's Do method. Any 6561// pending HTTP request will be aborted if the provided context is 6562// canceled. 6563func (c *InstancesAddServerCaCall) Context(ctx context.Context) *InstancesAddServerCaCall { 6564 c.ctx_ = ctx 6565 return c 6566} 6567 6568// Header returns an http.Header that can be modified by the caller to 6569// add HTTP headers to the request. 6570func (c *InstancesAddServerCaCall) Header() http.Header { 6571 if c.header_ == nil { 6572 c.header_ = make(http.Header) 6573 } 6574 return c.header_ 6575} 6576 6577func (c *InstancesAddServerCaCall) doRequest(alt string) (*http.Response, error) { 6578 reqHeaders := make(http.Header) 6579 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6580 for k, v := range c.header_ { 6581 reqHeaders[k] = v 6582 } 6583 reqHeaders.Set("User-Agent", c.s.userAgent()) 6584 var body io.Reader = nil 6585 c.urlParams_.Set("alt", alt) 6586 c.urlParams_.Set("prettyPrint", "false") 6587 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa") 6588 urls += "?" + c.urlParams_.Encode() 6589 req, err := http.NewRequest("POST", urls, body) 6590 if err != nil { 6591 return nil, err 6592 } 6593 req.Header = reqHeaders 6594 googleapi.Expand(req.URL, map[string]string{ 6595 "project": c.project, 6596 "instance": c.instance, 6597 }) 6598 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6599} 6600 6601// Do executes the "sql.instances.addServerCa" call. 6602// Exactly one of *Operation or error will be non-nil. Any non-2xx 6603// status code is an error. Response headers are in either 6604// *Operation.ServerResponse.Header or (if a response was returned at 6605// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6606// to check whether the returned error was because 6607// http.StatusNotModified was returned. 6608func (c *InstancesAddServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6609 gensupport.SetOptions(c.urlParams_, opts...) 6610 res, err := c.doRequest("json") 6611 if res != nil && res.StatusCode == http.StatusNotModified { 6612 if res.Body != nil { 6613 res.Body.Close() 6614 } 6615 return nil, &googleapi.Error{ 6616 Code: res.StatusCode, 6617 Header: res.Header, 6618 } 6619 } 6620 if err != nil { 6621 return nil, err 6622 } 6623 defer googleapi.CloseBody(res) 6624 if err := googleapi.CheckResponse(res); err != nil { 6625 return nil, err 6626 } 6627 ret := &Operation{ 6628 ServerResponse: googleapi.ServerResponse{ 6629 Header: res.Header, 6630 HTTPStatusCode: res.StatusCode, 6631 }, 6632 } 6633 target := &ret 6634 if err := gensupport.DecodeResponse(target, res); err != nil { 6635 return nil, err 6636 } 6637 return ret, nil 6638 // { 6639 // "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.", 6640 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa", 6641 // "httpMethod": "POST", 6642 // "id": "sql.instances.addServerCa", 6643 // "parameterOrder": [ 6644 // "project", 6645 // "instance" 6646 // ], 6647 // "parameters": { 6648 // "instance": { 6649 // "description": "Cloud SQL instance ID. This does not include the project ID.", 6650 // "location": "path", 6651 // "required": true, 6652 // "type": "string" 6653 // }, 6654 // "project": { 6655 // "description": "Project ID of the project that contains the instance.", 6656 // "location": "path", 6657 // "required": true, 6658 // "type": "string" 6659 // } 6660 // }, 6661 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/addServerCa", 6662 // "response": { 6663 // "$ref": "Operation" 6664 // }, 6665 // "scopes": [ 6666 // "https://www.googleapis.com/auth/cloud-platform", 6667 // "https://www.googleapis.com/auth/sqlservice.admin" 6668 // ] 6669 // } 6670 6671} 6672 6673// method id "sql.instances.clone": 6674 6675type InstancesCloneCall struct { 6676 s *Service 6677 project string 6678 instance string 6679 instancesclonerequest *InstancesCloneRequest 6680 urlParams_ gensupport.URLParams 6681 ctx_ context.Context 6682 header_ http.Header 6683} 6684 6685// Clone: Creates a Cloud SQL instance as a clone of the source 6686// instance. Using this operation might cause your instance to restart. 6687// 6688// - instance: The ID of the Cloud SQL instance to be cloned (source). 6689// This does not include the project ID. 6690// - project: Project ID of the source as well as the clone Cloud SQL 6691// instance. 6692func (r *InstancesService) Clone(project string, instance string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall { 6693 c := &InstancesCloneCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6694 c.project = project 6695 c.instance = instance 6696 c.instancesclonerequest = instancesclonerequest 6697 return c 6698} 6699 6700// Fields allows partial responses to be retrieved. See 6701// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6702// for more information. 6703func (c *InstancesCloneCall) Fields(s ...googleapi.Field) *InstancesCloneCall { 6704 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6705 return c 6706} 6707 6708// Context sets the context to be used in this call's Do method. Any 6709// pending HTTP request will be aborted if the provided context is 6710// canceled. 6711func (c *InstancesCloneCall) Context(ctx context.Context) *InstancesCloneCall { 6712 c.ctx_ = ctx 6713 return c 6714} 6715 6716// Header returns an http.Header that can be modified by the caller to 6717// add HTTP headers to the request. 6718func (c *InstancesCloneCall) Header() http.Header { 6719 if c.header_ == nil { 6720 c.header_ = make(http.Header) 6721 } 6722 return c.header_ 6723} 6724 6725func (c *InstancesCloneCall) doRequest(alt string) (*http.Response, error) { 6726 reqHeaders := make(http.Header) 6727 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6728 for k, v := range c.header_ { 6729 reqHeaders[k] = v 6730 } 6731 reqHeaders.Set("User-Agent", c.s.userAgent()) 6732 var body io.Reader = nil 6733 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesclonerequest) 6734 if err != nil { 6735 return nil, err 6736 } 6737 reqHeaders.Set("Content-Type", "application/json") 6738 c.urlParams_.Set("alt", alt) 6739 c.urlParams_.Set("prettyPrint", "false") 6740 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/clone") 6741 urls += "?" + c.urlParams_.Encode() 6742 req, err := http.NewRequest("POST", urls, body) 6743 if err != nil { 6744 return nil, err 6745 } 6746 req.Header = reqHeaders 6747 googleapi.Expand(req.URL, map[string]string{ 6748 "project": c.project, 6749 "instance": c.instance, 6750 }) 6751 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6752} 6753 6754// Do executes the "sql.instances.clone" call. 6755// Exactly one of *Operation or error will be non-nil. Any non-2xx 6756// status code is an error. Response headers are in either 6757// *Operation.ServerResponse.Header or (if a response was returned at 6758// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6759// to check whether the returned error was because 6760// http.StatusNotModified was returned. 6761func (c *InstancesCloneCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6762 gensupport.SetOptions(c.urlParams_, opts...) 6763 res, err := c.doRequest("json") 6764 if res != nil && res.StatusCode == http.StatusNotModified { 6765 if res.Body != nil { 6766 res.Body.Close() 6767 } 6768 return nil, &googleapi.Error{ 6769 Code: res.StatusCode, 6770 Header: res.Header, 6771 } 6772 } 6773 if err != nil { 6774 return nil, err 6775 } 6776 defer googleapi.CloseBody(res) 6777 if err := googleapi.CheckResponse(res); err != nil { 6778 return nil, err 6779 } 6780 ret := &Operation{ 6781 ServerResponse: googleapi.ServerResponse{ 6782 Header: res.Header, 6783 HTTPStatusCode: res.StatusCode, 6784 }, 6785 } 6786 target := &ret 6787 if err := gensupport.DecodeResponse(target, res); err != nil { 6788 return nil, err 6789 } 6790 return ret, nil 6791 // { 6792 // "description": "Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.", 6793 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/clone", 6794 // "httpMethod": "POST", 6795 // "id": "sql.instances.clone", 6796 // "parameterOrder": [ 6797 // "project", 6798 // "instance" 6799 // ], 6800 // "parameters": { 6801 // "instance": { 6802 // "description": "The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID.", 6803 // "location": "path", 6804 // "required": true, 6805 // "type": "string" 6806 // }, 6807 // "project": { 6808 // "description": "Project ID of the source as well as the clone Cloud SQL instance.", 6809 // "location": "path", 6810 // "required": true, 6811 // "type": "string" 6812 // } 6813 // }, 6814 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/clone", 6815 // "request": { 6816 // "$ref": "InstancesCloneRequest" 6817 // }, 6818 // "response": { 6819 // "$ref": "Operation" 6820 // }, 6821 // "scopes": [ 6822 // "https://www.googleapis.com/auth/cloud-platform", 6823 // "https://www.googleapis.com/auth/sqlservice.admin" 6824 // ] 6825 // } 6826 6827} 6828 6829// method id "sql.instances.delete": 6830 6831type InstancesDeleteCall struct { 6832 s *Service 6833 project string 6834 instance string 6835 urlParams_ gensupport.URLParams 6836 ctx_ context.Context 6837 header_ http.Header 6838} 6839 6840// Delete: Deletes a Cloud SQL instance. 6841// 6842// - instance: Cloud SQL instance ID. This does not include the project 6843// ID. 6844// - project: Project ID of the project that contains the instance to be 6845// deleted. 6846func (r *InstancesService) Delete(project string, instance string) *InstancesDeleteCall { 6847 c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6848 c.project = project 6849 c.instance = instance 6850 return c 6851} 6852 6853// Fields allows partial responses to be retrieved. See 6854// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6855// for more information. 6856func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall { 6857 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6858 return c 6859} 6860 6861// Context sets the context to be used in this call's Do method. Any 6862// pending HTTP request will be aborted if the provided context is 6863// canceled. 6864func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall { 6865 c.ctx_ = ctx 6866 return c 6867} 6868 6869// Header returns an http.Header that can be modified by the caller to 6870// add HTTP headers to the request. 6871func (c *InstancesDeleteCall) Header() http.Header { 6872 if c.header_ == nil { 6873 c.header_ = make(http.Header) 6874 } 6875 return c.header_ 6876} 6877 6878func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { 6879 reqHeaders := make(http.Header) 6880 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 6881 for k, v := range c.header_ { 6882 reqHeaders[k] = v 6883 } 6884 reqHeaders.Set("User-Agent", c.s.userAgent()) 6885 var body io.Reader = nil 6886 c.urlParams_.Set("alt", alt) 6887 c.urlParams_.Set("prettyPrint", "false") 6888 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 6889 urls += "?" + c.urlParams_.Encode() 6890 req, err := http.NewRequest("DELETE", urls, body) 6891 if err != nil { 6892 return nil, err 6893 } 6894 req.Header = reqHeaders 6895 googleapi.Expand(req.URL, map[string]string{ 6896 "project": c.project, 6897 "instance": c.instance, 6898 }) 6899 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6900} 6901 6902// Do executes the "sql.instances.delete" call. 6903// Exactly one of *Operation or error will be non-nil. Any non-2xx 6904// status code is an error. Response headers are in either 6905// *Operation.ServerResponse.Header or (if a response was returned at 6906// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6907// to check whether the returned error was because 6908// http.StatusNotModified was returned. 6909func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6910 gensupport.SetOptions(c.urlParams_, opts...) 6911 res, err := c.doRequest("json") 6912 if res != nil && res.StatusCode == http.StatusNotModified { 6913 if res.Body != nil { 6914 res.Body.Close() 6915 } 6916 return nil, &googleapi.Error{ 6917 Code: res.StatusCode, 6918 Header: res.Header, 6919 } 6920 } 6921 if err != nil { 6922 return nil, err 6923 } 6924 defer googleapi.CloseBody(res) 6925 if err := googleapi.CheckResponse(res); err != nil { 6926 return nil, err 6927 } 6928 ret := &Operation{ 6929 ServerResponse: googleapi.ServerResponse{ 6930 Header: res.Header, 6931 HTTPStatusCode: res.StatusCode, 6932 }, 6933 } 6934 target := &ret 6935 if err := gensupport.DecodeResponse(target, res); err != nil { 6936 return nil, err 6937 } 6938 return ret, nil 6939 // { 6940 // "description": "Deletes a Cloud SQL instance.", 6941 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 6942 // "httpMethod": "DELETE", 6943 // "id": "sql.instances.delete", 6944 // "parameterOrder": [ 6945 // "project", 6946 // "instance" 6947 // ], 6948 // "parameters": { 6949 // "instance": { 6950 // "description": "Cloud SQL instance ID. This does not include the project ID.", 6951 // "location": "path", 6952 // "required": true, 6953 // "type": "string" 6954 // }, 6955 // "project": { 6956 // "description": "Project ID of the project that contains the instance to be deleted.", 6957 // "location": "path", 6958 // "required": true, 6959 // "type": "string" 6960 // } 6961 // }, 6962 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 6963 // "response": { 6964 // "$ref": "Operation" 6965 // }, 6966 // "scopes": [ 6967 // "https://www.googleapis.com/auth/cloud-platform", 6968 // "https://www.googleapis.com/auth/sqlservice.admin" 6969 // ] 6970 // } 6971 6972} 6973 6974// method id "sql.instances.demoteMaster": 6975 6976type InstancesDemoteMasterCall struct { 6977 s *Service 6978 project string 6979 instance string 6980 instancesdemotemasterrequest *InstancesDemoteMasterRequest 6981 urlParams_ gensupport.URLParams 6982 ctx_ context.Context 6983 header_ http.Header 6984} 6985 6986// DemoteMaster: Demotes the stand-alone instance to be a Cloud SQL read 6987// replica for an external database server. 6988// 6989// - instance: Cloud SQL instance name. 6990// - project: ID of the project that contains the instance. 6991func (r *InstancesService) DemoteMaster(project string, instance string, instancesdemotemasterrequest *InstancesDemoteMasterRequest) *InstancesDemoteMasterCall { 6992 c := &InstancesDemoteMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6993 c.project = project 6994 c.instance = instance 6995 c.instancesdemotemasterrequest = instancesdemotemasterrequest 6996 return c 6997} 6998 6999// Fields allows partial responses to be retrieved. See 7000// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7001// for more information. 7002func (c *InstancesDemoteMasterCall) Fields(s ...googleapi.Field) *InstancesDemoteMasterCall { 7003 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7004 return c 7005} 7006 7007// Context sets the context to be used in this call's Do method. Any 7008// pending HTTP request will be aborted if the provided context is 7009// canceled. 7010func (c *InstancesDemoteMasterCall) Context(ctx context.Context) *InstancesDemoteMasterCall { 7011 c.ctx_ = ctx 7012 return c 7013} 7014 7015// Header returns an http.Header that can be modified by the caller to 7016// add HTTP headers to the request. 7017func (c *InstancesDemoteMasterCall) Header() http.Header { 7018 if c.header_ == nil { 7019 c.header_ = make(http.Header) 7020 } 7021 return c.header_ 7022} 7023 7024func (c *InstancesDemoteMasterCall) doRequest(alt string) (*http.Response, error) { 7025 reqHeaders := make(http.Header) 7026 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7027 for k, v := range c.header_ { 7028 reqHeaders[k] = v 7029 } 7030 reqHeaders.Set("User-Agent", c.s.userAgent()) 7031 var body io.Reader = nil 7032 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesdemotemasterrequest) 7033 if err != nil { 7034 return nil, err 7035 } 7036 reqHeaders.Set("Content-Type", "application/json") 7037 c.urlParams_.Set("alt", alt) 7038 c.urlParams_.Set("prettyPrint", "false") 7039 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster") 7040 urls += "?" + c.urlParams_.Encode() 7041 req, err := http.NewRequest("POST", urls, body) 7042 if err != nil { 7043 return nil, err 7044 } 7045 req.Header = reqHeaders 7046 googleapi.Expand(req.URL, map[string]string{ 7047 "project": c.project, 7048 "instance": c.instance, 7049 }) 7050 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7051} 7052 7053// Do executes the "sql.instances.demoteMaster" call. 7054// Exactly one of *Operation or error will be non-nil. Any non-2xx 7055// status code is an error. Response headers are in either 7056// *Operation.ServerResponse.Header or (if a response was returned at 7057// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7058// to check whether the returned error was because 7059// http.StatusNotModified was returned. 7060func (c *InstancesDemoteMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7061 gensupport.SetOptions(c.urlParams_, opts...) 7062 res, err := c.doRequest("json") 7063 if res != nil && res.StatusCode == http.StatusNotModified { 7064 if res.Body != nil { 7065 res.Body.Close() 7066 } 7067 return nil, &googleapi.Error{ 7068 Code: res.StatusCode, 7069 Header: res.Header, 7070 } 7071 } 7072 if err != nil { 7073 return nil, err 7074 } 7075 defer googleapi.CloseBody(res) 7076 if err := googleapi.CheckResponse(res); err != nil { 7077 return nil, err 7078 } 7079 ret := &Operation{ 7080 ServerResponse: googleapi.ServerResponse{ 7081 Header: res.Header, 7082 HTTPStatusCode: res.StatusCode, 7083 }, 7084 } 7085 target := &ret 7086 if err := gensupport.DecodeResponse(target, res); err != nil { 7087 return nil, err 7088 } 7089 return ret, nil 7090 // { 7091 // "description": "Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.", 7092 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster", 7093 // "httpMethod": "POST", 7094 // "id": "sql.instances.demoteMaster", 7095 // "parameterOrder": [ 7096 // "project", 7097 // "instance" 7098 // ], 7099 // "parameters": { 7100 // "instance": { 7101 // "description": "Cloud SQL instance name.", 7102 // "location": "path", 7103 // "required": true, 7104 // "type": "string" 7105 // }, 7106 // "project": { 7107 // "description": "ID of the project that contains the instance.", 7108 // "location": "path", 7109 // "required": true, 7110 // "type": "string" 7111 // } 7112 // }, 7113 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster", 7114 // "request": { 7115 // "$ref": "InstancesDemoteMasterRequest" 7116 // }, 7117 // "response": { 7118 // "$ref": "Operation" 7119 // }, 7120 // "scopes": [ 7121 // "https://www.googleapis.com/auth/cloud-platform", 7122 // "https://www.googleapis.com/auth/sqlservice.admin" 7123 // ] 7124 // } 7125 7126} 7127 7128// method id "sql.instances.export": 7129 7130type InstancesExportCall struct { 7131 s *Service 7132 project string 7133 instance string 7134 instancesexportrequest *InstancesExportRequest 7135 urlParams_ gensupport.URLParams 7136 ctx_ context.Context 7137 header_ http.Header 7138} 7139 7140// Export: Exports data from a Cloud SQL instance to a Cloud Storage 7141// bucket as a SQL dump or CSV file. 7142// 7143// - instance: Cloud SQL instance ID. This does not include the project 7144// ID. 7145// - project: Project ID of the project that contains the instance to be 7146// exported. 7147func (r *InstancesService) Export(project string, instance string, instancesexportrequest *InstancesExportRequest) *InstancesExportCall { 7148 c := &InstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7149 c.project = project 7150 c.instance = instance 7151 c.instancesexportrequest = instancesexportrequest 7152 return c 7153} 7154 7155// Fields allows partial responses to be retrieved. See 7156// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7157// for more information. 7158func (c *InstancesExportCall) Fields(s ...googleapi.Field) *InstancesExportCall { 7159 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7160 return c 7161} 7162 7163// Context sets the context to be used in this call's Do method. Any 7164// pending HTTP request will be aborted if the provided context is 7165// canceled. 7166func (c *InstancesExportCall) Context(ctx context.Context) *InstancesExportCall { 7167 c.ctx_ = ctx 7168 return c 7169} 7170 7171// Header returns an http.Header that can be modified by the caller to 7172// add HTTP headers to the request. 7173func (c *InstancesExportCall) Header() http.Header { 7174 if c.header_ == nil { 7175 c.header_ = make(http.Header) 7176 } 7177 return c.header_ 7178} 7179 7180func (c *InstancesExportCall) doRequest(alt string) (*http.Response, error) { 7181 reqHeaders := make(http.Header) 7182 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7183 for k, v := range c.header_ { 7184 reqHeaders[k] = v 7185 } 7186 reqHeaders.Set("User-Agent", c.s.userAgent()) 7187 var body io.Reader = nil 7188 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesexportrequest) 7189 if err != nil { 7190 return nil, err 7191 } 7192 reqHeaders.Set("Content-Type", "application/json") 7193 c.urlParams_.Set("alt", alt) 7194 c.urlParams_.Set("prettyPrint", "false") 7195 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/export") 7196 urls += "?" + c.urlParams_.Encode() 7197 req, err := http.NewRequest("POST", urls, body) 7198 if err != nil { 7199 return nil, err 7200 } 7201 req.Header = reqHeaders 7202 googleapi.Expand(req.URL, map[string]string{ 7203 "project": c.project, 7204 "instance": c.instance, 7205 }) 7206 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7207} 7208 7209// Do executes the "sql.instances.export" call. 7210// Exactly one of *Operation or error will be non-nil. Any non-2xx 7211// status code is an error. Response headers are in either 7212// *Operation.ServerResponse.Header or (if a response was returned at 7213// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7214// to check whether the returned error was because 7215// http.StatusNotModified was returned. 7216func (c *InstancesExportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7217 gensupport.SetOptions(c.urlParams_, opts...) 7218 res, err := c.doRequest("json") 7219 if res != nil && res.StatusCode == http.StatusNotModified { 7220 if res.Body != nil { 7221 res.Body.Close() 7222 } 7223 return nil, &googleapi.Error{ 7224 Code: res.StatusCode, 7225 Header: res.Header, 7226 } 7227 } 7228 if err != nil { 7229 return nil, err 7230 } 7231 defer googleapi.CloseBody(res) 7232 if err := googleapi.CheckResponse(res); err != nil { 7233 return nil, err 7234 } 7235 ret := &Operation{ 7236 ServerResponse: googleapi.ServerResponse{ 7237 Header: res.Header, 7238 HTTPStatusCode: res.StatusCode, 7239 }, 7240 } 7241 target := &ret 7242 if err := gensupport.DecodeResponse(target, res); err != nil { 7243 return nil, err 7244 } 7245 return ret, nil 7246 // { 7247 // "description": "Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.", 7248 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/export", 7249 // "httpMethod": "POST", 7250 // "id": "sql.instances.export", 7251 // "parameterOrder": [ 7252 // "project", 7253 // "instance" 7254 // ], 7255 // "parameters": { 7256 // "instance": { 7257 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7258 // "location": "path", 7259 // "required": true, 7260 // "type": "string" 7261 // }, 7262 // "project": { 7263 // "description": "Project ID of the project that contains the instance to be exported.", 7264 // "location": "path", 7265 // "required": true, 7266 // "type": "string" 7267 // } 7268 // }, 7269 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/export", 7270 // "request": { 7271 // "$ref": "InstancesExportRequest" 7272 // }, 7273 // "response": { 7274 // "$ref": "Operation" 7275 // }, 7276 // "scopes": [ 7277 // "https://www.googleapis.com/auth/cloud-platform" 7278 // ] 7279 // } 7280 7281} 7282 7283// method id "sql.instances.failover": 7284 7285type InstancesFailoverCall struct { 7286 s *Service 7287 project string 7288 instance string 7289 instancesfailoverrequest *InstancesFailoverRequest 7290 urlParams_ gensupport.URLParams 7291 ctx_ context.Context 7292 header_ http.Header 7293} 7294 7295// Failover: Initiates a manual failover of a high availability (HA) 7296// primary instance to a standby instance, which becomes the primary 7297// instance. Users are then rerouted to the new primary. For more 7298// information, see the Overview of high availability 7299// (https://cloud.google.com/sql/docs/mysql/high-availability) page in 7300// the Cloud SQL documentation. If using Legacy HA (MySQL only), this 7301// causes the instance to failover to its failover replica instance. 7302// 7303// - instance: Cloud SQL instance ID. This does not include the project 7304// ID. 7305// - project: ID of the project that contains the read replica. 7306func (r *InstancesService) Failover(project string, instance string, instancesfailoverrequest *InstancesFailoverRequest) *InstancesFailoverCall { 7307 c := &InstancesFailoverCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7308 c.project = project 7309 c.instance = instance 7310 c.instancesfailoverrequest = instancesfailoverrequest 7311 return c 7312} 7313 7314// Fields allows partial responses to be retrieved. See 7315// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7316// for more information. 7317func (c *InstancesFailoverCall) Fields(s ...googleapi.Field) *InstancesFailoverCall { 7318 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7319 return c 7320} 7321 7322// Context sets the context to be used in this call's Do method. Any 7323// pending HTTP request will be aborted if the provided context is 7324// canceled. 7325func (c *InstancesFailoverCall) Context(ctx context.Context) *InstancesFailoverCall { 7326 c.ctx_ = ctx 7327 return c 7328} 7329 7330// Header returns an http.Header that can be modified by the caller to 7331// add HTTP headers to the request. 7332func (c *InstancesFailoverCall) Header() http.Header { 7333 if c.header_ == nil { 7334 c.header_ = make(http.Header) 7335 } 7336 return c.header_ 7337} 7338 7339func (c *InstancesFailoverCall) doRequest(alt string) (*http.Response, error) { 7340 reqHeaders := make(http.Header) 7341 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7342 for k, v := range c.header_ { 7343 reqHeaders[k] = v 7344 } 7345 reqHeaders.Set("User-Agent", c.s.userAgent()) 7346 var body io.Reader = nil 7347 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesfailoverrequest) 7348 if err != nil { 7349 return nil, err 7350 } 7351 reqHeaders.Set("Content-Type", "application/json") 7352 c.urlParams_.Set("alt", alt) 7353 c.urlParams_.Set("prettyPrint", "false") 7354 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/failover") 7355 urls += "?" + c.urlParams_.Encode() 7356 req, err := http.NewRequest("POST", urls, body) 7357 if err != nil { 7358 return nil, err 7359 } 7360 req.Header = reqHeaders 7361 googleapi.Expand(req.URL, map[string]string{ 7362 "project": c.project, 7363 "instance": c.instance, 7364 }) 7365 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7366} 7367 7368// Do executes the "sql.instances.failover" call. 7369// Exactly one of *Operation or error will be non-nil. Any non-2xx 7370// status code is an error. Response headers are in either 7371// *Operation.ServerResponse.Header or (if a response was returned at 7372// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7373// to check whether the returned error was because 7374// http.StatusNotModified was returned. 7375func (c *InstancesFailoverCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7376 gensupport.SetOptions(c.urlParams_, opts...) 7377 res, err := c.doRequest("json") 7378 if res != nil && res.StatusCode == http.StatusNotModified { 7379 if res.Body != nil { 7380 res.Body.Close() 7381 } 7382 return nil, &googleapi.Error{ 7383 Code: res.StatusCode, 7384 Header: res.Header, 7385 } 7386 } 7387 if err != nil { 7388 return nil, err 7389 } 7390 defer googleapi.CloseBody(res) 7391 if err := googleapi.CheckResponse(res); err != nil { 7392 return nil, err 7393 } 7394 ret := &Operation{ 7395 ServerResponse: googleapi.ServerResponse{ 7396 Header: res.Header, 7397 HTTPStatusCode: res.StatusCode, 7398 }, 7399 } 7400 target := &ret 7401 if err := gensupport.DecodeResponse(target, res); err != nil { 7402 return nil, err 7403 } 7404 return ret, nil 7405 // { 7406 // "description": "Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to the new primary. For more information, see the [Overview of high availability](https://cloud.google.com/sql/docs/mysql/high-availability) page in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its failover replica instance.", 7407 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/failover", 7408 // "httpMethod": "POST", 7409 // "id": "sql.instances.failover", 7410 // "parameterOrder": [ 7411 // "project", 7412 // "instance" 7413 // ], 7414 // "parameters": { 7415 // "instance": { 7416 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7417 // "location": "path", 7418 // "required": true, 7419 // "type": "string" 7420 // }, 7421 // "project": { 7422 // "description": "ID of the project that contains the read replica.", 7423 // "location": "path", 7424 // "required": true, 7425 // "type": "string" 7426 // } 7427 // }, 7428 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/failover", 7429 // "request": { 7430 // "$ref": "InstancesFailoverRequest" 7431 // }, 7432 // "response": { 7433 // "$ref": "Operation" 7434 // }, 7435 // "scopes": [ 7436 // "https://www.googleapis.com/auth/cloud-platform", 7437 // "https://www.googleapis.com/auth/sqlservice.admin" 7438 // ] 7439 // } 7440 7441} 7442 7443// method id "sql.instances.get": 7444 7445type InstancesGetCall struct { 7446 s *Service 7447 project string 7448 instance string 7449 urlParams_ gensupport.URLParams 7450 ifNoneMatch_ string 7451 ctx_ context.Context 7452 header_ http.Header 7453} 7454 7455// Get: Retrieves a resource containing information about a Cloud SQL 7456// instance. 7457// 7458// - instance: Database instance ID. This does not include the project 7459// ID. 7460// - project: Project ID of the project that contains the instance. 7461func (r *InstancesService) Get(project string, instance string) *InstancesGetCall { 7462 c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7463 c.project = project 7464 c.instance = instance 7465 return c 7466} 7467 7468// Fields allows partial responses to be retrieved. See 7469// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7470// for more information. 7471func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall { 7472 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7473 return c 7474} 7475 7476// IfNoneMatch sets the optional parameter which makes the operation 7477// fail if the object's ETag matches the given value. This is useful for 7478// getting updates only after the object has changed since the last 7479// request. Use googleapi.IsNotModified to check whether the response 7480// error from Do is the result of In-None-Match. 7481func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall { 7482 c.ifNoneMatch_ = entityTag 7483 return c 7484} 7485 7486// Context sets the context to be used in this call's Do method. Any 7487// pending HTTP request will be aborted if the provided context is 7488// canceled. 7489func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall { 7490 c.ctx_ = ctx 7491 return c 7492} 7493 7494// Header returns an http.Header that can be modified by the caller to 7495// add HTTP headers to the request. 7496func (c *InstancesGetCall) Header() http.Header { 7497 if c.header_ == nil { 7498 c.header_ = make(http.Header) 7499 } 7500 return c.header_ 7501} 7502 7503func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { 7504 reqHeaders := make(http.Header) 7505 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7506 for k, v := range c.header_ { 7507 reqHeaders[k] = v 7508 } 7509 reqHeaders.Set("User-Agent", c.s.userAgent()) 7510 if c.ifNoneMatch_ != "" { 7511 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7512 } 7513 var body io.Reader = nil 7514 c.urlParams_.Set("alt", alt) 7515 c.urlParams_.Set("prettyPrint", "false") 7516 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 7517 urls += "?" + c.urlParams_.Encode() 7518 req, err := http.NewRequest("GET", urls, body) 7519 if err != nil { 7520 return nil, err 7521 } 7522 req.Header = reqHeaders 7523 googleapi.Expand(req.URL, map[string]string{ 7524 "project": c.project, 7525 "instance": c.instance, 7526 }) 7527 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7528} 7529 7530// Do executes the "sql.instances.get" call. 7531// Exactly one of *DatabaseInstance or error will be non-nil. Any 7532// non-2xx status code is an error. Response headers are in either 7533// *DatabaseInstance.ServerResponse.Header or (if a response was 7534// returned at all) in error.(*googleapi.Error).Header. Use 7535// googleapi.IsNotModified to check whether the returned error was 7536// because http.StatusNotModified was returned. 7537func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*DatabaseInstance, error) { 7538 gensupport.SetOptions(c.urlParams_, opts...) 7539 res, err := c.doRequest("json") 7540 if res != nil && res.StatusCode == http.StatusNotModified { 7541 if res.Body != nil { 7542 res.Body.Close() 7543 } 7544 return nil, &googleapi.Error{ 7545 Code: res.StatusCode, 7546 Header: res.Header, 7547 } 7548 } 7549 if err != nil { 7550 return nil, err 7551 } 7552 defer googleapi.CloseBody(res) 7553 if err := googleapi.CheckResponse(res); err != nil { 7554 return nil, err 7555 } 7556 ret := &DatabaseInstance{ 7557 ServerResponse: googleapi.ServerResponse{ 7558 Header: res.Header, 7559 HTTPStatusCode: res.StatusCode, 7560 }, 7561 } 7562 target := &ret 7563 if err := gensupport.DecodeResponse(target, res); err != nil { 7564 return nil, err 7565 } 7566 return ret, nil 7567 // { 7568 // "description": "Retrieves a resource containing information about a Cloud SQL instance.", 7569 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 7570 // "httpMethod": "GET", 7571 // "id": "sql.instances.get", 7572 // "parameterOrder": [ 7573 // "project", 7574 // "instance" 7575 // ], 7576 // "parameters": { 7577 // "instance": { 7578 // "description": "Database instance ID. This does not include the project ID.", 7579 // "location": "path", 7580 // "required": true, 7581 // "type": "string" 7582 // }, 7583 // "project": { 7584 // "description": "Project ID of the project that contains the instance.", 7585 // "location": "path", 7586 // "required": true, 7587 // "type": "string" 7588 // } 7589 // }, 7590 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 7591 // "response": { 7592 // "$ref": "DatabaseInstance" 7593 // }, 7594 // "scopes": [ 7595 // "https://www.googleapis.com/auth/cloud-platform", 7596 // "https://www.googleapis.com/auth/sqlservice.admin" 7597 // ] 7598 // } 7599 7600} 7601 7602// method id "sql.instances.import": 7603 7604type InstancesImportCall struct { 7605 s *Service 7606 project string 7607 instance string 7608 instancesimportrequest *InstancesImportRequest 7609 urlParams_ gensupport.URLParams 7610 ctx_ context.Context 7611 header_ http.Header 7612} 7613 7614// Import: Imports data into a Cloud SQL instance from a SQL dump or CSV 7615// file in Cloud Storage. 7616// 7617// - instance: Cloud SQL instance ID. This does not include the project 7618// ID. 7619// - project: Project ID of the project that contains the instance. 7620func (r *InstancesService) Import(project string, instance string, instancesimportrequest *InstancesImportRequest) *InstancesImportCall { 7621 c := &InstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7622 c.project = project 7623 c.instance = instance 7624 c.instancesimportrequest = instancesimportrequest 7625 return c 7626} 7627 7628// Fields allows partial responses to be retrieved. See 7629// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7630// for more information. 7631func (c *InstancesImportCall) Fields(s ...googleapi.Field) *InstancesImportCall { 7632 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7633 return c 7634} 7635 7636// Context sets the context to be used in this call's Do method. Any 7637// pending HTTP request will be aborted if the provided context is 7638// canceled. 7639func (c *InstancesImportCall) Context(ctx context.Context) *InstancesImportCall { 7640 c.ctx_ = ctx 7641 return c 7642} 7643 7644// Header returns an http.Header that can be modified by the caller to 7645// add HTTP headers to the request. 7646func (c *InstancesImportCall) Header() http.Header { 7647 if c.header_ == nil { 7648 c.header_ = make(http.Header) 7649 } 7650 return c.header_ 7651} 7652 7653func (c *InstancesImportCall) doRequest(alt string) (*http.Response, error) { 7654 reqHeaders := make(http.Header) 7655 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7656 for k, v := range c.header_ { 7657 reqHeaders[k] = v 7658 } 7659 reqHeaders.Set("User-Agent", c.s.userAgent()) 7660 var body io.Reader = nil 7661 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesimportrequest) 7662 if err != nil { 7663 return nil, err 7664 } 7665 reqHeaders.Set("Content-Type", "application/json") 7666 c.urlParams_.Set("alt", alt) 7667 c.urlParams_.Set("prettyPrint", "false") 7668 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/import") 7669 urls += "?" + c.urlParams_.Encode() 7670 req, err := http.NewRequest("POST", urls, body) 7671 if err != nil { 7672 return nil, err 7673 } 7674 req.Header = reqHeaders 7675 googleapi.Expand(req.URL, map[string]string{ 7676 "project": c.project, 7677 "instance": c.instance, 7678 }) 7679 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7680} 7681 7682// Do executes the "sql.instances.import" call. 7683// Exactly one of *Operation or error will be non-nil. Any non-2xx 7684// status code is an error. Response headers are in either 7685// *Operation.ServerResponse.Header or (if a response was returned at 7686// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7687// to check whether the returned error was because 7688// http.StatusNotModified was returned. 7689func (c *InstancesImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7690 gensupport.SetOptions(c.urlParams_, opts...) 7691 res, err := c.doRequest("json") 7692 if res != nil && res.StatusCode == http.StatusNotModified { 7693 if res.Body != nil { 7694 res.Body.Close() 7695 } 7696 return nil, &googleapi.Error{ 7697 Code: res.StatusCode, 7698 Header: res.Header, 7699 } 7700 } 7701 if err != nil { 7702 return nil, err 7703 } 7704 defer googleapi.CloseBody(res) 7705 if err := googleapi.CheckResponse(res); err != nil { 7706 return nil, err 7707 } 7708 ret := &Operation{ 7709 ServerResponse: googleapi.ServerResponse{ 7710 Header: res.Header, 7711 HTTPStatusCode: res.StatusCode, 7712 }, 7713 } 7714 target := &ret 7715 if err := gensupport.DecodeResponse(target, res); err != nil { 7716 return nil, err 7717 } 7718 return ret, nil 7719 // { 7720 // "description": "Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.", 7721 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/import", 7722 // "httpMethod": "POST", 7723 // "id": "sql.instances.import", 7724 // "parameterOrder": [ 7725 // "project", 7726 // "instance" 7727 // ], 7728 // "parameters": { 7729 // "instance": { 7730 // "description": "Cloud SQL instance ID. This does not include the project ID.", 7731 // "location": "path", 7732 // "required": true, 7733 // "type": "string" 7734 // }, 7735 // "project": { 7736 // "description": "Project ID of the project that contains the instance.", 7737 // "location": "path", 7738 // "required": true, 7739 // "type": "string" 7740 // } 7741 // }, 7742 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/import", 7743 // "request": { 7744 // "$ref": "InstancesImportRequest" 7745 // }, 7746 // "response": { 7747 // "$ref": "Operation" 7748 // }, 7749 // "scopes": [ 7750 // "https://www.googleapis.com/auth/cloud-platform" 7751 // ] 7752 // } 7753 7754} 7755 7756// method id "sql.instances.insert": 7757 7758type InstancesInsertCall struct { 7759 s *Service 7760 project string 7761 databaseinstance *DatabaseInstance 7762 urlParams_ gensupport.URLParams 7763 ctx_ context.Context 7764 header_ http.Header 7765} 7766 7767// Insert: Creates a new Cloud SQL instance. 7768// 7769// - project: Project ID of the project to which the newly created Cloud 7770// SQL instances should belong. 7771func (r *InstancesService) Insert(project string, databaseinstance *DatabaseInstance) *InstancesInsertCall { 7772 c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7773 c.project = project 7774 c.databaseinstance = databaseinstance 7775 return c 7776} 7777 7778// Fields allows partial responses to be retrieved. See 7779// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7780// for more information. 7781func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall { 7782 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7783 return c 7784} 7785 7786// Context sets the context to be used in this call's Do method. Any 7787// pending HTTP request will be aborted if the provided context is 7788// canceled. 7789func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall { 7790 c.ctx_ = ctx 7791 return c 7792} 7793 7794// Header returns an http.Header that can be modified by the caller to 7795// add HTTP headers to the request. 7796func (c *InstancesInsertCall) Header() http.Header { 7797 if c.header_ == nil { 7798 c.header_ = make(http.Header) 7799 } 7800 return c.header_ 7801} 7802 7803func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) { 7804 reqHeaders := make(http.Header) 7805 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7806 for k, v := range c.header_ { 7807 reqHeaders[k] = v 7808 } 7809 reqHeaders.Set("User-Agent", c.s.userAgent()) 7810 var body io.Reader = nil 7811 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) 7812 if err != nil { 7813 return nil, err 7814 } 7815 reqHeaders.Set("Content-Type", "application/json") 7816 c.urlParams_.Set("alt", alt) 7817 c.urlParams_.Set("prettyPrint", "false") 7818 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances") 7819 urls += "?" + c.urlParams_.Encode() 7820 req, err := http.NewRequest("POST", urls, body) 7821 if err != nil { 7822 return nil, err 7823 } 7824 req.Header = reqHeaders 7825 googleapi.Expand(req.URL, map[string]string{ 7826 "project": c.project, 7827 }) 7828 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7829} 7830 7831// Do executes the "sql.instances.insert" call. 7832// Exactly one of *Operation or error will be non-nil. Any non-2xx 7833// status code is an error. Response headers are in either 7834// *Operation.ServerResponse.Header or (if a response was returned at 7835// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7836// to check whether the returned error was because 7837// http.StatusNotModified was returned. 7838func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7839 gensupport.SetOptions(c.urlParams_, opts...) 7840 res, err := c.doRequest("json") 7841 if res != nil && res.StatusCode == http.StatusNotModified { 7842 if res.Body != nil { 7843 res.Body.Close() 7844 } 7845 return nil, &googleapi.Error{ 7846 Code: res.StatusCode, 7847 Header: res.Header, 7848 } 7849 } 7850 if err != nil { 7851 return nil, err 7852 } 7853 defer googleapi.CloseBody(res) 7854 if err := googleapi.CheckResponse(res); err != nil { 7855 return nil, err 7856 } 7857 ret := &Operation{ 7858 ServerResponse: googleapi.ServerResponse{ 7859 Header: res.Header, 7860 HTTPStatusCode: res.StatusCode, 7861 }, 7862 } 7863 target := &ret 7864 if err := gensupport.DecodeResponse(target, res); err != nil { 7865 return nil, err 7866 } 7867 return ret, nil 7868 // { 7869 // "description": "Creates a new Cloud SQL instance.", 7870 // "flatPath": "sql/v1beta4/projects/{project}/instances", 7871 // "httpMethod": "POST", 7872 // "id": "sql.instances.insert", 7873 // "parameterOrder": [ 7874 // "project" 7875 // ], 7876 // "parameters": { 7877 // "project": { 7878 // "description": "Project ID of the project to which the newly created Cloud SQL instances should belong.", 7879 // "location": "path", 7880 // "required": true, 7881 // "type": "string" 7882 // } 7883 // }, 7884 // "path": "sql/v1beta4/projects/{project}/instances", 7885 // "request": { 7886 // "$ref": "DatabaseInstance" 7887 // }, 7888 // "response": { 7889 // "$ref": "Operation" 7890 // }, 7891 // "scopes": [ 7892 // "https://www.googleapis.com/auth/cloud-platform", 7893 // "https://www.googleapis.com/auth/sqlservice.admin" 7894 // ] 7895 // } 7896 7897} 7898 7899// method id "sql.instances.list": 7900 7901type InstancesListCall struct { 7902 s *Service 7903 project string 7904 urlParams_ gensupport.URLParams 7905 ifNoneMatch_ string 7906 ctx_ context.Context 7907 header_ http.Header 7908} 7909 7910// List: Lists instances under a given project. 7911// 7912// - project: Project ID of the project for which to list Cloud SQL 7913// instances. 7914func (r *InstancesService) List(project string) *InstancesListCall { 7915 c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7916 c.project = project 7917 return c 7918} 7919 7920// Filter sets the optional parameter "filter": A filter expression that 7921// filters resources listed in the response. The expression is in the 7922// form of field:value. For example, 'instanceType:CLOUD_SQL_INSTANCE'. 7923// Fields can be nested as needed as per their JSON representation, such 7924// as 'settings.userLabels.auto_start:true'. Multiple filter queries are 7925// space-separated. For example. 'state:RUNNABLE 7926// instanceType:CLOUD_SQL_INSTANCE'. By default, each expression is an 7927// AND expression. However, you can include AND and OR expressions 7928// explicitly. 7929func (c *InstancesListCall) Filter(filter string) *InstancesListCall { 7930 c.urlParams_.Set("filter", filter) 7931 return c 7932} 7933 7934// MaxResults sets the optional parameter "maxResults": The maximum 7935// number of results to return per response. 7936func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { 7937 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 7938 return c 7939} 7940 7941// PageToken sets the optional parameter "pageToken": A 7942// previously-returned page token representing part of the larger set of 7943// results to view. 7944func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { 7945 c.urlParams_.Set("pageToken", pageToken) 7946 return c 7947} 7948 7949// Fields allows partial responses to be retrieved. See 7950// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7951// for more information. 7952func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall { 7953 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7954 return c 7955} 7956 7957// IfNoneMatch sets the optional parameter which makes the operation 7958// fail if the object's ETag matches the given value. This is useful for 7959// getting updates only after the object has changed since the last 7960// request. Use googleapi.IsNotModified to check whether the response 7961// error from Do is the result of In-None-Match. 7962func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall { 7963 c.ifNoneMatch_ = entityTag 7964 return c 7965} 7966 7967// Context sets the context to be used in this call's Do method. Any 7968// pending HTTP request will be aborted if the provided context is 7969// canceled. 7970func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall { 7971 c.ctx_ = ctx 7972 return c 7973} 7974 7975// Header returns an http.Header that can be modified by the caller to 7976// add HTTP headers to the request. 7977func (c *InstancesListCall) Header() http.Header { 7978 if c.header_ == nil { 7979 c.header_ = make(http.Header) 7980 } 7981 return c.header_ 7982} 7983 7984func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { 7985 reqHeaders := make(http.Header) 7986 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 7987 for k, v := range c.header_ { 7988 reqHeaders[k] = v 7989 } 7990 reqHeaders.Set("User-Agent", c.s.userAgent()) 7991 if c.ifNoneMatch_ != "" { 7992 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7993 } 7994 var body io.Reader = nil 7995 c.urlParams_.Set("alt", alt) 7996 c.urlParams_.Set("prettyPrint", "false") 7997 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances") 7998 urls += "?" + c.urlParams_.Encode() 7999 req, err := http.NewRequest("GET", urls, body) 8000 if err != nil { 8001 return nil, err 8002 } 8003 req.Header = reqHeaders 8004 googleapi.Expand(req.URL, map[string]string{ 8005 "project": c.project, 8006 }) 8007 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8008} 8009 8010// Do executes the "sql.instances.list" call. 8011// Exactly one of *InstancesListResponse or error will be non-nil. Any 8012// non-2xx status code is an error. Response headers are in either 8013// *InstancesListResponse.ServerResponse.Header or (if a response was 8014// returned at all) in error.(*googleapi.Error).Header. Use 8015// googleapi.IsNotModified to check whether the returned error was 8016// because http.StatusNotModified was returned. 8017func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstancesListResponse, error) { 8018 gensupport.SetOptions(c.urlParams_, opts...) 8019 res, err := c.doRequest("json") 8020 if res != nil && res.StatusCode == http.StatusNotModified { 8021 if res.Body != nil { 8022 res.Body.Close() 8023 } 8024 return nil, &googleapi.Error{ 8025 Code: res.StatusCode, 8026 Header: res.Header, 8027 } 8028 } 8029 if err != nil { 8030 return nil, err 8031 } 8032 defer googleapi.CloseBody(res) 8033 if err := googleapi.CheckResponse(res); err != nil { 8034 return nil, err 8035 } 8036 ret := &InstancesListResponse{ 8037 ServerResponse: googleapi.ServerResponse{ 8038 Header: res.Header, 8039 HTTPStatusCode: res.StatusCode, 8040 }, 8041 } 8042 target := &ret 8043 if err := gensupport.DecodeResponse(target, res); err != nil { 8044 return nil, err 8045 } 8046 return ret, nil 8047 // { 8048 // "description": "Lists instances under a given project.", 8049 // "flatPath": "sql/v1beta4/projects/{project}/instances", 8050 // "httpMethod": "GET", 8051 // "id": "sql.instances.list", 8052 // "parameterOrder": [ 8053 // "project" 8054 // ], 8055 // "parameters": { 8056 // "filter": { 8057 // "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.", 8058 // "location": "query", 8059 // "type": "string" 8060 // }, 8061 // "maxResults": { 8062 // "description": "The maximum number of results to return per response.", 8063 // "format": "uint32", 8064 // "location": "query", 8065 // "type": "integer" 8066 // }, 8067 // "pageToken": { 8068 // "description": "A previously-returned page token representing part of the larger set of results to view.", 8069 // "location": "query", 8070 // "type": "string" 8071 // }, 8072 // "project": { 8073 // "description": "Project ID of the project for which to list Cloud SQL instances.", 8074 // "location": "path", 8075 // "required": true, 8076 // "type": "string" 8077 // } 8078 // }, 8079 // "path": "sql/v1beta4/projects/{project}/instances", 8080 // "response": { 8081 // "$ref": "InstancesListResponse" 8082 // }, 8083 // "scopes": [ 8084 // "https://www.googleapis.com/auth/cloud-platform", 8085 // "https://www.googleapis.com/auth/sqlservice.admin" 8086 // ] 8087 // } 8088 8089} 8090 8091// Pages invokes f for each page of results. 8092// A non-nil error returned from f will halt the iteration. 8093// The provided context supersedes any context provided to the Context method. 8094func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstancesListResponse) error) error { 8095 c.ctx_ = ctx 8096 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8097 for { 8098 x, err := c.Do() 8099 if err != nil { 8100 return err 8101 } 8102 if err := f(x); err != nil { 8103 return err 8104 } 8105 if x.NextPageToken == "" { 8106 return nil 8107 } 8108 c.PageToken(x.NextPageToken) 8109 } 8110} 8111 8112// method id "sql.instances.listServerCas": 8113 8114type InstancesListServerCasCall struct { 8115 s *Service 8116 project string 8117 instance string 8118 urlParams_ gensupport.URLParams 8119 ifNoneMatch_ string 8120 ctx_ context.Context 8121 header_ http.Header 8122} 8123 8124// ListServerCas: Lists all of the trusted Certificate Authorities (CAs) 8125// for the specified instance. There can be up to three CAs listed: the 8126// CA that was used to sign the certificate that is currently in use, a 8127// CA that has been added but not yet used to sign a certificate, and a 8128// CA used to sign a certificate that has previously rotated out. 8129// 8130// - instance: Cloud SQL instance ID. This does not include the project 8131// ID. 8132// - project: Project ID of the project that contains the instance. 8133func (r *InstancesService) ListServerCas(project string, instance string) *InstancesListServerCasCall { 8134 c := &InstancesListServerCasCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8135 c.project = project 8136 c.instance = instance 8137 return c 8138} 8139 8140// Fields allows partial responses to be retrieved. See 8141// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8142// for more information. 8143func (c *InstancesListServerCasCall) Fields(s ...googleapi.Field) *InstancesListServerCasCall { 8144 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8145 return c 8146} 8147 8148// IfNoneMatch sets the optional parameter which makes the operation 8149// fail if the object's ETag matches the given value. This is useful for 8150// getting updates only after the object has changed since the last 8151// request. Use googleapi.IsNotModified to check whether the response 8152// error from Do is the result of In-None-Match. 8153func (c *InstancesListServerCasCall) IfNoneMatch(entityTag string) *InstancesListServerCasCall { 8154 c.ifNoneMatch_ = entityTag 8155 return c 8156} 8157 8158// Context sets the context to be used in this call's Do method. Any 8159// pending HTTP request will be aborted if the provided context is 8160// canceled. 8161func (c *InstancesListServerCasCall) Context(ctx context.Context) *InstancesListServerCasCall { 8162 c.ctx_ = ctx 8163 return c 8164} 8165 8166// Header returns an http.Header that can be modified by the caller to 8167// add HTTP headers to the request. 8168func (c *InstancesListServerCasCall) Header() http.Header { 8169 if c.header_ == nil { 8170 c.header_ = make(http.Header) 8171 } 8172 return c.header_ 8173} 8174 8175func (c *InstancesListServerCasCall) doRequest(alt string) (*http.Response, error) { 8176 reqHeaders := make(http.Header) 8177 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8178 for k, v := range c.header_ { 8179 reqHeaders[k] = v 8180 } 8181 reqHeaders.Set("User-Agent", c.s.userAgent()) 8182 if c.ifNoneMatch_ != "" { 8183 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8184 } 8185 var body io.Reader = nil 8186 c.urlParams_.Set("alt", alt) 8187 c.urlParams_.Set("prettyPrint", "false") 8188 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas") 8189 urls += "?" + c.urlParams_.Encode() 8190 req, err := http.NewRequest("GET", urls, body) 8191 if err != nil { 8192 return nil, err 8193 } 8194 req.Header = reqHeaders 8195 googleapi.Expand(req.URL, map[string]string{ 8196 "project": c.project, 8197 "instance": c.instance, 8198 }) 8199 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8200} 8201 8202// Do executes the "sql.instances.listServerCas" call. 8203// Exactly one of *InstancesListServerCasResponse or error will be 8204// non-nil. Any non-2xx status code is an error. Response headers are in 8205// either *InstancesListServerCasResponse.ServerResponse.Header or (if a 8206// response was returned at all) in error.(*googleapi.Error).Header. Use 8207// googleapi.IsNotModified to check whether the returned error was 8208// because http.StatusNotModified was returned. 8209func (c *InstancesListServerCasCall) Do(opts ...googleapi.CallOption) (*InstancesListServerCasResponse, error) { 8210 gensupport.SetOptions(c.urlParams_, opts...) 8211 res, err := c.doRequest("json") 8212 if res != nil && res.StatusCode == http.StatusNotModified { 8213 if res.Body != nil { 8214 res.Body.Close() 8215 } 8216 return nil, &googleapi.Error{ 8217 Code: res.StatusCode, 8218 Header: res.Header, 8219 } 8220 } 8221 if err != nil { 8222 return nil, err 8223 } 8224 defer googleapi.CloseBody(res) 8225 if err := googleapi.CheckResponse(res); err != nil { 8226 return nil, err 8227 } 8228 ret := &InstancesListServerCasResponse{ 8229 ServerResponse: googleapi.ServerResponse{ 8230 Header: res.Header, 8231 HTTPStatusCode: res.StatusCode, 8232 }, 8233 } 8234 target := &ret 8235 if err := gensupport.DecodeResponse(target, res); err != nil { 8236 return nil, err 8237 } 8238 return ret, nil 8239 // { 8240 // "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.", 8241 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas", 8242 // "httpMethod": "GET", 8243 // "id": "sql.instances.listServerCas", 8244 // "parameterOrder": [ 8245 // "project", 8246 // "instance" 8247 // ], 8248 // "parameters": { 8249 // "instance": { 8250 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8251 // "location": "path", 8252 // "required": true, 8253 // "type": "string" 8254 // }, 8255 // "project": { 8256 // "description": "Project ID of the project that contains the instance.", 8257 // "location": "path", 8258 // "required": true, 8259 // "type": "string" 8260 // } 8261 // }, 8262 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/listServerCas", 8263 // "response": { 8264 // "$ref": "InstancesListServerCasResponse" 8265 // }, 8266 // "scopes": [ 8267 // "https://www.googleapis.com/auth/cloud-platform", 8268 // "https://www.googleapis.com/auth/sqlservice.admin" 8269 // ] 8270 // } 8271 8272} 8273 8274// method id "sql.instances.patch": 8275 8276type InstancesPatchCall struct { 8277 s *Service 8278 project string 8279 instance string 8280 databaseinstance *DatabaseInstance 8281 urlParams_ gensupport.URLParams 8282 ctx_ context.Context 8283 header_ http.Header 8284} 8285 8286// Patch: Updates settings of a Cloud SQL instance. This method supports 8287// patch semantics. 8288// 8289// - instance: Cloud SQL instance ID. This does not include the project 8290// ID. 8291// - project: Project ID of the project that contains the instance. 8292func (r *InstancesService) Patch(project string, instance string, databaseinstance *DatabaseInstance) *InstancesPatchCall { 8293 c := &InstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8294 c.project = project 8295 c.instance = instance 8296 c.databaseinstance = databaseinstance 8297 return c 8298} 8299 8300// Fields allows partial responses to be retrieved. See 8301// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8302// for more information. 8303func (c *InstancesPatchCall) Fields(s ...googleapi.Field) *InstancesPatchCall { 8304 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8305 return c 8306} 8307 8308// Context sets the context to be used in this call's Do method. Any 8309// pending HTTP request will be aborted if the provided context is 8310// canceled. 8311func (c *InstancesPatchCall) Context(ctx context.Context) *InstancesPatchCall { 8312 c.ctx_ = ctx 8313 return c 8314} 8315 8316// Header returns an http.Header that can be modified by the caller to 8317// add HTTP headers to the request. 8318func (c *InstancesPatchCall) Header() http.Header { 8319 if c.header_ == nil { 8320 c.header_ = make(http.Header) 8321 } 8322 return c.header_ 8323} 8324 8325func (c *InstancesPatchCall) doRequest(alt string) (*http.Response, error) { 8326 reqHeaders := make(http.Header) 8327 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8328 for k, v := range c.header_ { 8329 reqHeaders[k] = v 8330 } 8331 reqHeaders.Set("User-Agent", c.s.userAgent()) 8332 var body io.Reader = nil 8333 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) 8334 if err != nil { 8335 return nil, err 8336 } 8337 reqHeaders.Set("Content-Type", "application/json") 8338 c.urlParams_.Set("alt", alt) 8339 c.urlParams_.Set("prettyPrint", "false") 8340 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 8341 urls += "?" + c.urlParams_.Encode() 8342 req, err := http.NewRequest("PATCH", urls, body) 8343 if err != nil { 8344 return nil, err 8345 } 8346 req.Header = reqHeaders 8347 googleapi.Expand(req.URL, map[string]string{ 8348 "project": c.project, 8349 "instance": c.instance, 8350 }) 8351 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8352} 8353 8354// Do executes the "sql.instances.patch" call. 8355// Exactly one of *Operation or error will be non-nil. Any non-2xx 8356// status code is an error. Response headers are in either 8357// *Operation.ServerResponse.Header or (if a response was returned at 8358// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8359// to check whether the returned error was because 8360// http.StatusNotModified was returned. 8361func (c *InstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8362 gensupport.SetOptions(c.urlParams_, opts...) 8363 res, err := c.doRequest("json") 8364 if res != nil && res.StatusCode == http.StatusNotModified { 8365 if res.Body != nil { 8366 res.Body.Close() 8367 } 8368 return nil, &googleapi.Error{ 8369 Code: res.StatusCode, 8370 Header: res.Header, 8371 } 8372 } 8373 if err != nil { 8374 return nil, err 8375 } 8376 defer googleapi.CloseBody(res) 8377 if err := googleapi.CheckResponse(res); err != nil { 8378 return nil, err 8379 } 8380 ret := &Operation{ 8381 ServerResponse: googleapi.ServerResponse{ 8382 Header: res.Header, 8383 HTTPStatusCode: res.StatusCode, 8384 }, 8385 } 8386 target := &ret 8387 if err := gensupport.DecodeResponse(target, res); err != nil { 8388 return nil, err 8389 } 8390 return ret, nil 8391 // { 8392 // "description": "Updates settings of a Cloud SQL instance. This method supports patch semantics.", 8393 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 8394 // "httpMethod": "PATCH", 8395 // "id": "sql.instances.patch", 8396 // "parameterOrder": [ 8397 // "project", 8398 // "instance" 8399 // ], 8400 // "parameters": { 8401 // "instance": { 8402 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8403 // "location": "path", 8404 // "required": true, 8405 // "type": "string" 8406 // }, 8407 // "project": { 8408 // "description": "Project ID of the project that contains the instance.", 8409 // "location": "path", 8410 // "required": true, 8411 // "type": "string" 8412 // } 8413 // }, 8414 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 8415 // "request": { 8416 // "$ref": "DatabaseInstance" 8417 // }, 8418 // "response": { 8419 // "$ref": "Operation" 8420 // }, 8421 // "scopes": [ 8422 // "https://www.googleapis.com/auth/cloud-platform", 8423 // "https://www.googleapis.com/auth/sqlservice.admin" 8424 // ] 8425 // } 8426 8427} 8428 8429// method id "sql.instances.promoteReplica": 8430 8431type InstancesPromoteReplicaCall struct { 8432 s *Service 8433 project string 8434 instance string 8435 urlParams_ gensupport.URLParams 8436 ctx_ context.Context 8437 header_ http.Header 8438} 8439 8440// PromoteReplica: Promotes the read replica instance to be a 8441// stand-alone Cloud SQL instance. Using this operation might cause your 8442// instance to restart. 8443// 8444// - instance: Cloud SQL read replica instance name. 8445// - project: ID of the project that contains the read replica. 8446func (r *InstancesService) PromoteReplica(project string, instance string) *InstancesPromoteReplicaCall { 8447 c := &InstancesPromoteReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8448 c.project = project 8449 c.instance = instance 8450 return c 8451} 8452 8453// Fields allows partial responses to be retrieved. See 8454// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8455// for more information. 8456func (c *InstancesPromoteReplicaCall) Fields(s ...googleapi.Field) *InstancesPromoteReplicaCall { 8457 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8458 return c 8459} 8460 8461// Context sets the context to be used in this call's Do method. Any 8462// pending HTTP request will be aborted if the provided context is 8463// canceled. 8464func (c *InstancesPromoteReplicaCall) Context(ctx context.Context) *InstancesPromoteReplicaCall { 8465 c.ctx_ = ctx 8466 return c 8467} 8468 8469// Header returns an http.Header that can be modified by the caller to 8470// add HTTP headers to the request. 8471func (c *InstancesPromoteReplicaCall) Header() http.Header { 8472 if c.header_ == nil { 8473 c.header_ = make(http.Header) 8474 } 8475 return c.header_ 8476} 8477 8478func (c *InstancesPromoteReplicaCall) doRequest(alt string) (*http.Response, error) { 8479 reqHeaders := make(http.Header) 8480 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8481 for k, v := range c.header_ { 8482 reqHeaders[k] = v 8483 } 8484 reqHeaders.Set("User-Agent", c.s.userAgent()) 8485 var body io.Reader = nil 8486 c.urlParams_.Set("alt", alt) 8487 c.urlParams_.Set("prettyPrint", "false") 8488 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica") 8489 urls += "?" + c.urlParams_.Encode() 8490 req, err := http.NewRequest("POST", urls, body) 8491 if err != nil { 8492 return nil, err 8493 } 8494 req.Header = reqHeaders 8495 googleapi.Expand(req.URL, map[string]string{ 8496 "project": c.project, 8497 "instance": c.instance, 8498 }) 8499 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8500} 8501 8502// Do executes the "sql.instances.promoteReplica" call. 8503// Exactly one of *Operation or error will be non-nil. Any non-2xx 8504// status code is an error. Response headers are in either 8505// *Operation.ServerResponse.Header or (if a response was returned at 8506// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8507// to check whether the returned error was because 8508// http.StatusNotModified was returned. 8509func (c *InstancesPromoteReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8510 gensupport.SetOptions(c.urlParams_, opts...) 8511 res, err := c.doRequest("json") 8512 if res != nil && res.StatusCode == http.StatusNotModified { 8513 if res.Body != nil { 8514 res.Body.Close() 8515 } 8516 return nil, &googleapi.Error{ 8517 Code: res.StatusCode, 8518 Header: res.Header, 8519 } 8520 } 8521 if err != nil { 8522 return nil, err 8523 } 8524 defer googleapi.CloseBody(res) 8525 if err := googleapi.CheckResponse(res); err != nil { 8526 return nil, err 8527 } 8528 ret := &Operation{ 8529 ServerResponse: googleapi.ServerResponse{ 8530 Header: res.Header, 8531 HTTPStatusCode: res.StatusCode, 8532 }, 8533 } 8534 target := &ret 8535 if err := gensupport.DecodeResponse(target, res); err != nil { 8536 return nil, err 8537 } 8538 return ret, nil 8539 // { 8540 // "description": "Promotes the read replica instance to be a stand-alone Cloud SQL instance. Using this operation might cause your instance to restart.", 8541 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica", 8542 // "httpMethod": "POST", 8543 // "id": "sql.instances.promoteReplica", 8544 // "parameterOrder": [ 8545 // "project", 8546 // "instance" 8547 // ], 8548 // "parameters": { 8549 // "instance": { 8550 // "description": "Cloud SQL read replica instance name.", 8551 // "location": "path", 8552 // "required": true, 8553 // "type": "string" 8554 // }, 8555 // "project": { 8556 // "description": "ID of the project that contains the read replica.", 8557 // "location": "path", 8558 // "required": true, 8559 // "type": "string" 8560 // } 8561 // }, 8562 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica", 8563 // "response": { 8564 // "$ref": "Operation" 8565 // }, 8566 // "scopes": [ 8567 // "https://www.googleapis.com/auth/cloud-platform", 8568 // "https://www.googleapis.com/auth/sqlservice.admin" 8569 // ] 8570 // } 8571 8572} 8573 8574// method id "sql.instances.resetSslConfig": 8575 8576type InstancesResetSslConfigCall struct { 8577 s *Service 8578 project string 8579 instance string 8580 urlParams_ gensupport.URLParams 8581 ctx_ context.Context 8582 header_ http.Header 8583} 8584 8585// ResetSslConfig: Deletes all client certificates and generates a new 8586// server SSL certificate for the instance. 8587// 8588// - instance: Cloud SQL instance ID. This does not include the project 8589// ID. 8590// - project: Project ID of the project that contains the instance. 8591func (r *InstancesService) ResetSslConfig(project string, instance string) *InstancesResetSslConfigCall { 8592 c := &InstancesResetSslConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8593 c.project = project 8594 c.instance = instance 8595 return c 8596} 8597 8598// Fields allows partial responses to be retrieved. See 8599// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8600// for more information. 8601func (c *InstancesResetSslConfigCall) Fields(s ...googleapi.Field) *InstancesResetSslConfigCall { 8602 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8603 return c 8604} 8605 8606// Context sets the context to be used in this call's Do method. Any 8607// pending HTTP request will be aborted if the provided context is 8608// canceled. 8609func (c *InstancesResetSslConfigCall) Context(ctx context.Context) *InstancesResetSslConfigCall { 8610 c.ctx_ = ctx 8611 return c 8612} 8613 8614// Header returns an http.Header that can be modified by the caller to 8615// add HTTP headers to the request. 8616func (c *InstancesResetSslConfigCall) Header() http.Header { 8617 if c.header_ == nil { 8618 c.header_ = make(http.Header) 8619 } 8620 return c.header_ 8621} 8622 8623func (c *InstancesResetSslConfigCall) doRequest(alt string) (*http.Response, error) { 8624 reqHeaders := make(http.Header) 8625 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8626 for k, v := range c.header_ { 8627 reqHeaders[k] = v 8628 } 8629 reqHeaders.Set("User-Agent", c.s.userAgent()) 8630 var body io.Reader = nil 8631 c.urlParams_.Set("alt", alt) 8632 c.urlParams_.Set("prettyPrint", "false") 8633 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig") 8634 urls += "?" + c.urlParams_.Encode() 8635 req, err := http.NewRequest("POST", urls, body) 8636 if err != nil { 8637 return nil, err 8638 } 8639 req.Header = reqHeaders 8640 googleapi.Expand(req.URL, map[string]string{ 8641 "project": c.project, 8642 "instance": c.instance, 8643 }) 8644 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8645} 8646 8647// Do executes the "sql.instances.resetSslConfig" call. 8648// Exactly one of *Operation or error will be non-nil. Any non-2xx 8649// status code is an error. Response headers are in either 8650// *Operation.ServerResponse.Header or (if a response was returned at 8651// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8652// to check whether the returned error was because 8653// http.StatusNotModified was returned. 8654func (c *InstancesResetSslConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8655 gensupport.SetOptions(c.urlParams_, opts...) 8656 res, err := c.doRequest("json") 8657 if res != nil && res.StatusCode == http.StatusNotModified { 8658 if res.Body != nil { 8659 res.Body.Close() 8660 } 8661 return nil, &googleapi.Error{ 8662 Code: res.StatusCode, 8663 Header: res.Header, 8664 } 8665 } 8666 if err != nil { 8667 return nil, err 8668 } 8669 defer googleapi.CloseBody(res) 8670 if err := googleapi.CheckResponse(res); err != nil { 8671 return nil, err 8672 } 8673 ret := &Operation{ 8674 ServerResponse: googleapi.ServerResponse{ 8675 Header: res.Header, 8676 HTTPStatusCode: res.StatusCode, 8677 }, 8678 } 8679 target := &ret 8680 if err := gensupport.DecodeResponse(target, res); err != nil { 8681 return nil, err 8682 } 8683 return ret, nil 8684 // { 8685 // "description": "Deletes all client certificates and generates a new server SSL certificate for the instance.", 8686 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig", 8687 // "httpMethod": "POST", 8688 // "id": "sql.instances.resetSslConfig", 8689 // "parameterOrder": [ 8690 // "project", 8691 // "instance" 8692 // ], 8693 // "parameters": { 8694 // "instance": { 8695 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8696 // "location": "path", 8697 // "required": true, 8698 // "type": "string" 8699 // }, 8700 // "project": { 8701 // "description": "Project ID of the project that contains the instance.", 8702 // "location": "path", 8703 // "required": true, 8704 // "type": "string" 8705 // } 8706 // }, 8707 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig", 8708 // "response": { 8709 // "$ref": "Operation" 8710 // }, 8711 // "scopes": [ 8712 // "https://www.googleapis.com/auth/cloud-platform", 8713 // "https://www.googleapis.com/auth/sqlservice.admin" 8714 // ] 8715 // } 8716 8717} 8718 8719// method id "sql.instances.restart": 8720 8721type InstancesRestartCall struct { 8722 s *Service 8723 project string 8724 instance string 8725 urlParams_ gensupport.URLParams 8726 ctx_ context.Context 8727 header_ http.Header 8728} 8729 8730// Restart: Restarts a Cloud SQL instance. 8731// 8732// - instance: Cloud SQL instance ID. This does not include the project 8733// ID. 8734// - project: Project ID of the project that contains the instance to be 8735// restarted. 8736func (r *InstancesService) Restart(project string, instance string) *InstancesRestartCall { 8737 c := &InstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8738 c.project = project 8739 c.instance = instance 8740 return c 8741} 8742 8743// Fields allows partial responses to be retrieved. See 8744// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8745// for more information. 8746func (c *InstancesRestartCall) Fields(s ...googleapi.Field) *InstancesRestartCall { 8747 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8748 return c 8749} 8750 8751// Context sets the context to be used in this call's Do method. Any 8752// pending HTTP request will be aborted if the provided context is 8753// canceled. 8754func (c *InstancesRestartCall) Context(ctx context.Context) *InstancesRestartCall { 8755 c.ctx_ = ctx 8756 return c 8757} 8758 8759// Header returns an http.Header that can be modified by the caller to 8760// add HTTP headers to the request. 8761func (c *InstancesRestartCall) Header() http.Header { 8762 if c.header_ == nil { 8763 c.header_ = make(http.Header) 8764 } 8765 return c.header_ 8766} 8767 8768func (c *InstancesRestartCall) doRequest(alt string) (*http.Response, error) { 8769 reqHeaders := make(http.Header) 8770 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8771 for k, v := range c.header_ { 8772 reqHeaders[k] = v 8773 } 8774 reqHeaders.Set("User-Agent", c.s.userAgent()) 8775 var body io.Reader = nil 8776 c.urlParams_.Set("alt", alt) 8777 c.urlParams_.Set("prettyPrint", "false") 8778 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/restart") 8779 urls += "?" + c.urlParams_.Encode() 8780 req, err := http.NewRequest("POST", urls, body) 8781 if err != nil { 8782 return nil, err 8783 } 8784 req.Header = reqHeaders 8785 googleapi.Expand(req.URL, map[string]string{ 8786 "project": c.project, 8787 "instance": c.instance, 8788 }) 8789 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8790} 8791 8792// Do executes the "sql.instances.restart" call. 8793// Exactly one of *Operation or error will be non-nil. Any non-2xx 8794// status code is an error. Response headers are in either 8795// *Operation.ServerResponse.Header or (if a response was returned at 8796// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8797// to check whether the returned error was because 8798// http.StatusNotModified was returned. 8799func (c *InstancesRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8800 gensupport.SetOptions(c.urlParams_, opts...) 8801 res, err := c.doRequest("json") 8802 if res != nil && res.StatusCode == http.StatusNotModified { 8803 if res.Body != nil { 8804 res.Body.Close() 8805 } 8806 return nil, &googleapi.Error{ 8807 Code: res.StatusCode, 8808 Header: res.Header, 8809 } 8810 } 8811 if err != nil { 8812 return nil, err 8813 } 8814 defer googleapi.CloseBody(res) 8815 if err := googleapi.CheckResponse(res); err != nil { 8816 return nil, err 8817 } 8818 ret := &Operation{ 8819 ServerResponse: googleapi.ServerResponse{ 8820 Header: res.Header, 8821 HTTPStatusCode: res.StatusCode, 8822 }, 8823 } 8824 target := &ret 8825 if err := gensupport.DecodeResponse(target, res); err != nil { 8826 return nil, err 8827 } 8828 return ret, nil 8829 // { 8830 // "description": "Restarts a Cloud SQL instance.", 8831 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/restart", 8832 // "httpMethod": "POST", 8833 // "id": "sql.instances.restart", 8834 // "parameterOrder": [ 8835 // "project", 8836 // "instance" 8837 // ], 8838 // "parameters": { 8839 // "instance": { 8840 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8841 // "location": "path", 8842 // "required": true, 8843 // "type": "string" 8844 // }, 8845 // "project": { 8846 // "description": "Project ID of the project that contains the instance to be restarted.", 8847 // "location": "path", 8848 // "required": true, 8849 // "type": "string" 8850 // } 8851 // }, 8852 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/restart", 8853 // "response": { 8854 // "$ref": "Operation" 8855 // }, 8856 // "scopes": [ 8857 // "https://www.googleapis.com/auth/cloud-platform", 8858 // "https://www.googleapis.com/auth/sqlservice.admin" 8859 // ] 8860 // } 8861 8862} 8863 8864// method id "sql.instances.restoreBackup": 8865 8866type InstancesRestoreBackupCall struct { 8867 s *Service 8868 project string 8869 instance string 8870 instancesrestorebackuprequest *InstancesRestoreBackupRequest 8871 urlParams_ gensupport.URLParams 8872 ctx_ context.Context 8873 header_ http.Header 8874} 8875 8876// RestoreBackup: Restores a backup of a Cloud SQL instance. Using this 8877// operation might cause your instance to restart. 8878// 8879// - instance: Cloud SQL instance ID. This does not include the project 8880// ID. 8881// - project: Project ID of the project that contains the instance. 8882func (r *InstancesService) RestoreBackup(project string, instance string, instancesrestorebackuprequest *InstancesRestoreBackupRequest) *InstancesRestoreBackupCall { 8883 c := &InstancesRestoreBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8884 c.project = project 8885 c.instance = instance 8886 c.instancesrestorebackuprequest = instancesrestorebackuprequest 8887 return c 8888} 8889 8890// Fields allows partial responses to be retrieved. See 8891// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8892// for more information. 8893func (c *InstancesRestoreBackupCall) Fields(s ...googleapi.Field) *InstancesRestoreBackupCall { 8894 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8895 return c 8896} 8897 8898// Context sets the context to be used in this call's Do method. Any 8899// pending HTTP request will be aborted if the provided context is 8900// canceled. 8901func (c *InstancesRestoreBackupCall) Context(ctx context.Context) *InstancesRestoreBackupCall { 8902 c.ctx_ = ctx 8903 return c 8904} 8905 8906// Header returns an http.Header that can be modified by the caller to 8907// add HTTP headers to the request. 8908func (c *InstancesRestoreBackupCall) Header() http.Header { 8909 if c.header_ == nil { 8910 c.header_ = make(http.Header) 8911 } 8912 return c.header_ 8913} 8914 8915func (c *InstancesRestoreBackupCall) doRequest(alt string) (*http.Response, error) { 8916 reqHeaders := make(http.Header) 8917 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 8918 for k, v := range c.header_ { 8919 reqHeaders[k] = v 8920 } 8921 reqHeaders.Set("User-Agent", c.s.userAgent()) 8922 var body io.Reader = nil 8923 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrestorebackuprequest) 8924 if err != nil { 8925 return nil, err 8926 } 8927 reqHeaders.Set("Content-Type", "application/json") 8928 c.urlParams_.Set("alt", alt) 8929 c.urlParams_.Set("prettyPrint", "false") 8930 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup") 8931 urls += "?" + c.urlParams_.Encode() 8932 req, err := http.NewRequest("POST", urls, body) 8933 if err != nil { 8934 return nil, err 8935 } 8936 req.Header = reqHeaders 8937 googleapi.Expand(req.URL, map[string]string{ 8938 "project": c.project, 8939 "instance": c.instance, 8940 }) 8941 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8942} 8943 8944// Do executes the "sql.instances.restoreBackup" call. 8945// Exactly one of *Operation or error will be non-nil. Any non-2xx 8946// status code is an error. Response headers are in either 8947// *Operation.ServerResponse.Header or (if a response was returned at 8948// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8949// to check whether the returned error was because 8950// http.StatusNotModified was returned. 8951func (c *InstancesRestoreBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8952 gensupport.SetOptions(c.urlParams_, opts...) 8953 res, err := c.doRequest("json") 8954 if res != nil && res.StatusCode == http.StatusNotModified { 8955 if res.Body != nil { 8956 res.Body.Close() 8957 } 8958 return nil, &googleapi.Error{ 8959 Code: res.StatusCode, 8960 Header: res.Header, 8961 } 8962 } 8963 if err != nil { 8964 return nil, err 8965 } 8966 defer googleapi.CloseBody(res) 8967 if err := googleapi.CheckResponse(res); err != nil { 8968 return nil, err 8969 } 8970 ret := &Operation{ 8971 ServerResponse: googleapi.ServerResponse{ 8972 Header: res.Header, 8973 HTTPStatusCode: res.StatusCode, 8974 }, 8975 } 8976 target := &ret 8977 if err := gensupport.DecodeResponse(target, res); err != nil { 8978 return nil, err 8979 } 8980 return ret, nil 8981 // { 8982 // "description": "Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.", 8983 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup", 8984 // "httpMethod": "POST", 8985 // "id": "sql.instances.restoreBackup", 8986 // "parameterOrder": [ 8987 // "project", 8988 // "instance" 8989 // ], 8990 // "parameters": { 8991 // "instance": { 8992 // "description": "Cloud SQL instance ID. This does not include the project ID.", 8993 // "location": "path", 8994 // "required": true, 8995 // "type": "string" 8996 // }, 8997 // "project": { 8998 // "description": "Project ID of the project that contains the instance.", 8999 // "location": "path", 9000 // "required": true, 9001 // "type": "string" 9002 // } 9003 // }, 9004 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup", 9005 // "request": { 9006 // "$ref": "InstancesRestoreBackupRequest" 9007 // }, 9008 // "response": { 9009 // "$ref": "Operation" 9010 // }, 9011 // "scopes": [ 9012 // "https://www.googleapis.com/auth/cloud-platform", 9013 // "https://www.googleapis.com/auth/sqlservice.admin" 9014 // ] 9015 // } 9016 9017} 9018 9019// method id "sql.instances.rotateServerCa": 9020 9021type InstancesRotateServerCaCall struct { 9022 s *Service 9023 project string 9024 instance string 9025 instancesrotateservercarequest *InstancesRotateServerCaRequest 9026 urlParams_ gensupport.URLParams 9027 ctx_ context.Context 9028 header_ http.Header 9029} 9030 9031// RotateServerCa: Rotates the server certificate to one signed by the 9032// Certificate Authority (CA) version previously added with the 9033// addServerCA method. 9034// 9035// - instance: Cloud SQL instance ID. This does not include the project 9036// ID. 9037// - project: Project ID of the project that contains the instance. 9038func (r *InstancesService) RotateServerCa(project string, instance string, instancesrotateservercarequest *InstancesRotateServerCaRequest) *InstancesRotateServerCaCall { 9039 c := &InstancesRotateServerCaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9040 c.project = project 9041 c.instance = instance 9042 c.instancesrotateservercarequest = instancesrotateservercarequest 9043 return c 9044} 9045 9046// Fields allows partial responses to be retrieved. See 9047// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9048// for more information. 9049func (c *InstancesRotateServerCaCall) Fields(s ...googleapi.Field) *InstancesRotateServerCaCall { 9050 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9051 return c 9052} 9053 9054// Context sets the context to be used in this call's Do method. Any 9055// pending HTTP request will be aborted if the provided context is 9056// canceled. 9057func (c *InstancesRotateServerCaCall) Context(ctx context.Context) *InstancesRotateServerCaCall { 9058 c.ctx_ = ctx 9059 return c 9060} 9061 9062// Header returns an http.Header that can be modified by the caller to 9063// add HTTP headers to the request. 9064func (c *InstancesRotateServerCaCall) Header() http.Header { 9065 if c.header_ == nil { 9066 c.header_ = make(http.Header) 9067 } 9068 return c.header_ 9069} 9070 9071func (c *InstancesRotateServerCaCall) doRequest(alt string) (*http.Response, error) { 9072 reqHeaders := make(http.Header) 9073 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9074 for k, v := range c.header_ { 9075 reqHeaders[k] = v 9076 } 9077 reqHeaders.Set("User-Agent", c.s.userAgent()) 9078 var body io.Reader = nil 9079 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesrotateservercarequest) 9080 if err != nil { 9081 return nil, err 9082 } 9083 reqHeaders.Set("Content-Type", "application/json") 9084 c.urlParams_.Set("alt", alt) 9085 c.urlParams_.Set("prettyPrint", "false") 9086 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa") 9087 urls += "?" + c.urlParams_.Encode() 9088 req, err := http.NewRequest("POST", urls, body) 9089 if err != nil { 9090 return nil, err 9091 } 9092 req.Header = reqHeaders 9093 googleapi.Expand(req.URL, map[string]string{ 9094 "project": c.project, 9095 "instance": c.instance, 9096 }) 9097 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9098} 9099 9100// Do executes the "sql.instances.rotateServerCa" call. 9101// Exactly one of *Operation or error will be non-nil. Any non-2xx 9102// status code is an error. Response headers are in either 9103// *Operation.ServerResponse.Header or (if a response was returned at 9104// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9105// to check whether the returned error was because 9106// http.StatusNotModified was returned. 9107func (c *InstancesRotateServerCaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9108 gensupport.SetOptions(c.urlParams_, opts...) 9109 res, err := c.doRequest("json") 9110 if res != nil && res.StatusCode == http.StatusNotModified { 9111 if res.Body != nil { 9112 res.Body.Close() 9113 } 9114 return nil, &googleapi.Error{ 9115 Code: res.StatusCode, 9116 Header: res.Header, 9117 } 9118 } 9119 if err != nil { 9120 return nil, err 9121 } 9122 defer googleapi.CloseBody(res) 9123 if err := googleapi.CheckResponse(res); err != nil { 9124 return nil, err 9125 } 9126 ret := &Operation{ 9127 ServerResponse: googleapi.ServerResponse{ 9128 Header: res.Header, 9129 HTTPStatusCode: res.StatusCode, 9130 }, 9131 } 9132 target := &ret 9133 if err := gensupport.DecodeResponse(target, res); err != nil { 9134 return nil, err 9135 } 9136 return ret, nil 9137 // { 9138 // "description": "Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.", 9139 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa", 9140 // "httpMethod": "POST", 9141 // "id": "sql.instances.rotateServerCa", 9142 // "parameterOrder": [ 9143 // "project", 9144 // "instance" 9145 // ], 9146 // "parameters": { 9147 // "instance": { 9148 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9149 // "location": "path", 9150 // "required": true, 9151 // "type": "string" 9152 // }, 9153 // "project": { 9154 // "description": "Project ID of the project that contains the instance.", 9155 // "location": "path", 9156 // "required": true, 9157 // "type": "string" 9158 // } 9159 // }, 9160 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCa", 9161 // "request": { 9162 // "$ref": "InstancesRotateServerCaRequest" 9163 // }, 9164 // "response": { 9165 // "$ref": "Operation" 9166 // }, 9167 // "scopes": [ 9168 // "https://www.googleapis.com/auth/cloud-platform", 9169 // "https://www.googleapis.com/auth/sqlservice.admin" 9170 // ] 9171 // } 9172 9173} 9174 9175// method id "sql.instances.startReplica": 9176 9177type InstancesStartReplicaCall struct { 9178 s *Service 9179 project string 9180 instance string 9181 urlParams_ gensupport.URLParams 9182 ctx_ context.Context 9183 header_ http.Header 9184} 9185 9186// StartReplica: Starts the replication in the read replica instance. 9187// 9188// - instance: Cloud SQL read replica instance name. 9189// - project: ID of the project that contains the read replica. 9190func (r *InstancesService) StartReplica(project string, instance string) *InstancesStartReplicaCall { 9191 c := &InstancesStartReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9192 c.project = project 9193 c.instance = instance 9194 return c 9195} 9196 9197// Fields allows partial responses to be retrieved. See 9198// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9199// for more information. 9200func (c *InstancesStartReplicaCall) Fields(s ...googleapi.Field) *InstancesStartReplicaCall { 9201 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9202 return c 9203} 9204 9205// Context sets the context to be used in this call's Do method. Any 9206// pending HTTP request will be aborted if the provided context is 9207// canceled. 9208func (c *InstancesStartReplicaCall) Context(ctx context.Context) *InstancesStartReplicaCall { 9209 c.ctx_ = ctx 9210 return c 9211} 9212 9213// Header returns an http.Header that can be modified by the caller to 9214// add HTTP headers to the request. 9215func (c *InstancesStartReplicaCall) Header() http.Header { 9216 if c.header_ == nil { 9217 c.header_ = make(http.Header) 9218 } 9219 return c.header_ 9220} 9221 9222func (c *InstancesStartReplicaCall) doRequest(alt string) (*http.Response, error) { 9223 reqHeaders := make(http.Header) 9224 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9225 for k, v := range c.header_ { 9226 reqHeaders[k] = v 9227 } 9228 reqHeaders.Set("User-Agent", c.s.userAgent()) 9229 var body io.Reader = nil 9230 c.urlParams_.Set("alt", alt) 9231 c.urlParams_.Set("prettyPrint", "false") 9232 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/startReplica") 9233 urls += "?" + c.urlParams_.Encode() 9234 req, err := http.NewRequest("POST", urls, body) 9235 if err != nil { 9236 return nil, err 9237 } 9238 req.Header = reqHeaders 9239 googleapi.Expand(req.URL, map[string]string{ 9240 "project": c.project, 9241 "instance": c.instance, 9242 }) 9243 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9244} 9245 9246// Do executes the "sql.instances.startReplica" call. 9247// Exactly one of *Operation or error will be non-nil. Any non-2xx 9248// status code is an error. Response headers are in either 9249// *Operation.ServerResponse.Header or (if a response was returned at 9250// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9251// to check whether the returned error was because 9252// http.StatusNotModified was returned. 9253func (c *InstancesStartReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9254 gensupport.SetOptions(c.urlParams_, opts...) 9255 res, err := c.doRequest("json") 9256 if res != nil && res.StatusCode == http.StatusNotModified { 9257 if res.Body != nil { 9258 res.Body.Close() 9259 } 9260 return nil, &googleapi.Error{ 9261 Code: res.StatusCode, 9262 Header: res.Header, 9263 } 9264 } 9265 if err != nil { 9266 return nil, err 9267 } 9268 defer googleapi.CloseBody(res) 9269 if err := googleapi.CheckResponse(res); err != nil { 9270 return nil, err 9271 } 9272 ret := &Operation{ 9273 ServerResponse: googleapi.ServerResponse{ 9274 Header: res.Header, 9275 HTTPStatusCode: res.StatusCode, 9276 }, 9277 } 9278 target := &ret 9279 if err := gensupport.DecodeResponse(target, res); err != nil { 9280 return nil, err 9281 } 9282 return ret, nil 9283 // { 9284 // "description": "Starts the replication in the read replica instance.", 9285 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/startReplica", 9286 // "httpMethod": "POST", 9287 // "id": "sql.instances.startReplica", 9288 // "parameterOrder": [ 9289 // "project", 9290 // "instance" 9291 // ], 9292 // "parameters": { 9293 // "instance": { 9294 // "description": "Cloud SQL read replica instance name.", 9295 // "location": "path", 9296 // "required": true, 9297 // "type": "string" 9298 // }, 9299 // "project": { 9300 // "description": "ID of the project that contains the read replica.", 9301 // "location": "path", 9302 // "required": true, 9303 // "type": "string" 9304 // } 9305 // }, 9306 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/startReplica", 9307 // "response": { 9308 // "$ref": "Operation" 9309 // }, 9310 // "scopes": [ 9311 // "https://www.googleapis.com/auth/cloud-platform", 9312 // "https://www.googleapis.com/auth/sqlservice.admin" 9313 // ] 9314 // } 9315 9316} 9317 9318// method id "sql.instances.stopReplica": 9319 9320type InstancesStopReplicaCall struct { 9321 s *Service 9322 project string 9323 instance string 9324 urlParams_ gensupport.URLParams 9325 ctx_ context.Context 9326 header_ http.Header 9327} 9328 9329// StopReplica: Stops the replication in the read replica instance. 9330// 9331// - instance: Cloud SQL read replica instance name. 9332// - project: ID of the project that contains the read replica. 9333func (r *InstancesService) StopReplica(project string, instance string) *InstancesStopReplicaCall { 9334 c := &InstancesStopReplicaCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9335 c.project = project 9336 c.instance = instance 9337 return c 9338} 9339 9340// Fields allows partial responses to be retrieved. See 9341// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9342// for more information. 9343func (c *InstancesStopReplicaCall) Fields(s ...googleapi.Field) *InstancesStopReplicaCall { 9344 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9345 return c 9346} 9347 9348// Context sets the context to be used in this call's Do method. Any 9349// pending HTTP request will be aborted if the provided context is 9350// canceled. 9351func (c *InstancesStopReplicaCall) Context(ctx context.Context) *InstancesStopReplicaCall { 9352 c.ctx_ = ctx 9353 return c 9354} 9355 9356// Header returns an http.Header that can be modified by the caller to 9357// add HTTP headers to the request. 9358func (c *InstancesStopReplicaCall) Header() http.Header { 9359 if c.header_ == nil { 9360 c.header_ = make(http.Header) 9361 } 9362 return c.header_ 9363} 9364 9365func (c *InstancesStopReplicaCall) doRequest(alt string) (*http.Response, error) { 9366 reqHeaders := make(http.Header) 9367 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9368 for k, v := range c.header_ { 9369 reqHeaders[k] = v 9370 } 9371 reqHeaders.Set("User-Agent", c.s.userAgent()) 9372 var body io.Reader = nil 9373 c.urlParams_.Set("alt", alt) 9374 c.urlParams_.Set("prettyPrint", "false") 9375 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica") 9376 urls += "?" + c.urlParams_.Encode() 9377 req, err := http.NewRequest("POST", urls, body) 9378 if err != nil { 9379 return nil, err 9380 } 9381 req.Header = reqHeaders 9382 googleapi.Expand(req.URL, map[string]string{ 9383 "project": c.project, 9384 "instance": c.instance, 9385 }) 9386 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9387} 9388 9389// Do executes the "sql.instances.stopReplica" call. 9390// Exactly one of *Operation or error will be non-nil. Any non-2xx 9391// status code is an error. Response headers are in either 9392// *Operation.ServerResponse.Header or (if a response was returned at 9393// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9394// to check whether the returned error was because 9395// http.StatusNotModified was returned. 9396func (c *InstancesStopReplicaCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9397 gensupport.SetOptions(c.urlParams_, opts...) 9398 res, err := c.doRequest("json") 9399 if res != nil && res.StatusCode == http.StatusNotModified { 9400 if res.Body != nil { 9401 res.Body.Close() 9402 } 9403 return nil, &googleapi.Error{ 9404 Code: res.StatusCode, 9405 Header: res.Header, 9406 } 9407 } 9408 if err != nil { 9409 return nil, err 9410 } 9411 defer googleapi.CloseBody(res) 9412 if err := googleapi.CheckResponse(res); err != nil { 9413 return nil, err 9414 } 9415 ret := &Operation{ 9416 ServerResponse: googleapi.ServerResponse{ 9417 Header: res.Header, 9418 HTTPStatusCode: res.StatusCode, 9419 }, 9420 } 9421 target := &ret 9422 if err := gensupport.DecodeResponse(target, res); err != nil { 9423 return nil, err 9424 } 9425 return ret, nil 9426 // { 9427 // "description": "Stops the replication in the read replica instance.", 9428 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica", 9429 // "httpMethod": "POST", 9430 // "id": "sql.instances.stopReplica", 9431 // "parameterOrder": [ 9432 // "project", 9433 // "instance" 9434 // ], 9435 // "parameters": { 9436 // "instance": { 9437 // "description": "Cloud SQL read replica instance name.", 9438 // "location": "path", 9439 // "required": true, 9440 // "type": "string" 9441 // }, 9442 // "project": { 9443 // "description": "ID of the project that contains the read replica.", 9444 // "location": "path", 9445 // "required": true, 9446 // "type": "string" 9447 // } 9448 // }, 9449 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/stopReplica", 9450 // "response": { 9451 // "$ref": "Operation" 9452 // }, 9453 // "scopes": [ 9454 // "https://www.googleapis.com/auth/cloud-platform", 9455 // "https://www.googleapis.com/auth/sqlservice.admin" 9456 // ] 9457 // } 9458 9459} 9460 9461// method id "sql.instances.truncateLog": 9462 9463type InstancesTruncateLogCall struct { 9464 s *Service 9465 project string 9466 instance string 9467 instancestruncatelogrequest *InstancesTruncateLogRequest 9468 urlParams_ gensupport.URLParams 9469 ctx_ context.Context 9470 header_ http.Header 9471} 9472 9473// TruncateLog: Truncate MySQL general and slow query log tables MySQL 9474// only. 9475// 9476// - instance: Cloud SQL instance ID. This does not include the project 9477// ID. 9478// - project: Project ID of the Cloud SQL project. 9479func (r *InstancesService) TruncateLog(project string, instance string, instancestruncatelogrequest *InstancesTruncateLogRequest) *InstancesTruncateLogCall { 9480 c := &InstancesTruncateLogCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9481 c.project = project 9482 c.instance = instance 9483 c.instancestruncatelogrequest = instancestruncatelogrequest 9484 return c 9485} 9486 9487// Fields allows partial responses to be retrieved. See 9488// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9489// for more information. 9490func (c *InstancesTruncateLogCall) Fields(s ...googleapi.Field) *InstancesTruncateLogCall { 9491 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9492 return c 9493} 9494 9495// Context sets the context to be used in this call's Do method. Any 9496// pending HTTP request will be aborted if the provided context is 9497// canceled. 9498func (c *InstancesTruncateLogCall) Context(ctx context.Context) *InstancesTruncateLogCall { 9499 c.ctx_ = ctx 9500 return c 9501} 9502 9503// Header returns an http.Header that can be modified by the caller to 9504// add HTTP headers to the request. 9505func (c *InstancesTruncateLogCall) Header() http.Header { 9506 if c.header_ == nil { 9507 c.header_ = make(http.Header) 9508 } 9509 return c.header_ 9510} 9511 9512func (c *InstancesTruncateLogCall) doRequest(alt string) (*http.Response, error) { 9513 reqHeaders := make(http.Header) 9514 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9515 for k, v := range c.header_ { 9516 reqHeaders[k] = v 9517 } 9518 reqHeaders.Set("User-Agent", c.s.userAgent()) 9519 var body io.Reader = nil 9520 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancestruncatelogrequest) 9521 if err != nil { 9522 return nil, err 9523 } 9524 reqHeaders.Set("Content-Type", "application/json") 9525 c.urlParams_.Set("alt", alt) 9526 c.urlParams_.Set("prettyPrint", "false") 9527 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/truncateLog") 9528 urls += "?" + c.urlParams_.Encode() 9529 req, err := http.NewRequest("POST", urls, body) 9530 if err != nil { 9531 return nil, err 9532 } 9533 req.Header = reqHeaders 9534 googleapi.Expand(req.URL, map[string]string{ 9535 "project": c.project, 9536 "instance": c.instance, 9537 }) 9538 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9539} 9540 9541// Do executes the "sql.instances.truncateLog" call. 9542// Exactly one of *Operation or error will be non-nil. Any non-2xx 9543// status code is an error. Response headers are in either 9544// *Operation.ServerResponse.Header or (if a response was returned at 9545// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9546// to check whether the returned error was because 9547// http.StatusNotModified was returned. 9548func (c *InstancesTruncateLogCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9549 gensupport.SetOptions(c.urlParams_, opts...) 9550 res, err := c.doRequest("json") 9551 if res != nil && res.StatusCode == http.StatusNotModified { 9552 if res.Body != nil { 9553 res.Body.Close() 9554 } 9555 return nil, &googleapi.Error{ 9556 Code: res.StatusCode, 9557 Header: res.Header, 9558 } 9559 } 9560 if err != nil { 9561 return nil, err 9562 } 9563 defer googleapi.CloseBody(res) 9564 if err := googleapi.CheckResponse(res); err != nil { 9565 return nil, err 9566 } 9567 ret := &Operation{ 9568 ServerResponse: googleapi.ServerResponse{ 9569 Header: res.Header, 9570 HTTPStatusCode: res.StatusCode, 9571 }, 9572 } 9573 target := &ret 9574 if err := gensupport.DecodeResponse(target, res); err != nil { 9575 return nil, err 9576 } 9577 return ret, nil 9578 // { 9579 // "description": "Truncate MySQL general and slow query log tables MySQL only.", 9580 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/truncateLog", 9581 // "httpMethod": "POST", 9582 // "id": "sql.instances.truncateLog", 9583 // "parameterOrder": [ 9584 // "project", 9585 // "instance" 9586 // ], 9587 // "parameters": { 9588 // "instance": { 9589 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9590 // "location": "path", 9591 // "required": true, 9592 // "type": "string" 9593 // }, 9594 // "project": { 9595 // "description": "Project ID of the Cloud SQL project.", 9596 // "location": "path", 9597 // "required": true, 9598 // "type": "string" 9599 // } 9600 // }, 9601 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/truncateLog", 9602 // "request": { 9603 // "$ref": "InstancesTruncateLogRequest" 9604 // }, 9605 // "response": { 9606 // "$ref": "Operation" 9607 // }, 9608 // "scopes": [ 9609 // "https://www.googleapis.com/auth/cloud-platform", 9610 // "https://www.googleapis.com/auth/sqlservice.admin" 9611 // ] 9612 // } 9613 9614} 9615 9616// method id "sql.instances.update": 9617 9618type InstancesUpdateCall struct { 9619 s *Service 9620 project string 9621 instance string 9622 databaseinstance *DatabaseInstance 9623 urlParams_ gensupport.URLParams 9624 ctx_ context.Context 9625 header_ http.Header 9626} 9627 9628// Update: Updates settings of a Cloud SQL instance. Using this 9629// operation might cause your instance to restart. 9630// 9631// - instance: Cloud SQL instance ID. This does not include the project 9632// ID. 9633// - project: Project ID of the project that contains the instance. 9634func (r *InstancesService) Update(project string, instance string, databaseinstance *DatabaseInstance) *InstancesUpdateCall { 9635 c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9636 c.project = project 9637 c.instance = instance 9638 c.databaseinstance = databaseinstance 9639 return c 9640} 9641 9642// Fields allows partial responses to be retrieved. See 9643// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9644// for more information. 9645func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall { 9646 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9647 return c 9648} 9649 9650// Context sets the context to be used in this call's Do method. Any 9651// pending HTTP request will be aborted if the provided context is 9652// canceled. 9653func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall { 9654 c.ctx_ = ctx 9655 return c 9656} 9657 9658// Header returns an http.Header that can be modified by the caller to 9659// add HTTP headers to the request. 9660func (c *InstancesUpdateCall) Header() http.Header { 9661 if c.header_ == nil { 9662 c.header_ = make(http.Header) 9663 } 9664 return c.header_ 9665} 9666 9667func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) { 9668 reqHeaders := make(http.Header) 9669 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9670 for k, v := range c.header_ { 9671 reqHeaders[k] = v 9672 } 9673 reqHeaders.Set("User-Agent", c.s.userAgent()) 9674 var body io.Reader = nil 9675 body, err := googleapi.WithoutDataWrapper.JSONReader(c.databaseinstance) 9676 if err != nil { 9677 return nil, err 9678 } 9679 reqHeaders.Set("Content-Type", "application/json") 9680 c.urlParams_.Set("alt", alt) 9681 c.urlParams_.Set("prettyPrint", "false") 9682 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}") 9683 urls += "?" + c.urlParams_.Encode() 9684 req, err := http.NewRequest("PUT", urls, body) 9685 if err != nil { 9686 return nil, err 9687 } 9688 req.Header = reqHeaders 9689 googleapi.Expand(req.URL, map[string]string{ 9690 "project": c.project, 9691 "instance": c.instance, 9692 }) 9693 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9694} 9695 9696// Do executes the "sql.instances.update" call. 9697// Exactly one of *Operation or error will be non-nil. Any non-2xx 9698// status code is an error. Response headers are in either 9699// *Operation.ServerResponse.Header or (if a response was returned at 9700// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9701// to check whether the returned error was because 9702// http.StatusNotModified was returned. 9703func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9704 gensupport.SetOptions(c.urlParams_, opts...) 9705 res, err := c.doRequest("json") 9706 if res != nil && res.StatusCode == http.StatusNotModified { 9707 if res.Body != nil { 9708 res.Body.Close() 9709 } 9710 return nil, &googleapi.Error{ 9711 Code: res.StatusCode, 9712 Header: res.Header, 9713 } 9714 } 9715 if err != nil { 9716 return nil, err 9717 } 9718 defer googleapi.CloseBody(res) 9719 if err := googleapi.CheckResponse(res); err != nil { 9720 return nil, err 9721 } 9722 ret := &Operation{ 9723 ServerResponse: googleapi.ServerResponse{ 9724 Header: res.Header, 9725 HTTPStatusCode: res.StatusCode, 9726 }, 9727 } 9728 target := &ret 9729 if err := gensupport.DecodeResponse(target, res); err != nil { 9730 return nil, err 9731 } 9732 return ret, nil 9733 // { 9734 // "description": "Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.", 9735 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}", 9736 // "httpMethod": "PUT", 9737 // "id": "sql.instances.update", 9738 // "parameterOrder": [ 9739 // "project", 9740 // "instance" 9741 // ], 9742 // "parameters": { 9743 // "instance": { 9744 // "description": "Cloud SQL instance ID. This does not include the project ID.", 9745 // "location": "path", 9746 // "required": true, 9747 // "type": "string" 9748 // }, 9749 // "project": { 9750 // "description": "Project ID of the project that contains the instance.", 9751 // "location": "path", 9752 // "required": true, 9753 // "type": "string" 9754 // } 9755 // }, 9756 // "path": "sql/v1beta4/projects/{project}/instances/{instance}", 9757 // "request": { 9758 // "$ref": "DatabaseInstance" 9759 // }, 9760 // "response": { 9761 // "$ref": "Operation" 9762 // }, 9763 // "scopes": [ 9764 // "https://www.googleapis.com/auth/cloud-platform", 9765 // "https://www.googleapis.com/auth/sqlservice.admin" 9766 // ] 9767 // } 9768 9769} 9770 9771// method id "sql.operations.get": 9772 9773type OperationsGetCall struct { 9774 s *Service 9775 project string 9776 operation string 9777 urlParams_ gensupport.URLParams 9778 ifNoneMatch_ string 9779 ctx_ context.Context 9780 header_ http.Header 9781} 9782 9783// Get: Retrieves an instance operation that has been performed on an 9784// instance. 9785// 9786// - operation: Instance operation ID. 9787// - project: Project ID of the project that contains the instance. 9788func (r *OperationsService) Get(project string, operation string) *OperationsGetCall { 9789 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9790 c.project = project 9791 c.operation = operation 9792 return c 9793} 9794 9795// Fields allows partial responses to be retrieved. See 9796// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9797// for more information. 9798func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 9799 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9800 return c 9801} 9802 9803// IfNoneMatch sets the optional parameter which makes the operation 9804// fail if the object's ETag matches the given value. This is useful for 9805// getting updates only after the object has changed since the last 9806// request. Use googleapi.IsNotModified to check whether the response 9807// error from Do is the result of In-None-Match. 9808func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 9809 c.ifNoneMatch_ = entityTag 9810 return c 9811} 9812 9813// Context sets the context to be used in this call's Do method. Any 9814// pending HTTP request will be aborted if the provided context is 9815// canceled. 9816func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 9817 c.ctx_ = ctx 9818 return c 9819} 9820 9821// Header returns an http.Header that can be modified by the caller to 9822// add HTTP headers to the request. 9823func (c *OperationsGetCall) Header() http.Header { 9824 if c.header_ == nil { 9825 c.header_ = make(http.Header) 9826 } 9827 return c.header_ 9828} 9829 9830func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 9831 reqHeaders := make(http.Header) 9832 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 9833 for k, v := range c.header_ { 9834 reqHeaders[k] = v 9835 } 9836 reqHeaders.Set("User-Agent", c.s.userAgent()) 9837 if c.ifNoneMatch_ != "" { 9838 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9839 } 9840 var body io.Reader = nil 9841 c.urlParams_.Set("alt", alt) 9842 c.urlParams_.Set("prettyPrint", "false") 9843 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/operations/{operation}") 9844 urls += "?" + c.urlParams_.Encode() 9845 req, err := http.NewRequest("GET", urls, body) 9846 if err != nil { 9847 return nil, err 9848 } 9849 req.Header = reqHeaders 9850 googleapi.Expand(req.URL, map[string]string{ 9851 "project": c.project, 9852 "operation": c.operation, 9853 }) 9854 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9855} 9856 9857// Do executes the "sql.operations.get" call. 9858// Exactly one of *Operation or error will be non-nil. Any non-2xx 9859// status code is an error. Response headers are in either 9860// *Operation.ServerResponse.Header or (if a response was returned at 9861// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9862// to check whether the returned error was because 9863// http.StatusNotModified was returned. 9864func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9865 gensupport.SetOptions(c.urlParams_, opts...) 9866 res, err := c.doRequest("json") 9867 if res != nil && res.StatusCode == http.StatusNotModified { 9868 if res.Body != nil { 9869 res.Body.Close() 9870 } 9871 return nil, &googleapi.Error{ 9872 Code: res.StatusCode, 9873 Header: res.Header, 9874 } 9875 } 9876 if err != nil { 9877 return nil, err 9878 } 9879 defer googleapi.CloseBody(res) 9880 if err := googleapi.CheckResponse(res); err != nil { 9881 return nil, err 9882 } 9883 ret := &Operation{ 9884 ServerResponse: googleapi.ServerResponse{ 9885 Header: res.Header, 9886 HTTPStatusCode: res.StatusCode, 9887 }, 9888 } 9889 target := &ret 9890 if err := gensupport.DecodeResponse(target, res); err != nil { 9891 return nil, err 9892 } 9893 return ret, nil 9894 // { 9895 // "description": "Retrieves an instance operation that has been performed on an instance.", 9896 // "flatPath": "sql/v1beta4/projects/{project}/operations/{operation}", 9897 // "httpMethod": "GET", 9898 // "id": "sql.operations.get", 9899 // "parameterOrder": [ 9900 // "project", 9901 // "operation" 9902 // ], 9903 // "parameters": { 9904 // "operation": { 9905 // "description": "Instance operation ID.", 9906 // "location": "path", 9907 // "required": true, 9908 // "type": "string" 9909 // }, 9910 // "project": { 9911 // "description": "Project ID of the project that contains the instance.", 9912 // "location": "path", 9913 // "required": true, 9914 // "type": "string" 9915 // } 9916 // }, 9917 // "path": "sql/v1beta4/projects/{project}/operations/{operation}", 9918 // "response": { 9919 // "$ref": "Operation" 9920 // }, 9921 // "scopes": [ 9922 // "https://www.googleapis.com/auth/cloud-platform", 9923 // "https://www.googleapis.com/auth/sqlservice.admin" 9924 // ] 9925 // } 9926 9927} 9928 9929// method id "sql.operations.list": 9930 9931type OperationsListCall struct { 9932 s *Service 9933 project string 9934 urlParams_ gensupport.URLParams 9935 ifNoneMatch_ string 9936 ctx_ context.Context 9937 header_ http.Header 9938} 9939 9940// List: Lists all instance operations that have been performed on the 9941// given Cloud SQL instance in the reverse chronological order of the 9942// start time. 9943// 9944// - project: Project ID of the project that contains the instance. 9945func (r *OperationsService) List(project string) *OperationsListCall { 9946 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9947 c.project = project 9948 return c 9949} 9950 9951// Instance sets the optional parameter "instance": Cloud SQL instance 9952// ID. This does not include the project ID. 9953func (c *OperationsListCall) Instance(instance string) *OperationsListCall { 9954 c.urlParams_.Set("instance", instance) 9955 return c 9956} 9957 9958// MaxResults sets the optional parameter "maxResults": Maximum number 9959// of operations per response. 9960func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall { 9961 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 9962 return c 9963} 9964 9965// PageToken sets the optional parameter "pageToken": A 9966// previously-returned page token representing part of the larger set of 9967// results to view. 9968func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { 9969 c.urlParams_.Set("pageToken", pageToken) 9970 return c 9971} 9972 9973// Fields allows partial responses to be retrieved. See 9974// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9975// for more information. 9976func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { 9977 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9978 return c 9979} 9980 9981// IfNoneMatch sets the optional parameter which makes the operation 9982// fail if the object's ETag matches the given value. This is useful for 9983// getting updates only after the object has changed since the last 9984// request. Use googleapi.IsNotModified to check whether the response 9985// error from Do is the result of In-None-Match. 9986func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { 9987 c.ifNoneMatch_ = entityTag 9988 return c 9989} 9990 9991// Context sets the context to be used in this call's Do method. Any 9992// pending HTTP request will be aborted if the provided context is 9993// canceled. 9994func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { 9995 c.ctx_ = ctx 9996 return c 9997} 9998 9999// Header returns an http.Header that can be modified by the caller to 10000// add HTTP headers to the request. 10001func (c *OperationsListCall) Header() http.Header { 10002 if c.header_ == nil { 10003 c.header_ = make(http.Header) 10004 } 10005 return c.header_ 10006} 10007 10008func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { 10009 reqHeaders := make(http.Header) 10010 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10011 for k, v := range c.header_ { 10012 reqHeaders[k] = v 10013 } 10014 reqHeaders.Set("User-Agent", c.s.userAgent()) 10015 if c.ifNoneMatch_ != "" { 10016 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10017 } 10018 var body io.Reader = nil 10019 c.urlParams_.Set("alt", alt) 10020 c.urlParams_.Set("prettyPrint", "false") 10021 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/operations") 10022 urls += "?" + c.urlParams_.Encode() 10023 req, err := http.NewRequest("GET", urls, body) 10024 if err != nil { 10025 return nil, err 10026 } 10027 req.Header = reqHeaders 10028 googleapi.Expand(req.URL, map[string]string{ 10029 "project": c.project, 10030 }) 10031 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10032} 10033 10034// Do executes the "sql.operations.list" call. 10035// Exactly one of *OperationsListResponse or error will be non-nil. Any 10036// non-2xx status code is an error. Response headers are in either 10037// *OperationsListResponse.ServerResponse.Header or (if a response was 10038// returned at all) in error.(*googleapi.Error).Header. Use 10039// googleapi.IsNotModified to check whether the returned error was 10040// because http.StatusNotModified was returned. 10041func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) { 10042 gensupport.SetOptions(c.urlParams_, opts...) 10043 res, err := c.doRequest("json") 10044 if res != nil && res.StatusCode == http.StatusNotModified { 10045 if res.Body != nil { 10046 res.Body.Close() 10047 } 10048 return nil, &googleapi.Error{ 10049 Code: res.StatusCode, 10050 Header: res.Header, 10051 } 10052 } 10053 if err != nil { 10054 return nil, err 10055 } 10056 defer googleapi.CloseBody(res) 10057 if err := googleapi.CheckResponse(res); err != nil { 10058 return nil, err 10059 } 10060 ret := &OperationsListResponse{ 10061 ServerResponse: googleapi.ServerResponse{ 10062 Header: res.Header, 10063 HTTPStatusCode: res.StatusCode, 10064 }, 10065 } 10066 target := &ret 10067 if err := gensupport.DecodeResponse(target, res); err != nil { 10068 return nil, err 10069 } 10070 return ret, nil 10071 // { 10072 // "description": "Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.", 10073 // "flatPath": "sql/v1beta4/projects/{project}/operations", 10074 // "httpMethod": "GET", 10075 // "id": "sql.operations.list", 10076 // "parameterOrder": [ 10077 // "project" 10078 // ], 10079 // "parameters": { 10080 // "instance": { 10081 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10082 // "location": "query", 10083 // "type": "string" 10084 // }, 10085 // "maxResults": { 10086 // "description": "Maximum number of operations per response.", 10087 // "format": "uint32", 10088 // "location": "query", 10089 // "type": "integer" 10090 // }, 10091 // "pageToken": { 10092 // "description": "A previously-returned page token representing part of the larger set of results to view.", 10093 // "location": "query", 10094 // "type": "string" 10095 // }, 10096 // "project": { 10097 // "description": "Project ID of the project that contains the instance.", 10098 // "location": "path", 10099 // "required": true, 10100 // "type": "string" 10101 // } 10102 // }, 10103 // "path": "sql/v1beta4/projects/{project}/operations", 10104 // "response": { 10105 // "$ref": "OperationsListResponse" 10106 // }, 10107 // "scopes": [ 10108 // "https://www.googleapis.com/auth/cloud-platform", 10109 // "https://www.googleapis.com/auth/sqlservice.admin" 10110 // ] 10111 // } 10112 10113} 10114 10115// Pages invokes f for each page of results. 10116// A non-nil error returned from f will halt the iteration. 10117// The provided context supersedes any context provided to the Context method. 10118func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error { 10119 c.ctx_ = ctx 10120 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10121 for { 10122 x, err := c.Do() 10123 if err != nil { 10124 return err 10125 } 10126 if err := f(x); err != nil { 10127 return err 10128 } 10129 if x.NextPageToken == "" { 10130 return nil 10131 } 10132 c.PageToken(x.NextPageToken) 10133 } 10134} 10135 10136// method id "sql.projects.instances.rescheduleMaintenance": 10137 10138type ProjectsInstancesRescheduleMaintenanceCall struct { 10139 s *Service 10140 project string 10141 instance string 10142 sqlinstancesreschedulemaintenancerequestbody *SqlInstancesRescheduleMaintenanceRequestBody 10143 urlParams_ gensupport.URLParams 10144 ctx_ context.Context 10145 header_ http.Header 10146} 10147 10148// RescheduleMaintenance: Reschedules the maintenance on the given 10149// instance. 10150// 10151// - instance: Cloud SQL instance ID. This does not include the project 10152// ID. 10153// - project: ID of the project that contains the instance. 10154func (r *ProjectsInstancesService) RescheduleMaintenance(project string, instance string, sqlinstancesreschedulemaintenancerequestbody *SqlInstancesRescheduleMaintenanceRequestBody) *ProjectsInstancesRescheduleMaintenanceCall { 10155 c := &ProjectsInstancesRescheduleMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10156 c.project = project 10157 c.instance = instance 10158 c.sqlinstancesreschedulemaintenancerequestbody = sqlinstancesreschedulemaintenancerequestbody 10159 return c 10160} 10161 10162// Fields allows partial responses to be retrieved. See 10163// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10164// for more information. 10165func (c *ProjectsInstancesRescheduleMaintenanceCall) Fields(s ...googleapi.Field) *ProjectsInstancesRescheduleMaintenanceCall { 10166 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10167 return c 10168} 10169 10170// Context sets the context to be used in this call's Do method. Any 10171// pending HTTP request will be aborted if the provided context is 10172// canceled. 10173func (c *ProjectsInstancesRescheduleMaintenanceCall) Context(ctx context.Context) *ProjectsInstancesRescheduleMaintenanceCall { 10174 c.ctx_ = ctx 10175 return c 10176} 10177 10178// Header returns an http.Header that can be modified by the caller to 10179// add HTTP headers to the request. 10180func (c *ProjectsInstancesRescheduleMaintenanceCall) Header() http.Header { 10181 if c.header_ == nil { 10182 c.header_ = make(http.Header) 10183 } 10184 return c.header_ 10185} 10186 10187func (c *ProjectsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) { 10188 reqHeaders := make(http.Header) 10189 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10190 for k, v := range c.header_ { 10191 reqHeaders[k] = v 10192 } 10193 reqHeaders.Set("User-Agent", c.s.userAgent()) 10194 var body io.Reader = nil 10195 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesreschedulemaintenancerequestbody) 10196 if err != nil { 10197 return nil, err 10198 } 10199 reqHeaders.Set("Content-Type", "application/json") 10200 c.urlParams_.Set("alt", alt) 10201 c.urlParams_.Set("prettyPrint", "false") 10202 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance") 10203 urls += "?" + c.urlParams_.Encode() 10204 req, err := http.NewRequest("POST", urls, body) 10205 if err != nil { 10206 return nil, err 10207 } 10208 req.Header = reqHeaders 10209 googleapi.Expand(req.URL, map[string]string{ 10210 "project": c.project, 10211 "instance": c.instance, 10212 }) 10213 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10214} 10215 10216// Do executes the "sql.projects.instances.rescheduleMaintenance" call. 10217// Exactly one of *Operation or error will be non-nil. Any non-2xx 10218// status code is an error. Response headers are in either 10219// *Operation.ServerResponse.Header or (if a response was returned at 10220// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10221// to check whether the returned error was because 10222// http.StatusNotModified was returned. 10223func (c *ProjectsInstancesRescheduleMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10224 gensupport.SetOptions(c.urlParams_, opts...) 10225 res, err := c.doRequest("json") 10226 if res != nil && res.StatusCode == http.StatusNotModified { 10227 if res.Body != nil { 10228 res.Body.Close() 10229 } 10230 return nil, &googleapi.Error{ 10231 Code: res.StatusCode, 10232 Header: res.Header, 10233 } 10234 } 10235 if err != nil { 10236 return nil, err 10237 } 10238 defer googleapi.CloseBody(res) 10239 if err := googleapi.CheckResponse(res); err != nil { 10240 return nil, err 10241 } 10242 ret := &Operation{ 10243 ServerResponse: googleapi.ServerResponse{ 10244 Header: res.Header, 10245 HTTPStatusCode: res.StatusCode, 10246 }, 10247 } 10248 target := &ret 10249 if err := gensupport.DecodeResponse(target, res); err != nil { 10250 return nil, err 10251 } 10252 return ret, nil 10253 // { 10254 // "description": "Reschedules the maintenance on the given instance.", 10255 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance", 10256 // "httpMethod": "POST", 10257 // "id": "sql.projects.instances.rescheduleMaintenance", 10258 // "parameterOrder": [ 10259 // "project", 10260 // "instance" 10261 // ], 10262 // "parameters": { 10263 // "instance": { 10264 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10265 // "location": "path", 10266 // "required": true, 10267 // "type": "string" 10268 // }, 10269 // "project": { 10270 // "description": "ID of the project that contains the instance.", 10271 // "location": "path", 10272 // "required": true, 10273 // "type": "string" 10274 // } 10275 // }, 10276 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenance", 10277 // "request": { 10278 // "$ref": "SqlInstancesRescheduleMaintenanceRequestBody" 10279 // }, 10280 // "response": { 10281 // "$ref": "Operation" 10282 // }, 10283 // "scopes": [ 10284 // "https://www.googleapis.com/auth/cloud-platform", 10285 // "https://www.googleapis.com/auth/sqlservice.admin" 10286 // ] 10287 // } 10288 10289} 10290 10291// method id "sql.projects.instances.startExternalSync": 10292 10293type ProjectsInstancesStartExternalSyncCall struct { 10294 s *Service 10295 project string 10296 instance string 10297 sqlinstancesstartexternalsyncrequest *SqlInstancesStartExternalSyncRequest 10298 urlParams_ gensupport.URLParams 10299 ctx_ context.Context 10300 header_ http.Header 10301} 10302 10303// StartExternalSync: Start External primary instance migration. 10304// 10305// - instance: Cloud SQL instance ID. This does not include the project 10306// ID. 10307// - project: ID of the project that contains the instance. 10308func (r *ProjectsInstancesService) StartExternalSync(project string, instance string, sqlinstancesstartexternalsyncrequest *SqlInstancesStartExternalSyncRequest) *ProjectsInstancesStartExternalSyncCall { 10309 c := &ProjectsInstancesStartExternalSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10310 c.project = project 10311 c.instance = instance 10312 c.sqlinstancesstartexternalsyncrequest = sqlinstancesstartexternalsyncrequest 10313 return c 10314} 10315 10316// Fields allows partial responses to be retrieved. See 10317// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10318// for more information. 10319func (c *ProjectsInstancesStartExternalSyncCall) Fields(s ...googleapi.Field) *ProjectsInstancesStartExternalSyncCall { 10320 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10321 return c 10322} 10323 10324// Context sets the context to be used in this call's Do method. Any 10325// pending HTTP request will be aborted if the provided context is 10326// canceled. 10327func (c *ProjectsInstancesStartExternalSyncCall) Context(ctx context.Context) *ProjectsInstancesStartExternalSyncCall { 10328 c.ctx_ = ctx 10329 return c 10330} 10331 10332// Header returns an http.Header that can be modified by the caller to 10333// add HTTP headers to the request. 10334func (c *ProjectsInstancesStartExternalSyncCall) Header() http.Header { 10335 if c.header_ == nil { 10336 c.header_ = make(http.Header) 10337 } 10338 return c.header_ 10339} 10340 10341func (c *ProjectsInstancesStartExternalSyncCall) doRequest(alt string) (*http.Response, error) { 10342 reqHeaders := make(http.Header) 10343 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10344 for k, v := range c.header_ { 10345 reqHeaders[k] = v 10346 } 10347 reqHeaders.Set("User-Agent", c.s.userAgent()) 10348 var body io.Reader = nil 10349 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesstartexternalsyncrequest) 10350 if err != nil { 10351 return nil, err 10352 } 10353 reqHeaders.Set("Content-Type", "application/json") 10354 c.urlParams_.Set("alt", alt) 10355 c.urlParams_.Set("prettyPrint", "false") 10356 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync") 10357 urls += "?" + c.urlParams_.Encode() 10358 req, err := http.NewRequest("POST", urls, body) 10359 if err != nil { 10360 return nil, err 10361 } 10362 req.Header = reqHeaders 10363 googleapi.Expand(req.URL, map[string]string{ 10364 "project": c.project, 10365 "instance": c.instance, 10366 }) 10367 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10368} 10369 10370// Do executes the "sql.projects.instances.startExternalSync" call. 10371// Exactly one of *Operation or error will be non-nil. Any non-2xx 10372// status code is an error. Response headers are in either 10373// *Operation.ServerResponse.Header or (if a response was returned at 10374// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10375// to check whether the returned error was because 10376// http.StatusNotModified was returned. 10377func (c *ProjectsInstancesStartExternalSyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10378 gensupport.SetOptions(c.urlParams_, opts...) 10379 res, err := c.doRequest("json") 10380 if res != nil && res.StatusCode == http.StatusNotModified { 10381 if res.Body != nil { 10382 res.Body.Close() 10383 } 10384 return nil, &googleapi.Error{ 10385 Code: res.StatusCode, 10386 Header: res.Header, 10387 } 10388 } 10389 if err != nil { 10390 return nil, err 10391 } 10392 defer googleapi.CloseBody(res) 10393 if err := googleapi.CheckResponse(res); err != nil { 10394 return nil, err 10395 } 10396 ret := &Operation{ 10397 ServerResponse: googleapi.ServerResponse{ 10398 Header: res.Header, 10399 HTTPStatusCode: res.StatusCode, 10400 }, 10401 } 10402 target := &ret 10403 if err := gensupport.DecodeResponse(target, res); err != nil { 10404 return nil, err 10405 } 10406 return ret, nil 10407 // { 10408 // "description": "Start External primary instance migration.", 10409 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync", 10410 // "httpMethod": "POST", 10411 // "id": "sql.projects.instances.startExternalSync", 10412 // "parameterOrder": [ 10413 // "project", 10414 // "instance" 10415 // ], 10416 // "parameters": { 10417 // "instance": { 10418 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10419 // "location": "path", 10420 // "required": true, 10421 // "type": "string" 10422 // }, 10423 // "project": { 10424 // "description": "ID of the project that contains the instance.", 10425 // "location": "path", 10426 // "required": true, 10427 // "type": "string" 10428 // } 10429 // }, 10430 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/startExternalSync", 10431 // "request": { 10432 // "$ref": "SqlInstancesStartExternalSyncRequest" 10433 // }, 10434 // "response": { 10435 // "$ref": "Operation" 10436 // }, 10437 // "scopes": [ 10438 // "https://www.googleapis.com/auth/cloud-platform", 10439 // "https://www.googleapis.com/auth/sqlservice.admin" 10440 // ] 10441 // } 10442 10443} 10444 10445// method id "sql.projects.instances.verifyExternalSyncSettings": 10446 10447type ProjectsInstancesVerifyExternalSyncSettingsCall struct { 10448 s *Service 10449 project string 10450 instance string 10451 sqlinstancesverifyexternalsyncsettingsrequest *SqlInstancesVerifyExternalSyncSettingsRequest 10452 urlParams_ gensupport.URLParams 10453 ctx_ context.Context 10454 header_ http.Header 10455} 10456 10457// VerifyExternalSyncSettings: Verify External primary instance external 10458// sync settings. 10459// 10460// - instance: Cloud SQL instance ID. This does not include the project 10461// ID. 10462// - project: Project ID of the project that contains the instance. 10463func (r *ProjectsInstancesService) VerifyExternalSyncSettings(project string, instance string, sqlinstancesverifyexternalsyncsettingsrequest *SqlInstancesVerifyExternalSyncSettingsRequest) *ProjectsInstancesVerifyExternalSyncSettingsCall { 10464 c := &ProjectsInstancesVerifyExternalSyncSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10465 c.project = project 10466 c.instance = instance 10467 c.sqlinstancesverifyexternalsyncsettingsrequest = sqlinstancesverifyexternalsyncsettingsrequest 10468 return c 10469} 10470 10471// Fields allows partial responses to be retrieved. See 10472// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10473// for more information. 10474func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Fields(s ...googleapi.Field) *ProjectsInstancesVerifyExternalSyncSettingsCall { 10475 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10476 return c 10477} 10478 10479// Context sets the context to be used in this call's Do method. Any 10480// pending HTTP request will be aborted if the provided context is 10481// canceled. 10482func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Context(ctx context.Context) *ProjectsInstancesVerifyExternalSyncSettingsCall { 10483 c.ctx_ = ctx 10484 return c 10485} 10486 10487// Header returns an http.Header that can be modified by the caller to 10488// add HTTP headers to the request. 10489func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Header() http.Header { 10490 if c.header_ == nil { 10491 c.header_ = make(http.Header) 10492 } 10493 return c.header_ 10494} 10495 10496func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) doRequest(alt string) (*http.Response, error) { 10497 reqHeaders := make(http.Header) 10498 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10499 for k, v := range c.header_ { 10500 reqHeaders[k] = v 10501 } 10502 reqHeaders.Set("User-Agent", c.s.userAgent()) 10503 var body io.Reader = nil 10504 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sqlinstancesverifyexternalsyncsettingsrequest) 10505 if err != nil { 10506 return nil, err 10507 } 10508 reqHeaders.Set("Content-Type", "application/json") 10509 c.urlParams_.Set("alt", alt) 10510 c.urlParams_.Set("prettyPrint", "false") 10511 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings") 10512 urls += "?" + c.urlParams_.Encode() 10513 req, err := http.NewRequest("POST", urls, body) 10514 if err != nil { 10515 return nil, err 10516 } 10517 req.Header = reqHeaders 10518 googleapi.Expand(req.URL, map[string]string{ 10519 "project": c.project, 10520 "instance": c.instance, 10521 }) 10522 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10523} 10524 10525// Do executes the "sql.projects.instances.verifyExternalSyncSettings" call. 10526// Exactly one of *SqlInstancesVerifyExternalSyncSettingsResponse or 10527// error will be non-nil. Any non-2xx status code is an error. Response 10528// headers are in either 10529// *SqlInstancesVerifyExternalSyncSettingsResponse.ServerResponse.Header 10530// or (if a response was returned at all) in 10531// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10532// whether the returned error was because http.StatusNotModified was 10533// returned. 10534func (c *ProjectsInstancesVerifyExternalSyncSettingsCall) Do(opts ...googleapi.CallOption) (*SqlInstancesVerifyExternalSyncSettingsResponse, error) { 10535 gensupport.SetOptions(c.urlParams_, opts...) 10536 res, err := c.doRequest("json") 10537 if res != nil && res.StatusCode == http.StatusNotModified { 10538 if res.Body != nil { 10539 res.Body.Close() 10540 } 10541 return nil, &googleapi.Error{ 10542 Code: res.StatusCode, 10543 Header: res.Header, 10544 } 10545 } 10546 if err != nil { 10547 return nil, err 10548 } 10549 defer googleapi.CloseBody(res) 10550 if err := googleapi.CheckResponse(res); err != nil { 10551 return nil, err 10552 } 10553 ret := &SqlInstancesVerifyExternalSyncSettingsResponse{ 10554 ServerResponse: googleapi.ServerResponse{ 10555 Header: res.Header, 10556 HTTPStatusCode: res.StatusCode, 10557 }, 10558 } 10559 target := &ret 10560 if err := gensupport.DecodeResponse(target, res); err != nil { 10561 return nil, err 10562 } 10563 return ret, nil 10564 // { 10565 // "description": "Verify External primary instance external sync settings.", 10566 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings", 10567 // "httpMethod": "POST", 10568 // "id": "sql.projects.instances.verifyExternalSyncSettings", 10569 // "parameterOrder": [ 10570 // "project", 10571 // "instance" 10572 // ], 10573 // "parameters": { 10574 // "instance": { 10575 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10576 // "location": "path", 10577 // "required": true, 10578 // "type": "string" 10579 // }, 10580 // "project": { 10581 // "description": "Project ID of the project that contains the instance.", 10582 // "location": "path", 10583 // "required": true, 10584 // "type": "string" 10585 // } 10586 // }, 10587 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettings", 10588 // "request": { 10589 // "$ref": "SqlInstancesVerifyExternalSyncSettingsRequest" 10590 // }, 10591 // "response": { 10592 // "$ref": "SqlInstancesVerifyExternalSyncSettingsResponse" 10593 // }, 10594 // "scopes": [ 10595 // "https://www.googleapis.com/auth/cloud-platform", 10596 // "https://www.googleapis.com/auth/sqlservice.admin" 10597 // ] 10598 // } 10599 10600} 10601 10602// method id "sql.sslCerts.createEphemeral": 10603 10604type SslCertsCreateEphemeralCall struct { 10605 s *Service 10606 project string 10607 instance string 10608 sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest 10609 urlParams_ gensupport.URLParams 10610 ctx_ context.Context 10611 header_ http.Header 10612} 10613 10614// CreateEphemeral: Generates a short-lived X509 certificate containing 10615// the provided public key and signed by a private key specific to the 10616// target instance. Users may use the certificate to authenticate as 10617// themselves when connecting to the database. 10618// 10619// - instance: Cloud SQL instance ID. This does not include the project 10620// ID. 10621// - project: Project ID of the Cloud SQL project. 10622func (r *SslCertsService) CreateEphemeral(project string, instance string, sslcertscreateephemeralrequest *SslCertsCreateEphemeralRequest) *SslCertsCreateEphemeralCall { 10623 c := &SslCertsCreateEphemeralCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10624 c.project = project 10625 c.instance = instance 10626 c.sslcertscreateephemeralrequest = sslcertscreateephemeralrequest 10627 return c 10628} 10629 10630// Fields allows partial responses to be retrieved. See 10631// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10632// for more information. 10633func (c *SslCertsCreateEphemeralCall) Fields(s ...googleapi.Field) *SslCertsCreateEphemeralCall { 10634 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10635 return c 10636} 10637 10638// Context sets the context to be used in this call's Do method. Any 10639// pending HTTP request will be aborted if the provided context is 10640// canceled. 10641func (c *SslCertsCreateEphemeralCall) Context(ctx context.Context) *SslCertsCreateEphemeralCall { 10642 c.ctx_ = ctx 10643 return c 10644} 10645 10646// Header returns an http.Header that can be modified by the caller to 10647// add HTTP headers to the request. 10648func (c *SslCertsCreateEphemeralCall) Header() http.Header { 10649 if c.header_ == nil { 10650 c.header_ = make(http.Header) 10651 } 10652 return c.header_ 10653} 10654 10655func (c *SslCertsCreateEphemeralCall) doRequest(alt string) (*http.Response, error) { 10656 reqHeaders := make(http.Header) 10657 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10658 for k, v := range c.header_ { 10659 reqHeaders[k] = v 10660 } 10661 reqHeaders.Set("User-Agent", c.s.userAgent()) 10662 var body io.Reader = nil 10663 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertscreateephemeralrequest) 10664 if err != nil { 10665 return nil, err 10666 } 10667 reqHeaders.Set("Content-Type", "application/json") 10668 c.urlParams_.Set("alt", alt) 10669 c.urlParams_.Set("prettyPrint", "false") 10670 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral") 10671 urls += "?" + c.urlParams_.Encode() 10672 req, err := http.NewRequest("POST", urls, body) 10673 if err != nil { 10674 return nil, err 10675 } 10676 req.Header = reqHeaders 10677 googleapi.Expand(req.URL, map[string]string{ 10678 "project": c.project, 10679 "instance": c.instance, 10680 }) 10681 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10682} 10683 10684// Do executes the "sql.sslCerts.createEphemeral" call. 10685// Exactly one of *SslCert or error will be non-nil. Any non-2xx status 10686// code is an error. Response headers are in either 10687// *SslCert.ServerResponse.Header or (if a response was returned at all) 10688// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10689// check whether the returned error was because http.StatusNotModified 10690// was returned. 10691func (c *SslCertsCreateEphemeralCall) Do(opts ...googleapi.CallOption) (*SslCert, error) { 10692 gensupport.SetOptions(c.urlParams_, opts...) 10693 res, err := c.doRequest("json") 10694 if res != nil && res.StatusCode == http.StatusNotModified { 10695 if res.Body != nil { 10696 res.Body.Close() 10697 } 10698 return nil, &googleapi.Error{ 10699 Code: res.StatusCode, 10700 Header: res.Header, 10701 } 10702 } 10703 if err != nil { 10704 return nil, err 10705 } 10706 defer googleapi.CloseBody(res) 10707 if err := googleapi.CheckResponse(res); err != nil { 10708 return nil, err 10709 } 10710 ret := &SslCert{ 10711 ServerResponse: googleapi.ServerResponse{ 10712 Header: res.Header, 10713 HTTPStatusCode: res.StatusCode, 10714 }, 10715 } 10716 target := &ret 10717 if err := gensupport.DecodeResponse(target, res); err != nil { 10718 return nil, err 10719 } 10720 return ret, nil 10721 // { 10722 // "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.", 10723 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral", 10724 // "httpMethod": "POST", 10725 // "id": "sql.sslCerts.createEphemeral", 10726 // "parameterOrder": [ 10727 // "project", 10728 // "instance" 10729 // ], 10730 // "parameters": { 10731 // "instance": { 10732 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10733 // "location": "path", 10734 // "required": true, 10735 // "type": "string" 10736 // }, 10737 // "project": { 10738 // "description": "Project ID of the Cloud SQL project.", 10739 // "location": "path", 10740 // "required": true, 10741 // "type": "string" 10742 // } 10743 // }, 10744 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral", 10745 // "request": { 10746 // "$ref": "SslCertsCreateEphemeralRequest" 10747 // }, 10748 // "response": { 10749 // "$ref": "SslCert" 10750 // }, 10751 // "scopes": [ 10752 // "https://www.googleapis.com/auth/cloud-platform", 10753 // "https://www.googleapis.com/auth/sqlservice.admin" 10754 // ] 10755 // } 10756 10757} 10758 10759// method id "sql.sslCerts.delete": 10760 10761type SslCertsDeleteCall struct { 10762 s *Service 10763 project string 10764 instance string 10765 sha1Fingerprint string 10766 urlParams_ gensupport.URLParams 10767 ctx_ context.Context 10768 header_ http.Header 10769} 10770 10771// Delete: Deletes the SSL certificate. For First Generation instances, 10772// the certificate remains valid until the instance is restarted. 10773// 10774// - instance: Cloud SQL instance ID. This does not include the project 10775// ID. 10776// - project: Project ID of the project that contains the instance. 10777// - sha1Fingerprint: Sha1 FingerPrint. 10778func (r *SslCertsService) Delete(project string, instance string, sha1Fingerprint string) *SslCertsDeleteCall { 10779 c := &SslCertsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10780 c.project = project 10781 c.instance = instance 10782 c.sha1Fingerprint = sha1Fingerprint 10783 return c 10784} 10785 10786// Fields allows partial responses to be retrieved. See 10787// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10788// for more information. 10789func (c *SslCertsDeleteCall) Fields(s ...googleapi.Field) *SslCertsDeleteCall { 10790 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10791 return c 10792} 10793 10794// Context sets the context to be used in this call's Do method. Any 10795// pending HTTP request will be aborted if the provided context is 10796// canceled. 10797func (c *SslCertsDeleteCall) Context(ctx context.Context) *SslCertsDeleteCall { 10798 c.ctx_ = ctx 10799 return c 10800} 10801 10802// Header returns an http.Header that can be modified by the caller to 10803// add HTTP headers to the request. 10804func (c *SslCertsDeleteCall) Header() http.Header { 10805 if c.header_ == nil { 10806 c.header_ = make(http.Header) 10807 } 10808 return c.header_ 10809} 10810 10811func (c *SslCertsDeleteCall) doRequest(alt string) (*http.Response, error) { 10812 reqHeaders := make(http.Header) 10813 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10814 for k, v := range c.header_ { 10815 reqHeaders[k] = v 10816 } 10817 reqHeaders.Set("User-Agent", c.s.userAgent()) 10818 var body io.Reader = nil 10819 c.urlParams_.Set("alt", alt) 10820 c.urlParams_.Set("prettyPrint", "false") 10821 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") 10822 urls += "?" + c.urlParams_.Encode() 10823 req, err := http.NewRequest("DELETE", urls, body) 10824 if err != nil { 10825 return nil, err 10826 } 10827 req.Header = reqHeaders 10828 googleapi.Expand(req.URL, map[string]string{ 10829 "project": c.project, 10830 "instance": c.instance, 10831 "sha1Fingerprint": c.sha1Fingerprint, 10832 }) 10833 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10834} 10835 10836// Do executes the "sql.sslCerts.delete" call. 10837// Exactly one of *Operation or error will be non-nil. Any non-2xx 10838// status code is an error. Response headers are in either 10839// *Operation.ServerResponse.Header or (if a response was returned at 10840// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10841// to check whether the returned error was because 10842// http.StatusNotModified was returned. 10843func (c *SslCertsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10844 gensupport.SetOptions(c.urlParams_, opts...) 10845 res, err := c.doRequest("json") 10846 if res != nil && res.StatusCode == http.StatusNotModified { 10847 if res.Body != nil { 10848 res.Body.Close() 10849 } 10850 return nil, &googleapi.Error{ 10851 Code: res.StatusCode, 10852 Header: res.Header, 10853 } 10854 } 10855 if err != nil { 10856 return nil, err 10857 } 10858 defer googleapi.CloseBody(res) 10859 if err := googleapi.CheckResponse(res); err != nil { 10860 return nil, err 10861 } 10862 ret := &Operation{ 10863 ServerResponse: googleapi.ServerResponse{ 10864 Header: res.Header, 10865 HTTPStatusCode: res.StatusCode, 10866 }, 10867 } 10868 target := &ret 10869 if err := gensupport.DecodeResponse(target, res); err != nil { 10870 return nil, err 10871 } 10872 return ret, nil 10873 // { 10874 // "description": "Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.", 10875 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 10876 // "httpMethod": "DELETE", 10877 // "id": "sql.sslCerts.delete", 10878 // "parameterOrder": [ 10879 // "project", 10880 // "instance", 10881 // "sha1Fingerprint" 10882 // ], 10883 // "parameters": { 10884 // "instance": { 10885 // "description": "Cloud SQL instance ID. This does not include the project ID.", 10886 // "location": "path", 10887 // "required": true, 10888 // "type": "string" 10889 // }, 10890 // "project": { 10891 // "description": "Project ID of the project that contains the instance.", 10892 // "location": "path", 10893 // "required": true, 10894 // "type": "string" 10895 // }, 10896 // "sha1Fingerprint": { 10897 // "description": "Sha1 FingerPrint.", 10898 // "location": "path", 10899 // "required": true, 10900 // "type": "string" 10901 // } 10902 // }, 10903 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 10904 // "response": { 10905 // "$ref": "Operation" 10906 // }, 10907 // "scopes": [ 10908 // "https://www.googleapis.com/auth/cloud-platform", 10909 // "https://www.googleapis.com/auth/sqlservice.admin" 10910 // ] 10911 // } 10912 10913} 10914 10915// method id "sql.sslCerts.get": 10916 10917type SslCertsGetCall struct { 10918 s *Service 10919 project string 10920 instance string 10921 sha1Fingerprint string 10922 urlParams_ gensupport.URLParams 10923 ifNoneMatch_ string 10924 ctx_ context.Context 10925 header_ http.Header 10926} 10927 10928// Get: Retrieves a particular SSL certificate. Does not include the 10929// private key (required for usage). The private key must be saved from 10930// the response to initial creation. 10931// 10932// - instance: Cloud SQL instance ID. This does not include the project 10933// ID. 10934// - project: Project ID of the project that contains the instance. 10935// - sha1Fingerprint: Sha1 FingerPrint. 10936func (r *SslCertsService) Get(project string, instance string, sha1Fingerprint string) *SslCertsGetCall { 10937 c := &SslCertsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10938 c.project = project 10939 c.instance = instance 10940 c.sha1Fingerprint = sha1Fingerprint 10941 return c 10942} 10943 10944// Fields allows partial responses to be retrieved. See 10945// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10946// for more information. 10947func (c *SslCertsGetCall) Fields(s ...googleapi.Field) *SslCertsGetCall { 10948 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10949 return c 10950} 10951 10952// IfNoneMatch sets the optional parameter which makes the operation 10953// fail if the object's ETag matches the given value. This is useful for 10954// getting updates only after the object has changed since the last 10955// request. Use googleapi.IsNotModified to check whether the response 10956// error from Do is the result of In-None-Match. 10957func (c *SslCertsGetCall) IfNoneMatch(entityTag string) *SslCertsGetCall { 10958 c.ifNoneMatch_ = entityTag 10959 return c 10960} 10961 10962// Context sets the context to be used in this call's Do method. Any 10963// pending HTTP request will be aborted if the provided context is 10964// canceled. 10965func (c *SslCertsGetCall) Context(ctx context.Context) *SslCertsGetCall { 10966 c.ctx_ = ctx 10967 return c 10968} 10969 10970// Header returns an http.Header that can be modified by the caller to 10971// add HTTP headers to the request. 10972func (c *SslCertsGetCall) Header() http.Header { 10973 if c.header_ == nil { 10974 c.header_ = make(http.Header) 10975 } 10976 return c.header_ 10977} 10978 10979func (c *SslCertsGetCall) doRequest(alt string) (*http.Response, error) { 10980 reqHeaders := make(http.Header) 10981 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 10982 for k, v := range c.header_ { 10983 reqHeaders[k] = v 10984 } 10985 reqHeaders.Set("User-Agent", c.s.userAgent()) 10986 if c.ifNoneMatch_ != "" { 10987 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10988 } 10989 var body io.Reader = nil 10990 c.urlParams_.Set("alt", alt) 10991 c.urlParams_.Set("prettyPrint", "false") 10992 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}") 10993 urls += "?" + c.urlParams_.Encode() 10994 req, err := http.NewRequest("GET", urls, body) 10995 if err != nil { 10996 return nil, err 10997 } 10998 req.Header = reqHeaders 10999 googleapi.Expand(req.URL, map[string]string{ 11000 "project": c.project, 11001 "instance": c.instance, 11002 "sha1Fingerprint": c.sha1Fingerprint, 11003 }) 11004 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11005} 11006 11007// Do executes the "sql.sslCerts.get" call. 11008// Exactly one of *SslCert or error will be non-nil. Any non-2xx status 11009// code is an error. Response headers are in either 11010// *SslCert.ServerResponse.Header or (if a response was returned at all) 11011// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11012// check whether the returned error was because http.StatusNotModified 11013// was returned. 11014func (c *SslCertsGetCall) Do(opts ...googleapi.CallOption) (*SslCert, error) { 11015 gensupport.SetOptions(c.urlParams_, opts...) 11016 res, err := c.doRequest("json") 11017 if res != nil && res.StatusCode == http.StatusNotModified { 11018 if res.Body != nil { 11019 res.Body.Close() 11020 } 11021 return nil, &googleapi.Error{ 11022 Code: res.StatusCode, 11023 Header: res.Header, 11024 } 11025 } 11026 if err != nil { 11027 return nil, err 11028 } 11029 defer googleapi.CloseBody(res) 11030 if err := googleapi.CheckResponse(res); err != nil { 11031 return nil, err 11032 } 11033 ret := &SslCert{ 11034 ServerResponse: googleapi.ServerResponse{ 11035 Header: res.Header, 11036 HTTPStatusCode: res.StatusCode, 11037 }, 11038 } 11039 target := &ret 11040 if err := gensupport.DecodeResponse(target, res); err != nil { 11041 return nil, err 11042 } 11043 return ret, nil 11044 // { 11045 // "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.", 11046 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 11047 // "httpMethod": "GET", 11048 // "id": "sql.sslCerts.get", 11049 // "parameterOrder": [ 11050 // "project", 11051 // "instance", 11052 // "sha1Fingerprint" 11053 // ], 11054 // "parameters": { 11055 // "instance": { 11056 // "description": "Cloud SQL instance ID. This does not include the project ID.", 11057 // "location": "path", 11058 // "required": true, 11059 // "type": "string" 11060 // }, 11061 // "project": { 11062 // "description": "Project ID of the project that contains the instance.", 11063 // "location": "path", 11064 // "required": true, 11065 // "type": "string" 11066 // }, 11067 // "sha1Fingerprint": { 11068 // "description": "Sha1 FingerPrint.", 11069 // "location": "path", 11070 // "required": true, 11071 // "type": "string" 11072 // } 11073 // }, 11074 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}", 11075 // "response": { 11076 // "$ref": "SslCert" 11077 // }, 11078 // "scopes": [ 11079 // "https://www.googleapis.com/auth/cloud-platform", 11080 // "https://www.googleapis.com/auth/sqlservice.admin" 11081 // ] 11082 // } 11083 11084} 11085 11086// method id "sql.sslCerts.insert": 11087 11088type SslCertsInsertCall struct { 11089 s *Service 11090 project string 11091 instance string 11092 sslcertsinsertrequest *SslCertsInsertRequest 11093 urlParams_ gensupport.URLParams 11094 ctx_ context.Context 11095 header_ http.Header 11096} 11097 11098// Insert: Creates an SSL certificate and returns it along with the 11099// private key and server certificate authority. The new certificate 11100// will not be usable until the instance is restarted. 11101// 11102// - instance: Cloud SQL instance ID. This does not include the project 11103// ID. 11104// - project: Project ID of the project that contains the instance. 11105func (r *SslCertsService) Insert(project string, instance string, sslcertsinsertrequest *SslCertsInsertRequest) *SslCertsInsertCall { 11106 c := &SslCertsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11107 c.project = project 11108 c.instance = instance 11109 c.sslcertsinsertrequest = sslcertsinsertrequest 11110 return c 11111} 11112 11113// Fields allows partial responses to be retrieved. See 11114// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11115// for more information. 11116func (c *SslCertsInsertCall) Fields(s ...googleapi.Field) *SslCertsInsertCall { 11117 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11118 return c 11119} 11120 11121// Context sets the context to be used in this call's Do method. Any 11122// pending HTTP request will be aborted if the provided context is 11123// canceled. 11124func (c *SslCertsInsertCall) Context(ctx context.Context) *SslCertsInsertCall { 11125 c.ctx_ = ctx 11126 return c 11127} 11128 11129// Header returns an http.Header that can be modified by the caller to 11130// add HTTP headers to the request. 11131func (c *SslCertsInsertCall) Header() http.Header { 11132 if c.header_ == nil { 11133 c.header_ = make(http.Header) 11134 } 11135 return c.header_ 11136} 11137 11138func (c *SslCertsInsertCall) doRequest(alt string) (*http.Response, error) { 11139 reqHeaders := make(http.Header) 11140 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11141 for k, v := range c.header_ { 11142 reqHeaders[k] = v 11143 } 11144 reqHeaders.Set("User-Agent", c.s.userAgent()) 11145 var body io.Reader = nil 11146 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertsinsertrequest) 11147 if err != nil { 11148 return nil, err 11149 } 11150 reqHeaders.Set("Content-Type", "application/json") 11151 c.urlParams_.Set("alt", alt) 11152 c.urlParams_.Set("prettyPrint", "false") 11153 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts") 11154 urls += "?" + c.urlParams_.Encode() 11155 req, err := http.NewRequest("POST", urls, body) 11156 if err != nil { 11157 return nil, err 11158 } 11159 req.Header = reqHeaders 11160 googleapi.Expand(req.URL, map[string]string{ 11161 "project": c.project, 11162 "instance": c.instance, 11163 }) 11164 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11165} 11166 11167// Do executes the "sql.sslCerts.insert" call. 11168// Exactly one of *SslCertsInsertResponse or error will be non-nil. Any 11169// non-2xx status code is an error. Response headers are in either 11170// *SslCertsInsertResponse.ServerResponse.Header or (if a response was 11171// returned at all) in error.(*googleapi.Error).Header. Use 11172// googleapi.IsNotModified to check whether the returned error was 11173// because http.StatusNotModified was returned. 11174func (c *SslCertsInsertCall) Do(opts ...googleapi.CallOption) (*SslCertsInsertResponse, error) { 11175 gensupport.SetOptions(c.urlParams_, opts...) 11176 res, err := c.doRequest("json") 11177 if res != nil && res.StatusCode == http.StatusNotModified { 11178 if res.Body != nil { 11179 res.Body.Close() 11180 } 11181 return nil, &googleapi.Error{ 11182 Code: res.StatusCode, 11183 Header: res.Header, 11184 } 11185 } 11186 if err != nil { 11187 return nil, err 11188 } 11189 defer googleapi.CloseBody(res) 11190 if err := googleapi.CheckResponse(res); err != nil { 11191 return nil, err 11192 } 11193 ret := &SslCertsInsertResponse{ 11194 ServerResponse: googleapi.ServerResponse{ 11195 Header: res.Header, 11196 HTTPStatusCode: res.StatusCode, 11197 }, 11198 } 11199 target := &ret 11200 if err := gensupport.DecodeResponse(target, res); err != nil { 11201 return nil, err 11202 } 11203 return ret, nil 11204 // { 11205 // "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.", 11206 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 11207 // "httpMethod": "POST", 11208 // "id": "sql.sslCerts.insert", 11209 // "parameterOrder": [ 11210 // "project", 11211 // "instance" 11212 // ], 11213 // "parameters": { 11214 // "instance": { 11215 // "description": "Cloud SQL instance ID. This does not include the project ID.", 11216 // "location": "path", 11217 // "required": true, 11218 // "type": "string" 11219 // }, 11220 // "project": { 11221 // "description": "Project ID of the project that contains the instance.", 11222 // "location": "path", 11223 // "required": true, 11224 // "type": "string" 11225 // } 11226 // }, 11227 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 11228 // "request": { 11229 // "$ref": "SslCertsInsertRequest" 11230 // }, 11231 // "response": { 11232 // "$ref": "SslCertsInsertResponse" 11233 // }, 11234 // "scopes": [ 11235 // "https://www.googleapis.com/auth/cloud-platform", 11236 // "https://www.googleapis.com/auth/sqlservice.admin" 11237 // ] 11238 // } 11239 11240} 11241 11242// method id "sql.sslCerts.list": 11243 11244type SslCertsListCall struct { 11245 s *Service 11246 project string 11247 instance string 11248 urlParams_ gensupport.URLParams 11249 ifNoneMatch_ string 11250 ctx_ context.Context 11251 header_ http.Header 11252} 11253 11254// List: Lists all of the current SSL certificates for the instance. 11255// 11256// - instance: Cloud SQL instance ID. This does not include the project 11257// ID. 11258// - project: Project ID of the project that contains the instance. 11259func (r *SslCertsService) List(project string, instance string) *SslCertsListCall { 11260 c := &SslCertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11261 c.project = project 11262 c.instance = instance 11263 return c 11264} 11265 11266// Fields allows partial responses to be retrieved. See 11267// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11268// for more information. 11269func (c *SslCertsListCall) Fields(s ...googleapi.Field) *SslCertsListCall { 11270 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11271 return c 11272} 11273 11274// IfNoneMatch sets the optional parameter which makes the operation 11275// fail if the object's ETag matches the given value. This is useful for 11276// getting updates only after the object has changed since the last 11277// request. Use googleapi.IsNotModified to check whether the response 11278// error from Do is the result of In-None-Match. 11279func (c *SslCertsListCall) IfNoneMatch(entityTag string) *SslCertsListCall { 11280 c.ifNoneMatch_ = entityTag 11281 return c 11282} 11283 11284// Context sets the context to be used in this call's Do method. Any 11285// pending HTTP request will be aborted if the provided context is 11286// canceled. 11287func (c *SslCertsListCall) Context(ctx context.Context) *SslCertsListCall { 11288 c.ctx_ = ctx 11289 return c 11290} 11291 11292// Header returns an http.Header that can be modified by the caller to 11293// add HTTP headers to the request. 11294func (c *SslCertsListCall) Header() http.Header { 11295 if c.header_ == nil { 11296 c.header_ = make(http.Header) 11297 } 11298 return c.header_ 11299} 11300 11301func (c *SslCertsListCall) doRequest(alt string) (*http.Response, error) { 11302 reqHeaders := make(http.Header) 11303 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11304 for k, v := range c.header_ { 11305 reqHeaders[k] = v 11306 } 11307 reqHeaders.Set("User-Agent", c.s.userAgent()) 11308 if c.ifNoneMatch_ != "" { 11309 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11310 } 11311 var body io.Reader = nil 11312 c.urlParams_.Set("alt", alt) 11313 c.urlParams_.Set("prettyPrint", "false") 11314 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts") 11315 urls += "?" + c.urlParams_.Encode() 11316 req, err := http.NewRequest("GET", urls, body) 11317 if err != nil { 11318 return nil, err 11319 } 11320 req.Header = reqHeaders 11321 googleapi.Expand(req.URL, map[string]string{ 11322 "project": c.project, 11323 "instance": c.instance, 11324 }) 11325 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11326} 11327 11328// Do executes the "sql.sslCerts.list" call. 11329// Exactly one of *SslCertsListResponse or error will be non-nil. Any 11330// non-2xx status code is an error. Response headers are in either 11331// *SslCertsListResponse.ServerResponse.Header or (if a response was 11332// returned at all) in error.(*googleapi.Error).Header. Use 11333// googleapi.IsNotModified to check whether the returned error was 11334// because http.StatusNotModified was returned. 11335func (c *SslCertsListCall) Do(opts ...googleapi.CallOption) (*SslCertsListResponse, error) { 11336 gensupport.SetOptions(c.urlParams_, opts...) 11337 res, err := c.doRequest("json") 11338 if res != nil && res.StatusCode == http.StatusNotModified { 11339 if res.Body != nil { 11340 res.Body.Close() 11341 } 11342 return nil, &googleapi.Error{ 11343 Code: res.StatusCode, 11344 Header: res.Header, 11345 } 11346 } 11347 if err != nil { 11348 return nil, err 11349 } 11350 defer googleapi.CloseBody(res) 11351 if err := googleapi.CheckResponse(res); err != nil { 11352 return nil, err 11353 } 11354 ret := &SslCertsListResponse{ 11355 ServerResponse: googleapi.ServerResponse{ 11356 Header: res.Header, 11357 HTTPStatusCode: res.StatusCode, 11358 }, 11359 } 11360 target := &ret 11361 if err := gensupport.DecodeResponse(target, res); err != nil { 11362 return nil, err 11363 } 11364 return ret, nil 11365 // { 11366 // "description": "Lists all of the current SSL certificates for the instance.", 11367 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 11368 // "httpMethod": "GET", 11369 // "id": "sql.sslCerts.list", 11370 // "parameterOrder": [ 11371 // "project", 11372 // "instance" 11373 // ], 11374 // "parameters": { 11375 // "instance": { 11376 // "description": "Cloud SQL instance ID. This does not include the project ID.", 11377 // "location": "path", 11378 // "required": true, 11379 // "type": "string" 11380 // }, 11381 // "project": { 11382 // "description": "Project ID of the project that contains the instance.", 11383 // "location": "path", 11384 // "required": true, 11385 // "type": "string" 11386 // } 11387 // }, 11388 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/sslCerts", 11389 // "response": { 11390 // "$ref": "SslCertsListResponse" 11391 // }, 11392 // "scopes": [ 11393 // "https://www.googleapis.com/auth/cloud-platform", 11394 // "https://www.googleapis.com/auth/sqlservice.admin" 11395 // ] 11396 // } 11397 11398} 11399 11400// method id "sql.tiers.list": 11401 11402type TiersListCall struct { 11403 s *Service 11404 project string 11405 urlParams_ gensupport.URLParams 11406 ifNoneMatch_ string 11407 ctx_ context.Context 11408 header_ http.Header 11409} 11410 11411// List: Lists all available machine types (tiers) for Cloud SQL, for 11412// example, db-custom-1-3840. For related information, see Pricing. 11413// 11414// - project: Project ID of the project for which to list tiers. 11415func (r *TiersService) List(project string) *TiersListCall { 11416 c := &TiersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11417 c.project = project 11418 return c 11419} 11420 11421// Fields allows partial responses to be retrieved. See 11422// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11423// for more information. 11424func (c *TiersListCall) Fields(s ...googleapi.Field) *TiersListCall { 11425 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11426 return c 11427} 11428 11429// IfNoneMatch sets the optional parameter which makes the operation 11430// fail if the object's ETag matches the given value. This is useful for 11431// getting updates only after the object has changed since the last 11432// request. Use googleapi.IsNotModified to check whether the response 11433// error from Do is the result of In-None-Match. 11434func (c *TiersListCall) IfNoneMatch(entityTag string) *TiersListCall { 11435 c.ifNoneMatch_ = entityTag 11436 return c 11437} 11438 11439// Context sets the context to be used in this call's Do method. Any 11440// pending HTTP request will be aborted if the provided context is 11441// canceled. 11442func (c *TiersListCall) Context(ctx context.Context) *TiersListCall { 11443 c.ctx_ = ctx 11444 return c 11445} 11446 11447// Header returns an http.Header that can be modified by the caller to 11448// add HTTP headers to the request. 11449func (c *TiersListCall) Header() http.Header { 11450 if c.header_ == nil { 11451 c.header_ = make(http.Header) 11452 } 11453 return c.header_ 11454} 11455 11456func (c *TiersListCall) doRequest(alt string) (*http.Response, error) { 11457 reqHeaders := make(http.Header) 11458 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11459 for k, v := range c.header_ { 11460 reqHeaders[k] = v 11461 } 11462 reqHeaders.Set("User-Agent", c.s.userAgent()) 11463 if c.ifNoneMatch_ != "" { 11464 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11465 } 11466 var body io.Reader = nil 11467 c.urlParams_.Set("alt", alt) 11468 c.urlParams_.Set("prettyPrint", "false") 11469 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/tiers") 11470 urls += "?" + c.urlParams_.Encode() 11471 req, err := http.NewRequest("GET", urls, body) 11472 if err != nil { 11473 return nil, err 11474 } 11475 req.Header = reqHeaders 11476 googleapi.Expand(req.URL, map[string]string{ 11477 "project": c.project, 11478 }) 11479 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11480} 11481 11482// Do executes the "sql.tiers.list" call. 11483// Exactly one of *TiersListResponse or error will be non-nil. Any 11484// non-2xx status code is an error. Response headers are in either 11485// *TiersListResponse.ServerResponse.Header or (if a response was 11486// returned at all) in error.(*googleapi.Error).Header. Use 11487// googleapi.IsNotModified to check whether the returned error was 11488// because http.StatusNotModified was returned. 11489func (c *TiersListCall) Do(opts ...googleapi.CallOption) (*TiersListResponse, error) { 11490 gensupport.SetOptions(c.urlParams_, opts...) 11491 res, err := c.doRequest("json") 11492 if res != nil && res.StatusCode == http.StatusNotModified { 11493 if res.Body != nil { 11494 res.Body.Close() 11495 } 11496 return nil, &googleapi.Error{ 11497 Code: res.StatusCode, 11498 Header: res.Header, 11499 } 11500 } 11501 if err != nil { 11502 return nil, err 11503 } 11504 defer googleapi.CloseBody(res) 11505 if err := googleapi.CheckResponse(res); err != nil { 11506 return nil, err 11507 } 11508 ret := &TiersListResponse{ 11509 ServerResponse: googleapi.ServerResponse{ 11510 Header: res.Header, 11511 HTTPStatusCode: res.StatusCode, 11512 }, 11513 } 11514 target := &ret 11515 if err := gensupport.DecodeResponse(target, res); err != nil { 11516 return nil, err 11517 } 11518 return ret, nil 11519 // { 11520 // "description": "Lists all available machine types (tiers) for Cloud SQL, for example, db-custom-1-3840. For related information, see Pricing.", 11521 // "flatPath": "sql/v1beta4/projects/{project}/tiers", 11522 // "httpMethod": "GET", 11523 // "id": "sql.tiers.list", 11524 // "parameterOrder": [ 11525 // "project" 11526 // ], 11527 // "parameters": { 11528 // "project": { 11529 // "description": "Project ID of the project for which to list tiers.", 11530 // "location": "path", 11531 // "required": true, 11532 // "type": "string" 11533 // } 11534 // }, 11535 // "path": "sql/v1beta4/projects/{project}/tiers", 11536 // "response": { 11537 // "$ref": "TiersListResponse" 11538 // }, 11539 // "scopes": [ 11540 // "https://www.googleapis.com/auth/cloud-platform", 11541 // "https://www.googleapis.com/auth/sqlservice.admin" 11542 // ] 11543 // } 11544 11545} 11546 11547// method id "sql.users.delete": 11548 11549type UsersDeleteCall struct { 11550 s *Service 11551 project string 11552 instance string 11553 urlParams_ gensupport.URLParams 11554 ctx_ context.Context 11555 header_ http.Header 11556} 11557 11558// Delete: Deletes a user from a Cloud SQL instance. 11559// 11560// - instance: Database instance ID. This does not include the project 11561// ID. 11562// - project: Project ID of the project that contains the instance. 11563func (r *UsersService) Delete(project string, instance string) *UsersDeleteCall { 11564 c := &UsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11565 c.project = project 11566 c.instance = instance 11567 return c 11568} 11569 11570// Host sets the optional parameter "host": Host of the user in the 11571// instance. 11572func (c *UsersDeleteCall) Host(host string) *UsersDeleteCall { 11573 c.urlParams_.Set("host", host) 11574 return c 11575} 11576 11577// Name sets the optional parameter "name": Name of the user in the 11578// instance. 11579func (c *UsersDeleteCall) Name(name string) *UsersDeleteCall { 11580 c.urlParams_.Set("name", name) 11581 return c 11582} 11583 11584// Fields allows partial responses to be retrieved. See 11585// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11586// for more information. 11587func (c *UsersDeleteCall) Fields(s ...googleapi.Field) *UsersDeleteCall { 11588 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11589 return c 11590} 11591 11592// Context sets the context to be used in this call's Do method. Any 11593// pending HTTP request will be aborted if the provided context is 11594// canceled. 11595func (c *UsersDeleteCall) Context(ctx context.Context) *UsersDeleteCall { 11596 c.ctx_ = ctx 11597 return c 11598} 11599 11600// Header returns an http.Header that can be modified by the caller to 11601// add HTTP headers to the request. 11602func (c *UsersDeleteCall) Header() http.Header { 11603 if c.header_ == nil { 11604 c.header_ = make(http.Header) 11605 } 11606 return c.header_ 11607} 11608 11609func (c *UsersDeleteCall) doRequest(alt string) (*http.Response, error) { 11610 reqHeaders := make(http.Header) 11611 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11612 for k, v := range c.header_ { 11613 reqHeaders[k] = v 11614 } 11615 reqHeaders.Set("User-Agent", c.s.userAgent()) 11616 var body io.Reader = nil 11617 c.urlParams_.Set("alt", alt) 11618 c.urlParams_.Set("prettyPrint", "false") 11619 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 11620 urls += "?" + c.urlParams_.Encode() 11621 req, err := http.NewRequest("DELETE", urls, body) 11622 if err != nil { 11623 return nil, err 11624 } 11625 req.Header = reqHeaders 11626 googleapi.Expand(req.URL, map[string]string{ 11627 "project": c.project, 11628 "instance": c.instance, 11629 }) 11630 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11631} 11632 11633// Do executes the "sql.users.delete" call. 11634// Exactly one of *Operation or error will be non-nil. Any non-2xx 11635// status code is an error. Response headers are in either 11636// *Operation.ServerResponse.Header or (if a response was returned at 11637// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11638// to check whether the returned error was because 11639// http.StatusNotModified was returned. 11640func (c *UsersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 11641 gensupport.SetOptions(c.urlParams_, opts...) 11642 res, err := c.doRequest("json") 11643 if res != nil && res.StatusCode == http.StatusNotModified { 11644 if res.Body != nil { 11645 res.Body.Close() 11646 } 11647 return nil, &googleapi.Error{ 11648 Code: res.StatusCode, 11649 Header: res.Header, 11650 } 11651 } 11652 if err != nil { 11653 return nil, err 11654 } 11655 defer googleapi.CloseBody(res) 11656 if err := googleapi.CheckResponse(res); err != nil { 11657 return nil, err 11658 } 11659 ret := &Operation{ 11660 ServerResponse: googleapi.ServerResponse{ 11661 Header: res.Header, 11662 HTTPStatusCode: res.StatusCode, 11663 }, 11664 } 11665 target := &ret 11666 if err := gensupport.DecodeResponse(target, res); err != nil { 11667 return nil, err 11668 } 11669 return ret, nil 11670 // { 11671 // "description": "Deletes a user from a Cloud SQL instance.", 11672 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11673 // "httpMethod": "DELETE", 11674 // "id": "sql.users.delete", 11675 // "parameterOrder": [ 11676 // "project", 11677 // "instance" 11678 // ], 11679 // "parameters": { 11680 // "host": { 11681 // "description": "Host of the user in the instance.", 11682 // "location": "query", 11683 // "type": "string" 11684 // }, 11685 // "instance": { 11686 // "description": "Database instance ID. This does not include the project ID.", 11687 // "location": "path", 11688 // "required": true, 11689 // "type": "string" 11690 // }, 11691 // "name": { 11692 // "description": "Name of the user in the instance.", 11693 // "location": "query", 11694 // "type": "string" 11695 // }, 11696 // "project": { 11697 // "description": "Project ID of the project that contains the instance.", 11698 // "location": "path", 11699 // "required": true, 11700 // "type": "string" 11701 // } 11702 // }, 11703 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11704 // "response": { 11705 // "$ref": "Operation" 11706 // }, 11707 // "scopes": [ 11708 // "https://www.googleapis.com/auth/cloud-platform", 11709 // "https://www.googleapis.com/auth/sqlservice.admin" 11710 // ] 11711 // } 11712 11713} 11714 11715// method id "sql.users.insert": 11716 11717type UsersInsertCall struct { 11718 s *Service 11719 project string 11720 instance string 11721 user *User 11722 urlParams_ gensupport.URLParams 11723 ctx_ context.Context 11724 header_ http.Header 11725} 11726 11727// Insert: Creates a new user in a Cloud SQL instance. 11728// 11729// - instance: Database instance ID. This does not include the project 11730// ID. 11731// - project: Project ID of the project that contains the instance. 11732func (r *UsersService) Insert(project string, instance string, user *User) *UsersInsertCall { 11733 c := &UsersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11734 c.project = project 11735 c.instance = instance 11736 c.user = user 11737 return c 11738} 11739 11740// Fields allows partial responses to be retrieved. See 11741// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11742// for more information. 11743func (c *UsersInsertCall) Fields(s ...googleapi.Field) *UsersInsertCall { 11744 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11745 return c 11746} 11747 11748// Context sets the context to be used in this call's Do method. Any 11749// pending HTTP request will be aborted if the provided context is 11750// canceled. 11751func (c *UsersInsertCall) Context(ctx context.Context) *UsersInsertCall { 11752 c.ctx_ = ctx 11753 return c 11754} 11755 11756// Header returns an http.Header that can be modified by the caller to 11757// add HTTP headers to the request. 11758func (c *UsersInsertCall) Header() http.Header { 11759 if c.header_ == nil { 11760 c.header_ = make(http.Header) 11761 } 11762 return c.header_ 11763} 11764 11765func (c *UsersInsertCall) doRequest(alt string) (*http.Response, error) { 11766 reqHeaders := make(http.Header) 11767 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11768 for k, v := range c.header_ { 11769 reqHeaders[k] = v 11770 } 11771 reqHeaders.Set("User-Agent", c.s.userAgent()) 11772 var body io.Reader = nil 11773 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 11774 if err != nil { 11775 return nil, err 11776 } 11777 reqHeaders.Set("Content-Type", "application/json") 11778 c.urlParams_.Set("alt", alt) 11779 c.urlParams_.Set("prettyPrint", "false") 11780 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 11781 urls += "?" + c.urlParams_.Encode() 11782 req, err := http.NewRequest("POST", urls, body) 11783 if err != nil { 11784 return nil, err 11785 } 11786 req.Header = reqHeaders 11787 googleapi.Expand(req.URL, map[string]string{ 11788 "project": c.project, 11789 "instance": c.instance, 11790 }) 11791 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11792} 11793 11794// Do executes the "sql.users.insert" call. 11795// Exactly one of *Operation or error will be non-nil. Any non-2xx 11796// status code is an error. Response headers are in either 11797// *Operation.ServerResponse.Header or (if a response was returned at 11798// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11799// to check whether the returned error was because 11800// http.StatusNotModified was returned. 11801func (c *UsersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 11802 gensupport.SetOptions(c.urlParams_, opts...) 11803 res, err := c.doRequest("json") 11804 if res != nil && res.StatusCode == http.StatusNotModified { 11805 if res.Body != nil { 11806 res.Body.Close() 11807 } 11808 return nil, &googleapi.Error{ 11809 Code: res.StatusCode, 11810 Header: res.Header, 11811 } 11812 } 11813 if err != nil { 11814 return nil, err 11815 } 11816 defer googleapi.CloseBody(res) 11817 if err := googleapi.CheckResponse(res); err != nil { 11818 return nil, err 11819 } 11820 ret := &Operation{ 11821 ServerResponse: googleapi.ServerResponse{ 11822 Header: res.Header, 11823 HTTPStatusCode: res.StatusCode, 11824 }, 11825 } 11826 target := &ret 11827 if err := gensupport.DecodeResponse(target, res); err != nil { 11828 return nil, err 11829 } 11830 return ret, nil 11831 // { 11832 // "description": "Creates a new user in a Cloud SQL instance.", 11833 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11834 // "httpMethod": "POST", 11835 // "id": "sql.users.insert", 11836 // "parameterOrder": [ 11837 // "project", 11838 // "instance" 11839 // ], 11840 // "parameters": { 11841 // "instance": { 11842 // "description": "Database instance ID. This does not include the project ID.", 11843 // "location": "path", 11844 // "required": true, 11845 // "type": "string" 11846 // }, 11847 // "project": { 11848 // "description": "Project ID of the project that contains the instance.", 11849 // "location": "path", 11850 // "required": true, 11851 // "type": "string" 11852 // } 11853 // }, 11854 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11855 // "request": { 11856 // "$ref": "User" 11857 // }, 11858 // "response": { 11859 // "$ref": "Operation" 11860 // }, 11861 // "scopes": [ 11862 // "https://www.googleapis.com/auth/cloud-platform", 11863 // "https://www.googleapis.com/auth/sqlservice.admin" 11864 // ] 11865 // } 11866 11867} 11868 11869// method id "sql.users.list": 11870 11871type UsersListCall struct { 11872 s *Service 11873 project string 11874 instance string 11875 urlParams_ gensupport.URLParams 11876 ifNoneMatch_ string 11877 ctx_ context.Context 11878 header_ http.Header 11879} 11880 11881// List: Lists users in the specified Cloud SQL instance. 11882// 11883// - instance: Database instance ID. This does not include the project 11884// ID. 11885// - project: Project ID of the project that contains the instance. 11886func (r *UsersService) List(project string, instance string) *UsersListCall { 11887 c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11888 c.project = project 11889 c.instance = instance 11890 return c 11891} 11892 11893// Fields allows partial responses to be retrieved. See 11894// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11895// for more information. 11896func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall { 11897 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11898 return c 11899} 11900 11901// IfNoneMatch sets the optional parameter which makes the operation 11902// fail if the object's ETag matches the given value. This is useful for 11903// getting updates only after the object has changed since the last 11904// request. Use googleapi.IsNotModified to check whether the response 11905// error from Do is the result of In-None-Match. 11906func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall { 11907 c.ifNoneMatch_ = entityTag 11908 return c 11909} 11910 11911// Context sets the context to be used in this call's Do method. Any 11912// pending HTTP request will be aborted if the provided context is 11913// canceled. 11914func (c *UsersListCall) Context(ctx context.Context) *UsersListCall { 11915 c.ctx_ = ctx 11916 return c 11917} 11918 11919// Header returns an http.Header that can be modified by the caller to 11920// add HTTP headers to the request. 11921func (c *UsersListCall) Header() http.Header { 11922 if c.header_ == nil { 11923 c.header_ = make(http.Header) 11924 } 11925 return c.header_ 11926} 11927 11928func (c *UsersListCall) doRequest(alt string) (*http.Response, error) { 11929 reqHeaders := make(http.Header) 11930 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 11931 for k, v := range c.header_ { 11932 reqHeaders[k] = v 11933 } 11934 reqHeaders.Set("User-Agent", c.s.userAgent()) 11935 if c.ifNoneMatch_ != "" { 11936 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11937 } 11938 var body io.Reader = nil 11939 c.urlParams_.Set("alt", alt) 11940 c.urlParams_.Set("prettyPrint", "false") 11941 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 11942 urls += "?" + c.urlParams_.Encode() 11943 req, err := http.NewRequest("GET", urls, body) 11944 if err != nil { 11945 return nil, err 11946 } 11947 req.Header = reqHeaders 11948 googleapi.Expand(req.URL, map[string]string{ 11949 "project": c.project, 11950 "instance": c.instance, 11951 }) 11952 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11953} 11954 11955// Do executes the "sql.users.list" call. 11956// Exactly one of *UsersListResponse or error will be non-nil. Any 11957// non-2xx status code is an error. Response headers are in either 11958// *UsersListResponse.ServerResponse.Header or (if a response was 11959// returned at all) in error.(*googleapi.Error).Header. Use 11960// googleapi.IsNotModified to check whether the returned error was 11961// because http.StatusNotModified was returned. 11962func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) { 11963 gensupport.SetOptions(c.urlParams_, opts...) 11964 res, err := c.doRequest("json") 11965 if res != nil && res.StatusCode == http.StatusNotModified { 11966 if res.Body != nil { 11967 res.Body.Close() 11968 } 11969 return nil, &googleapi.Error{ 11970 Code: res.StatusCode, 11971 Header: res.Header, 11972 } 11973 } 11974 if err != nil { 11975 return nil, err 11976 } 11977 defer googleapi.CloseBody(res) 11978 if err := googleapi.CheckResponse(res); err != nil { 11979 return nil, err 11980 } 11981 ret := &UsersListResponse{ 11982 ServerResponse: googleapi.ServerResponse{ 11983 Header: res.Header, 11984 HTTPStatusCode: res.StatusCode, 11985 }, 11986 } 11987 target := &ret 11988 if err := gensupport.DecodeResponse(target, res); err != nil { 11989 return nil, err 11990 } 11991 return ret, nil 11992 // { 11993 // "description": "Lists users in the specified Cloud SQL instance.", 11994 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 11995 // "httpMethod": "GET", 11996 // "id": "sql.users.list", 11997 // "parameterOrder": [ 11998 // "project", 11999 // "instance" 12000 // ], 12001 // "parameters": { 12002 // "instance": { 12003 // "description": "Database instance ID. This does not include the project ID.", 12004 // "location": "path", 12005 // "required": true, 12006 // "type": "string" 12007 // }, 12008 // "project": { 12009 // "description": "Project ID of the project that contains the instance.", 12010 // "location": "path", 12011 // "required": true, 12012 // "type": "string" 12013 // } 12014 // }, 12015 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 12016 // "response": { 12017 // "$ref": "UsersListResponse" 12018 // }, 12019 // "scopes": [ 12020 // "https://www.googleapis.com/auth/cloud-platform", 12021 // "https://www.googleapis.com/auth/sqlservice.admin" 12022 // ] 12023 // } 12024 12025} 12026 12027// method id "sql.users.update": 12028 12029type UsersUpdateCall struct { 12030 s *Service 12031 project string 12032 instance string 12033 user *User 12034 urlParams_ gensupport.URLParams 12035 ctx_ context.Context 12036 header_ http.Header 12037} 12038 12039// Update: Updates an existing user in a Cloud SQL instance. 12040// 12041// - instance: Database instance ID. This does not include the project 12042// ID. 12043// - project: Project ID of the project that contains the instance. 12044func (r *UsersService) Update(project string, instance string, user *User) *UsersUpdateCall { 12045 c := &UsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12046 c.project = project 12047 c.instance = instance 12048 c.user = user 12049 return c 12050} 12051 12052// Host sets the optional parameter "host": Host of the user in the 12053// instance. 12054func (c *UsersUpdateCall) Host(host string) *UsersUpdateCall { 12055 c.urlParams_.Set("host", host) 12056 return c 12057} 12058 12059// Name sets the optional parameter "name": Name of the user in the 12060// instance. 12061func (c *UsersUpdateCall) Name(name string) *UsersUpdateCall { 12062 c.urlParams_.Set("name", name) 12063 return c 12064} 12065 12066// Fields allows partial responses to be retrieved. See 12067// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12068// for more information. 12069func (c *UsersUpdateCall) Fields(s ...googleapi.Field) *UsersUpdateCall { 12070 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12071 return c 12072} 12073 12074// Context sets the context to be used in this call's Do method. Any 12075// pending HTTP request will be aborted if the provided context is 12076// canceled. 12077func (c *UsersUpdateCall) Context(ctx context.Context) *UsersUpdateCall { 12078 c.ctx_ = ctx 12079 return c 12080} 12081 12082// Header returns an http.Header that can be modified by the caller to 12083// add HTTP headers to the request. 12084func (c *UsersUpdateCall) Header() http.Header { 12085 if c.header_ == nil { 12086 c.header_ = make(http.Header) 12087 } 12088 return c.header_ 12089} 12090 12091func (c *UsersUpdateCall) doRequest(alt string) (*http.Response, error) { 12092 reqHeaders := make(http.Header) 12093 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027") 12094 for k, v := range c.header_ { 12095 reqHeaders[k] = v 12096 } 12097 reqHeaders.Set("User-Agent", c.s.userAgent()) 12098 var body io.Reader = nil 12099 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 12100 if err != nil { 12101 return nil, err 12102 } 12103 reqHeaders.Set("Content-Type", "application/json") 12104 c.urlParams_.Set("alt", alt) 12105 c.urlParams_.Set("prettyPrint", "false") 12106 urls := googleapi.ResolveRelative(c.s.BasePath, "sql/v1beta4/projects/{project}/instances/{instance}/users") 12107 urls += "?" + c.urlParams_.Encode() 12108 req, err := http.NewRequest("PUT", urls, body) 12109 if err != nil { 12110 return nil, err 12111 } 12112 req.Header = reqHeaders 12113 googleapi.Expand(req.URL, map[string]string{ 12114 "project": c.project, 12115 "instance": c.instance, 12116 }) 12117 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12118} 12119 12120// Do executes the "sql.users.update" call. 12121// Exactly one of *Operation or error will be non-nil. Any non-2xx 12122// status code is an error. Response headers are in either 12123// *Operation.ServerResponse.Header or (if a response was returned at 12124// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12125// to check whether the returned error was because 12126// http.StatusNotModified was returned. 12127func (c *UsersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 12128 gensupport.SetOptions(c.urlParams_, opts...) 12129 res, err := c.doRequest("json") 12130 if res != nil && res.StatusCode == http.StatusNotModified { 12131 if res.Body != nil { 12132 res.Body.Close() 12133 } 12134 return nil, &googleapi.Error{ 12135 Code: res.StatusCode, 12136 Header: res.Header, 12137 } 12138 } 12139 if err != nil { 12140 return nil, err 12141 } 12142 defer googleapi.CloseBody(res) 12143 if err := googleapi.CheckResponse(res); err != nil { 12144 return nil, err 12145 } 12146 ret := &Operation{ 12147 ServerResponse: googleapi.ServerResponse{ 12148 Header: res.Header, 12149 HTTPStatusCode: res.StatusCode, 12150 }, 12151 } 12152 target := &ret 12153 if err := gensupport.DecodeResponse(target, res); err != nil { 12154 return nil, err 12155 } 12156 return ret, nil 12157 // { 12158 // "description": "Updates an existing user in a Cloud SQL instance.", 12159 // "flatPath": "sql/v1beta4/projects/{project}/instances/{instance}/users", 12160 // "httpMethod": "PUT", 12161 // "id": "sql.users.update", 12162 // "parameterOrder": [ 12163 // "project", 12164 // "instance" 12165 // ], 12166 // "parameters": { 12167 // "host": { 12168 // "description": "Optional. Host of the user in the instance.", 12169 // "location": "query", 12170 // "type": "string" 12171 // }, 12172 // "instance": { 12173 // "description": "Database instance ID. This does not include the project ID.", 12174 // "location": "path", 12175 // "required": true, 12176 // "type": "string" 12177 // }, 12178 // "name": { 12179 // "description": "Name of the user in the instance.", 12180 // "location": "query", 12181 // "type": "string" 12182 // }, 12183 // "project": { 12184 // "description": "Project ID of the project that contains the instance.", 12185 // "location": "path", 12186 // "required": true, 12187 // "type": "string" 12188 // } 12189 // }, 12190 // "path": "sql/v1beta4/projects/{project}/instances/{instance}/users", 12191 // "request": { 12192 // "$ref": "User" 12193 // }, 12194 // "response": { 12195 // "$ref": "Operation" 12196 // }, 12197 // "scopes": [ 12198 // "https://www.googleapis.com/auth/cloud-platform", 12199 // "https://www.googleapis.com/auth/sqlservice.admin" 12200 // ] 12201 // } 12202 12203} 12204