1 // Copyright 2024 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 alloydb provides access to the AlloyDB API. 8 // 9 // For product documentation, see: https://cloud.google.com/alloydb/ 10 // 11 // # Library status 12 // 13 // These client libraries are officially supported by Google. However, this 14 // library is considered complete and is in maintenance mode. This means 15 // that we will address critical bugs and security issues but will not add 16 // any new features. 17 // 18 // When possible, we recommend using our newer 19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 20 // that are still actively being worked and iterated on. 21 // 22 // # Creating a client 23 // 24 // Usage example: 25 // 26 // import "google.golang.org/api/alloydb/v1" 27 // ... 28 // ctx := context.Background() 29 // alloydbService, err := alloydb.NewService(ctx) 30 // 31 // In this example, Google Application Default Credentials are used for 32 // authentication. For information on how to create and obtain Application 33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 34 // 35 // # Other authentication options 36 // 37 // To use an API key for authentication (note: some APIs do not support API 38 // keys), use [google.golang.org/api/option.WithAPIKey]: 39 // 40 // alloydbService, err := alloydb.NewService(ctx, option.WithAPIKey("AIza...")) 41 // 42 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 43 // flow, use [google.golang.org/api/option.WithTokenSource]: 44 // 45 // config := &oauth2.Config{...} 46 // // ... 47 // token, err := config.Exchange(ctx, ...) 48 // alloydbService, err := alloydb.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 49 // 50 // See [google.golang.org/api/option.ClientOption] for details on options. 51 package alloydb // import "google.golang.org/api/alloydb/v1" 52 53 import ( 54 "bytes" 55 "context" 56 "encoding/json" 57 "errors" 58 "fmt" 59 "io" 60 "net/http" 61 "net/url" 62 "strconv" 63 "strings" 64 65 googleapi "google.golang.org/api/googleapi" 66 internal "google.golang.org/api/internal" 67 gensupport "google.golang.org/api/internal/gensupport" 68 option "google.golang.org/api/option" 69 internaloption "google.golang.org/api/option/internaloption" 70 htransport "google.golang.org/api/transport/http" 71 ) 72 73 // Always reference these packages, just in case the auto-generated code 74 // below doesn't. 75 var _ = bytes.NewBuffer 76 var _ = strconv.Itoa 77 var _ = fmt.Sprintf 78 var _ = json.NewDecoder 79 var _ = io.Copy 80 var _ = url.Parse 81 var _ = gensupport.MarshalJSON 82 var _ = googleapi.Version 83 var _ = errors.New 84 var _ = strings.Replace 85 var _ = context.Canceled 86 var _ = internaloption.WithDefaultEndpoint 87 var _ = internal.Version 88 89 const apiId = "alloydb:v1" 90 const apiName = "alloydb" 91 const apiVersion = "v1" 92 const basePath = "https://alloydb.googleapis.com/" 93 const basePathTemplate = "https://alloydb.UNIVERSE_DOMAIN/" 94 const mtlsBasePath = "https://alloydb.mtls.googleapis.com/" 95 96 // OAuth2 scopes used by this API. 97 const ( 98 // See, edit, configure, and delete your Google Cloud data and see the email 99 // address for your Google Account. 100 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 101 ) 102 103 // NewService creates a new Service. 104 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 105 scopesOption := internaloption.WithDefaultScopes( 106 "https://www.googleapis.com/auth/cloud-platform", 107 ) 108 // NOTE: prepend, so we don't override user-specified scopes. 109 opts = append([]option.ClientOption{scopesOption}, opts...) 110 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 111 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 113 opts = append(opts, internaloption.EnableNewAuthLibrary()) 114 client, endpoint, err := htransport.NewClient(ctx, opts...) 115 if err != nil { 116 return nil, err 117 } 118 s, err := New(client) 119 if err != nil { 120 return nil, err 121 } 122 if endpoint != "" { 123 s.BasePath = endpoint 124 } 125 return s, nil 126 } 127 128 // New creates a new Service. It uses the provided http.Client for requests. 129 // 130 // Deprecated: please use NewService instead. 131 // To provide a custom HTTP client, use option.WithHTTPClient. 132 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 133 func New(client *http.Client) (*Service, error) { 134 if client == nil { 135 return nil, errors.New("client is nil") 136 } 137 s := &Service{client: client, BasePath: basePath} 138 s.Projects = NewProjectsService(s) 139 return s, nil 140 } 141 142 type Service struct { 143 client *http.Client 144 BasePath string // API endpoint base URL 145 UserAgent string // optional additional User-Agent fragment 146 147 Projects *ProjectsService 148 } 149 150 func (s *Service) userAgent() string { 151 if s.UserAgent == "" { 152 return googleapi.UserAgent 153 } 154 return googleapi.UserAgent + " " + s.UserAgent 155 } 156 157 func NewProjectsService(s *Service) *ProjectsService { 158 rs := &ProjectsService{s: s} 159 rs.Locations = NewProjectsLocationsService(s) 160 return rs 161 } 162 163 type ProjectsService struct { 164 s *Service 165 166 Locations *ProjectsLocationsService 167 } 168 169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 170 rs := &ProjectsLocationsService{s: s} 171 rs.Backups = NewProjectsLocationsBackupsService(s) 172 rs.Clusters = NewProjectsLocationsClustersService(s) 173 rs.Operations = NewProjectsLocationsOperationsService(s) 174 rs.SupportedDatabaseFlags = NewProjectsLocationsSupportedDatabaseFlagsService(s) 175 return rs 176 } 177 178 type ProjectsLocationsService struct { 179 s *Service 180 181 Backups *ProjectsLocationsBackupsService 182 183 Clusters *ProjectsLocationsClustersService 184 185 Operations *ProjectsLocationsOperationsService 186 187 SupportedDatabaseFlags *ProjectsLocationsSupportedDatabaseFlagsService 188 } 189 190 func NewProjectsLocationsBackupsService(s *Service) *ProjectsLocationsBackupsService { 191 rs := &ProjectsLocationsBackupsService{s: s} 192 return rs 193 } 194 195 type ProjectsLocationsBackupsService struct { 196 s *Service 197 } 198 199 func NewProjectsLocationsClustersService(s *Service) *ProjectsLocationsClustersService { 200 rs := &ProjectsLocationsClustersService{s: s} 201 rs.Instances = NewProjectsLocationsClustersInstancesService(s) 202 rs.Users = NewProjectsLocationsClustersUsersService(s) 203 return rs 204 } 205 206 type ProjectsLocationsClustersService struct { 207 s *Service 208 209 Instances *ProjectsLocationsClustersInstancesService 210 211 Users *ProjectsLocationsClustersUsersService 212 } 213 214 func NewProjectsLocationsClustersInstancesService(s *Service) *ProjectsLocationsClustersInstancesService { 215 rs := &ProjectsLocationsClustersInstancesService{s: s} 216 return rs 217 } 218 219 type ProjectsLocationsClustersInstancesService struct { 220 s *Service 221 } 222 223 func NewProjectsLocationsClustersUsersService(s *Service) *ProjectsLocationsClustersUsersService { 224 rs := &ProjectsLocationsClustersUsersService{s: s} 225 return rs 226 } 227 228 type ProjectsLocationsClustersUsersService struct { 229 s *Service 230 } 231 232 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 233 rs := &ProjectsLocationsOperationsService{s: s} 234 return rs 235 } 236 237 type ProjectsLocationsOperationsService struct { 238 s *Service 239 } 240 241 func NewProjectsLocationsSupportedDatabaseFlagsService(s *Service) *ProjectsLocationsSupportedDatabaseFlagsService { 242 rs := &ProjectsLocationsSupportedDatabaseFlagsService{s: s} 243 return rs 244 } 245 246 type ProjectsLocationsSupportedDatabaseFlagsService struct { 247 s *Service 248 } 249 250 // AuthorizedNetwork: AuthorizedNetwork contains metadata for an authorized 251 // network. 252 type AuthorizedNetwork struct { 253 // CidrRange: CIDR range for one authorzied network of the instance. 254 CidrRange string `json:"cidrRange,omitempty"` 255 // ForceSendFields is a list of field names (e.g. "CidrRange") to 256 // unconditionally include in API requests. By default, fields with empty or 257 // default values are omitted from API requests. See 258 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 259 // details. 260 ForceSendFields []string `json:"-"` 261 // NullFields is a list of field names (e.g. "CidrRange") to include in API 262 // requests with the JSON null value. By default, fields with empty values are 263 // omitted from API requests. See 264 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 265 NullFields []string `json:"-"` 266 } 267 268 func (s *AuthorizedNetwork) MarshalJSON() ([]byte, error) { 269 type NoMethod AuthorizedNetwork 270 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 271 } 272 273 // AutomatedBackupPolicy: Message describing the user-specified automated 274 // backup policy. All fields in the automated backup policy are optional. 275 // Defaults for each field are provided if they are not set. 276 type AutomatedBackupPolicy struct { 277 // BackupWindow: The length of the time window during which a backup can be 278 // taken. If a backup does not succeed within this time window, it will be 279 // canceled and considered failed. The backup window must be at least 5 minutes 280 // long. There is no upper bound on the window. If not set, it defaults to 1 281 // hour. 282 BackupWindow string `json:"backupWindow,omitempty"` 283 // Enabled: Whether automated automated backups are enabled. If not set, 284 // defaults to true. 285 Enabled bool `json:"enabled,omitempty"` 286 // EncryptionConfig: Optional. The encryption config can be specified to 287 // encrypt the backups with a customer-managed encryption key (CMEK). When this 288 // field is not specified, the backup will then use default encryption scheme 289 // to protect the user data. 290 EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"` 291 // Labels: Labels to apply to backups created using this configuration. 292 Labels map[string]string `json:"labels,omitempty"` 293 // Location: The location where the backup will be stored. Currently, the only 294 // supported option is to store the backup in the same region as the cluster. 295 // If empty, defaults to the region of the cluster. 296 Location string `json:"location,omitempty"` 297 // QuantityBasedRetention: Quantity-based Backup retention policy to retain 298 // recent backups. 299 QuantityBasedRetention *QuantityBasedRetention `json:"quantityBasedRetention,omitempty"` 300 // TimeBasedRetention: Time-based Backup retention policy. 301 TimeBasedRetention *TimeBasedRetention `json:"timeBasedRetention,omitempty"` 302 // WeeklySchedule: Weekly schedule for the Backup. 303 WeeklySchedule *WeeklySchedule `json:"weeklySchedule,omitempty"` 304 // ForceSendFields is a list of field names (e.g. "BackupWindow") to 305 // unconditionally include in API requests. By default, fields with empty or 306 // default values are omitted from API requests. See 307 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 308 // details. 309 ForceSendFields []string `json:"-"` 310 // NullFields is a list of field names (e.g. "BackupWindow") to include in API 311 // requests with the JSON null value. By default, fields with empty values are 312 // omitted from API requests. See 313 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 314 NullFields []string `json:"-"` 315 } 316 317 func (s *AutomatedBackupPolicy) MarshalJSON() ([]byte, error) { 318 type NoMethod AutomatedBackupPolicy 319 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 320 } 321 322 // Backup: Message describing Backup object 323 type Backup struct { 324 // Annotations: Annotations to allow client tools to store small amount of 325 // arbitrary data. This is distinct from labels. https://google.aip.dev/128 326 Annotations map[string]string `json:"annotations,omitempty"` 327 // ClusterName: Required. The full resource name of the backup source cluster 328 // (e.g., projects/{project}/locations/{region}/clusters/{cluster_id}). 329 ClusterName string `json:"clusterName,omitempty"` 330 // ClusterUid: Output only. The system-generated UID of the cluster which was 331 // used to create this resource. 332 ClusterUid string `json:"clusterUid,omitempty"` 333 // CreateTime: Output only. Create time stamp 334 CreateTime string `json:"createTime,omitempty"` 335 // DatabaseVersion: Output only. The database engine major version of the 336 // cluster this backup was created from. Any restored cluster created from this 337 // backup will have the same database version. 338 // 339 // Possible values: 340 // "DATABASE_VERSION_UNSPECIFIED" - This is an unknown database version. 341 // "POSTGRES_13" - DEPRECATED - The database version is Postgres 13. 342 // "POSTGRES_14" - The database version is Postgres 14. 343 // "POSTGRES_15" - The database version is Postgres 15. 344 DatabaseVersion string `json:"databaseVersion,omitempty"` 345 // DeleteTime: Output only. Delete time stamp 346 DeleteTime string `json:"deleteTime,omitempty"` 347 // Description: User-provided description of the backup. 348 Description string `json:"description,omitempty"` 349 // DisplayName: User-settable and human-readable display name for the Backup. 350 DisplayName string `json:"displayName,omitempty"` 351 // EncryptionConfig: Optional. The encryption config can be specified to 352 // encrypt the backup with a customer-managed encryption key (CMEK). When this 353 // field is not specified, the backup will then use default encryption scheme 354 // to protect the user data. 355 EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"` 356 // EncryptionInfo: Output only. The encryption information for the backup. 357 EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"` 358 // Etag: For Resource freshness validation (https://google.aip.dev/154) 359 Etag string `json:"etag,omitempty"` 360 // ExpiryQuantity: Output only. The QuantityBasedExpiry of the backup, 361 // specified by the backup's retention policy. Once the expiry quantity is over 362 // retention, the backup is eligible to be garbage collected. 363 ExpiryQuantity *QuantityBasedExpiry `json:"expiryQuantity,omitempty"` 364 // ExpiryTime: Output only. The time at which after the backup is eligible to 365 // be garbage collected. It is the duration specified by the backup's retention 366 // policy, added to the backup's create_time. 367 ExpiryTime string `json:"expiryTime,omitempty"` 368 // Labels: Labels as key value pairs 369 Labels map[string]string `json:"labels,omitempty"` 370 // Name: Output only. The name of the backup resource with the format: * 371 // projects/{project}/locations/{region}/backups/{backup_id} where the cluster 372 // and backup ID segments should satisfy the regex expression 373 // `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of lowercase 374 // letters, numbers, and dashes, starting with a letter, and ending with a 375 // letter or number. For more details see https://google.aip.dev/122. The 376 // prefix of the backup resource name is the name of the parent resource: * 377 // projects/{project}/locations/{region} 378 Name string `json:"name,omitempty"` 379 // Reconciling: Output only. Reconciling 380 // (https://google.aip.dev/128#reconciliation), if true, indicates that the 381 // service is actively updating the resource. This can happen due to 382 // user-triggered updates or system actions like failover or maintenance. 383 Reconciling bool `json:"reconciling,omitempty"` 384 // SatisfiesPzs: Output only. Reserved for future use. 385 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"` 386 // SizeBytes: Output only. The size of the backup in bytes. 387 SizeBytes int64 `json:"sizeBytes,omitempty,string"` 388 // State: Output only. The current state of the backup. 389 // 390 // Possible values: 391 // "STATE_UNSPECIFIED" - The state of the backup is unknown. 392 // "READY" - The backup is ready. 393 // "CREATING" - The backup is creating. 394 // "FAILED" - The backup failed. 395 // "DELETING" - The backup is being deleted. 396 State string `json:"state,omitempty"` 397 // Type: The backup type, which suggests the trigger for the backup. 398 // 399 // Possible values: 400 // "TYPE_UNSPECIFIED" - Backup Type is unknown. 401 // "ON_DEMAND" - ON_DEMAND backups that were triggered by the customer (e.g., 402 // not AUTOMATED). 403 // "AUTOMATED" - AUTOMATED backups triggered by the automated backups 404 // scheduler pursuant to an automated backup policy. 405 // "CONTINUOUS" - CONTINUOUS backups triggered by the automated backups 406 // scheduler due to a continuous backup policy. 407 Type string `json:"type,omitempty"` 408 // Uid: Output only. The system-generated UID of the resource. The UID is 409 // assigned when the resource is created, and it is retained until it is 410 // deleted. 411 Uid string `json:"uid,omitempty"` 412 // UpdateTime: Output only. Update time stamp 413 UpdateTime string `json:"updateTime,omitempty"` 414 415 // ServerResponse contains the HTTP response code and headers from the server. 416 googleapi.ServerResponse `json:"-"` 417 // ForceSendFields is a list of field names (e.g. "Annotations") to 418 // unconditionally include in API requests. By default, fields with empty or 419 // default values are omitted from API requests. See 420 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 421 // details. 422 ForceSendFields []string `json:"-"` 423 // NullFields is a list of field names (e.g. "Annotations") to include in API 424 // requests with the JSON null value. By default, fields with empty values are 425 // omitted from API requests. See 426 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 427 NullFields []string `json:"-"` 428 } 429 430 func (s *Backup) MarshalJSON() ([]byte, error) { 431 type NoMethod Backup 432 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 433 } 434 435 // BackupSource: Message describing a BackupSource. 436 type BackupSource struct { 437 // BackupName: Required. The name of the backup resource with the format: * 438 // projects/{project}/locations/{region}/backups/{backup_id} 439 BackupName string `json:"backupName,omitempty"` 440 // BackupUid: Output only. The system-generated UID of the backup which was 441 // used to create this resource. The UID is generated when the backup is 442 // created, and it is retained until the backup is deleted. 443 BackupUid string `json:"backupUid,omitempty"` 444 // ForceSendFields is a list of field names (e.g. "BackupName") to 445 // unconditionally include in API requests. By default, fields with empty or 446 // default values are omitted from API requests. See 447 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 448 // details. 449 ForceSendFields []string `json:"-"` 450 // NullFields is a list of field names (e.g. "BackupName") to include in API 451 // requests with the JSON null value. By default, fields with empty values are 452 // omitted from API requests. See 453 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 454 NullFields []string `json:"-"` 455 } 456 457 func (s *BackupSource) MarshalJSON() ([]byte, error) { 458 type NoMethod BackupSource 459 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 460 } 461 462 // CancelOperationRequest: The request message for Operations.CancelOperation. 463 type CancelOperationRequest struct { 464 } 465 466 // ClientConnectionConfig: Client connection configuration 467 type ClientConnectionConfig struct { 468 // RequireConnectors: Optional. Configuration to enforce connectors only (ex: 469 // AuthProxy) connections to the database. 470 RequireConnectors bool `json:"requireConnectors,omitempty"` 471 // SslConfig: Optional. SSL config option for this instance. 472 SslConfig *SslConfig `json:"sslConfig,omitempty"` 473 // ForceSendFields is a list of field names (e.g. "RequireConnectors") to 474 // unconditionally include in API requests. By default, fields with empty or 475 // default values are omitted from API requests. See 476 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 477 // details. 478 ForceSendFields []string `json:"-"` 479 // NullFields is a list of field names (e.g. "RequireConnectors") to include in 480 // API requests with the JSON null value. By default, fields with empty values 481 // are omitted from API requests. See 482 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 483 NullFields []string `json:"-"` 484 } 485 486 func (s *ClientConnectionConfig) MarshalJSON() ([]byte, error) { 487 type NoMethod ClientConnectionConfig 488 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 489 } 490 491 // CloudControl2SharedOperationsReconciliationOperationMetadata: Operation 492 // metadata returned by the CLH during resource state reconciliation. 493 type CloudControl2SharedOperationsReconciliationOperationMetadata struct { 494 // DeleteResource: DEPRECATED. Use exclusive_action instead. 495 DeleteResource bool `json:"deleteResource,omitempty"` 496 // ExclusiveAction: Excluisive action returned by the CLH. 497 // 498 // Possible values: 499 // "UNKNOWN_REPAIR_ACTION" - Unknown repair action. 500 // "DELETE" - The resource has to be deleted. When using this bit, the CLH 501 // should fail the operation. DEPRECATED. Instead use DELETE_RESOURCE 502 // OperationSignal in SideChannel. 503 // "RETRY" - This resource could not be repaired but the repair should be 504 // tried again at a later time. This can happen if there is a dependency that 505 // needs to be resolved first- e.g. if a parent resource must be repaired 506 // before a child resource. 507 ExclusiveAction string `json:"exclusiveAction,omitempty"` 508 // ForceSendFields is a list of field names (e.g. "DeleteResource") to 509 // unconditionally include in API requests. By default, fields with empty or 510 // default values are omitted from API requests. See 511 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 512 // details. 513 ForceSendFields []string `json:"-"` 514 // NullFields is a list of field names (e.g. "DeleteResource") to include in 515 // API requests with the JSON null value. By default, fields with empty values 516 // are omitted from API requests. See 517 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 518 NullFields []string `json:"-"` 519 } 520 521 func (s *CloudControl2SharedOperationsReconciliationOperationMetadata) MarshalJSON() ([]byte, error) { 522 type NoMethod CloudControl2SharedOperationsReconciliationOperationMetadata 523 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 524 } 525 526 // Cluster: A cluster is a collection of regional AlloyDB resources. It can 527 // include a primary instance and one or more read pool instances. All cluster 528 // resources share a storage layer, which scales as needed. 529 type Cluster struct { 530 // Annotations: Annotations to allow client tools to store small amount of 531 // arbitrary data. This is distinct from labels. https://google.aip.dev/128 532 Annotations map[string]string `json:"annotations,omitempty"` 533 // AutomatedBackupPolicy: The automated backup policy for this cluster. If no 534 // policy is provided then the default policy will be used. If backups are 535 // supported for the cluster, the default policy takes one backup a day, has a 536 // backup window of 1 hour, and retains backups for 14 days. For more 537 // information on the defaults, consult the documentation for the message type. 538 AutomatedBackupPolicy *AutomatedBackupPolicy `json:"automatedBackupPolicy,omitempty"` 539 // BackupSource: Output only. Cluster created from backup. 540 BackupSource *BackupSource `json:"backupSource,omitempty"` 541 // ClusterType: Output only. The type of the cluster. This is an output-only 542 // field and it's populated at the Cluster creation time or the Cluster 543 // promotion time. The cluster type is determined by which RPC was used to 544 // create the cluster (i.e. `CreateCluster` vs. `CreateSecondaryCluster` 545 // 546 // Possible values: 547 // "CLUSTER_TYPE_UNSPECIFIED" - The type of the cluster is unknown. 548 // "PRIMARY" - Primary cluster that support read and write operations. 549 // "SECONDARY" - Secondary cluster that is replicating from another region. 550 // This only supports read. 551 ClusterType string `json:"clusterType,omitempty"` 552 // ContinuousBackupConfig: Optional. Continuous backup configuration for this 553 // cluster. 554 ContinuousBackupConfig *ContinuousBackupConfig `json:"continuousBackupConfig,omitempty"` 555 // ContinuousBackupInfo: Output only. Continuous backup properties for this 556 // cluster. 557 ContinuousBackupInfo *ContinuousBackupInfo `json:"continuousBackupInfo,omitempty"` 558 // CreateTime: Output only. Create time stamp 559 CreateTime string `json:"createTime,omitempty"` 560 // DatabaseVersion: Optional. The database engine major version. This is an 561 // optional field and it is populated at the Cluster creation time. If a 562 // database version is not supplied at cluster creation time, then a default 563 // database version will be used. 564 // 565 // Possible values: 566 // "DATABASE_VERSION_UNSPECIFIED" - This is an unknown database version. 567 // "POSTGRES_13" - DEPRECATED - The database version is Postgres 13. 568 // "POSTGRES_14" - The database version is Postgres 14. 569 // "POSTGRES_15" - The database version is Postgres 15. 570 DatabaseVersion string `json:"databaseVersion,omitempty"` 571 // DeleteTime: Output only. Delete time stamp 572 DeleteTime string `json:"deleteTime,omitempty"` 573 // DisplayName: User-settable and human-readable display name for the Cluster. 574 DisplayName string `json:"displayName,omitempty"` 575 // EncryptionConfig: Optional. The encryption config can be specified to 576 // encrypt the data disks and other persistent data resources of a cluster with 577 // a customer-managed encryption key (CMEK). When this field is not specified, 578 // the cluster will then use default encryption scheme to protect the user 579 // data. 580 EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"` 581 // EncryptionInfo: Output only. The encryption information for the cluster. 582 EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"` 583 // Etag: For Resource freshness validation (https://google.aip.dev/154) 584 Etag string `json:"etag,omitempty"` 585 // InitialUser: Input only. Initial user to setup during cluster creation. 586 // Required. If used in `RestoreCluster` this is ignored. 587 InitialUser *UserPassword `json:"initialUser,omitempty"` 588 // Labels: Labels as key value pairs 589 Labels map[string]string `json:"labels,omitempty"` 590 // MaintenanceSchedule: Output only. The maintenance schedule for the cluster, 591 // generated for a specific rollout if a maintenance window is set. 592 MaintenanceSchedule *MaintenanceSchedule `json:"maintenanceSchedule,omitempty"` 593 // MaintenanceUpdatePolicy: Optional. The maintenance update policy determines 594 // when to allow or deny updates. 595 MaintenanceUpdatePolicy *MaintenanceUpdatePolicy `json:"maintenanceUpdatePolicy,omitempty"` 596 // MigrationSource: Output only. Cluster created via DMS migration. 597 MigrationSource *MigrationSource `json:"migrationSource,omitempty"` 598 // Name: Output only. The name of the cluster resource with the format: * 599 // projects/{project}/locations/{region}/clusters/{cluster_id} where the 600 // cluster ID segment should satisfy the regex expression `[a-z0-9-]+`. For 601 // more details see https://google.aip.dev/122. The prefix of the cluster 602 // resource name is the name of the parent resource: * 603 // projects/{project}/locations/{region} 604 Name string `json:"name,omitempty"` 605 // Network: Required. The resource link for the VPC network in which cluster 606 // resources are created and from which they are accessible via Private IP. The 607 // network must belong to the same project as the cluster. It is specified in 608 // the form: `projects/{project}/global/networks/{network_id}`. This is 609 // required to create a cluster. Deprecated, use network_config.network 610 // instead. 611 Network string `json:"network,omitempty"` 612 NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"` 613 // PrimaryConfig: Output only. Cross Region replication config specific to 614 // PRIMARY cluster. 615 PrimaryConfig *PrimaryConfig `json:"primaryConfig,omitempty"` 616 // PscConfig: Optional. The configuration for Private Service Connect (PSC) for 617 // the cluster. 618 PscConfig *PscConfig `json:"pscConfig,omitempty"` 619 // Reconciling: Output only. Reconciling 620 // (https://google.aip.dev/128#reconciliation). Set to true if the current 621 // state of Cluster does not match the user's intended state, and the service 622 // is actively updating the resource to reconcile them. This can happen due to 623 // user-triggered updates or system actions like failover or maintenance. 624 Reconciling bool `json:"reconciling,omitempty"` 625 // SatisfiesPzs: Output only. Reserved for future use. 626 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"` 627 // SecondaryConfig: Cross Region replication config specific to SECONDARY 628 // cluster. 629 SecondaryConfig *SecondaryConfig `json:"secondaryConfig,omitempty"` 630 // SslConfig: SSL configuration for this AlloyDB cluster. 631 SslConfig *SslConfig `json:"sslConfig,omitempty"` 632 // State: Output only. The current serving state of the cluster. 633 // 634 // Possible values: 635 // "STATE_UNSPECIFIED" - The state of the cluster is unknown. 636 // "READY" - The cluster is active and running. 637 // "STOPPED" - The cluster is stopped. All instances in the cluster are 638 // stopped. Customers can start a stopped cluster at any point and all their 639 // instances will come back to life with same names and IP resources. In this 640 // state, customer pays for storage. Associated backups could also be present 641 // in a stopped cluster. 642 // "EMPTY" - The cluster is empty and has no associated resources. All 643 // instances, associated storage and backups have been deleted. 644 // "CREATING" - The cluster is being created. 645 // "DELETING" - The cluster is being deleted. 646 // "FAILED" - The creation of the cluster failed. 647 // "BOOTSTRAPPING" - The cluster is bootstrapping with data from some other 648 // source. Direct mutations to the cluster (e.g. adding read pool) are not 649 // allowed. 650 // "MAINTENANCE" - The cluster is under maintenance. AlloyDB regularly 651 // performs maintenance and upgrades on customer clusters. Updates on the 652 // cluster are not allowed while the cluster is in this state. 653 // "PROMOTING" - The cluster is being promoted. 654 State string `json:"state,omitempty"` 655 // Uid: Output only. The system-generated UID of the resource. The UID is 656 // assigned when the resource is created, and it is retained until it is 657 // deleted. 658 Uid string `json:"uid,omitempty"` 659 // UpdateTime: Output only. Update time stamp 660 UpdateTime string `json:"updateTime,omitempty"` 661 662 // ServerResponse contains the HTTP response code and headers from the server. 663 googleapi.ServerResponse `json:"-"` 664 // ForceSendFields is a list of field names (e.g. "Annotations") to 665 // unconditionally include in API requests. By default, fields with empty or 666 // default values are omitted from API requests. See 667 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 668 // details. 669 ForceSendFields []string `json:"-"` 670 // NullFields is a list of field names (e.g. "Annotations") to include in API 671 // requests with the JSON null value. By default, fields with empty values are 672 // omitted from API requests. See 673 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 674 NullFields []string `json:"-"` 675 } 676 677 func (s *Cluster) MarshalJSON() ([]byte, error) { 678 type NoMethod Cluster 679 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 680 } 681 682 // ConnectionInfo: ConnectionInfo singleton resource. 683 // https://google.aip.dev/156 684 type ConnectionInfo struct { 685 // InstanceUid: Output only. The unique ID of the Instance. 686 InstanceUid string `json:"instanceUid,omitempty"` 687 // IpAddress: Output only. The private network IP address for the Instance. 688 // This is the default IP for the instance and is always created (even if 689 // enable_public_ip is set). This is the connection endpoint for an end-user 690 // application. 691 IpAddress string `json:"ipAddress,omitempty"` 692 // Name: The name of the ConnectionInfo singleton resource, e.g.: 693 // projects/{project}/locations/{location}/clusters/*/instances/*/connectionInfo 694 // This field currently has no semantic meaning. 695 Name string `json:"name,omitempty"` 696 // PublicIpAddress: Output only. The public IP addresses for the Instance. This 697 // is available ONLY when enable_public_ip is set. This is the connection 698 // endpoint for an end-user application. 699 PublicIpAddress string `json:"publicIpAddress,omitempty"` 700 701 // ServerResponse contains the HTTP response code and headers from the server. 702 googleapi.ServerResponse `json:"-"` 703 // ForceSendFields is a list of field names (e.g. "InstanceUid") to 704 // unconditionally include in API requests. By default, fields with empty or 705 // default values are omitted from API requests. See 706 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 707 // details. 708 ForceSendFields []string `json:"-"` 709 // NullFields is a list of field names (e.g. "InstanceUid") to include in API 710 // requests with the JSON null value. By default, fields with empty values are 711 // omitted from API requests. See 712 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 713 NullFields []string `json:"-"` 714 } 715 716 func (s *ConnectionInfo) MarshalJSON() ([]byte, error) { 717 type NoMethod ConnectionInfo 718 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 719 } 720 721 // ContinuousBackupConfig: ContinuousBackupConfig describes the continuous 722 // backups recovery configurations of a cluster. 723 type ContinuousBackupConfig struct { 724 // Enabled: Whether ContinuousBackup is enabled. 725 Enabled bool `json:"enabled,omitempty"` 726 // EncryptionConfig: The encryption config can be specified to encrypt the 727 // backups with a customer-managed encryption key (CMEK). When this field is 728 // not specified, the backup will then use default encryption scheme to protect 729 // the user data. 730 EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"` 731 // RecoveryWindowDays: The number of days that are eligible to restore from 732 // using PITR. To support the entire recovery window, backups and logs are 733 // retained for one day more than the recovery window. If not set, defaults to 734 // 14 days. 735 RecoveryWindowDays int64 `json:"recoveryWindowDays,omitempty"` 736 // ForceSendFields is a list of field names (e.g. "Enabled") to unconditionally 737 // include in API requests. By default, fields with empty or default values are 738 // omitted from API requests. See 739 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 740 // details. 741 ForceSendFields []string `json:"-"` 742 // NullFields is a list of field names (e.g. "Enabled") to include in API 743 // requests with the JSON null value. By default, fields with empty values are 744 // omitted from API requests. See 745 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 746 NullFields []string `json:"-"` 747 } 748 749 func (s *ContinuousBackupConfig) MarshalJSON() ([]byte, error) { 750 type NoMethod ContinuousBackupConfig 751 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 752 } 753 754 // ContinuousBackupInfo: ContinuousBackupInfo describes the continuous backup 755 // properties of a cluster. 756 type ContinuousBackupInfo struct { 757 // EarliestRestorableTime: Output only. The earliest restorable time that can 758 // be restored to. Output only field. 759 EarliestRestorableTime string `json:"earliestRestorableTime,omitempty"` 760 // EnabledTime: Output only. When ContinuousBackup was most recently enabled. 761 // Set to null if ContinuousBackup is not enabled. 762 EnabledTime string `json:"enabledTime,omitempty"` 763 // EncryptionInfo: Output only. The encryption information for the WALs and 764 // backups required for ContinuousBackup. 765 EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"` 766 // Schedule: Output only. Days of the week on which a continuous backup is 767 // taken. Output only field. Ignored if passed into the request. 768 // 769 // Possible values: 770 // "DAY_OF_WEEK_UNSPECIFIED" - The day of the week is unspecified. 771 // "MONDAY" - Monday 772 // "TUESDAY" - Tuesday 773 // "WEDNESDAY" - Wednesday 774 // "THURSDAY" - Thursday 775 // "FRIDAY" - Friday 776 // "SATURDAY" - Saturday 777 // "SUNDAY" - Sunday 778 Schedule []string `json:"schedule,omitempty"` 779 // ForceSendFields is a list of field names (e.g. "EarliestRestorableTime") to 780 // unconditionally include in API requests. By default, fields with empty or 781 // default values are omitted from API requests. See 782 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 783 // details. 784 ForceSendFields []string `json:"-"` 785 // NullFields is a list of field names (e.g. "EarliestRestorableTime") to 786 // include in API requests with the JSON null value. By default, fields with 787 // empty values are omitted from API requests. See 788 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 789 NullFields []string `json:"-"` 790 } 791 792 func (s *ContinuousBackupInfo) MarshalJSON() ([]byte, error) { 793 type NoMethod ContinuousBackupInfo 794 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 795 } 796 797 // ContinuousBackupSource: Message describing a ContinuousBackupSource. 798 type ContinuousBackupSource struct { 799 // Cluster: Required. The source cluster from which to restore. This cluster 800 // must have continuous backup enabled for this operation to succeed. For the 801 // required format, see the comment on the Cluster.name field. 802 Cluster string `json:"cluster,omitempty"` 803 // PointInTime: Required. The point in time to restore to. 804 PointInTime string `json:"pointInTime,omitempty"` 805 // ForceSendFields is a list of field names (e.g. "Cluster") to unconditionally 806 // include in API requests. By default, fields with empty or default values are 807 // omitted from API requests. See 808 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 809 // details. 810 ForceSendFields []string `json:"-"` 811 // NullFields is a list of field names (e.g. "Cluster") to include in API 812 // requests with the JSON null value. By default, fields with empty values are 813 // omitted from API requests. See 814 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 815 NullFields []string `json:"-"` 816 } 817 818 func (s *ContinuousBackupSource) MarshalJSON() ([]byte, error) { 819 type NoMethod ContinuousBackupSource 820 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 821 } 822 823 // Empty: A generic empty message that you can re-use to avoid defining 824 // duplicated empty messages in your APIs. A typical example is to use it as 825 // the request or the response type of an API method. For instance: service Foo 826 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } 827 type Empty struct { 828 // ServerResponse contains the HTTP response code and headers from the server. 829 googleapi.ServerResponse `json:"-"` 830 } 831 832 // EncryptionConfig: EncryptionConfig describes the encryption config of a 833 // cluster or a backup that is encrypted with a CMEK (customer-managed 834 // encryption key). 835 type EncryptionConfig struct { 836 // KmsKeyName: The fully-qualified resource name of the KMS key. Each Cloud KMS 837 // key is regionalized and has the following format: 838 // projects/[PROJECT]/locations/[REGION]/keyRings/[RING]/cryptoKeys/[KEY_NAME] 839 KmsKeyName string `json:"kmsKeyName,omitempty"` 840 // ForceSendFields is a list of field names (e.g. "KmsKeyName") to 841 // unconditionally include in API requests. By default, fields with empty or 842 // default values are omitted from API requests. See 843 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 844 // details. 845 ForceSendFields []string `json:"-"` 846 // NullFields is a list of field names (e.g. "KmsKeyName") to include in API 847 // requests with the JSON null value. By default, fields with empty values are 848 // omitted from API requests. See 849 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 850 NullFields []string `json:"-"` 851 } 852 853 func (s *EncryptionConfig) MarshalJSON() ([]byte, error) { 854 type NoMethod EncryptionConfig 855 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 856 } 857 858 // EncryptionInfo: EncryptionInfo describes the encryption information of a 859 // cluster or a backup. 860 type EncryptionInfo struct { 861 // EncryptionType: Output only. Type of encryption. 862 // 863 // Possible values: 864 // "TYPE_UNSPECIFIED" - Encryption type not specified. Defaults to 865 // GOOGLE_DEFAULT_ENCRYPTION. 866 // "GOOGLE_DEFAULT_ENCRYPTION" - The data is encrypted at rest with a key 867 // that is fully managed by Google. No key version will be populated. This is 868 // the default state. 869 // "CUSTOMER_MANAGED_ENCRYPTION" - The data is encrypted at rest with a key 870 // that is managed by the customer. KMS key versions will be populated. 871 EncryptionType string `json:"encryptionType,omitempty"` 872 // KmsKeyVersions: Output only. Cloud KMS key versions that are being used to 873 // protect the database or the backup. 874 KmsKeyVersions []string `json:"kmsKeyVersions,omitempty"` 875 // ForceSendFields is a list of field names (e.g. "EncryptionType") to 876 // unconditionally include in API requests. By default, fields with empty or 877 // default values are omitted from API requests. See 878 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 879 // details. 880 ForceSendFields []string `json:"-"` 881 // NullFields is a list of field names (e.g. "EncryptionType") to include in 882 // API requests with the JSON null value. By default, fields with empty values 883 // are omitted from API requests. See 884 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 885 NullFields []string `json:"-"` 886 } 887 888 func (s *EncryptionInfo) MarshalJSON() ([]byte, error) { 889 type NoMethod EncryptionInfo 890 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 891 } 892 893 // FailoverInstanceRequest: Message for triggering failover on an Instance 894 type FailoverInstanceRequest struct { 895 // RequestId: Optional. An optional request ID to identify requests. Specify a 896 // unique request ID so that if you must retry your request, the server will 897 // know to ignore the request if it has already been completed. The server will 898 // guarantee that for at least 60 minutes after the first request. For example, 899 // consider a situation where you make an initial request and the request times 900 // out. If you make the request again with the same request ID, the server can 901 // check if original operation with the same request ID was received, and if 902 // so, will ignore the second request. This prevents clients from accidentally 903 // creating duplicate commitments. The request ID must be a valid UUID with the 904 // exception that zero UUID is not supported 905 // (00000000-0000-0000-0000-000000000000). 906 RequestId string `json:"requestId,omitempty"` 907 // ValidateOnly: Optional. If set, performs request validation (e.g. permission 908 // checks and any other type of validation), but do not actually execute the 909 // failover. 910 ValidateOnly bool `json:"validateOnly,omitempty"` 911 // ForceSendFields is a list of field names (e.g. "RequestId") to 912 // unconditionally include in API requests. By default, fields with empty or 913 // default values are omitted from API requests. See 914 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 915 // details. 916 ForceSendFields []string `json:"-"` 917 // NullFields is a list of field names (e.g. "RequestId") to include in API 918 // requests with the JSON null value. By default, fields with empty values are 919 // omitted from API requests. See 920 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 921 NullFields []string `json:"-"` 922 } 923 924 func (s *FailoverInstanceRequest) MarshalJSON() ([]byte, error) { 925 type NoMethod FailoverInstanceRequest 926 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 927 } 928 929 // GoogleCloudLocationListLocationsResponse: The response message for 930 // Locations.ListLocations. 931 type GoogleCloudLocationListLocationsResponse struct { 932 // Locations: A list of locations that matches the specified filter in the 933 // request. 934 Locations []*GoogleCloudLocationLocation `json:"locations,omitempty"` 935 // NextPageToken: The standard List next-page token. 936 NextPageToken string `json:"nextPageToken,omitempty"` 937 938 // ServerResponse contains the HTTP response code and headers from the server. 939 googleapi.ServerResponse `json:"-"` 940 // ForceSendFields is a list of field names (e.g. "Locations") to 941 // unconditionally include in API requests. By default, fields with empty or 942 // default values are omitted from API requests. See 943 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 944 // details. 945 ForceSendFields []string `json:"-"` 946 // NullFields is a list of field names (e.g. "Locations") to include in API 947 // requests with the JSON null value. By default, fields with empty values are 948 // omitted from API requests. See 949 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 950 NullFields []string `json:"-"` 951 } 952 953 func (s *GoogleCloudLocationListLocationsResponse) MarshalJSON() ([]byte, error) { 954 type NoMethod GoogleCloudLocationListLocationsResponse 955 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 956 } 957 958 // GoogleCloudLocationLocation: A resource that represents a Google Cloud 959 // location. 960 type GoogleCloudLocationLocation struct { 961 // DisplayName: The friendly name for this location, typically a nearby city 962 // name. For example, "Tokyo". 963 DisplayName string `json:"displayName,omitempty"` 964 // Labels: Cross-service attributes for the location. For example 965 // {"cloud.googleapis.com/region": "us-east1"} 966 Labels map[string]string `json:"labels,omitempty"` 967 // LocationId: The canonical id for this location. For example: "us-east1". 968 LocationId string `json:"locationId,omitempty"` 969 // Metadata: Service-specific metadata. For example the available capacity at 970 // the given location. 971 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 972 // Name: Resource name for the location, which may vary between 973 // implementations. For example: 974 // "projects/example-project/locations/us-east1" 975 Name string `json:"name,omitempty"` 976 977 // ServerResponse contains the HTTP response code and headers from the server. 978 googleapi.ServerResponse `json:"-"` 979 // ForceSendFields is a list of field names (e.g. "DisplayName") to 980 // unconditionally include in API requests. By default, fields with empty or 981 // default values are omitted from API requests. See 982 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 983 // details. 984 ForceSendFields []string `json:"-"` 985 // NullFields is a list of field names (e.g. "DisplayName") to include in API 986 // requests with the JSON null value. By default, fields with empty values are 987 // omitted from API requests. See 988 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 989 NullFields []string `json:"-"` 990 } 991 992 func (s *GoogleCloudLocationLocation) MarshalJSON() ([]byte, error) { 993 type NoMethod GoogleCloudLocationLocation 994 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 995 } 996 997 // GoogleTypeTimeOfDay: Represents a time of day. The date and time zone are 998 // either not significant or are specified elsewhere. An API may choose to 999 // allow leap seconds. Related types are google.type.Date and 1000 // `google.protobuf.Timestamp`. 1001 type GoogleTypeTimeOfDay struct { 1002 // Hours: Hours of day in 24 hour format. Should be from 0 to 23. An API may 1003 // choose to allow the value "24:00:00" for scenarios like business closing 1004 // time. 1005 Hours int64 `json:"hours,omitempty"` 1006 // Minutes: Minutes of hour of day. Must be from 0 to 59. 1007 Minutes int64 `json:"minutes,omitempty"` 1008 // Nanos: Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. 1009 Nanos int64 `json:"nanos,omitempty"` 1010 // Seconds: Seconds of minutes of the time. Must normally be from 0 to 59. An 1011 // API may allow the value 60 if it allows leap-seconds. 1012 Seconds int64 `json:"seconds,omitempty"` 1013 // ForceSendFields is a list of field names (e.g. "Hours") to unconditionally 1014 // include in API requests. By default, fields with empty or default values are 1015 // omitted from API requests. See 1016 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1017 // details. 1018 ForceSendFields []string `json:"-"` 1019 // NullFields is a list of field names (e.g. "Hours") to include in API 1020 // requests with the JSON null value. By default, fields with empty values are 1021 // omitted from API requests. See 1022 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1023 NullFields []string `json:"-"` 1024 } 1025 1026 func (s *GoogleTypeTimeOfDay) MarshalJSON() ([]byte, error) { 1027 type NoMethod GoogleTypeTimeOfDay 1028 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1029 } 1030 1031 // InjectFaultRequest: Message for triggering fault injection on an instance 1032 type InjectFaultRequest struct { 1033 // FaultType: Required. The type of fault to be injected in an instance. 1034 // 1035 // Possible values: 1036 // "FAULT_TYPE_UNSPECIFIED" - The fault type is unknown. 1037 // "STOP_VM" - Stop the VM 1038 FaultType string `json:"faultType,omitempty"` 1039 // RequestId: Optional. An optional request ID to identify requests. Specify a 1040 // unique request ID so that if you must retry your request, the server will 1041 // know to ignore the request if it has already been completed. The server will 1042 // guarantee that for at least 60 minutes after the first request. For example, 1043 // consider a situation where you make an initial request and the request times 1044 // out. If you make the request again with the same request ID, the server can 1045 // check if original operation with the same request ID was received, and if 1046 // so, will ignore the second request. This prevents clients from accidentally 1047 // creating duplicate commitments. The request ID must be a valid UUID with the 1048 // exception that zero UUID is not supported 1049 // (00000000-0000-0000-0000-000000000000). 1050 RequestId string `json:"requestId,omitempty"` 1051 // ValidateOnly: Optional. If set, performs request validation (e.g. permission 1052 // checks and any other type of validation), but do not actually execute the 1053 // fault injection. 1054 ValidateOnly bool `json:"validateOnly,omitempty"` 1055 // ForceSendFields is a list of field names (e.g. "FaultType") to 1056 // unconditionally include in API requests. By default, fields with empty or 1057 // default values are omitted from API requests. See 1058 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1059 // details. 1060 ForceSendFields []string `json:"-"` 1061 // NullFields is a list of field names (e.g. "FaultType") to include in API 1062 // requests with the JSON null value. By default, fields with empty values are 1063 // omitted from API requests. See 1064 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1065 NullFields []string `json:"-"` 1066 } 1067 1068 func (s *InjectFaultRequest) MarshalJSON() ([]byte, error) { 1069 type NoMethod InjectFaultRequest 1070 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1071 } 1072 1073 // Instance: An Instance is a computing unit that an end customer can connect 1074 // to. It's the main unit of computing resources in AlloyDB. 1075 type Instance struct { 1076 // Annotations: Annotations to allow client tools to store small amount of 1077 // arbitrary data. This is distinct from labels. https://google.aip.dev/128 1078 Annotations map[string]string `json:"annotations,omitempty"` 1079 // AvailabilityType: Availability type of an Instance. If empty, defaults to 1080 // REGIONAL for primary instances. For read pools, availability_type is always 1081 // UNSPECIFIED. Instances in the read pools are evenly distributed across 1082 // available zones within the region (i.e. read pools with more than one node 1083 // will have a node in at least two zones). 1084 // 1085 // Possible values: 1086 // "AVAILABILITY_TYPE_UNSPECIFIED" - This is an unknown Availability type. 1087 // "ZONAL" - Zonal available instance. 1088 // "REGIONAL" - Regional (or Highly) available instance. 1089 AvailabilityType string `json:"availabilityType,omitempty"` 1090 // ClientConnectionConfig: Optional. Client connection specific configurations 1091 ClientConnectionConfig *ClientConnectionConfig `json:"clientConnectionConfig,omitempty"` 1092 // CreateTime: Output only. Create time stamp 1093 CreateTime string `json:"createTime,omitempty"` 1094 // DatabaseFlags: Database flags. Set at instance level. * They are copied from 1095 // primary instance on read instance creation. * Read instances can set new or 1096 // override existing flags that are relevant for reads, e.g. for enabling 1097 // columnar cache on a read instance. Flags set on read instance may or may not 1098 // be present on primary. This is a list of "key": "value" pairs. "key": The 1099 // name of the flag. These flags are passed at instance setup time, so include 1100 // both server options and system variables for Postgres. Flags are specified 1101 // with underscores, not hyphens. "value": The value of the flag. Booleans are 1102 // set to **on** for true and **off** for false. This field must be omitted if 1103 // the flag doesn't take a value. 1104 DatabaseFlags map[string]string `json:"databaseFlags,omitempty"` 1105 // DeleteTime: Output only. Delete time stamp 1106 DeleteTime string `json:"deleteTime,omitempty"` 1107 // DisplayName: User-settable and human-readable display name for the Instance. 1108 DisplayName string `json:"displayName,omitempty"` 1109 // Etag: For Resource freshness validation (https://google.aip.dev/154) 1110 Etag string `json:"etag,omitempty"` 1111 // GceZone: The Compute Engine zone that the instance should serve from, per 1112 // https://cloud.google.com/compute/docs/regions-zones This can ONLY be 1113 // specified for ZONAL instances. If present for a REGIONAL instance, an error 1114 // will be thrown. If this is absent for a ZONAL instance, instance is created 1115 // in a random zone with available capacity. 1116 GceZone string `json:"gceZone,omitempty"` 1117 // InstanceType: Required. The type of the instance. Specified at creation 1118 // time. 1119 // 1120 // Possible values: 1121 // "INSTANCE_TYPE_UNSPECIFIED" - The type of the instance is unknown. 1122 // "PRIMARY" - PRIMARY instances support read and write operations. 1123 // "READ_POOL" - READ POOL instances support read operations only. Each read 1124 // pool instance consists of one or more homogeneous nodes. * Read pool of size 1125 // 1 can only have zonal availability. * Read pools with node count of 2 or 1126 // more can have regional availability (nodes are present in 2 or more zones in 1127 // a region). 1128 // "SECONDARY" - SECONDARY instances support read operations only. SECONDARY 1129 // instance is a cross-region read replica 1130 InstanceType string `json:"instanceType,omitempty"` 1131 // IpAddress: Output only. The IP address for the Instance. This is the 1132 // connection endpoint for an end-user application. 1133 IpAddress string `json:"ipAddress,omitempty"` 1134 // Labels: Labels as key value pairs 1135 Labels map[string]string `json:"labels,omitempty"` 1136 // MachineConfig: Configurations for the machines that host the underlying 1137 // database engine. 1138 MachineConfig *MachineConfig `json:"machineConfig,omitempty"` 1139 // Name: Output only. The name of the instance resource with the format: * 1140 // projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instan 1141 // ce_id} where the cluster and instance ID segments should satisfy the regex 1142 // expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of 1143 // lowercase letters, numbers, and dashes, starting with a letter, and ending 1144 // with a letter or number. For more details see https://google.aip.dev/122. 1145 // The prefix of the instance resource name is the name of the parent resource: 1146 // * projects/{project}/locations/{region}/clusters/{cluster_id} 1147 Name string `json:"name,omitempty"` 1148 // NetworkConfig: Optional. Instance level network configuration. 1149 NetworkConfig *InstanceNetworkConfig `json:"networkConfig,omitempty"` 1150 // Nodes: Output only. List of available read-only VMs in this instance, 1151 // including the standby for a PRIMARY instance. 1152 Nodes []*Node `json:"nodes,omitempty"` 1153 // PscInstanceConfig: Optional. The configuration for Private Service Connect 1154 // (PSC) for the instance. 1155 PscInstanceConfig *PscInstanceConfig `json:"pscInstanceConfig,omitempty"` 1156 // PublicIpAddress: Output only. The public IP addresses for the Instance. This 1157 // is available ONLY when enable_public_ip is set. This is the connection 1158 // endpoint for an end-user application. 1159 PublicIpAddress string `json:"publicIpAddress,omitempty"` 1160 // QueryInsightsConfig: Configuration for query insights. 1161 QueryInsightsConfig *QueryInsightsInstanceConfig `json:"queryInsightsConfig,omitempty"` 1162 // ReadPoolConfig: Read pool instance configuration. This is required if the 1163 // value of instanceType is READ_POOL. 1164 ReadPoolConfig *ReadPoolConfig `json:"readPoolConfig,omitempty"` 1165 // Reconciling: Output only. Reconciling 1166 // (https://google.aip.dev/128#reconciliation). Set to true if the current 1167 // state of Instance does not match the user's intended state, and the service 1168 // is actively updating the resource to reconcile them. This can happen due to 1169 // user-triggered updates or system actions like failover or maintenance. 1170 Reconciling bool `json:"reconciling,omitempty"` 1171 // SatisfiesPzs: Output only. Reserved for future use. 1172 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"` 1173 // State: Output only. The current serving state of the instance. 1174 // 1175 // Possible values: 1176 // "STATE_UNSPECIFIED" - The state of the instance is unknown. 1177 // "READY" - The instance is active and running. 1178 // "STOPPED" - The instance is stopped. Instance name and IP resources are 1179 // preserved. 1180 // "CREATING" - The instance is being created. 1181 // "DELETING" - The instance is being deleted. 1182 // "MAINTENANCE" - The instance is down for maintenance. 1183 // "FAILED" - The creation of the instance failed or a fatal error occurred 1184 // during an operation on the instance. Note: Instances in this state would 1185 // tried to be auto-repaired. And Customers should be able to restart, update 1186 // or delete these instances. 1187 // "BOOTSTRAPPING" - Index 7 is used in the producer apis for ROLLED_BACK 1188 // state. Keeping that index unused in case that state also needs to exposed 1189 // via consumer apis in future. The instance has been configured to sync data 1190 // from some other source. 1191 // "PROMOTING" - The instance is being promoted. 1192 State string `json:"state,omitempty"` 1193 // Uid: Output only. The system-generated UID of the resource. The UID is 1194 // assigned when the resource is created, and it is retained until it is 1195 // deleted. 1196 Uid string `json:"uid,omitempty"` 1197 // UpdateTime: Output only. Update time stamp 1198 UpdateTime string `json:"updateTime,omitempty"` 1199 // WritableNode: Output only. This is set for the read-write VM of the PRIMARY 1200 // instance only. 1201 WritableNode *Node `json:"writableNode,omitempty"` 1202 1203 // ServerResponse contains the HTTP response code and headers from the server. 1204 googleapi.ServerResponse `json:"-"` 1205 // ForceSendFields is a list of field names (e.g. "Annotations") to 1206 // unconditionally include in API requests. By default, fields with empty or 1207 // default values are omitted from API requests. See 1208 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1209 // details. 1210 ForceSendFields []string `json:"-"` 1211 // NullFields is a list of field names (e.g. "Annotations") to include in API 1212 // requests with the JSON null value. By default, fields with empty values are 1213 // omitted from API requests. See 1214 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1215 NullFields []string `json:"-"` 1216 } 1217 1218 func (s *Instance) MarshalJSON() ([]byte, error) { 1219 type NoMethod Instance 1220 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1221 } 1222 1223 // InstanceNetworkConfig: Metadata related to instance level network 1224 // configuration. 1225 type InstanceNetworkConfig struct { 1226 // AuthorizedExternalNetworks: Optional. A list of external network authorized 1227 // to access this instance. 1228 AuthorizedExternalNetworks []*AuthorizedNetwork `json:"authorizedExternalNetworks,omitempty"` 1229 // EnablePublicIp: Optional. Enabling public ip for the instance. 1230 EnablePublicIp bool `json:"enablePublicIp,omitempty"` 1231 // ForceSendFields is a list of field names (e.g. "AuthorizedExternalNetworks") 1232 // to unconditionally include in API requests. By default, fields with empty or 1233 // default values are omitted from API requests. See 1234 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1235 // details. 1236 ForceSendFields []string `json:"-"` 1237 // NullFields is a list of field names (e.g. "AuthorizedExternalNetworks") to 1238 // include in API requests with the JSON null value. By default, fields with 1239 // empty values are omitted from API requests. See 1240 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1241 NullFields []string `json:"-"` 1242 } 1243 1244 func (s *InstanceNetworkConfig) MarshalJSON() ([]byte, error) { 1245 type NoMethod InstanceNetworkConfig 1246 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1247 } 1248 1249 // IntegerRestrictions: Restrictions on INTEGER type values. 1250 type IntegerRestrictions struct { 1251 // MaxValue: The maximum value that can be specified, if applicable. 1252 MaxValue int64 `json:"maxValue,omitempty,string"` 1253 // MinValue: The minimum value that can be specified, if applicable. 1254 MinValue int64 `json:"minValue,omitempty,string"` 1255 // ForceSendFields is a list of field names (e.g. "MaxValue") to 1256 // unconditionally include in API requests. By default, fields with empty or 1257 // default values are omitted from API requests. See 1258 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1259 // details. 1260 ForceSendFields []string `json:"-"` 1261 // NullFields is a list of field names (e.g. "MaxValue") to include in API 1262 // requests with the JSON null value. By default, fields with empty values are 1263 // omitted from API requests. See 1264 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1265 NullFields []string `json:"-"` 1266 } 1267 1268 func (s *IntegerRestrictions) MarshalJSON() ([]byte, error) { 1269 type NoMethod IntegerRestrictions 1270 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1271 } 1272 1273 // ListBackupsResponse: Message for response to listing Backups 1274 type ListBackupsResponse struct { 1275 // Backups: The list of Backup 1276 Backups []*Backup `json:"backups,omitempty"` 1277 // NextPageToken: A token identifying a page of results the server should 1278 // return. 1279 NextPageToken string `json:"nextPageToken,omitempty"` 1280 // Unreachable: Locations that could not be reached. 1281 Unreachable []string `json:"unreachable,omitempty"` 1282 1283 // ServerResponse contains the HTTP response code and headers from the server. 1284 googleapi.ServerResponse `json:"-"` 1285 // ForceSendFields is a list of field names (e.g. "Backups") to unconditionally 1286 // include in API requests. By default, fields with empty or default values are 1287 // omitted from API requests. See 1288 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1289 // details. 1290 ForceSendFields []string `json:"-"` 1291 // NullFields is a list of field names (e.g. "Backups") to include in API 1292 // requests with the JSON null value. By default, fields with empty values are 1293 // omitted from API requests. See 1294 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1295 NullFields []string `json:"-"` 1296 } 1297 1298 func (s *ListBackupsResponse) MarshalJSON() ([]byte, error) { 1299 type NoMethod ListBackupsResponse 1300 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1301 } 1302 1303 // ListClustersResponse: Message for response to listing Clusters 1304 type ListClustersResponse struct { 1305 // Clusters: The list of Cluster 1306 Clusters []*Cluster `json:"clusters,omitempty"` 1307 // NextPageToken: A token identifying a page of results the server should 1308 // return. 1309 NextPageToken string `json:"nextPageToken,omitempty"` 1310 // Unreachable: Locations that could not be reached. 1311 Unreachable []string `json:"unreachable,omitempty"` 1312 1313 // ServerResponse contains the HTTP response code and headers from the server. 1314 googleapi.ServerResponse `json:"-"` 1315 // ForceSendFields is a list of field names (e.g. "Clusters") to 1316 // unconditionally include in API requests. By default, fields with empty or 1317 // default values are omitted from API requests. See 1318 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1319 // details. 1320 ForceSendFields []string `json:"-"` 1321 // NullFields is a list of field names (e.g. "Clusters") to include in API 1322 // requests with the JSON null value. By default, fields with empty values are 1323 // omitted from API requests. See 1324 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1325 NullFields []string `json:"-"` 1326 } 1327 1328 func (s *ListClustersResponse) MarshalJSON() ([]byte, error) { 1329 type NoMethod ListClustersResponse 1330 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1331 } 1332 1333 // ListInstancesResponse: Message for response to listing Instances 1334 type ListInstancesResponse struct { 1335 // Instances: The list of Instance 1336 Instances []*Instance `json:"instances,omitempty"` 1337 // NextPageToken: A token identifying a page of results the server should 1338 // return. 1339 NextPageToken string `json:"nextPageToken,omitempty"` 1340 // Unreachable: Locations that could not be reached. 1341 Unreachable []string `json:"unreachable,omitempty"` 1342 1343 // ServerResponse contains the HTTP response code and headers from the server. 1344 googleapi.ServerResponse `json:"-"` 1345 // ForceSendFields is a list of field names (e.g. "Instances") to 1346 // unconditionally include in API requests. By default, fields with empty or 1347 // default values are omitted from API requests. See 1348 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1349 // details. 1350 ForceSendFields []string `json:"-"` 1351 // NullFields is a list of field names (e.g. "Instances") to include in API 1352 // requests with the JSON null value. By default, fields with empty values are 1353 // omitted from API requests. See 1354 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1355 NullFields []string `json:"-"` 1356 } 1357 1358 func (s *ListInstancesResponse) MarshalJSON() ([]byte, error) { 1359 type NoMethod ListInstancesResponse 1360 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1361 } 1362 1363 // ListOperationsResponse: The response message for Operations.ListOperations. 1364 type ListOperationsResponse struct { 1365 // NextPageToken: The standard List next-page token. 1366 NextPageToken string `json:"nextPageToken,omitempty"` 1367 // Operations: A list of operations that matches the specified filter in the 1368 // request. 1369 Operations []*Operation `json:"operations,omitempty"` 1370 1371 // ServerResponse contains the HTTP response code and headers from the server. 1372 googleapi.ServerResponse `json:"-"` 1373 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1374 // unconditionally include in API requests. By default, fields with empty or 1375 // default values are omitted from API requests. See 1376 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1377 // details. 1378 ForceSendFields []string `json:"-"` 1379 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 1380 // requests with the JSON null value. By default, fields with empty values are 1381 // omitted from API requests. See 1382 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1383 NullFields []string `json:"-"` 1384 } 1385 1386 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 1387 type NoMethod ListOperationsResponse 1388 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1389 } 1390 1391 // ListSupportedDatabaseFlagsResponse: Message for response to listing 1392 // SupportedDatabaseFlags. 1393 type ListSupportedDatabaseFlagsResponse struct { 1394 // NextPageToken: A token identifying a page of results the server should 1395 // return. 1396 NextPageToken string `json:"nextPageToken,omitempty"` 1397 // SupportedDatabaseFlags: The list of SupportedDatabaseFlags. 1398 SupportedDatabaseFlags []*SupportedDatabaseFlag `json:"supportedDatabaseFlags,omitempty"` 1399 1400 // ServerResponse contains the HTTP response code and headers from the server. 1401 googleapi.ServerResponse `json:"-"` 1402 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1403 // unconditionally include in API requests. By default, fields with empty or 1404 // default values are omitted from API requests. See 1405 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1406 // details. 1407 ForceSendFields []string `json:"-"` 1408 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 1409 // requests with the JSON null value. By default, fields with empty values are 1410 // omitted from API requests. See 1411 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1412 NullFields []string `json:"-"` 1413 } 1414 1415 func (s *ListSupportedDatabaseFlagsResponse) MarshalJSON() ([]byte, error) { 1416 type NoMethod ListSupportedDatabaseFlagsResponse 1417 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1418 } 1419 1420 // ListUsersResponse: Message for response to listing Users 1421 type ListUsersResponse struct { 1422 // NextPageToken: A token identifying a page of results the server should 1423 // return. 1424 NextPageToken string `json:"nextPageToken,omitempty"` 1425 // Unreachable: Locations that could not be reached. 1426 Unreachable []string `json:"unreachable,omitempty"` 1427 // Users: The list of User 1428 Users []*User `json:"users,omitempty"` 1429 1430 // ServerResponse contains the HTTP response code and headers from the server. 1431 googleapi.ServerResponse `json:"-"` 1432 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1433 // unconditionally include in API requests. By default, fields with empty or 1434 // default values are omitted from API requests. See 1435 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1436 // details. 1437 ForceSendFields []string `json:"-"` 1438 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 1439 // requests with the JSON null value. By default, fields with empty values are 1440 // omitted from API requests. See 1441 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1442 NullFields []string `json:"-"` 1443 } 1444 1445 func (s *ListUsersResponse) MarshalJSON() ([]byte, error) { 1446 type NoMethod ListUsersResponse 1447 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1448 } 1449 1450 // MachineConfig: MachineConfig describes the configuration of a machine. 1451 type MachineConfig struct { 1452 // CpuCount: The number of CPU's in the VM instance. 1453 CpuCount int64 `json:"cpuCount,omitempty"` 1454 // ForceSendFields is a list of field names (e.g. "CpuCount") to 1455 // unconditionally include in API requests. By default, fields with empty or 1456 // default values are omitted from API requests. See 1457 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1458 // details. 1459 ForceSendFields []string `json:"-"` 1460 // NullFields is a list of field names (e.g. "CpuCount") to include in API 1461 // requests with the JSON null value. By default, fields with empty values are 1462 // omitted from API requests. See 1463 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1464 NullFields []string `json:"-"` 1465 } 1466 1467 func (s *MachineConfig) MarshalJSON() ([]byte, error) { 1468 type NoMethod MachineConfig 1469 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1470 } 1471 1472 // MaintenanceSchedule: MaintenanceSchedule stores the maintenance schedule 1473 // generated from the MaintenanceUpdatePolicy, once a maintenance rollout is 1474 // triggered, if MaintenanceWindow is set, and if there is no conflicting 1475 // DenyPeriod. The schedule is cleared once the update takes place. This field 1476 // cannot be manually changed; modify the MaintenanceUpdatePolicy instead. 1477 type MaintenanceSchedule struct { 1478 // StartTime: Output only. The scheduled start time for the maintenance. 1479 StartTime string `json:"startTime,omitempty"` 1480 // ForceSendFields is a list of field names (e.g. "StartTime") to 1481 // unconditionally include in API requests. By default, fields with empty or 1482 // default values are omitted from API requests. See 1483 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1484 // details. 1485 ForceSendFields []string `json:"-"` 1486 // NullFields is a list of field names (e.g. "StartTime") to include in API 1487 // requests with the JSON null value. By default, fields with empty values are 1488 // omitted from API requests. See 1489 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1490 NullFields []string `json:"-"` 1491 } 1492 1493 func (s *MaintenanceSchedule) MarshalJSON() ([]byte, error) { 1494 type NoMethod MaintenanceSchedule 1495 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1496 } 1497 1498 // MaintenanceUpdatePolicy: MaintenanceUpdatePolicy defines the policy for 1499 // system updates. 1500 type MaintenanceUpdatePolicy struct { 1501 // MaintenanceWindows: Preferred windows to perform maintenance. Currently 1502 // limited to 1. 1503 MaintenanceWindows []*MaintenanceWindow `json:"maintenanceWindows,omitempty"` 1504 // ForceSendFields is a list of field names (e.g. "MaintenanceWindows") to 1505 // unconditionally include in API requests. By default, fields with empty or 1506 // default values are omitted from API requests. See 1507 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1508 // details. 1509 ForceSendFields []string `json:"-"` 1510 // NullFields is a list of field names (e.g. "MaintenanceWindows") to include 1511 // in API requests with the JSON null value. By default, fields with empty 1512 // values are omitted from API requests. See 1513 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1514 NullFields []string `json:"-"` 1515 } 1516 1517 func (s *MaintenanceUpdatePolicy) MarshalJSON() ([]byte, error) { 1518 type NoMethod MaintenanceUpdatePolicy 1519 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1520 } 1521 1522 // MaintenanceWindow: MaintenanceWindow specifies a preferred day and time for 1523 // maintenance. 1524 type MaintenanceWindow struct { 1525 // Day: Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY, etc. 1526 // 1527 // Possible values: 1528 // "DAY_OF_WEEK_UNSPECIFIED" - The day of the week is unspecified. 1529 // "MONDAY" - Monday 1530 // "TUESDAY" - Tuesday 1531 // "WEDNESDAY" - Wednesday 1532 // "THURSDAY" - Thursday 1533 // "FRIDAY" - Friday 1534 // "SATURDAY" - Saturday 1535 // "SUNDAY" - Sunday 1536 Day string `json:"day,omitempty"` 1537 // StartTime: Preferred time to start the maintenance operation on the 1538 // specified day. Maintenance will start within 1 hour of this time. 1539 StartTime *GoogleTypeTimeOfDay `json:"startTime,omitempty"` 1540 // ForceSendFields is a list of field names (e.g. "Day") to unconditionally 1541 // include in API requests. By default, fields with empty or default values are 1542 // omitted from API requests. See 1543 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1544 // details. 1545 ForceSendFields []string `json:"-"` 1546 // NullFields is a list of field names (e.g. "Day") to include in API requests 1547 // with the JSON null value. By default, fields with empty values are omitted 1548 // from API requests. See 1549 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1550 NullFields []string `json:"-"` 1551 } 1552 1553 func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) { 1554 type NoMethod MaintenanceWindow 1555 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1556 } 1557 1558 // MigrationSource: Subset of the source instance configuration that is 1559 // available when reading the cluster resource. 1560 type MigrationSource struct { 1561 // HostPort: Output only. The host and port of the on-premises instance in 1562 // host:port format 1563 HostPort string `json:"hostPort,omitempty"` 1564 // ReferenceId: Output only. Place holder for the external source 1565 // identifier(e.g DMS job name) that created the cluster. 1566 ReferenceId string `json:"referenceId,omitempty"` 1567 // SourceType: Output only. Type of migration source. 1568 // 1569 // Possible values: 1570 // "MIGRATION_SOURCE_TYPE_UNSPECIFIED" - Migration source is unknown. 1571 // "DMS" - DMS source means the cluster was created via DMS migration job. 1572 SourceType string `json:"sourceType,omitempty"` 1573 // ForceSendFields is a list of field names (e.g. "HostPort") to 1574 // unconditionally include in API requests. By default, fields with empty or 1575 // default values are omitted from API requests. See 1576 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1577 // details. 1578 ForceSendFields []string `json:"-"` 1579 // NullFields is a list of field names (e.g. "HostPort") to include in API 1580 // requests with the JSON null value. By default, fields with empty values are 1581 // omitted from API requests. See 1582 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1583 NullFields []string `json:"-"` 1584 } 1585 1586 func (s *MigrationSource) MarshalJSON() ([]byte, error) { 1587 type NoMethod MigrationSource 1588 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1589 } 1590 1591 // NetworkConfig: Metadata related to network configuration. 1592 type NetworkConfig struct { 1593 // AllocatedIpRange: Optional. Name of the allocated IP range for the private 1594 // IP AlloyDB cluster, for example: "google-managed-services-default". If set, 1595 // the instance IPs for this cluster will be created in the allocated range. 1596 // The range name must comply with RFC 1035. Specifically, the name must be 1597 // 1-63 characters long and match the regular expression 1598 // `[a-z]([-a-z0-9]*[a-z0-9])?`. Field name is intended to be consistent with 1599 // Cloud SQL. 1600 AllocatedIpRange string `json:"allocatedIpRange,omitempty"` 1601 // Network: Optional. The resource link for the VPC network in which cluster 1602 // resources are created and from which they are accessible via Private IP. The 1603 // network must belong to the same project as the cluster. It is specified in 1604 // the form: `projects/{project_number}/global/networks/{network_id}`. This is 1605 // required to create a cluster. 1606 Network string `json:"network,omitempty"` 1607 // ForceSendFields is a list of field names (e.g. "AllocatedIpRange") to 1608 // unconditionally include in API requests. By default, fields with empty or 1609 // default values are omitted from API requests. See 1610 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1611 // details. 1612 ForceSendFields []string `json:"-"` 1613 // NullFields is a list of field names (e.g. "AllocatedIpRange") to include in 1614 // API requests with the JSON null value. By default, fields with empty values 1615 // are omitted from API requests. See 1616 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1617 NullFields []string `json:"-"` 1618 } 1619 1620 func (s *NetworkConfig) MarshalJSON() ([]byte, error) { 1621 type NoMethod NetworkConfig 1622 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1623 } 1624 1625 // Node: Details of a single node in the instance. Nodes in an AlloyDB instance 1626 // are ephemereal, they can change during update, failover, autohealing and 1627 // resize operations. 1628 type Node struct { 1629 // Id: The identifier of the VM e.g. "test-read-0601-407e52be-ms3l". 1630 Id string `json:"id,omitempty"` 1631 // Ip: The private IP address of the VM e.g. "10.57.0.34". 1632 Ip string `json:"ip,omitempty"` 1633 // State: Determined by state of the compute VM and postgres-service health. 1634 // Compute VM state can have values listed in 1635 // https://cloud.google.com/compute/docs/instances/instance-life-cycle and 1636 // postgres-service health can have values: HEALTHY and UNHEALTHY. 1637 State string `json:"state,omitempty"` 1638 // ZoneId: The Compute Engine zone of the VM e.g. "us-central1-b". 1639 ZoneId string `json:"zoneId,omitempty"` 1640 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally 1641 // include in API requests. By default, fields with empty or default values are 1642 // omitted from API requests. See 1643 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1644 // details. 1645 ForceSendFields []string `json:"-"` 1646 // NullFields is a list of field names (e.g. "Id") to include in API requests 1647 // with the JSON null value. By default, fields with empty values are omitted 1648 // from API requests. See 1649 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1650 NullFields []string `json:"-"` 1651 } 1652 1653 func (s *Node) MarshalJSON() ([]byte, error) { 1654 type NoMethod Node 1655 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1656 } 1657 1658 // Operation: This resource represents a long-running operation that is the 1659 // result of a network API call. 1660 type Operation struct { 1661 // Done: If the value is `false`, it means the operation is still in progress. 1662 // If `true`, the operation is completed, and either `error` or `response` is 1663 // available. 1664 Done bool `json:"done,omitempty"` 1665 // Error: The error result of the operation in case of failure or cancellation. 1666 Error *Status `json:"error,omitempty"` 1667 // Metadata: Service-specific metadata associated with the operation. It 1668 // typically contains progress information and common metadata such as create 1669 // time. Some services might not provide such metadata. Any method that returns 1670 // a long-running operation should document the metadata type, if any. 1671 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1672 // Name: The server-assigned name, which is only unique within the same service 1673 // that originally returns it. If you use the default HTTP mapping, the `name` 1674 // should be a resource name ending with `operations/{unique_id}`. 1675 Name string `json:"name,omitempty"` 1676 // Response: The normal, successful response of the operation. If the original 1677 // method returns no data on success, such as `Delete`, the response is 1678 // `google.protobuf.Empty`. If the original method is standard 1679 // `Get`/`Create`/`Update`, the response should be the resource. For other 1680 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 1681 // original method name. For example, if the original method name is 1682 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 1683 Response googleapi.RawMessage `json:"response,omitempty"` 1684 1685 // ServerResponse contains the HTTP response code and headers from the server. 1686 googleapi.ServerResponse `json:"-"` 1687 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 1688 // include in API requests. By default, fields with empty or default values are 1689 // omitted from API requests. See 1690 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1691 // details. 1692 ForceSendFields []string `json:"-"` 1693 // NullFields is a list of field names (e.g. "Done") to include in API requests 1694 // with the JSON null value. By default, fields with empty values are omitted 1695 // from API requests. See 1696 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1697 NullFields []string `json:"-"` 1698 } 1699 1700 func (s *Operation) MarshalJSON() ([]byte, error) { 1701 type NoMethod Operation 1702 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1703 } 1704 1705 // OperationMetadata: Represents the metadata of the long-running operation. 1706 type OperationMetadata struct { 1707 // ApiVersion: Output only. API version used to start the operation. 1708 ApiVersion string `json:"apiVersion,omitempty"` 1709 // CreateTime: Output only. The time the operation was created. 1710 CreateTime string `json:"createTime,omitempty"` 1711 // EndTime: Output only. The time the operation finished running. 1712 EndTime string `json:"endTime,omitempty"` 1713 // RequestedCancellation: Output only. Identifies whether the user has 1714 // requested cancellation of the operation. Operations that have successfully 1715 // been cancelled have Operation.error value with a google.rpc.Status.code of 1716 // 1, corresponding to `Code.CANCELLED`. 1717 RequestedCancellation bool `json:"requestedCancellation,omitempty"` 1718 // StatusMessage: Output only. Human-readable status of the operation, if any. 1719 StatusMessage string `json:"statusMessage,omitempty"` 1720 // Target: Output only. Server-defined resource path for the target of the 1721 // operation. 1722 Target string `json:"target,omitempty"` 1723 // Verb: Output only. Name of the verb executed by the operation. 1724 Verb string `json:"verb,omitempty"` 1725 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1726 // unconditionally include in API requests. By default, fields with empty or 1727 // default values are omitted from API requests. See 1728 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1729 // details. 1730 ForceSendFields []string `json:"-"` 1731 // NullFields is a list of field names (e.g. "ApiVersion") to include in API 1732 // requests with the JSON null value. By default, fields with empty values are 1733 // omitted from API requests. See 1734 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1735 NullFields []string `json:"-"` 1736 } 1737 1738 func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 1739 type NoMethod OperationMetadata 1740 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1741 } 1742 1743 // PrimaryConfig: Configuration for the primary cluster. It has the list of 1744 // clusters that are replicating from this cluster. This should be set if and 1745 // only if the cluster is of type PRIMARY. 1746 type PrimaryConfig struct { 1747 // SecondaryClusterNames: Output only. Names of the clusters that are 1748 // replicating from this cluster. 1749 SecondaryClusterNames []string `json:"secondaryClusterNames,omitempty"` 1750 // ForceSendFields is a list of field names (e.g. "SecondaryClusterNames") to 1751 // unconditionally include in API requests. By default, fields with empty or 1752 // default values are omitted from API requests. See 1753 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1754 // details. 1755 ForceSendFields []string `json:"-"` 1756 // NullFields is a list of field names (e.g. "SecondaryClusterNames") to 1757 // include in API requests with the JSON null value. By default, fields with 1758 // empty values are omitted from API requests. See 1759 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1760 NullFields []string `json:"-"` 1761 } 1762 1763 func (s *PrimaryConfig) MarshalJSON() ([]byte, error) { 1764 type NoMethod PrimaryConfig 1765 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1766 } 1767 1768 // PromoteClusterRequest: Message for promoting a Cluster 1769 type PromoteClusterRequest struct { 1770 // Etag: Optional. The current etag of the Cluster. If an etag is provided and 1771 // does not match the current etag of the Cluster, deletion will be blocked and 1772 // an ABORTED error will be returned. 1773 Etag string `json:"etag,omitempty"` 1774 // RequestId: Optional. An optional request ID to identify requests. Specify a 1775 // unique request ID so that if you must retry your request, the server will 1776 // know to ignore the request if it has already been completed. The server will 1777 // guarantee that for at least 60 minutes after the first request. For example, 1778 // consider a situation where you make an initial request and the request times 1779 // out. If you make the request again with the same request ID, the server can 1780 // check if original operation with the same request ID was received, and if 1781 // so, will ignore the second request. This prevents clients from accidentally 1782 // creating duplicate commitments. The request ID must be a valid UUID with the 1783 // exception that zero UUID is not supported 1784 // (00000000-0000-0000-0000-000000000000). 1785 RequestId string `json:"requestId,omitempty"` 1786 // ValidateOnly: Optional. If set, performs request validation (e.g. permission 1787 // checks and any other type of validation), but do not actually execute the 1788 // delete. 1789 ValidateOnly bool `json:"validateOnly,omitempty"` 1790 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally 1791 // include in API requests. By default, fields with empty or default values are 1792 // omitted from API requests. See 1793 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1794 // details. 1795 ForceSendFields []string `json:"-"` 1796 // NullFields is a list of field names (e.g. "Etag") to include in API requests 1797 // with the JSON null value. By default, fields with empty values are omitted 1798 // from API requests. See 1799 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1800 NullFields []string `json:"-"` 1801 } 1802 1803 func (s *PromoteClusterRequest) MarshalJSON() ([]byte, error) { 1804 type NoMethod PromoteClusterRequest 1805 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1806 } 1807 1808 // PscConfig: PscConfig contains PSC related configuration at a cluster level. 1809 type PscConfig struct { 1810 // PscEnabled: Optional. Create an instance that allows connections from 1811 // Private Service Connect endpoints to the instance. 1812 PscEnabled bool `json:"pscEnabled,omitempty"` 1813 // ForceSendFields is a list of field names (e.g. "PscEnabled") to 1814 // unconditionally include in API requests. By default, fields with empty or 1815 // default values are omitted from API requests. See 1816 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1817 // details. 1818 ForceSendFields []string `json:"-"` 1819 // NullFields is a list of field names (e.g. "PscEnabled") to include in API 1820 // requests with the JSON null value. By default, fields with empty values are 1821 // omitted from API requests. See 1822 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1823 NullFields []string `json:"-"` 1824 } 1825 1826 func (s *PscConfig) MarshalJSON() ([]byte, error) { 1827 type NoMethod PscConfig 1828 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1829 } 1830 1831 // PscInstanceConfig: PscInstanceConfig contains PSC related configuration at 1832 // an instance level. 1833 type PscInstanceConfig struct { 1834 // AllowedConsumerProjects: Optional. List of consumer projects that are 1835 // allowed to create PSC endpoints to service-attachments to this instance. 1836 AllowedConsumerProjects []string `json:"allowedConsumerProjects,omitempty"` 1837 // PscDnsName: Output only. The DNS name of the instance for PSC connectivity. 1838 // Name convention: ...alloydb-psc.goog 1839 PscDnsName string `json:"pscDnsName,omitempty"` 1840 // ServiceAttachmentLink: Output only. The service attachment created when 1841 // Private Service Connect (PSC) is enabled for the instance. The name of the 1842 // resource will be in the format of `projects//regions//serviceAttachments/` 1843 ServiceAttachmentLink string `json:"serviceAttachmentLink,omitempty"` 1844 // ForceSendFields is a list of field names (e.g. "AllowedConsumerProjects") to 1845 // unconditionally include in API requests. By default, fields with empty or 1846 // default values are omitted from API requests. See 1847 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1848 // details. 1849 ForceSendFields []string `json:"-"` 1850 // NullFields is a list of field names (e.g. "AllowedConsumerProjects") to 1851 // include in API requests with the JSON null value. By default, fields with 1852 // empty values are omitted from API requests. See 1853 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1854 NullFields []string `json:"-"` 1855 } 1856 1857 func (s *PscInstanceConfig) MarshalJSON() ([]byte, error) { 1858 type NoMethod PscInstanceConfig 1859 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1860 } 1861 1862 // QuantityBasedExpiry: A backup's position in a quantity-based retention 1863 // queue, of backups with the same source cluster and type, with length, 1864 // retention, specified by the backup's retention policy. Once the position is 1865 // greater than the retention, the backup is eligible to be garbage collected. 1866 // Example: 5 backups from the same source cluster and type with a 1867 // quantity-based retention of 3 and denoted by backup_id (position, 1868 // retention). Safe: backup_5 (1, 3), backup_4, (2, 3), backup_3 (3, 3). 1869 // Awaiting garbage collection: backup_2 (4, 3), backup_1 (5, 3) 1870 type QuantityBasedExpiry struct { 1871 // RetentionCount: Output only. The backup's position among its backups with 1872 // the same source cluster and type, by descending chronological order create 1873 // time(i.e. newest first). 1874 RetentionCount int64 `json:"retentionCount,omitempty"` 1875 // TotalRetentionCount: Output only. The length of the quantity-based queue, 1876 // specified by the backup's retention policy. 1877 TotalRetentionCount int64 `json:"totalRetentionCount,omitempty"` 1878 // ForceSendFields is a list of field names (e.g. "RetentionCount") to 1879 // unconditionally include in API requests. By default, fields with empty or 1880 // default values are omitted from API requests. See 1881 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1882 // details. 1883 ForceSendFields []string `json:"-"` 1884 // NullFields is a list of field names (e.g. "RetentionCount") to include in 1885 // API requests with the JSON null value. By default, fields with empty values 1886 // are omitted from API requests. See 1887 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1888 NullFields []string `json:"-"` 1889 } 1890 1891 func (s *QuantityBasedExpiry) MarshalJSON() ([]byte, error) { 1892 type NoMethod QuantityBasedExpiry 1893 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1894 } 1895 1896 // QuantityBasedRetention: A quantity based policy specifies that a certain 1897 // number of the most recent successful backups should be retained. 1898 type QuantityBasedRetention struct { 1899 // Count: The number of backups to retain. 1900 Count int64 `json:"count,omitempty"` 1901 // ForceSendFields is a list of field names (e.g. "Count") to unconditionally 1902 // include in API requests. By default, fields with empty or default values are 1903 // omitted from API requests. See 1904 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1905 // details. 1906 ForceSendFields []string `json:"-"` 1907 // NullFields is a list of field names (e.g. "Count") to include in API 1908 // requests with the JSON null value. By default, fields with empty values are 1909 // omitted from API requests. See 1910 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1911 NullFields []string `json:"-"` 1912 } 1913 1914 func (s *QuantityBasedRetention) MarshalJSON() ([]byte, error) { 1915 type NoMethod QuantityBasedRetention 1916 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1917 } 1918 1919 // QueryInsightsInstanceConfig: QueryInsights Instance specific configuration. 1920 type QueryInsightsInstanceConfig struct { 1921 // QueryPlansPerMinute: Number of query execution plans captured by Insights 1922 // per minute for all queries combined. The default value is 5. Any integer 1923 // between 0 and 20 is considered valid. 1924 QueryPlansPerMinute int64 `json:"queryPlansPerMinute,omitempty"` 1925 // QueryStringLength: Query string length. The default value is 1024. Any 1926 // integer between 256 and 4500 is considered valid. 1927 QueryStringLength int64 `json:"queryStringLength,omitempty"` 1928 // RecordApplicationTags: Record application tags for an instance. This flag is 1929 // turned "on" by default. 1930 RecordApplicationTags bool `json:"recordApplicationTags,omitempty"` 1931 // RecordClientAddress: Record client address for an instance. Client address 1932 // is PII information. This flag is turned "on" by default. 1933 RecordClientAddress bool `json:"recordClientAddress,omitempty"` 1934 // ForceSendFields is a list of field names (e.g. "QueryPlansPerMinute") to 1935 // unconditionally include in API requests. By default, fields with empty or 1936 // default values are omitted from API requests. See 1937 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1938 // details. 1939 ForceSendFields []string `json:"-"` 1940 // NullFields is a list of field names (e.g. "QueryPlansPerMinute") to include 1941 // in API requests with the JSON null value. By default, fields with empty 1942 // values are omitted from API requests. See 1943 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1944 NullFields []string `json:"-"` 1945 } 1946 1947 func (s *QueryInsightsInstanceConfig) MarshalJSON() ([]byte, error) { 1948 type NoMethod QueryInsightsInstanceConfig 1949 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1950 } 1951 1952 // ReadPoolConfig: Configuration for a read pool instance. 1953 type ReadPoolConfig struct { 1954 // NodeCount: Read capacity, i.e. number of nodes in a read pool instance. 1955 NodeCount int64 `json:"nodeCount,omitempty"` 1956 // ForceSendFields is a list of field names (e.g. "NodeCount") to 1957 // unconditionally include in API requests. By default, fields with empty or 1958 // default values are omitted from API requests. See 1959 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1960 // details. 1961 ForceSendFields []string `json:"-"` 1962 // NullFields is a list of field names (e.g. "NodeCount") to include in API 1963 // requests with the JSON null value. By default, fields with empty values are 1964 // omitted from API requests. See 1965 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1966 NullFields []string `json:"-"` 1967 } 1968 1969 func (s *ReadPoolConfig) MarshalJSON() ([]byte, error) { 1970 type NoMethod ReadPoolConfig 1971 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1972 } 1973 1974 type RestartInstanceRequest struct { 1975 // RequestId: Optional. An optional request ID to identify requests. Specify a 1976 // unique request ID so that if you must retry your request, the server will 1977 // know to ignore the request if it has already been completed. The server will 1978 // guarantee that for at least 60 minutes after the first request. For example, 1979 // consider a situation where you make an initial request and the request times 1980 // out. If you make the request again with the same request ID, the server can 1981 // check if original operation with the same request ID was received, and if 1982 // so, will ignore the second request. This prevents clients from accidentally 1983 // creating duplicate commitments. The request ID must be a valid UUID with the 1984 // exception that zero UUID is not supported 1985 // (00000000-0000-0000-0000-000000000000). 1986 RequestId string `json:"requestId,omitempty"` 1987 // ValidateOnly: Optional. If set, performs request validation (e.g. permission 1988 // checks and any other type of validation), but do not actually execute the 1989 // restart. 1990 ValidateOnly bool `json:"validateOnly,omitempty"` 1991 // ForceSendFields is a list of field names (e.g. "RequestId") to 1992 // unconditionally include in API requests. By default, fields with empty or 1993 // default values are omitted from API requests. See 1994 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1995 // details. 1996 ForceSendFields []string `json:"-"` 1997 // NullFields is a list of field names (e.g. "RequestId") to include in API 1998 // requests with the JSON null value. By default, fields with empty values are 1999 // omitted from API requests. See 2000 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2001 NullFields []string `json:"-"` 2002 } 2003 2004 func (s *RestartInstanceRequest) MarshalJSON() ([]byte, error) { 2005 type NoMethod RestartInstanceRequest 2006 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2007 } 2008 2009 // RestoreClusterRequest: Message for restoring a Cluster from a backup or 2010 // another cluster at a given point in time. 2011 type RestoreClusterRequest struct { 2012 // BackupSource: Backup source. 2013 BackupSource *BackupSource `json:"backupSource,omitempty"` 2014 // Cluster: Required. The resource being created 2015 Cluster *Cluster `json:"cluster,omitempty"` 2016 // ClusterId: Required. ID of the requesting object. 2017 ClusterId string `json:"clusterId,omitempty"` 2018 // ContinuousBackupSource: ContinuousBackup source. Continuous backup needs to 2019 // be enabled in the source cluster for this operation to succeed. 2020 ContinuousBackupSource *ContinuousBackupSource `json:"continuousBackupSource,omitempty"` 2021 // RequestId: Optional. An optional request ID to identify requests. Specify a 2022 // unique request ID so that if you must retry your request, the server will 2023 // know to ignore the request if it has already been completed. The server will 2024 // guarantee that for at least 60 minutes since the first request. For example, 2025 // consider a situation where you make an initial request and the request times 2026 // out. If you make the request again with the same request ID, the server can 2027 // check if original operation with the same request ID was received, and if 2028 // so, will ignore the second request. This prevents clients from accidentally 2029 // creating duplicate commitments. The request ID must be a valid UUID with the 2030 // exception that zero UUID is not supported 2031 // (00000000-0000-0000-0000-000000000000). 2032 RequestId string `json:"requestId,omitempty"` 2033 // ValidateOnly: Optional. If set, performs request validation (e.g. permission 2034 // checks and any other type of validation), but do not actually execute the 2035 // import request. 2036 ValidateOnly bool `json:"validateOnly,omitempty"` 2037 // ForceSendFields is a list of field names (e.g. "BackupSource") to 2038 // unconditionally include in API requests. By default, fields with empty or 2039 // default values are omitted from API requests. See 2040 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2041 // details. 2042 ForceSendFields []string `json:"-"` 2043 // NullFields is a list of field names (e.g. "BackupSource") to include in API 2044 // requests with the JSON null value. By default, fields with empty values are 2045 // omitted from API requests. See 2046 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2047 NullFields []string `json:"-"` 2048 } 2049 2050 func (s *RestoreClusterRequest) MarshalJSON() ([]byte, error) { 2051 type NoMethod RestoreClusterRequest 2052 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2053 } 2054 2055 // SecondaryConfig: Configuration information for the secondary cluster. This 2056 // should be set if and only if the cluster is of type SECONDARY. 2057 type SecondaryConfig struct { 2058 // PrimaryClusterName: The name of the primary cluster name with the format: * 2059 // projects/{project}/locations/{region}/clusters/{cluster_id} 2060 PrimaryClusterName string `json:"primaryClusterName,omitempty"` 2061 // ForceSendFields is a list of field names (e.g. "PrimaryClusterName") to 2062 // unconditionally include in API requests. By default, fields with empty or 2063 // default values are omitted from API requests. See 2064 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2065 // details. 2066 ForceSendFields []string `json:"-"` 2067 // NullFields is a list of field names (e.g. "PrimaryClusterName") to include 2068 // in API requests with the JSON null value. By default, fields with empty 2069 // values are omitted from API requests. See 2070 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2071 NullFields []string `json:"-"` 2072 } 2073 2074 func (s *SecondaryConfig) MarshalJSON() ([]byte, error) { 2075 type NoMethod SecondaryConfig 2076 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2077 } 2078 2079 // SslConfig: SSL configuration. 2080 type SslConfig struct { 2081 // CaSource: Optional. Certificate Authority (CA) source. Only 2082 // CA_SOURCE_MANAGED is supported currently, and is the default value. 2083 // 2084 // Possible values: 2085 // "CA_SOURCE_UNSPECIFIED" - Certificate Authority (CA) source not specified. 2086 // Defaults to CA_SOURCE_MANAGED. 2087 // "CA_SOURCE_MANAGED" - Certificate Authority (CA) managed by the AlloyDB 2088 // Cluster. 2089 CaSource string `json:"caSource,omitempty"` 2090 // SslMode: Optional. SSL mode. Specifies client-server SSL/TLS connection 2091 // behavior. 2092 // 2093 // Possible values: 2094 // "SSL_MODE_UNSPECIFIED" - SSL mode not specified. Defaults to 2095 // ENCRYPTED_ONLY. 2096 // "SSL_MODE_ALLOW" - SSL connections are optional. CA verification not 2097 // enforced. 2098 // "SSL_MODE_REQUIRE" - SSL connections are required. CA verification not 2099 // enforced. Clients may use locally self-signed certificates (default psql 2100 // client behavior). 2101 // "SSL_MODE_VERIFY_CA" - SSL connections are required. CA verification 2102 // enforced. Clients must have certificates signed by a Cluster CA, e.g. via 2103 // GenerateClientCertificate. 2104 // "ALLOW_UNENCRYPTED_AND_ENCRYPTED" - SSL connections are optional. CA 2105 // verification not enforced. 2106 // "ENCRYPTED_ONLY" - SSL connections are required. CA verification not 2107 // enforced. 2108 SslMode string `json:"sslMode,omitempty"` 2109 // ForceSendFields is a list of field names (e.g. "CaSource") to 2110 // unconditionally include in API requests. By default, fields with empty or 2111 // default values are omitted from API requests. See 2112 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2113 // details. 2114 ForceSendFields []string `json:"-"` 2115 // NullFields is a list of field names (e.g. "CaSource") to include in API 2116 // requests with the JSON null value. By default, fields with empty values are 2117 // omitted from API requests. See 2118 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2119 NullFields []string `json:"-"` 2120 } 2121 2122 func (s *SslConfig) MarshalJSON() ([]byte, error) { 2123 type NoMethod SslConfig 2124 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2125 } 2126 2127 // Status: The `Status` type defines a logical error model that is suitable for 2128 // different programming environments, including REST APIs and RPC APIs. It is 2129 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 2130 // pieces of data: error code, error message, and error details. You can find 2131 // out more about this error model and how to work with it in the API Design 2132 // Guide (https://cloud.google.com/apis/design/errors). 2133 type Status struct { 2134 // Code: The status code, which should be an enum value of google.rpc.Code. 2135 Code int64 `json:"code,omitempty"` 2136 // Details: A list of messages that carry the error details. There is a common 2137 // set of message types for APIs to use. 2138 Details []googleapi.RawMessage `json:"details,omitempty"` 2139 // Message: A developer-facing error message, which should be in English. Any 2140 // user-facing error message should be localized and sent in the 2141 // google.rpc.Status.details field, or localized by the client. 2142 Message string `json:"message,omitempty"` 2143 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 2144 // include in API requests. By default, fields with empty or default values are 2145 // omitted from API requests. See 2146 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2147 // details. 2148 ForceSendFields []string `json:"-"` 2149 // NullFields is a list of field names (e.g. "Code") to include in API requests 2150 // with the JSON null value. By default, fields with empty values are omitted 2151 // from API requests. See 2152 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2153 NullFields []string `json:"-"` 2154 } 2155 2156 func (s *Status) MarshalJSON() ([]byte, error) { 2157 type NoMethod Status 2158 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2159 } 2160 2161 // StorageDatabasecenterPartnerapiV1mainAvailabilityConfiguration: 2162 // Configuration for availability of database instance 2163 type StorageDatabasecenterPartnerapiV1mainAvailabilityConfiguration struct { 2164 // AvailabilityType: Availability type. Potential values: * `ZONAL`: The 2165 // instance serves data from only one zone. Outages in that zone affect data 2166 // accessibility. * `REGIONAL`: The instance can serve data from more than one 2167 // zone in a region (it is highly available). 2168 // 2169 // Possible values: 2170 // "AVAILABILITY_TYPE_UNSPECIFIED" 2171 // "ZONAL" - Zonal available instance. 2172 // "REGIONAL" - Regional available instance. 2173 // "MULTI_REGIONAL" - Multi regional instance 2174 // "AVAILABILITY_TYPE_OTHER" - For rest of the other category 2175 AvailabilityType string `json:"availabilityType,omitempty"` 2176 // CrossRegionReplicaConfigured: Checks for resources that are configured to 2177 // have redundancy, and ongoing replication across regions 2178 CrossRegionReplicaConfigured bool `json:"crossRegionReplicaConfigured,omitempty"` 2179 ExternalReplicaConfigured bool `json:"externalReplicaConfigured,omitempty"` 2180 PromotableReplicaConfigured bool `json:"promotableReplicaConfigured,omitempty"` 2181 // ForceSendFields is a list of field names (e.g. "AvailabilityType") to 2182 // unconditionally include in API requests. By default, fields with empty or 2183 // default values are omitted from API requests. See 2184 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2185 // details. 2186 ForceSendFields []string `json:"-"` 2187 // NullFields is a list of field names (e.g. "AvailabilityType") to include in 2188 // API requests with the JSON null value. By default, fields with empty values 2189 // are omitted from API requests. See 2190 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2191 NullFields []string `json:"-"` 2192 } 2193 2194 func (s *StorageDatabasecenterPartnerapiV1mainAvailabilityConfiguration) MarshalJSON() ([]byte, error) { 2195 type NoMethod StorageDatabasecenterPartnerapiV1mainAvailabilityConfiguration 2196 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2197 } 2198 2199 // StorageDatabasecenterPartnerapiV1mainBackupConfiguration: Configuration for 2200 // automatic backups 2201 type StorageDatabasecenterPartnerapiV1mainBackupConfiguration struct { 2202 // AutomatedBackupEnabled: Whether customer visible automated backups are 2203 // enabled on the instance. 2204 AutomatedBackupEnabled bool `json:"automatedBackupEnabled,omitempty"` 2205 // BackupRetentionSettings: Backup retention settings. 2206 BackupRetentionSettings *StorageDatabasecenterPartnerapiV1mainRetentionSettings `json:"backupRetentionSettings,omitempty"` 2207 // PointInTimeRecoveryEnabled: Whether point-in-time recovery is enabled. This 2208 // is optional field, if the database service does not have this feature or 2209 // metadata is not available in control plane, this can be omitted. 2210 PointInTimeRecoveryEnabled bool `json:"pointInTimeRecoveryEnabled,omitempty"` 2211 // ForceSendFields is a list of field names (e.g. "AutomatedBackupEnabled") to 2212 // unconditionally include in API requests. By default, fields with empty or 2213 // default values are omitted from API requests. See 2214 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2215 // details. 2216 ForceSendFields []string `json:"-"` 2217 // NullFields is a list of field names (e.g. "AutomatedBackupEnabled") to 2218 // include in API requests with the JSON null value. By default, fields with 2219 // empty values are omitted from API requests. See 2220 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2221 NullFields []string `json:"-"` 2222 } 2223 2224 func (s *StorageDatabasecenterPartnerapiV1mainBackupConfiguration) MarshalJSON() ([]byte, error) { 2225 type NoMethod StorageDatabasecenterPartnerapiV1mainBackupConfiguration 2226 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2227 } 2228 2229 // StorageDatabasecenterPartnerapiV1mainBackupRun: A backup run. 2230 type StorageDatabasecenterPartnerapiV1mainBackupRun struct { 2231 // EndTime: The time the backup operation completed. REQUIRED 2232 EndTime string `json:"endTime,omitempty"` 2233 // Error: Information about why the backup operation failed. This is only 2234 // present if the run has the FAILED status. OPTIONAL 2235 Error *StorageDatabasecenterPartnerapiV1mainOperationError `json:"error,omitempty"` 2236 // StartTime: The time the backup operation started. REQUIRED 2237 StartTime string `json:"startTime,omitempty"` 2238 // Status: The status of this run. REQUIRED 2239 // 2240 // Possible values: 2241 // "STATUS_UNSPECIFIED" 2242 // "SUCCESSFUL" - The backup was successful. 2243 // "FAILED" - The backup was unsuccessful. 2244 Status string `json:"status,omitempty"` 2245 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally 2246 // include in API requests. By default, fields with empty or default values are 2247 // omitted from API requests. See 2248 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2249 // details. 2250 ForceSendFields []string `json:"-"` 2251 // NullFields is a list of field names (e.g. "EndTime") to include in API 2252 // requests with the JSON null value. By default, fields with empty values are 2253 // omitted from API requests. See 2254 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2255 NullFields []string `json:"-"` 2256 } 2257 2258 func (s *StorageDatabasecenterPartnerapiV1mainBackupRun) MarshalJSON() ([]byte, error) { 2259 type NoMethod StorageDatabasecenterPartnerapiV1mainBackupRun 2260 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2261 } 2262 2263 // StorageDatabasecenterPartnerapiV1mainCompliance: Contains compliance 2264 // information about a security standard indicating unmet recommendations. 2265 type StorageDatabasecenterPartnerapiV1mainCompliance struct { 2266 // Standard: Industry-wide compliance standards or benchmarks, such as CIS, 2267 // PCI, and OWASP. 2268 Standard string `json:"standard,omitempty"` 2269 // Version: Version of the standard or benchmark, for example, 1.1 2270 Version string `json:"version,omitempty"` 2271 // ForceSendFields is a list of field names (e.g. "Standard") to 2272 // unconditionally include in API requests. By default, fields with empty or 2273 // default values are omitted from API requests. See 2274 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2275 // details. 2276 ForceSendFields []string `json:"-"` 2277 // NullFields is a list of field names (e.g. "Standard") to include in API 2278 // requests with the JSON null value. By default, fields with empty values are 2279 // omitted from API requests. See 2280 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2281 NullFields []string `json:"-"` 2282 } 2283 2284 func (s *StorageDatabasecenterPartnerapiV1mainCompliance) MarshalJSON() ([]byte, error) { 2285 type NoMethod StorageDatabasecenterPartnerapiV1mainCompliance 2286 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2287 } 2288 2289 // StorageDatabasecenterPartnerapiV1mainCustomMetadataData: Any custom metadata 2290 // associated with the resource. i.e. A spanner instance can have multiple 2291 // databases with its own unique metadata. Information for these individual 2292 // databases can be captured in custom metadata data 2293 type StorageDatabasecenterPartnerapiV1mainCustomMetadataData struct { 2294 DatabaseMetadata []*StorageDatabasecenterPartnerapiV1mainDatabaseMetadata `json:"databaseMetadata,omitempty"` 2295 // ForceSendFields is a list of field names (e.g. "DatabaseMetadata") to 2296 // unconditionally include in API requests. By default, fields with empty or 2297 // default values are omitted from API requests. See 2298 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2299 // details. 2300 ForceSendFields []string `json:"-"` 2301 // NullFields is a list of field names (e.g. "DatabaseMetadata") to include in 2302 // API requests with the JSON null value. By default, fields with empty values 2303 // are omitted from API requests. See 2304 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2305 NullFields []string `json:"-"` 2306 } 2307 2308 func (s *StorageDatabasecenterPartnerapiV1mainCustomMetadataData) MarshalJSON() ([]byte, error) { 2309 type NoMethod StorageDatabasecenterPartnerapiV1mainCustomMetadataData 2310 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2311 } 2312 2313 // StorageDatabasecenterPartnerapiV1mainDatabaseMetadata: Metadata for 2314 // individual databases created in an instance. i.e. spanner instance can have 2315 // multiple databases with unique configuration settings. 2316 type StorageDatabasecenterPartnerapiV1mainDatabaseMetadata struct { 2317 // BackupConfiguration: Backup configuration for this database 2318 BackupConfiguration *StorageDatabasecenterPartnerapiV1mainBackupConfiguration `json:"backupConfiguration,omitempty"` 2319 // BackupRun: Information about the last backup attempt for this database 2320 BackupRun *StorageDatabasecenterPartnerapiV1mainBackupRun `json:"backupRun,omitempty"` 2321 Product *StorageDatabasecenterProtoCommonProduct `json:"product,omitempty"` 2322 ResourceId *StorageDatabasecenterPartnerapiV1mainDatabaseResourceId `json:"resourceId,omitempty"` 2323 // ResourceName: Required. Database name. Resource name to follow CAIS 2324 // resource_name format as noted here go/condor-common-datamodel 2325 ResourceName string `json:"resourceName,omitempty"` 2326 // ForceSendFields is a list of field names (e.g. "BackupConfiguration") to 2327 // unconditionally include in API requests. By default, fields with empty or 2328 // default values are omitted from API requests. See 2329 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2330 // details. 2331 ForceSendFields []string `json:"-"` 2332 // NullFields is a list of field names (e.g. "BackupConfiguration") to include 2333 // in API requests with the JSON null value. By default, fields with empty 2334 // values are omitted from API requests. See 2335 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2336 NullFields []string `json:"-"` 2337 } 2338 2339 func (s *StorageDatabasecenterPartnerapiV1mainDatabaseMetadata) MarshalJSON() ([]byte, error) { 2340 type NoMethod StorageDatabasecenterPartnerapiV1mainDatabaseMetadata 2341 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2342 } 2343 2344 // StorageDatabasecenterPartnerapiV1mainDatabaseResourceFeed: 2345 // DatabaseResourceFeed is the top level proto to be used to ingest different 2346 // database resource level events into Condor platform. 2347 type StorageDatabasecenterPartnerapiV1mainDatabaseResourceFeed struct { 2348 // FeedTimestamp: Required. Timestamp when feed is generated. 2349 FeedTimestamp string `json:"feedTimestamp,omitempty"` 2350 // FeedType: Required. Type feed to be ingested into condor 2351 // 2352 // Possible values: 2353 // "FEEDTYPE_UNSPECIFIED" 2354 // "RESOURCE_METADATA" - Database resource metadata feed from control plane 2355 // "OBSERVABILITY_DATA" - Database resource monitoring data 2356 // "SECURITY_FINDING_DATA" - Database resource security health signal data 2357 // "RECOMMENDATION_SIGNAL_DATA" - Database resource recommendation signal 2358 // data 2359 FeedType string `json:"feedType,omitempty"` 2360 // RecommendationSignalData: More feed data would be added in subsequent CLs 2361 RecommendationSignalData *StorageDatabasecenterPartnerapiV1mainDatabaseResourceRecommendationSignalData `json:"recommendationSignalData,omitempty"` 2362 ResourceHealthSignalData *StorageDatabasecenterPartnerapiV1mainDatabaseResourceHealthSignalData `json:"resourceHealthSignalData,omitempty"` 2363 // ResourceId: Primary key associated with the Resource. resource_id is 2364 // available in individual feed level as well. 2365 ResourceId *StorageDatabasecenterPartnerapiV1mainDatabaseResourceId `json:"resourceId,omitempty"` 2366 ResourceMetadata *StorageDatabasecenterPartnerapiV1mainDatabaseResourceMetadata `json:"resourceMetadata,omitempty"` 2367 // ForceSendFields is a list of field names (e.g. "FeedTimestamp") to 2368 // unconditionally include in API requests. By default, fields with empty or 2369 // default values are omitted from API requests. See 2370 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2371 // details. 2372 ForceSendFields []string `json:"-"` 2373 // NullFields is a list of field names (e.g. "FeedTimestamp") to include in API 2374 // requests with the JSON null value. By default, fields with empty values are 2375 // omitted from API requests. See 2376 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2377 NullFields []string `json:"-"` 2378 } 2379 2380 func (s *StorageDatabasecenterPartnerapiV1mainDatabaseResourceFeed) MarshalJSON() ([]byte, error) { 2381 type NoMethod StorageDatabasecenterPartnerapiV1mainDatabaseResourceFeed 2382 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2383 } 2384 2385 // StorageDatabasecenterPartnerapiV1mainDatabaseResourceHealthSignalData: 2386 // Common model for database resource health signal data. 2387 type StorageDatabasecenterPartnerapiV1mainDatabaseResourceHealthSignalData struct { 2388 // AdditionalMetadata: Any other additional metadata 2389 AdditionalMetadata googleapi.RawMessage `json:"additionalMetadata,omitempty"` 2390 // Compliance: Industry standards associated with this signal; if this signal 2391 // is an issue, that could be a violation of the associated industry 2392 // standard(s). For example, AUTO_BACKUP_DISABLED signal is associated with CIS 2393 // GCP 1.1, CIS GCP 1.2, CIS GCP 1.3, NIST 800-53 and ISO-27001 compliance 2394 // standards. If a database resource does not have automated backup enable, it 2395 // will violate these following industry standards. 2396 Compliance []*StorageDatabasecenterPartnerapiV1mainCompliance `json:"compliance,omitempty"` 2397 // Description: Description associated with signal 2398 Description string `json:"description,omitempty"` 2399 // EventTime: Required. The last time at which the event described by this 2400 // signal took place 2401 EventTime string `json:"eventTime,omitempty"` 2402 // ExternalUri: The external-uri of the signal, using which more information 2403 // about this signal can be obtained. In GCP, this will take user to SCC page 2404 // to get more details about signals. 2405 ExternalUri string `json:"externalUri,omitempty"` 2406 // Name: Required. The name of the signal, ex: PUBLIC_SQL_INSTANCE, 2407 // SQL_LOG_ERROR_VERBOSITY etc. 2408 Name string `json:"name,omitempty"` 2409 // Provider: Cloud provider name. Ex: GCP/AWS/Azure/OnPrem/SelfManaged 2410 // 2411 // Possible values: 2412 // "PROVIDER_UNSPECIFIED" 2413 // "GCP" - Google cloud platform provider 2414 // "AWS" - Amazon web service 2415 // "AZURE" - Azure web service 2416 // "ONPREM" - On-prem database resources. 2417 // "SELFMANAGED" - Self-managed database provider. These are resources on a 2418 // cloud platform, e.g., database resource installed in a GCE VM, but not a 2419 // managed database service. 2420 // "PROVIDER_OTHER" - For the rest of the other categories. Other refers to 2421 // the rest of other database service providers, this could be smaller cloud 2422 // provider. This needs to be provided when the provider is known, but it is 2423 // not present in the existing set of enum values. 2424 Provider string `json:"provider,omitempty"` 2425 // ResourceContainer: Closest parent container of this resource. In GCP, 2426 // 'container' refers to a Cloud Resource Manager project. It must be resource 2427 // name of a Cloud Resource Manager project with the format of "provider//", 2428 // such as "projects/123". For GCP provided resources, number should be project 2429 // number. 2430 ResourceContainer string `json:"resourceContainer,omitempty"` 2431 // ResourceName: Required. Database resource name associated with the signal. 2432 // Resource name to follow CAIS resource_name format as noted here 2433 // go/condor-common-datamodel 2434 ResourceName string `json:"resourceName,omitempty"` 2435 // SignalClass: Required. The class of the signal, such as if it's a THREAT or 2436 // VULNERABILITY. 2437 // 2438 // Possible values: 2439 // "CLASS_UNSPECIFIED" - Unspecified signal class. 2440 // "THREAT" - Describes unwanted or malicious activity. 2441 // "VULNERABILITY" - Describes a potential weakness in software that 2442 // increases risk to Confidentiality & Integrity & Availability. 2443 // "MISCONFIGURATION" - Describes a potential weakness in cloud 2444 // resource/asset configuration that increases risk. 2445 // "OBSERVATION" - Describes a security observation that is for informational 2446 // purposes. 2447 // "ERROR" - Describes an error that prevents some SCC functionality. 2448 SignalClass string `json:"signalClass,omitempty"` 2449 // SignalId: Required. Unique identifier for the signal. This is an unique id 2450 // which would be mainatined by partner to identify a signal. 2451 SignalId string `json:"signalId,omitempty"` 2452 // SignalType: Required. Type of signal, for example, 2453 // `AVAILABLE_IN_MULTIPLE_ZONES`, `LOGGING_MOST_ERRORS`, etc. 2454 // 2455 // Possible values: 2456 // "SIGNAL_TYPE_UNSPECIFIED" - Unspecified. 2457 // "SIGNAL_TYPE_NOT_PROTECTED_BY_AUTOMATIC_FAILOVER" - Represents if a 2458 // resource is protected by automatic failover. Checks for resources that are 2459 // configured to have redundancy within a region that enables automatic 2460 // failover. 2461 // "SIGNAL_TYPE_GROUP_NOT_REPLICATING_ACROSS_REGIONS" - Represents if a group 2462 // is replicating across regions. Checks for resources that are configured to 2463 // have redundancy, and ongoing replication, across regions. 2464 // "SIGNAL_TYPE_NOT_AVAILABLE_IN_MULTIPLE_ZONES" - Represents if the resource 2465 // is available in multiple zones or not. 2466 // "SIGNAL_TYPE_NOT_AVAILABLE_IN_MULTIPLE_REGIONS" - Represents if a resource 2467 // is available in multiple regions. 2468 // "SIGNAL_TYPE_NO_PROMOTABLE_REPLICA" - Represents if a resource has a 2469 // promotable replica. 2470 // "SIGNAL_TYPE_NO_AUTOMATED_BACKUP_POLICY" - Represents if a resource has an 2471 // automated backup policy. 2472 // "SIGNAL_TYPE_SHORT_BACKUP_RETENTION" - Represents if a resources has a 2473 // short backup retention period. 2474 // "SIGNAL_TYPE_LAST_BACKUP_FAILED" - Represents if the last backup of a 2475 // resource failed. 2476 // "SIGNAL_TYPE_LAST_BACKUP_OLD" - Represents if the last backup of a 2477 // resource is older than some threshold value. 2478 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_2_0" - Represents if a resource 2479 // violates CIS GCP Foundation 2.0. 2480 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_3" - Represents if a resource 2481 // violates CIS GCP Foundation 1.3. 2482 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_2" - Represents if a resource 2483 // violates CIS GCP Foundation 1.2. 2484 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_1" - Represents if a resource 2485 // violates CIS GCP Foundation 1.1. 2486 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_0" - Represents if a resource 2487 // violates CIS GCP Foundation 1.0. 2488 // "SIGNAL_TYPE_VIOLATES_NIST_800_53" - Represents if a resource violates 2489 // NIST 800-53. 2490 // "SIGNAL_TYPE_VIOLATES_ISO_27001" - Represents if a resource violates 2491 // ISO-27001. 2492 // "SIGNAL_TYPE_VIOLATES_PCI_DSS_V3_2_1" - Represents if a resource violates 2493 // PCI-DSS v3.2.1. 2494 // "SIGNAL_TYPE_LOGS_NOT_OPTIMIZED_FOR_TROUBLESHOOTING" - Represents if 2495 // log_checkpoints database flag for a Cloud SQL for PostgreSQL instance is not 2496 // set to on. 2497 // "SIGNAL_TYPE_QUERY_DURATIONS_NOT_LOGGED" - Represents if the log_duration 2498 // database flag for a Cloud SQL for PostgreSQL instance is not set to on. 2499 // "SIGNAL_TYPE_VERBOSE_ERROR_LOGGING" - Represents if the 2500 // log_error_verbosity database flag for a Cloud SQL for PostgreSQL instance is 2501 // not set to default or stricter (default or terse). 2502 // "SIGNAL_TYPE_QUERY_LOCK_WAITS_NOT_LOGGED" - Represents if the 2503 // log_lock_waits database flag for a Cloud SQL for PostgreSQL instance is not 2504 // set to on. 2505 // "SIGNAL_TYPE_LOGGING_MOST_ERRORS" - Represents if the 2506 // log_min_error_statement database flag for a Cloud SQL for PostgreSQL 2507 // instance is not set appropriately. 2508 // "SIGNAL_TYPE_LOGGING_ONLY_CRITICAL_ERRORS" - Represents if the 2509 // log_min_error_statement database flag for a Cloud SQL for PostgreSQL 2510 // instance does not have an appropriate severity level. 2511 // "SIGNAL_TYPE_MINIMAL_ERROR_LOGGING" - Represents if the log_min_messages 2512 // database flag for a Cloud SQL for PostgreSQL instance is not set to warning 2513 // or another recommended value. 2514 // "SIGNAL_TYPE_QUERY_STATISTICS_LOGGED" - Represents if the databaseFlags 2515 // property of instance metadata for the log_executor_status field is set to 2516 // on. 2517 // "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_CLIENT_HOSTNAME" - Represents if the 2518 // log_hostname database flag for a Cloud SQL for PostgreSQL instance is not 2519 // set to off. 2520 // "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PARSER_STATISTICS" - Represents if the 2521 // log_parser_stats database flag for a Cloud SQL for PostgreSQL instance is 2522 // not set to off. 2523 // "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PLANNER_STATISTICS" - Represents if the 2524 // log_planner_stats database flag for a Cloud SQL for PostgreSQL instance is 2525 // not set to off. 2526 // "SIGNAL_TYPE_NOT_LOGGING_ONLY_DDL_STATEMENTS" - Represents if the 2527 // log_statement database flag for a Cloud SQL for PostgreSQL instance is not 2528 // set to DDL (all data definition statements). 2529 // "SIGNAL_TYPE_LOGGING_QUERY_STATISTICS" - Represents if the 2530 // log_statement_stats database flag for a Cloud SQL for PostgreSQL instance is 2531 // not set to off. 2532 // "SIGNAL_TYPE_NOT_LOGGING_TEMPORARY_FILES" - Represents if the 2533 // log_temp_files database flag for a Cloud SQL for PostgreSQL instance is not 2534 // set to "0". (NOTE: 0 = ON) 2535 // "SIGNAL_TYPE_CONNECTION_MAX_NOT_CONFIGURED" - Represents if the user 2536 // connections database flag for a Cloud SQL for SQL Server instance is 2537 // configured. 2538 // "SIGNAL_TYPE_USER_OPTIONS_CONFIGURED" - Represents if the user options 2539 // database flag for Cloud SQL SQL Server instance is configured or not. 2540 // "SIGNAL_TYPE_EXPOSED_TO_PUBLIC_ACCESS" - Represents if a resource is 2541 // exposed to public access. 2542 // "SIGNAL_TYPE_UNENCRYPTED_CONNECTIONS" - Represents if a resources requires 2543 // all incoming connections to use SSL or not. 2544 // "SIGNAL_TYPE_NO_ROOT_PASSWORD" - Represents if a Cloud SQL database has a 2545 // password configured for the root account or not. 2546 // "SIGNAL_TYPE_WEAK_ROOT_PASSWORD" - Represents if a Cloud SQL database has 2547 // a weak password configured for the root account. 2548 // "SIGNAL_TYPE_ENCRYPTION_KEY_NOT_CUSTOMER_MANAGED" - Represents if a SQL 2549 // database instance is not encrypted with customer-managed encryption keys 2550 // (CMEK). 2551 // "SIGNAL_TYPE_SERVER_AUTHENTICATION_NOT_REQUIRED" - Represents if The 2552 // contained database authentication database flag for a Cloud SQL for SQL 2553 // Server instance is not set to off. 2554 // "SIGNAL_TYPE_EXPOSED_BY_OWNERSHIP_CHAINING" - Represents if the 2555 // cross_db_ownership_chaining database flag for a Cloud SQL for SQL Server 2556 // instance is not set to off. 2557 // "SIGNAL_TYPE_EXPOSED_TO_EXTERNAL_SCRIPTS" - Represents if he external 2558 // scripts enabled database flag for a Cloud SQL for SQL Server instance is not 2559 // set to off. 2560 // "SIGNAL_TYPE_EXPOSED_TO_LOCAL_DATA_LOADS" - Represents if the local_infile 2561 // database flag for a Cloud SQL for MySQL instance is not set to off. 2562 // "SIGNAL_TYPE_CONNECTION_ATTEMPTS_NOT_LOGGED" - Represents if the 2563 // log_connections database flag for a Cloud SQL for PostgreSQL instance is not 2564 // set to on. 2565 // "SIGNAL_TYPE_DISCONNECTIONS_NOT_LOGGED" - Represents if the 2566 // log_disconnections database flag for a Cloud SQL for PostgreSQL instance is 2567 // not set to on. 2568 // "SIGNAL_TYPE_LOGGING_EXCESSIVE_STATEMENT_INFO" - Represents if the 2569 // log_min_duration_statement database flag for a Cloud SQL for PostgreSQL 2570 // instance is not set to -1. 2571 // "SIGNAL_TYPE_EXPOSED_TO_REMOTE_ACCESS" - Represents if the remote access 2572 // database flag for a Cloud SQL for SQL Server instance is not set to off. 2573 // "SIGNAL_TYPE_DATABASE_NAMES_EXPOSED" - Represents if the 2574 // skip_show_database database flag for a Cloud SQL for MySQL instance is not 2575 // set to on. 2576 // "SIGNAL_TYPE_SENSITIVE_TRACE_INFO_NOT_MASKED" - Represents if the 3625 2577 // (trace flag) database flag for a Cloud SQL for SQL Server instance is not 2578 // set to on. 2579 // "SIGNAL_TYPE_PUBLIC_IP_ENABLED" - Represents if public IP is enabled. 2580 // "SIGNAL_TYPE_IDLE" - Represents Idle instance helps to reduce costs. 2581 // "SIGNAL_TYPE_OVERPROVISIONED" - Represents instances that are 2582 // unnecessarily large for given workload. 2583 // "SIGNAL_TYPE_HIGH_NUMBER_OF_OPEN_TABLES" - Represents high number of 2584 // concurrently opened tables. 2585 // "SIGNAL_TYPE_HIGH_NUMBER_OF_TABLES" - Represents high table count close to 2586 // SLA limit. 2587 // "SIGNAL_TYPE_HIGH_TRANSACTION_ID_UTILIZATION" - Represents high number of 2588 // unvacuumed transactions 2589 // "SIGNAL_TYPE_UNDERPROVISIONED" - Represents need for more CPU and/or 2590 // memory 2591 // "SIGNAL_TYPE_OUT_OF_DISK" - Represents out of disk. 2592 // "SIGNAL_TYPE_SERVER_CERTIFICATE_NEAR_EXPIRY" - Represents server 2593 // certificate is near expiry. 2594 // "SIGNAL_TYPE_DATABASE_AUDITING_DISABLED" - Represents database auditing is 2595 // disabled. 2596 // "SIGNAL_TYPE_RESTRICT_AUTHORIZED_NETWORKS" - Represents not restricted to 2597 // authorized networks. 2598 // "SIGNAL_TYPE_VIOLATE_POLICY_RESTRICT_PUBLIC_IP" - Represents violate org 2599 // policy restrict public ip. 2600 // "SIGNAL_TYPE_QUOTA_LIMIT" - Cluster nearing quota limit 2601 // "SIGNAL_TYPE_NO_PASSWORD_POLICY" - No password policy set on resources 2602 // "SIGNAL_TYPE_CONNECTIONS_PERFORMANCE_IMPACT" - Performance impact of 2603 // connections settings 2604 // "SIGNAL_TYPE_TMP_TABLES_PERFORMANCE_IMPACT" - Performance impact of 2605 // temporary tables settings 2606 // "SIGNAL_TYPE_TRANS_LOGS_PERFORMANCE_IMPACT" - Performance impact of 2607 // transaction logs settings 2608 // "SIGNAL_TYPE_HIGH_JOINS_WITHOUT_INDEXES" - Performance impact of high 2609 // joins without indexes 2610 SignalType string `json:"signalType,omitempty"` 2611 // Possible values: 2612 // "STATE_UNSPECIFIED" - Unspecified state. 2613 // "ACTIVE" - The signal requires attention and has not been addressed yet. 2614 // "RESOLVED" - The signal has been fixed, triaged as a non-issue or 2615 // otherwise addressed and is no longer active. 2616 // "MUTED" - The signal has been muted. 2617 State string `json:"state,omitempty"` 2618 // ForceSendFields is a list of field names (e.g. "AdditionalMetadata") to 2619 // unconditionally include in API requests. By default, fields with empty or 2620 // default values are omitted from API requests. See 2621 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2622 // details. 2623 ForceSendFields []string `json:"-"` 2624 // NullFields is a list of field names (e.g. "AdditionalMetadata") to include 2625 // in API requests with the JSON null value. By default, fields with empty 2626 // values are omitted from API requests. See 2627 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2628 NullFields []string `json:"-"` 2629 } 2630 2631 func (s *StorageDatabasecenterPartnerapiV1mainDatabaseResourceHealthSignalData) MarshalJSON() ([]byte, error) { 2632 type NoMethod StorageDatabasecenterPartnerapiV1mainDatabaseResourceHealthSignalData 2633 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2634 } 2635 2636 // StorageDatabasecenterPartnerapiV1mainDatabaseResourceId: DatabaseResourceId 2637 // will serve as primary key for any resource ingestion event. 2638 type StorageDatabasecenterPartnerapiV1mainDatabaseResourceId struct { 2639 // Provider: Required. Cloud provider name. Ex: 2640 // GCP/AWS/Azure/OnPrem/SelfManaged 2641 // 2642 // Possible values: 2643 // "PROVIDER_UNSPECIFIED" 2644 // "GCP" - Google cloud platform provider 2645 // "AWS" - Amazon web service 2646 // "AZURE" - Azure web service 2647 // "ONPREM" - On-prem database resources. 2648 // "SELFMANAGED" - Self-managed database provider. These are resources on a 2649 // cloud platform, e.g., database resource installed in a GCE VM, but not a 2650 // managed database service. 2651 // "PROVIDER_OTHER" - For the rest of the other categories. Other refers to 2652 // the rest of other database service providers, this could be smaller cloud 2653 // provider. This needs to be provided when the provider is known, but it is 2654 // not present in the existing set of enum values. 2655 Provider string `json:"provider,omitempty"` 2656 // ProviderDescription: Optional. Needs to be used only when the provider is 2657 // PROVIDER_OTHER. 2658 ProviderDescription string `json:"providerDescription,omitempty"` 2659 // ResourceType: Required. The type of resource this ID is identifying. Ex 2660 // redis.googleapis.com/Instance, redis.googleapis.com/Cluster, 2661 // alloydb.googleapis.com/Cluster, alloydb.googleapis.com/Instance, 2662 // spanner.googleapis.com/Instance REQUIRED Please refer 2663 // go/condor-common-datamodel 2664 ResourceType string `json:"resourceType,omitempty"` 2665 // UniqueId: Required. A service-local token that distinguishes this resource 2666 // from other resources within the same service. 2667 UniqueId string `json:"uniqueId,omitempty"` 2668 // ForceSendFields is a list of field names (e.g. "Provider") to 2669 // unconditionally include in API requests. By default, fields with empty or 2670 // default values are omitted from API requests. See 2671 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2672 // details. 2673 ForceSendFields []string `json:"-"` 2674 // NullFields is a list of field names (e.g. "Provider") to include in API 2675 // requests with the JSON null value. By default, fields with empty values are 2676 // omitted from API requests. See 2677 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2678 NullFields []string `json:"-"` 2679 } 2680 2681 func (s *StorageDatabasecenterPartnerapiV1mainDatabaseResourceId) MarshalJSON() ([]byte, error) { 2682 type NoMethod StorageDatabasecenterPartnerapiV1mainDatabaseResourceId 2683 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2684 } 2685 2686 // StorageDatabasecenterPartnerapiV1mainDatabaseResourceMetadata: Common model 2687 // for database resource instance metadata. 2688 type StorageDatabasecenterPartnerapiV1mainDatabaseResourceMetadata struct { 2689 // AvailabilityConfiguration: Availability configuration for this instance 2690 AvailabilityConfiguration *StorageDatabasecenterPartnerapiV1mainAvailabilityConfiguration `json:"availabilityConfiguration,omitempty"` 2691 // BackupConfiguration: Backup configuration for this instance 2692 BackupConfiguration *StorageDatabasecenterPartnerapiV1mainBackupConfiguration `json:"backupConfiguration,omitempty"` 2693 // BackupRun: Latest backup run information for this instance 2694 BackupRun *StorageDatabasecenterPartnerapiV1mainBackupRun `json:"backupRun,omitempty"` 2695 // CreationTime: The creation time of the resource, i.e. the time when resource 2696 // is created and recorded in partner service. 2697 CreationTime string `json:"creationTime,omitempty"` 2698 // CurrentState: Current state of the instance. 2699 // 2700 // Possible values: 2701 // "STATE_UNSPECIFIED" 2702 // "HEALTHY" - The instance is running. 2703 // "UNHEALTHY" - Instance being created, updated, deleted or under 2704 // maintenance 2705 // "SUSPENDED" - When instance is suspended 2706 // "DELETED" - Instance is deleted. 2707 // "STATE_OTHER" - For rest of the other category 2708 CurrentState string `json:"currentState,omitempty"` 2709 // CustomMetadata: Any custom metadata associated with the resource 2710 CustomMetadata *StorageDatabasecenterPartnerapiV1mainCustomMetadataData `json:"customMetadata,omitempty"` 2711 // Entitlements: Entitlements associated with the resource 2712 Entitlements []*StorageDatabasecenterPartnerapiV1mainEntitlement `json:"entitlements,omitempty"` 2713 // ExpectedState: The state that the instance is expected to be in. For 2714 // example, an instance state can transition to UNHEALTHY due to wrong patch 2715 // update, while the expected state will remain at the HEALTHY. 2716 // 2717 // Possible values: 2718 // "STATE_UNSPECIFIED" 2719 // "HEALTHY" - The instance is running. 2720 // "UNHEALTHY" - Instance being created, updated, deleted or under 2721 // maintenance 2722 // "SUSPENDED" - When instance is suspended 2723 // "DELETED" - Instance is deleted. 2724 // "STATE_OTHER" - For rest of the other category 2725 ExpectedState string `json:"expectedState,omitempty"` 2726 // Id: Required. Unique identifier for a Database resource 2727 Id *StorageDatabasecenterPartnerapiV1mainDatabaseResourceId `json:"id,omitempty"` 2728 // InstanceType: The type of the instance. Specified at creation time. 2729 // 2730 // Possible values: 2731 // "INSTANCE_TYPE_UNSPECIFIED" 2732 // "SUB_RESOURCE_TYPE_UNSPECIFIED" - For rest of the other categories. 2733 // "PRIMARY" - A regular primary database instance. 2734 // "SECONDARY" - A cluster or an instance acting as a secondary. 2735 // "READ_REPLICA" - An instance acting as a read-replica. 2736 // "OTHER" - For rest of the other categories. 2737 // "SUB_RESOURCE_TYPE_PRIMARY" - A regular primary database instance. 2738 // "SUB_RESOURCE_TYPE_SECONDARY" - A cluster or an instance acting as a 2739 // secondary. 2740 // "SUB_RESOURCE_TYPE_READ_REPLICA" - An instance acting as a read-replica. 2741 // "SUB_RESOURCE_TYPE_OTHER" - For rest of the other categories. 2742 InstanceType string `json:"instanceType,omitempty"` 2743 // Location: The resource location. REQUIRED 2744 Location string `json:"location,omitempty"` 2745 // PrimaryResourceId: Identifier for this resource's immediate parent/primary 2746 // resource if the current resource is a replica or derived form of another 2747 // Database resource. Else it would be NULL. REQUIRED if the immediate parent 2748 // exists when first time resource is getting ingested, otherwise optional. 2749 PrimaryResourceId *StorageDatabasecenterPartnerapiV1mainDatabaseResourceId `json:"primaryResourceId,omitempty"` 2750 // Product: The product this resource represents. 2751 Product *StorageDatabasecenterProtoCommonProduct `json:"product,omitempty"` 2752 // ResourceContainer: Closest parent Cloud Resource Manager container of this 2753 // resource. It must be resource name of a Cloud Resource Manager project with 2754 // the format of "/", such as "projects/123". For GCP provided resources, 2755 // number should be project number. 2756 ResourceContainer string `json:"resourceContainer,omitempty"` 2757 // ResourceName: Required. Different from DatabaseResourceId.unique_id, a 2758 // resource name can be reused over time. That is, after a resource named "ABC" 2759 // is deleted, the name "ABC" can be used to to create a new resource within 2760 // the same source. Resource name to follow CAIS resource_name format as noted 2761 // here go/condor-common-datamodel 2762 ResourceName string `json:"resourceName,omitempty"` 2763 // UpdationTime: The time at which the resource was updated and recorded at 2764 // partner service. 2765 UpdationTime string `json:"updationTime,omitempty"` 2766 // UserLabelSet: User-provided labels associated with the resource 2767 UserLabelSet *StorageDatabasecenterPartnerapiV1mainUserLabels `json:"userLabelSet,omitempty"` 2768 // UserLabels: User-provided labels, represented as a dictionary where each 2769 // label is a single key value pair. 2770 UserLabels map[string]string `json:"userLabels,omitempty"` 2771 // ForceSendFields is a list of field names (e.g. "AvailabilityConfiguration") 2772 // to unconditionally include in API requests. By default, fields with empty or 2773 // default values are omitted from API requests. See 2774 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2775 // details. 2776 ForceSendFields []string `json:"-"` 2777 // NullFields is a list of field names (e.g. "AvailabilityConfiguration") to 2778 // include in API requests with the JSON null value. By default, fields with 2779 // empty values are omitted from API requests. See 2780 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2781 NullFields []string `json:"-"` 2782 } 2783 2784 func (s *StorageDatabasecenterPartnerapiV1mainDatabaseResourceMetadata) MarshalJSON() ([]byte, error) { 2785 type NoMethod StorageDatabasecenterPartnerapiV1mainDatabaseResourceMetadata 2786 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2787 } 2788 2789 // StorageDatabasecenterPartnerapiV1mainDatabaseResourceRecommendationSignalData 2790 // : Common model for database resource recommendation signal data. 2791 type StorageDatabasecenterPartnerapiV1mainDatabaseResourceRecommendationSignalData struct { 2792 // AdditionalMetadata: Optional. Any other additional metadata specific to 2793 // recommendation 2794 AdditionalMetadata googleapi.RawMessage `json:"additionalMetadata,omitempty"` 2795 // LastRefreshTime: Required. last time recommendationw as refreshed 2796 LastRefreshTime string `json:"lastRefreshTime,omitempty"` 2797 // RecommendationState: Required. Recommendation state 2798 // 2799 // Possible values: 2800 // "UNSPECIFIED" 2801 // "ACTIVE" - Recommendation is active and can be applied. ACTIVE 2802 // recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. 2803 // "CLAIMED" - Recommendation is in claimed state. Recommendations content is 2804 // immutable and cannot be updated by Google. CLAIMED recommendations can be 2805 // marked as CLAIMED, SUCCEEDED, or FAILED. 2806 // "SUCCEEDED" - Recommendation is in succeeded state. Recommendations 2807 // content is immutable and cannot be updated by Google. SUCCEEDED 2808 // recommendations can be marked as SUCCEEDED, or FAILED. 2809 // "FAILED" - Recommendation is in failed state. Recommendations content is 2810 // immutable and cannot be updated by Google. FAILED recommendations can be 2811 // marked as SUCCEEDED, or FAILED. 2812 // "DISMISSED" - Recommendation is in dismissed state. Recommendation content 2813 // can be updated by Google. DISMISSED recommendations can be marked as ACTIVE. 2814 RecommendationState string `json:"recommendationState,omitempty"` 2815 // Recommender: Required. Name of recommendation. Examples: 2816 // organizations/1234/locations/us-central1/recommenders/google.cloudsql.instanc 2817 // e.PerformanceRecommender/recommendations/9876 2818 Recommender string `json:"recommender,omitempty"` 2819 // RecommenderId: Required. ID of recommender. Examples: 2820 // "google.cloudsql.instance.PerformanceRecommender" 2821 RecommenderId string `json:"recommenderId,omitempty"` 2822 // RecommenderSubtype: Required. Contains an identifier for a subtype of 2823 // recommendations produced for the same recommender. Subtype is a function of 2824 // content and impact, meaning a new subtype might be added when significant 2825 // changes to `content` or `primary_impact.category` are introduced. See the 2826 // Recommenders section to see a list of subtypes for a given Recommender. 2827 // Examples: For recommender = 2828 // "google.cloudsql.instance.PerformanceRecommender", recommender_subtype can 2829 // be 2830 // "MYSQL_HIGH_NUMBER_OF_OPEN_TABLES_BEST_PRACTICE"/"POSTGRES_HIGH_TRANSACTION_I 2831 // D_UTILIZATION_BEST_PRACTICE" 2832 RecommenderSubtype string `json:"recommenderSubtype,omitempty"` 2833 // ResourceName: Required. Database resource name associated with the signal. 2834 // Resource name to follow CAIS resource_name format as noted here 2835 // go/condor-common-datamodel 2836 ResourceName string `json:"resourceName,omitempty"` 2837 // SignalType: Required. Type of signal, for example, `SIGNAL_TYPE_IDLE`, 2838 // `SIGNAL_TYPE_HIGH_NUMBER_OF_TABLES`, etc. 2839 // 2840 // Possible values: 2841 // "SIGNAL_TYPE_UNSPECIFIED" - Unspecified. 2842 // "SIGNAL_TYPE_NOT_PROTECTED_BY_AUTOMATIC_FAILOVER" - Represents if a 2843 // resource is protected by automatic failover. Checks for resources that are 2844 // configured to have redundancy within a region that enables automatic 2845 // failover. 2846 // "SIGNAL_TYPE_GROUP_NOT_REPLICATING_ACROSS_REGIONS" - Represents if a group 2847 // is replicating across regions. Checks for resources that are configured to 2848 // have redundancy, and ongoing replication, across regions. 2849 // "SIGNAL_TYPE_NOT_AVAILABLE_IN_MULTIPLE_ZONES" - Represents if the resource 2850 // is available in multiple zones or not. 2851 // "SIGNAL_TYPE_NOT_AVAILABLE_IN_MULTIPLE_REGIONS" - Represents if a resource 2852 // is available in multiple regions. 2853 // "SIGNAL_TYPE_NO_PROMOTABLE_REPLICA" - Represents if a resource has a 2854 // promotable replica. 2855 // "SIGNAL_TYPE_NO_AUTOMATED_BACKUP_POLICY" - Represents if a resource has an 2856 // automated backup policy. 2857 // "SIGNAL_TYPE_SHORT_BACKUP_RETENTION" - Represents if a resources has a 2858 // short backup retention period. 2859 // "SIGNAL_TYPE_LAST_BACKUP_FAILED" - Represents if the last backup of a 2860 // resource failed. 2861 // "SIGNAL_TYPE_LAST_BACKUP_OLD" - Represents if the last backup of a 2862 // resource is older than some threshold value. 2863 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_2_0" - Represents if a resource 2864 // violates CIS GCP Foundation 2.0. 2865 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_3" - Represents if a resource 2866 // violates CIS GCP Foundation 1.3. 2867 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_2" - Represents if a resource 2868 // violates CIS GCP Foundation 1.2. 2869 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_1" - Represents if a resource 2870 // violates CIS GCP Foundation 1.1. 2871 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_0" - Represents if a resource 2872 // violates CIS GCP Foundation 1.0. 2873 // "SIGNAL_TYPE_VIOLATES_NIST_800_53" - Represents if a resource violates 2874 // NIST 800-53. 2875 // "SIGNAL_TYPE_VIOLATES_ISO_27001" - Represents if a resource violates 2876 // ISO-27001. 2877 // "SIGNAL_TYPE_VIOLATES_PCI_DSS_V3_2_1" - Represents if a resource violates 2878 // PCI-DSS v3.2.1. 2879 // "SIGNAL_TYPE_LOGS_NOT_OPTIMIZED_FOR_TROUBLESHOOTING" - Represents if 2880 // log_checkpoints database flag for a Cloud SQL for PostgreSQL instance is not 2881 // set to on. 2882 // "SIGNAL_TYPE_QUERY_DURATIONS_NOT_LOGGED" - Represents if the log_duration 2883 // database flag for a Cloud SQL for PostgreSQL instance is not set to on. 2884 // "SIGNAL_TYPE_VERBOSE_ERROR_LOGGING" - Represents if the 2885 // log_error_verbosity database flag for a Cloud SQL for PostgreSQL instance is 2886 // not set to default or stricter (default or terse). 2887 // "SIGNAL_TYPE_QUERY_LOCK_WAITS_NOT_LOGGED" - Represents if the 2888 // log_lock_waits database flag for a Cloud SQL for PostgreSQL instance is not 2889 // set to on. 2890 // "SIGNAL_TYPE_LOGGING_MOST_ERRORS" - Represents if the 2891 // log_min_error_statement database flag for a Cloud SQL for PostgreSQL 2892 // instance is not set appropriately. 2893 // "SIGNAL_TYPE_LOGGING_ONLY_CRITICAL_ERRORS" - Represents if the 2894 // log_min_error_statement database flag for a Cloud SQL for PostgreSQL 2895 // instance does not have an appropriate severity level. 2896 // "SIGNAL_TYPE_MINIMAL_ERROR_LOGGING" - Represents if the log_min_messages 2897 // database flag for a Cloud SQL for PostgreSQL instance is not set to warning 2898 // or another recommended value. 2899 // "SIGNAL_TYPE_QUERY_STATISTICS_LOGGED" - Represents if the databaseFlags 2900 // property of instance metadata for the log_executor_status field is set to 2901 // on. 2902 // "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_CLIENT_HOSTNAME" - Represents if the 2903 // log_hostname database flag for a Cloud SQL for PostgreSQL instance is not 2904 // set to off. 2905 // "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PARSER_STATISTICS" - Represents if the 2906 // log_parser_stats database flag for a Cloud SQL for PostgreSQL instance is 2907 // not set to off. 2908 // "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PLANNER_STATISTICS" - Represents if the 2909 // log_planner_stats database flag for a Cloud SQL for PostgreSQL instance is 2910 // not set to off. 2911 // "SIGNAL_TYPE_NOT_LOGGING_ONLY_DDL_STATEMENTS" - Represents if the 2912 // log_statement database flag for a Cloud SQL for PostgreSQL instance is not 2913 // set to DDL (all data definition statements). 2914 // "SIGNAL_TYPE_LOGGING_QUERY_STATISTICS" - Represents if the 2915 // log_statement_stats database flag for a Cloud SQL for PostgreSQL instance is 2916 // not set to off. 2917 // "SIGNAL_TYPE_NOT_LOGGING_TEMPORARY_FILES" - Represents if the 2918 // log_temp_files database flag for a Cloud SQL for PostgreSQL instance is not 2919 // set to "0". (NOTE: 0 = ON) 2920 // "SIGNAL_TYPE_CONNECTION_MAX_NOT_CONFIGURED" - Represents if the user 2921 // connections database flag for a Cloud SQL for SQL Server instance is 2922 // configured. 2923 // "SIGNAL_TYPE_USER_OPTIONS_CONFIGURED" - Represents if the user options 2924 // database flag for Cloud SQL SQL Server instance is configured or not. 2925 // "SIGNAL_TYPE_EXPOSED_TO_PUBLIC_ACCESS" - Represents if a resource is 2926 // exposed to public access. 2927 // "SIGNAL_TYPE_UNENCRYPTED_CONNECTIONS" - Represents if a resources requires 2928 // all incoming connections to use SSL or not. 2929 // "SIGNAL_TYPE_NO_ROOT_PASSWORD" - Represents if a Cloud SQL database has a 2930 // password configured for the root account or not. 2931 // "SIGNAL_TYPE_WEAK_ROOT_PASSWORD" - Represents if a Cloud SQL database has 2932 // a weak password configured for the root account. 2933 // "SIGNAL_TYPE_ENCRYPTION_KEY_NOT_CUSTOMER_MANAGED" - Represents if a SQL 2934 // database instance is not encrypted with customer-managed encryption keys 2935 // (CMEK). 2936 // "SIGNAL_TYPE_SERVER_AUTHENTICATION_NOT_REQUIRED" - Represents if The 2937 // contained database authentication database flag for a Cloud SQL for SQL 2938 // Server instance is not set to off. 2939 // "SIGNAL_TYPE_EXPOSED_BY_OWNERSHIP_CHAINING" - Represents if the 2940 // cross_db_ownership_chaining database flag for a Cloud SQL for SQL Server 2941 // instance is not set to off. 2942 // "SIGNAL_TYPE_EXPOSED_TO_EXTERNAL_SCRIPTS" - Represents if he external 2943 // scripts enabled database flag for a Cloud SQL for SQL Server instance is not 2944 // set to off. 2945 // "SIGNAL_TYPE_EXPOSED_TO_LOCAL_DATA_LOADS" - Represents if the local_infile 2946 // database flag for a Cloud SQL for MySQL instance is not set to off. 2947 // "SIGNAL_TYPE_CONNECTION_ATTEMPTS_NOT_LOGGED" - Represents if the 2948 // log_connections database flag for a Cloud SQL for PostgreSQL instance is not 2949 // set to on. 2950 // "SIGNAL_TYPE_DISCONNECTIONS_NOT_LOGGED" - Represents if the 2951 // log_disconnections database flag for a Cloud SQL for PostgreSQL instance is 2952 // not set to on. 2953 // "SIGNAL_TYPE_LOGGING_EXCESSIVE_STATEMENT_INFO" - Represents if the 2954 // log_min_duration_statement database flag for a Cloud SQL for PostgreSQL 2955 // instance is not set to -1. 2956 // "SIGNAL_TYPE_EXPOSED_TO_REMOTE_ACCESS" - Represents if the remote access 2957 // database flag for a Cloud SQL for SQL Server instance is not set to off. 2958 // "SIGNAL_TYPE_DATABASE_NAMES_EXPOSED" - Represents if the 2959 // skip_show_database database flag for a Cloud SQL for MySQL instance is not 2960 // set to on. 2961 // "SIGNAL_TYPE_SENSITIVE_TRACE_INFO_NOT_MASKED" - Represents if the 3625 2962 // (trace flag) database flag for a Cloud SQL for SQL Server instance is not 2963 // set to on. 2964 // "SIGNAL_TYPE_PUBLIC_IP_ENABLED" - Represents if public IP is enabled. 2965 // "SIGNAL_TYPE_IDLE" - Represents Idle instance helps to reduce costs. 2966 // "SIGNAL_TYPE_OVERPROVISIONED" - Represents instances that are 2967 // unnecessarily large for given workload. 2968 // "SIGNAL_TYPE_HIGH_NUMBER_OF_OPEN_TABLES" - Represents high number of 2969 // concurrently opened tables. 2970 // "SIGNAL_TYPE_HIGH_NUMBER_OF_TABLES" - Represents high table count close to 2971 // SLA limit. 2972 // "SIGNAL_TYPE_HIGH_TRANSACTION_ID_UTILIZATION" - Represents high number of 2973 // unvacuumed transactions 2974 // "SIGNAL_TYPE_UNDERPROVISIONED" - Represents need for more CPU and/or 2975 // memory 2976 // "SIGNAL_TYPE_OUT_OF_DISK" - Represents out of disk. 2977 // "SIGNAL_TYPE_SERVER_CERTIFICATE_NEAR_EXPIRY" - Represents server 2978 // certificate is near expiry. 2979 // "SIGNAL_TYPE_DATABASE_AUDITING_DISABLED" - Represents database auditing is 2980 // disabled. 2981 // "SIGNAL_TYPE_RESTRICT_AUTHORIZED_NETWORKS" - Represents not restricted to 2982 // authorized networks. 2983 // "SIGNAL_TYPE_VIOLATE_POLICY_RESTRICT_PUBLIC_IP" - Represents violate org 2984 // policy restrict public ip. 2985 // "SIGNAL_TYPE_QUOTA_LIMIT" - Cluster nearing quota limit 2986 // "SIGNAL_TYPE_NO_PASSWORD_POLICY" - No password policy set on resources 2987 // "SIGNAL_TYPE_CONNECTIONS_PERFORMANCE_IMPACT" - Performance impact of 2988 // connections settings 2989 // "SIGNAL_TYPE_TMP_TABLES_PERFORMANCE_IMPACT" - Performance impact of 2990 // temporary tables settings 2991 // "SIGNAL_TYPE_TRANS_LOGS_PERFORMANCE_IMPACT" - Performance impact of 2992 // transaction logs settings 2993 // "SIGNAL_TYPE_HIGH_JOINS_WITHOUT_INDEXES" - Performance impact of high 2994 // joins without indexes 2995 SignalType string `json:"signalType,omitempty"` 2996 // ForceSendFields is a list of field names (e.g. "AdditionalMetadata") to 2997 // unconditionally include in API requests. By default, fields with empty or 2998 // default values are omitted from API requests. See 2999 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3000 // details. 3001 ForceSendFields []string `json:"-"` 3002 // NullFields is a list of field names (e.g. "AdditionalMetadata") to include 3003 // in API requests with the JSON null value. By default, fields with empty 3004 // values are omitted from API requests. See 3005 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3006 NullFields []string `json:"-"` 3007 } 3008 3009 func (s *StorageDatabasecenterPartnerapiV1mainDatabaseResourceRecommendationSignalData) MarshalJSON() ([]byte, error) { 3010 type NoMethod StorageDatabasecenterPartnerapiV1mainDatabaseResourceRecommendationSignalData 3011 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3012 } 3013 3014 // StorageDatabasecenterPartnerapiV1mainEntitlement: Proto representing the 3015 // access that a user has to a specific feature/service. NextId: 3. 3016 type StorageDatabasecenterPartnerapiV1mainEntitlement struct { 3017 // EntitlementState: The current state of user's accessibility to a 3018 // feature/benefit. 3019 // 3020 // Possible values: 3021 // "ENTITLEMENT_STATE_UNSPECIFIED" 3022 // "ENTITLED" - User is entitled to a feature/benefit, but whether it has 3023 // been successfully provisioned is decided by provisioning state. 3024 // "REVOKED" - User is entitled to a feature/benefit, but it was requested to 3025 // be revoked. Whether the revoke has been successful is decided by 3026 // provisioning state. 3027 EntitlementState string `json:"entitlementState,omitempty"` 3028 // Type: An enum that represents the type of this entitlement. 3029 // 3030 // Possible values: 3031 // "ENTITLEMENT_TYPE_UNSPECIFIED" 3032 // "GEMINI" - The root entitlement representing Gemini package ownership. 3033 Type string `json:"type,omitempty"` 3034 // ForceSendFields is a list of field names (e.g. "EntitlementState") to 3035 // unconditionally include in API requests. By default, fields with empty or 3036 // default values are omitted from API requests. See 3037 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3038 // details. 3039 ForceSendFields []string `json:"-"` 3040 // NullFields is a list of field names (e.g. "EntitlementState") to include in 3041 // API requests with the JSON null value. By default, fields with empty values 3042 // are omitted from API requests. See 3043 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3044 NullFields []string `json:"-"` 3045 } 3046 3047 func (s *StorageDatabasecenterPartnerapiV1mainEntitlement) MarshalJSON() ([]byte, error) { 3048 type NoMethod StorageDatabasecenterPartnerapiV1mainEntitlement 3049 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3050 } 3051 3052 // StorageDatabasecenterPartnerapiV1mainOperationError: An error that occurred 3053 // during a backup creation operation. 3054 type StorageDatabasecenterPartnerapiV1mainOperationError struct { 3055 // Code: Identifies the specific error that occurred. REQUIRED 3056 Code string `json:"code,omitempty"` 3057 // Possible values: 3058 // "OPERATION_ERROR_TYPE_UNSPECIFIED" - UNSPECIFIED means product type is not 3059 // known or available. 3060 // "KMS_KEY_ERROR" - key destroyed, expired, not found, unreachable or 3061 // permission denied. 3062 // "DATABASE_ERROR" - Database is not accessible 3063 // "STOCKOUT_ERROR" - The zone or region does not have sufficient resources 3064 // to handle the request at the moment 3065 // "CANCELLATION_ERROR" - User initiated cancellation 3066 // "SQLSERVER_ERROR" - SQL server specific error 3067 // "INTERNAL_ERROR" - Any other internal error. 3068 ErrorType string `json:"errorType,omitempty"` 3069 // Message: Additional information about the error encountered. REQUIRED 3070 Message string `json:"message,omitempty"` 3071 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 3072 // include in API requests. By default, fields with empty or default values are 3073 // omitted from API requests. See 3074 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3075 // details. 3076 ForceSendFields []string `json:"-"` 3077 // NullFields is a list of field names (e.g. "Code") to include in API requests 3078 // with the JSON null value. By default, fields with empty values are omitted 3079 // from API requests. See 3080 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3081 NullFields []string `json:"-"` 3082 } 3083 3084 func (s *StorageDatabasecenterPartnerapiV1mainOperationError) MarshalJSON() ([]byte, error) { 3085 type NoMethod StorageDatabasecenterPartnerapiV1mainOperationError 3086 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3087 } 3088 3089 type StorageDatabasecenterPartnerapiV1mainRetentionSettings struct { 3090 QuantityBasedRetention int64 `json:"quantityBasedRetention,omitempty"` 3091 // RetentionUnit: The unit that 'retained_backups' represents. 3092 // 3093 // Possible values: 3094 // "RETENTION_UNIT_UNSPECIFIED" - Backup retention unit is unspecified, will 3095 // be treated as COUNT. 3096 // "COUNT" - Retention will be by count, eg. "retain the most recent 7 3097 // backups". 3098 // "TIME" - Retention will be by Time, eg. "retain the last 7 days backups". 3099 // "RETENTION_UNIT_OTHER" - For rest of the other category 3100 RetentionUnit string `json:"retentionUnit,omitempty"` 3101 TimeBasedRetention string `json:"timeBasedRetention,omitempty"` 3102 // ForceSendFields is a list of field names (e.g. "QuantityBasedRetention") to 3103 // unconditionally include in API requests. By default, fields with empty or 3104 // default values are omitted from API requests. See 3105 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3106 // details. 3107 ForceSendFields []string `json:"-"` 3108 // NullFields is a list of field names (e.g. "QuantityBasedRetention") to 3109 // include in API requests with the JSON null value. By default, fields with 3110 // empty values are omitted from API requests. See 3111 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3112 NullFields []string `json:"-"` 3113 } 3114 3115 func (s *StorageDatabasecenterPartnerapiV1mainRetentionSettings) MarshalJSON() ([]byte, error) { 3116 type NoMethod StorageDatabasecenterPartnerapiV1mainRetentionSettings 3117 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3118 } 3119 3120 // StorageDatabasecenterPartnerapiV1mainUserLabels: Message type for storing 3121 // user labels. User labels are used to tag App Engine resources, allowing 3122 // users to search for resources matching a set of labels and to aggregate 3123 // usage data by labels. 3124 type StorageDatabasecenterPartnerapiV1mainUserLabels struct { 3125 Labels map[string]string `json:"labels,omitempty"` 3126 // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally 3127 // include in API requests. By default, fields with empty or default values are 3128 // omitted from API requests. See 3129 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3130 // details. 3131 ForceSendFields []string `json:"-"` 3132 // NullFields is a list of field names (e.g. "Labels") to include in API 3133 // requests with the JSON null value. By default, fields with empty values are 3134 // omitted from API requests. See 3135 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3136 NullFields []string `json:"-"` 3137 } 3138 3139 func (s *StorageDatabasecenterPartnerapiV1mainUserLabels) MarshalJSON() ([]byte, error) { 3140 type NoMethod StorageDatabasecenterPartnerapiV1mainUserLabels 3141 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3142 } 3143 3144 // StorageDatabasecenterProtoCommonProduct: Product specification for Condor 3145 // resources. 3146 type StorageDatabasecenterProtoCommonProduct struct { 3147 // Engine: The specific engine that the underlying database is running. 3148 // 3149 // Possible values: 3150 // "ENGINE_UNSPECIFIED" - UNSPECIFIED means engine type is not known or 3151 // available. 3152 // "ENGINE_MYSQL" - MySQL binary running as an engine in the database 3153 // instance. 3154 // "MYSQL" - MySQL binary running as engine in database instance. 3155 // "ENGINE_POSTGRES" - Postgres binary running as engine in database 3156 // instance. 3157 // "POSTGRES" - Postgres binary running as engine in database instance. 3158 // "ENGINE_SQL_SERVER" - SQLServer binary running as engine in database 3159 // instance. 3160 // "SQL_SERVER" - SQLServer binary running as engine in database instance. 3161 // "ENGINE_NATIVE" - Native database binary running as engine in instance. 3162 // "NATIVE" - Native database binary running as engine in instance. 3163 // "ENGINE_CLOUD_SPANNER_WITH_POSTGRES_DIALECT" - Cloud Spanner with 3164 // PostgreSQL dialect. 3165 // "ENGINE_CLOUD_SPANNER_WITH_GOOGLESQL_DIALECT" - Cloud Spanner with Google 3166 // SQL dialect. 3167 // "ENGINE_MEMORYSTORE_FOR_REDIS" - Memorystore with Redis dialect. 3168 // "ENGINE_MEMORYSTORE_FOR_REDIS_CLUSTER" - Memorystore with Redis cluster 3169 // dialect. 3170 // "ENGINE_OTHER" - Other refers to rest of other database engine. This is to 3171 // be when engine is known, but it is not present in this enum. 3172 Engine string `json:"engine,omitempty"` 3173 // Type: Type of specific database product. It could be CloudSQL, AlloyDB etc.. 3174 // 3175 // Possible values: 3176 // "PRODUCT_TYPE_UNSPECIFIED" - UNSPECIFIED means product type is not known 3177 // or available. 3178 // "PRODUCT_TYPE_CLOUD_SQL" - Cloud SQL product area in GCP 3179 // "CLOUD_SQL" - Cloud SQL product area in GCP 3180 // "PRODUCT_TYPE_ALLOYDB" - AlloyDB product area in GCP 3181 // "ALLOYDB" - AlloyDB product area in GCP 3182 // "PRODUCT_TYPE_SPANNER" - Spanner product area in GCP 3183 // "PRODUCT_TYPE_ON_PREM" - On premises database product. 3184 // "ON_PREM" - On premises database product. 3185 // "PRODUCT_TYPE_MEMORYSTORE" - Memorystore product area in GCP 3186 // "PRODUCT_TYPE_BIGTABLE" - Bigtable product area in GCP 3187 // "PRODUCT_TYPE_OTHER" - Other refers to rest of other product type. This is 3188 // to be when product type is known, but it is not present in this enum. 3189 Type string `json:"type,omitempty"` 3190 // Version: Version of the underlying database engine. Example values: For 3191 // MySQL, it could be "8.0", "5.7" etc.. For Postgres, it could be "14", "15" 3192 // etc.. 3193 Version string `json:"version,omitempty"` 3194 // ForceSendFields is a list of field names (e.g. "Engine") to unconditionally 3195 // include in API requests. By default, fields with empty or default values are 3196 // omitted from API requests. See 3197 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3198 // details. 3199 ForceSendFields []string `json:"-"` 3200 // NullFields is a list of field names (e.g. "Engine") to include in API 3201 // requests with the JSON null value. By default, fields with empty values are 3202 // omitted from API requests. See 3203 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3204 NullFields []string `json:"-"` 3205 } 3206 3207 func (s *StorageDatabasecenterProtoCommonProduct) MarshalJSON() ([]byte, error) { 3208 type NoMethod StorageDatabasecenterProtoCommonProduct 3209 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3210 } 3211 3212 // StringRestrictions: Restrictions on STRING type values 3213 type StringRestrictions struct { 3214 // AllowedValues: The list of allowed values, if bounded. This field will be 3215 // empty if there is a unbounded number of allowed values. 3216 AllowedValues []string `json:"allowedValues,omitempty"` 3217 // ForceSendFields is a list of field names (e.g. "AllowedValues") to 3218 // unconditionally include in API requests. By default, fields with empty or 3219 // default values are omitted from API requests. See 3220 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3221 // details. 3222 ForceSendFields []string `json:"-"` 3223 // NullFields is a list of field names (e.g. "AllowedValues") to include in API 3224 // requests with the JSON null value. By default, fields with empty values are 3225 // omitted from API requests. See 3226 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3227 NullFields []string `json:"-"` 3228 } 3229 3230 func (s *StringRestrictions) MarshalJSON() ([]byte, error) { 3231 type NoMethod StringRestrictions 3232 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3233 } 3234 3235 // SupportedDatabaseFlag: SupportedDatabaseFlag gives general information about 3236 // a database flag, like type and allowed values. This is a static value that 3237 // is defined on the server side, and it cannot be modified by callers. To set 3238 // the Database flags on a particular Instance, a caller should modify the 3239 // Instance.database_flags field. 3240 type SupportedDatabaseFlag struct { 3241 // AcceptsMultipleValues: Whether the database flag accepts multiple values. If 3242 // true, a comma-separated list of stringified values may be specified. 3243 AcceptsMultipleValues bool `json:"acceptsMultipleValues,omitempty"` 3244 // FlagName: The name of the database flag, e.g. "max_allowed_packets". The is 3245 // a possibly key for the Instance.database_flags map field. 3246 FlagName string `json:"flagName,omitempty"` 3247 // IntegerRestrictions: Restriction on INTEGER type value. 3248 IntegerRestrictions *IntegerRestrictions `json:"integerRestrictions,omitempty"` 3249 // Name: The name of the flag resource, following Google Cloud conventions, 3250 // e.g.: * projects/{project}/locations/{location}/flags/{flag} This field 3251 // currently has no semantic meaning. 3252 Name string `json:"name,omitempty"` 3253 // RequiresDbRestart: Whether setting or updating this flag on an Instance 3254 // requires a database restart. If a flag that requires database restart is 3255 // set, the backend will automatically restart the database (making sure to 3256 // satisfy any availability SLO's). 3257 RequiresDbRestart bool `json:"requiresDbRestart,omitempty"` 3258 // StringRestrictions: Restriction on STRING type value. 3259 StringRestrictions *StringRestrictions `json:"stringRestrictions,omitempty"` 3260 // SupportedDbVersions: Major database engine versions for which this flag is 3261 // supported. 3262 // 3263 // Possible values: 3264 // "DATABASE_VERSION_UNSPECIFIED" - This is an unknown database version. 3265 // "POSTGRES_13" - DEPRECATED - The database version is Postgres 13. 3266 // "POSTGRES_14" - The database version is Postgres 14. 3267 // "POSTGRES_15" - The database version is Postgres 15. 3268 SupportedDbVersions []string `json:"supportedDbVersions,omitempty"` 3269 // Possible values: 3270 // "VALUE_TYPE_UNSPECIFIED" - This is an unknown flag type. 3271 // "STRING" - String type flag. 3272 // "INTEGER" - Integer type flag. 3273 // "FLOAT" - Float type flag. 3274 // "NONE" - Denotes that the flag does not accept any values. 3275 ValueType string `json:"valueType,omitempty"` 3276 // ForceSendFields is a list of field names (e.g. "AcceptsMultipleValues") to 3277 // unconditionally include in API requests. By default, fields with empty or 3278 // default values are omitted from API requests. See 3279 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3280 // details. 3281 ForceSendFields []string `json:"-"` 3282 // NullFields is a list of field names (e.g. "AcceptsMultipleValues") to 3283 // include in API requests with the JSON null value. By default, fields with 3284 // empty values are omitted from API requests. See 3285 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3286 NullFields []string `json:"-"` 3287 } 3288 3289 func (s *SupportedDatabaseFlag) MarshalJSON() ([]byte, error) { 3290 type NoMethod SupportedDatabaseFlag 3291 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3292 } 3293 3294 // TimeBasedRetention: A time based retention policy specifies that all backups 3295 // within a certain time period should be retained. 3296 type TimeBasedRetention struct { 3297 // RetentionPeriod: The retention period. 3298 RetentionPeriod string `json:"retentionPeriod,omitempty"` 3299 // ForceSendFields is a list of field names (e.g. "RetentionPeriod") to 3300 // unconditionally include in API requests. By default, fields with empty or 3301 // default values are omitted from API requests. See 3302 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3303 // details. 3304 ForceSendFields []string `json:"-"` 3305 // NullFields is a list of field names (e.g. "RetentionPeriod") to include in 3306 // API requests with the JSON null value. By default, fields with empty values 3307 // are omitted from API requests. See 3308 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3309 NullFields []string `json:"-"` 3310 } 3311 3312 func (s *TimeBasedRetention) MarshalJSON() ([]byte, error) { 3313 type NoMethod TimeBasedRetention 3314 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3315 } 3316 3317 // User: Message describing User object. 3318 type User struct { 3319 // DatabaseRoles: Optional. List of database roles this user has. The database 3320 // role strings are subject to the PostgreSQL naming conventions. 3321 DatabaseRoles []string `json:"databaseRoles,omitempty"` 3322 // Name: Output only. Name of the resource in the form of 3323 // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. 3324 Name string `json:"name,omitempty"` 3325 // Password: Input only. Password for the user. 3326 Password string `json:"password,omitempty"` 3327 // UserType: Optional. Type of this user. 3328 // 3329 // Possible values: 3330 // "USER_TYPE_UNSPECIFIED" - Unspecified user type. 3331 // "ALLOYDB_BUILT_IN" - The default user type that authenticates via 3332 // password-based authentication. 3333 // "ALLOYDB_IAM_USER" - Database user that can authenticate via IAM-Based 3334 // authentication. 3335 UserType string `json:"userType,omitempty"` 3336 3337 // ServerResponse contains the HTTP response code and headers from the server. 3338 googleapi.ServerResponse `json:"-"` 3339 // ForceSendFields is a list of field names (e.g. "DatabaseRoles") to 3340 // unconditionally include in API requests. By default, fields with empty or 3341 // default values are omitted from API requests. See 3342 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3343 // details. 3344 ForceSendFields []string `json:"-"` 3345 // NullFields is a list of field names (e.g. "DatabaseRoles") to include in API 3346 // requests with the JSON null value. By default, fields with empty values are 3347 // omitted from API requests. See 3348 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3349 NullFields []string `json:"-"` 3350 } 3351 3352 func (s *User) MarshalJSON() ([]byte, error) { 3353 type NoMethod User 3354 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3355 } 3356 3357 // UserPassword: The username/password for a database user. Used for specifying 3358 // initial users at cluster creation time. 3359 type UserPassword struct { 3360 // Password: The initial password for the user. 3361 Password string `json:"password,omitempty"` 3362 // User: The database username. 3363 User string `json:"user,omitempty"` 3364 // ForceSendFields is a list of field names (e.g. "Password") to 3365 // unconditionally include in API requests. By default, fields with empty or 3366 // default values are omitted from API requests. See 3367 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3368 // details. 3369 ForceSendFields []string `json:"-"` 3370 // NullFields is a list of field names (e.g. "Password") to include in API 3371 // requests with the JSON null value. By default, fields with empty values are 3372 // omitted from API requests. See 3373 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3374 NullFields []string `json:"-"` 3375 } 3376 3377 func (s *UserPassword) MarshalJSON() ([]byte, error) { 3378 type NoMethod UserPassword 3379 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3380 } 3381 3382 // WeeklySchedule: A weekly schedule starts a backup at prescribed start times 3383 // within a day, for the specified days of the week. The weekly schedule 3384 // message is flexible and can be used to create many types of schedules. For 3385 // example, to have a daily backup that starts at 22:00, configure the 3386 // `start_times` field to have one element "22:00" and the `days_of_week` field 3387 // to have all seven days of the week. 3388 type WeeklySchedule struct { 3389 // DaysOfWeek: The days of the week to perform a backup. If this field is left 3390 // empty, the default of every day of the week is used. 3391 // 3392 // Possible values: 3393 // "DAY_OF_WEEK_UNSPECIFIED" - The day of the week is unspecified. 3394 // "MONDAY" - Monday 3395 // "TUESDAY" - Tuesday 3396 // "WEDNESDAY" - Wednesday 3397 // "THURSDAY" - Thursday 3398 // "FRIDAY" - Friday 3399 // "SATURDAY" - Saturday 3400 // "SUNDAY" - Sunday 3401 DaysOfWeek []string `json:"daysOfWeek,omitempty"` 3402 // StartTimes: The times during the day to start a backup. The start times are 3403 // assumed to be in UTC and to be an exact hour (e.g., 04:00:00). If no start 3404 // times are provided, a single fixed start time is chosen arbitrarily. 3405 StartTimes []*GoogleTypeTimeOfDay `json:"startTimes,omitempty"` 3406 // ForceSendFields is a list of field names (e.g. "DaysOfWeek") to 3407 // unconditionally include in API requests. By default, fields with empty or 3408 // default values are omitted from API requests. See 3409 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3410 // details. 3411 ForceSendFields []string `json:"-"` 3412 // NullFields is a list of field names (e.g. "DaysOfWeek") to include in API 3413 // requests with the JSON null value. By default, fields with empty values are 3414 // omitted from API requests. See 3415 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3416 NullFields []string `json:"-"` 3417 } 3418 3419 func (s *WeeklySchedule) MarshalJSON() ([]byte, error) { 3420 type NoMethod WeeklySchedule 3421 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3422 } 3423 3424 type ProjectsLocationsGetCall struct { 3425 s *Service 3426 name string 3427 urlParams_ gensupport.URLParams 3428 ifNoneMatch_ string 3429 ctx_ context.Context 3430 header_ http.Header 3431 } 3432 3433 // Get: Gets information about a location. 3434 // 3435 // - name: Resource name for the location. 3436 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { 3437 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3438 c.name = name 3439 return c 3440 } 3441 3442 // Fields allows partial responses to be retrieved. See 3443 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3444 // details. 3445 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { 3446 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3447 return c 3448 } 3449 3450 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3451 // object's ETag matches the given value. This is useful for getting updates 3452 // only after the object has changed since the last request. 3453 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { 3454 c.ifNoneMatch_ = entityTag 3455 return c 3456 } 3457 3458 // Context sets the context to be used in this call's Do method. 3459 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { 3460 c.ctx_ = ctx 3461 return c 3462 } 3463 3464 // Header returns a http.Header that can be modified by the caller to add 3465 // headers to the request. 3466 func (c *ProjectsLocationsGetCall) Header() http.Header { 3467 if c.header_ == nil { 3468 c.header_ = make(http.Header) 3469 } 3470 return c.header_ 3471 } 3472 3473 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { 3474 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3475 if c.ifNoneMatch_ != "" { 3476 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3477 } 3478 var body io.Reader = nil 3479 c.urlParams_.Set("alt", alt) 3480 c.urlParams_.Set("prettyPrint", "false") 3481 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3482 urls += "?" + c.urlParams_.Encode() 3483 req, err := http.NewRequest("GET", urls, body) 3484 if err != nil { 3485 return nil, err 3486 } 3487 req.Header = reqHeaders 3488 googleapi.Expand(req.URL, map[string]string{ 3489 "name": c.name, 3490 }) 3491 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3492 } 3493 3494 // Do executes the "alloydb.projects.locations.get" call. 3495 // Any non-2xx status code is an error. Response headers are in either 3496 // *GoogleCloudLocationLocation.ServerResponse.Header or (if a response was 3497 // returned at all) in error.(*googleapi.Error).Header. Use 3498 // googleapi.IsNotModified to check whether the returned error was because 3499 // http.StatusNotModified was returned. 3500 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudLocationLocation, error) { 3501 gensupport.SetOptions(c.urlParams_, opts...) 3502 res, err := c.doRequest("json") 3503 if res != nil && res.StatusCode == http.StatusNotModified { 3504 if res.Body != nil { 3505 res.Body.Close() 3506 } 3507 return nil, gensupport.WrapError(&googleapi.Error{ 3508 Code: res.StatusCode, 3509 Header: res.Header, 3510 }) 3511 } 3512 if err != nil { 3513 return nil, err 3514 } 3515 defer googleapi.CloseBody(res) 3516 if err := googleapi.CheckResponse(res); err != nil { 3517 return nil, gensupport.WrapError(err) 3518 } 3519 ret := &GoogleCloudLocationLocation{ 3520 ServerResponse: googleapi.ServerResponse{ 3521 Header: res.Header, 3522 HTTPStatusCode: res.StatusCode, 3523 }, 3524 } 3525 target := &ret 3526 if err := gensupport.DecodeResponse(target, res); err != nil { 3527 return nil, err 3528 } 3529 return ret, nil 3530 } 3531 3532 type ProjectsLocationsListCall struct { 3533 s *Service 3534 name string 3535 urlParams_ gensupport.URLParams 3536 ifNoneMatch_ string 3537 ctx_ context.Context 3538 header_ http.Header 3539 } 3540 3541 // List: Lists information about the supported locations for this service. 3542 // 3543 // - name: The resource that owns the locations collection, if applicable. 3544 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { 3545 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3546 c.name = name 3547 return c 3548 } 3549 3550 // Filter sets the optional parameter "filter": A filter to narrow down results 3551 // to a preferred subset. The filtering language accepts strings like 3552 // "displayName=tokyo", and is documented in more detail in AIP-160 3553 // (https://google.aip.dev/160). 3554 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { 3555 c.urlParams_.Set("filter", filter) 3556 return c 3557 } 3558 3559 // PageSize sets the optional parameter "pageSize": The maximum number of 3560 // results to return. If not set, the service selects a default. 3561 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { 3562 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3563 return c 3564 } 3565 3566 // PageToken sets the optional parameter "pageToken": A page token received 3567 // from the `next_page_token` field in the response. Send that page token to 3568 // receive the subsequent page. 3569 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { 3570 c.urlParams_.Set("pageToken", pageToken) 3571 return c 3572 } 3573 3574 // Fields allows partial responses to be retrieved. See 3575 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3576 // details. 3577 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { 3578 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3579 return c 3580 } 3581 3582 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3583 // object's ETag matches the given value. This is useful for getting updates 3584 // only after the object has changed since the last request. 3585 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { 3586 c.ifNoneMatch_ = entityTag 3587 return c 3588 } 3589 3590 // Context sets the context to be used in this call's Do method. 3591 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { 3592 c.ctx_ = ctx 3593 return c 3594 } 3595 3596 // Header returns a http.Header that can be modified by the caller to add 3597 // headers to the request. 3598 func (c *ProjectsLocationsListCall) Header() http.Header { 3599 if c.header_ == nil { 3600 c.header_ = make(http.Header) 3601 } 3602 return c.header_ 3603 } 3604 3605 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { 3606 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3607 if c.ifNoneMatch_ != "" { 3608 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3609 } 3610 var body io.Reader = nil 3611 c.urlParams_.Set("alt", alt) 3612 c.urlParams_.Set("prettyPrint", "false") 3613 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") 3614 urls += "?" + c.urlParams_.Encode() 3615 req, err := http.NewRequest("GET", urls, body) 3616 if err != nil { 3617 return nil, err 3618 } 3619 req.Header = reqHeaders 3620 googleapi.Expand(req.URL, map[string]string{ 3621 "name": c.name, 3622 }) 3623 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3624 } 3625 3626 // Do executes the "alloydb.projects.locations.list" call. 3627 // Any non-2xx status code is an error. Response headers are in either 3628 // *GoogleCloudLocationListLocationsResponse.ServerResponse.Header or (if a 3629 // response was returned at all) in error.(*googleapi.Error).Header. Use 3630 // googleapi.IsNotModified to check whether the returned error was because 3631 // http.StatusNotModified was returned. 3632 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudLocationListLocationsResponse, error) { 3633 gensupport.SetOptions(c.urlParams_, opts...) 3634 res, err := c.doRequest("json") 3635 if res != nil && res.StatusCode == http.StatusNotModified { 3636 if res.Body != nil { 3637 res.Body.Close() 3638 } 3639 return nil, gensupport.WrapError(&googleapi.Error{ 3640 Code: res.StatusCode, 3641 Header: res.Header, 3642 }) 3643 } 3644 if err != nil { 3645 return nil, err 3646 } 3647 defer googleapi.CloseBody(res) 3648 if err := googleapi.CheckResponse(res); err != nil { 3649 return nil, gensupport.WrapError(err) 3650 } 3651 ret := &GoogleCloudLocationListLocationsResponse{ 3652 ServerResponse: googleapi.ServerResponse{ 3653 Header: res.Header, 3654 HTTPStatusCode: res.StatusCode, 3655 }, 3656 } 3657 target := &ret 3658 if err := gensupport.DecodeResponse(target, res); err != nil { 3659 return nil, err 3660 } 3661 return ret, nil 3662 } 3663 3664 // Pages invokes f for each page of results. 3665 // A non-nil error returned from f will halt the iteration. 3666 // The provided context supersedes any context provided to the Context method. 3667 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*GoogleCloudLocationListLocationsResponse) error) error { 3668 c.ctx_ = ctx 3669 defer c.PageToken(c.urlParams_.Get("pageToken")) 3670 for { 3671 x, err := c.Do() 3672 if err != nil { 3673 return err 3674 } 3675 if err := f(x); err != nil { 3676 return err 3677 } 3678 if x.NextPageToken == "" { 3679 return nil 3680 } 3681 c.PageToken(x.NextPageToken) 3682 } 3683 } 3684 3685 type ProjectsLocationsBackupsCreateCall struct { 3686 s *Service 3687 parent string 3688 backup *Backup 3689 urlParams_ gensupport.URLParams 3690 ctx_ context.Context 3691 header_ http.Header 3692 } 3693 3694 // Create: Creates a new Backup in a given project and location. 3695 // 3696 // - parent: Value for parent. 3697 func (r *ProjectsLocationsBackupsService) Create(parent string, backup *Backup) *ProjectsLocationsBackupsCreateCall { 3698 c := &ProjectsLocationsBackupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3699 c.parent = parent 3700 c.backup = backup 3701 return c 3702 } 3703 3704 // BackupId sets the optional parameter "backupId": Required. ID of the 3705 // requesting object. 3706 func (c *ProjectsLocationsBackupsCreateCall) BackupId(backupId string) *ProjectsLocationsBackupsCreateCall { 3707 c.urlParams_.Set("backupId", backupId) 3708 return c 3709 } 3710 3711 // RequestId sets the optional parameter "requestId": An optional request ID to 3712 // identify requests. Specify a unique request ID so that if you must retry 3713 // your request, the server will know to ignore the request if it has already 3714 // been completed. The server will guarantee that for at least 60 minutes since 3715 // the first request. For example, consider a situation where you make an 3716 // initial request and the request times out. If you make the request again 3717 // with the same request ID, the server can check if original operation with 3718 // the same request ID was received, and if so, will ignore the second request. 3719 // This prevents clients from accidentally creating duplicate commitments. The 3720 // request ID must be a valid UUID with the exception that zero UUID is not 3721 // supported (00000000-0000-0000-0000-000000000000). 3722 func (c *ProjectsLocationsBackupsCreateCall) RequestId(requestId string) *ProjectsLocationsBackupsCreateCall { 3723 c.urlParams_.Set("requestId", requestId) 3724 return c 3725 } 3726 3727 // ValidateOnly sets the optional parameter "validateOnly": If set, the backend 3728 // validates the request, but doesn't actually execute it. 3729 func (c *ProjectsLocationsBackupsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsBackupsCreateCall { 3730 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 3731 return c 3732 } 3733 3734 // Fields allows partial responses to be retrieved. See 3735 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3736 // details. 3737 func (c *ProjectsLocationsBackupsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupsCreateCall { 3738 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3739 return c 3740 } 3741 3742 // Context sets the context to be used in this call's Do method. 3743 func (c *ProjectsLocationsBackupsCreateCall) Context(ctx context.Context) *ProjectsLocationsBackupsCreateCall { 3744 c.ctx_ = ctx 3745 return c 3746 } 3747 3748 // Header returns a http.Header that can be modified by the caller to add 3749 // headers to the request. 3750 func (c *ProjectsLocationsBackupsCreateCall) Header() http.Header { 3751 if c.header_ == nil { 3752 c.header_ = make(http.Header) 3753 } 3754 return c.header_ 3755 } 3756 3757 func (c *ProjectsLocationsBackupsCreateCall) doRequest(alt string) (*http.Response, error) { 3758 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3759 var body io.Reader = nil 3760 body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) 3761 if err != nil { 3762 return nil, err 3763 } 3764 c.urlParams_.Set("alt", alt) 3765 c.urlParams_.Set("prettyPrint", "false") 3766 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups") 3767 urls += "?" + c.urlParams_.Encode() 3768 req, err := http.NewRequest("POST", urls, body) 3769 if err != nil { 3770 return nil, err 3771 } 3772 req.Header = reqHeaders 3773 googleapi.Expand(req.URL, map[string]string{ 3774 "parent": c.parent, 3775 }) 3776 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3777 } 3778 3779 // Do executes the "alloydb.projects.locations.backups.create" call. 3780 // Any non-2xx status code is an error. Response headers are in either 3781 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3782 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3783 // whether the returned error was because http.StatusNotModified was returned. 3784 func (c *ProjectsLocationsBackupsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3785 gensupport.SetOptions(c.urlParams_, opts...) 3786 res, err := c.doRequest("json") 3787 if res != nil && res.StatusCode == http.StatusNotModified { 3788 if res.Body != nil { 3789 res.Body.Close() 3790 } 3791 return nil, gensupport.WrapError(&googleapi.Error{ 3792 Code: res.StatusCode, 3793 Header: res.Header, 3794 }) 3795 } 3796 if err != nil { 3797 return nil, err 3798 } 3799 defer googleapi.CloseBody(res) 3800 if err := googleapi.CheckResponse(res); err != nil { 3801 return nil, gensupport.WrapError(err) 3802 } 3803 ret := &Operation{ 3804 ServerResponse: googleapi.ServerResponse{ 3805 Header: res.Header, 3806 HTTPStatusCode: res.StatusCode, 3807 }, 3808 } 3809 target := &ret 3810 if err := gensupport.DecodeResponse(target, res); err != nil { 3811 return nil, err 3812 } 3813 return ret, nil 3814 } 3815 3816 type ProjectsLocationsBackupsDeleteCall struct { 3817 s *Service 3818 name string 3819 urlParams_ gensupport.URLParams 3820 ctx_ context.Context 3821 header_ http.Header 3822 } 3823 3824 // Delete: Deletes a single Backup. 3825 // 3826 // - name: Name of the resource. For the required format, see the comment on 3827 // the Backup.name field. 3828 func (r *ProjectsLocationsBackupsService) Delete(name string) *ProjectsLocationsBackupsDeleteCall { 3829 c := &ProjectsLocationsBackupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3830 c.name = name 3831 return c 3832 } 3833 3834 // Etag sets the optional parameter "etag": The current etag of the Backup. If 3835 // an etag is provided and does not match the current etag of the Backup, 3836 // deletion will be blocked and an ABORTED error will be returned. 3837 func (c *ProjectsLocationsBackupsDeleteCall) Etag(etag string) *ProjectsLocationsBackupsDeleteCall { 3838 c.urlParams_.Set("etag", etag) 3839 return c 3840 } 3841 3842 // RequestId sets the optional parameter "requestId": An optional request ID to 3843 // identify requests. Specify a unique request ID so that if you must retry 3844 // your request, the server will know to ignore the request if it has already 3845 // been completed. The server will guarantee that for at least 60 minutes after 3846 // the first request. For example, consider a situation where you make an 3847 // initial request and the request times out. If you make the request again 3848 // with the same request ID, the server can check if original operation with 3849 // the same request ID was received, and if so, will ignore the second request. 3850 // This prevents clients from accidentally creating duplicate commitments. The 3851 // request ID must be a valid UUID with the exception that zero UUID is not 3852 // supported (00000000-0000-0000-0000-000000000000). 3853 func (c *ProjectsLocationsBackupsDeleteCall) RequestId(requestId string) *ProjectsLocationsBackupsDeleteCall { 3854 c.urlParams_.Set("requestId", requestId) 3855 return c 3856 } 3857 3858 // ValidateOnly sets the optional parameter "validateOnly": If set, the backend 3859 // validates the request, but doesn't actually execute it. 3860 func (c *ProjectsLocationsBackupsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsBackupsDeleteCall { 3861 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 3862 return c 3863 } 3864 3865 // Fields allows partial responses to be retrieved. See 3866 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3867 // details. 3868 func (c *ProjectsLocationsBackupsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupsDeleteCall { 3869 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3870 return c 3871 } 3872 3873 // Context sets the context to be used in this call's Do method. 3874 func (c *ProjectsLocationsBackupsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBackupsDeleteCall { 3875 c.ctx_ = ctx 3876 return c 3877 } 3878 3879 // Header returns a http.Header that can be modified by the caller to add 3880 // headers to the request. 3881 func (c *ProjectsLocationsBackupsDeleteCall) Header() http.Header { 3882 if c.header_ == nil { 3883 c.header_ = make(http.Header) 3884 } 3885 return c.header_ 3886 } 3887 3888 func (c *ProjectsLocationsBackupsDeleteCall) doRequest(alt string) (*http.Response, error) { 3889 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3890 var body io.Reader = nil 3891 c.urlParams_.Set("alt", alt) 3892 c.urlParams_.Set("prettyPrint", "false") 3893 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3894 urls += "?" + c.urlParams_.Encode() 3895 req, err := http.NewRequest("DELETE", urls, body) 3896 if err != nil { 3897 return nil, err 3898 } 3899 req.Header = reqHeaders 3900 googleapi.Expand(req.URL, map[string]string{ 3901 "name": c.name, 3902 }) 3903 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3904 } 3905 3906 // Do executes the "alloydb.projects.locations.backups.delete" call. 3907 // Any non-2xx status code is an error. Response headers are in either 3908 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3909 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3910 // whether the returned error was because http.StatusNotModified was returned. 3911 func (c *ProjectsLocationsBackupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3912 gensupport.SetOptions(c.urlParams_, opts...) 3913 res, err := c.doRequest("json") 3914 if res != nil && res.StatusCode == http.StatusNotModified { 3915 if res.Body != nil { 3916 res.Body.Close() 3917 } 3918 return nil, gensupport.WrapError(&googleapi.Error{ 3919 Code: res.StatusCode, 3920 Header: res.Header, 3921 }) 3922 } 3923 if err != nil { 3924 return nil, err 3925 } 3926 defer googleapi.CloseBody(res) 3927 if err := googleapi.CheckResponse(res); err != nil { 3928 return nil, gensupport.WrapError(err) 3929 } 3930 ret := &Operation{ 3931 ServerResponse: googleapi.ServerResponse{ 3932 Header: res.Header, 3933 HTTPStatusCode: res.StatusCode, 3934 }, 3935 } 3936 target := &ret 3937 if err := gensupport.DecodeResponse(target, res); err != nil { 3938 return nil, err 3939 } 3940 return ret, nil 3941 } 3942 3943 type ProjectsLocationsBackupsGetCall struct { 3944 s *Service 3945 name string 3946 urlParams_ gensupport.URLParams 3947 ifNoneMatch_ string 3948 ctx_ context.Context 3949 header_ http.Header 3950 } 3951 3952 // Get: Gets details of a single Backup. 3953 // 3954 // - name: Name of the resource. 3955 func (r *ProjectsLocationsBackupsService) Get(name string) *ProjectsLocationsBackupsGetCall { 3956 c := &ProjectsLocationsBackupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3957 c.name = name 3958 return c 3959 } 3960 3961 // Fields allows partial responses to be retrieved. See 3962 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3963 // details. 3964 func (c *ProjectsLocationsBackupsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupsGetCall { 3965 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3966 return c 3967 } 3968 3969 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3970 // object's ETag matches the given value. This is useful for getting updates 3971 // only after the object has changed since the last request. 3972 func (c *ProjectsLocationsBackupsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupsGetCall { 3973 c.ifNoneMatch_ = entityTag 3974 return c 3975 } 3976 3977 // Context sets the context to be used in this call's Do method. 3978 func (c *ProjectsLocationsBackupsGetCall) Context(ctx context.Context) *ProjectsLocationsBackupsGetCall { 3979 c.ctx_ = ctx 3980 return c 3981 } 3982 3983 // Header returns a http.Header that can be modified by the caller to add 3984 // headers to the request. 3985 func (c *ProjectsLocationsBackupsGetCall) Header() http.Header { 3986 if c.header_ == nil { 3987 c.header_ = make(http.Header) 3988 } 3989 return c.header_ 3990 } 3991 3992 func (c *ProjectsLocationsBackupsGetCall) doRequest(alt string) (*http.Response, error) { 3993 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3994 if c.ifNoneMatch_ != "" { 3995 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3996 } 3997 var body io.Reader = nil 3998 c.urlParams_.Set("alt", alt) 3999 c.urlParams_.Set("prettyPrint", "false") 4000 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4001 urls += "?" + c.urlParams_.Encode() 4002 req, err := http.NewRequest("GET", urls, body) 4003 if err != nil { 4004 return nil, err 4005 } 4006 req.Header = reqHeaders 4007 googleapi.Expand(req.URL, map[string]string{ 4008 "name": c.name, 4009 }) 4010 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4011 } 4012 4013 // Do executes the "alloydb.projects.locations.backups.get" call. 4014 // Any non-2xx status code is an error. Response headers are in either 4015 // *Backup.ServerResponse.Header or (if a response was returned at all) in 4016 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4017 // whether the returned error was because http.StatusNotModified was returned. 4018 func (c *ProjectsLocationsBackupsGetCall) Do(opts ...googleapi.CallOption) (*Backup, error) { 4019 gensupport.SetOptions(c.urlParams_, opts...) 4020 res, err := c.doRequest("json") 4021 if res != nil && res.StatusCode == http.StatusNotModified { 4022 if res.Body != nil { 4023 res.Body.Close() 4024 } 4025 return nil, gensupport.WrapError(&googleapi.Error{ 4026 Code: res.StatusCode, 4027 Header: res.Header, 4028 }) 4029 } 4030 if err != nil { 4031 return nil, err 4032 } 4033 defer googleapi.CloseBody(res) 4034 if err := googleapi.CheckResponse(res); err != nil { 4035 return nil, gensupport.WrapError(err) 4036 } 4037 ret := &Backup{ 4038 ServerResponse: googleapi.ServerResponse{ 4039 Header: res.Header, 4040 HTTPStatusCode: res.StatusCode, 4041 }, 4042 } 4043 target := &ret 4044 if err := gensupport.DecodeResponse(target, res); err != nil { 4045 return nil, err 4046 } 4047 return ret, nil 4048 } 4049 4050 type ProjectsLocationsBackupsListCall struct { 4051 s *Service 4052 parent string 4053 urlParams_ gensupport.URLParams 4054 ifNoneMatch_ string 4055 ctx_ context.Context 4056 header_ http.Header 4057 } 4058 4059 // List: Lists Backups in a given project and location. 4060 // 4061 // - parent: Parent value for ListBackupsRequest. 4062 func (r *ProjectsLocationsBackupsService) List(parent string) *ProjectsLocationsBackupsListCall { 4063 c := &ProjectsLocationsBackupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4064 c.parent = parent 4065 return c 4066 } 4067 4068 // Filter sets the optional parameter "filter": Filtering results 4069 func (c *ProjectsLocationsBackupsListCall) Filter(filter string) *ProjectsLocationsBackupsListCall { 4070 c.urlParams_.Set("filter", filter) 4071 return c 4072 } 4073 4074 // OrderBy sets the optional parameter "orderBy": Hint for how to order the 4075 // results 4076 func (c *ProjectsLocationsBackupsListCall) OrderBy(orderBy string) *ProjectsLocationsBackupsListCall { 4077 c.urlParams_.Set("orderBy", orderBy) 4078 return c 4079 } 4080 4081 // PageSize sets the optional parameter "pageSize": Requested page size. Server 4082 // may return fewer items than requested. If unspecified, server will pick an 4083 // appropriate default. 4084 func (c *ProjectsLocationsBackupsListCall) PageSize(pageSize int64) *ProjectsLocationsBackupsListCall { 4085 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4086 return c 4087 } 4088 4089 // PageToken sets the optional parameter "pageToken": A token identifying a 4090 // page of results the server should return. 4091 func (c *ProjectsLocationsBackupsListCall) PageToken(pageToken string) *ProjectsLocationsBackupsListCall { 4092 c.urlParams_.Set("pageToken", pageToken) 4093 return c 4094 } 4095 4096 // Fields allows partial responses to be retrieved. See 4097 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4098 // details. 4099 func (c *ProjectsLocationsBackupsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupsListCall { 4100 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4101 return c 4102 } 4103 4104 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4105 // object's ETag matches the given value. This is useful for getting updates 4106 // only after the object has changed since the last request. 4107 func (c *ProjectsLocationsBackupsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBackupsListCall { 4108 c.ifNoneMatch_ = entityTag 4109 return c 4110 } 4111 4112 // Context sets the context to be used in this call's Do method. 4113 func (c *ProjectsLocationsBackupsListCall) Context(ctx context.Context) *ProjectsLocationsBackupsListCall { 4114 c.ctx_ = ctx 4115 return c 4116 } 4117 4118 // Header returns a http.Header that can be modified by the caller to add 4119 // headers to the request. 4120 func (c *ProjectsLocationsBackupsListCall) Header() http.Header { 4121 if c.header_ == nil { 4122 c.header_ = make(http.Header) 4123 } 4124 return c.header_ 4125 } 4126 4127 func (c *ProjectsLocationsBackupsListCall) doRequest(alt string) (*http.Response, error) { 4128 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4129 if c.ifNoneMatch_ != "" { 4130 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4131 } 4132 var body io.Reader = nil 4133 c.urlParams_.Set("alt", alt) 4134 c.urlParams_.Set("prettyPrint", "false") 4135 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/backups") 4136 urls += "?" + c.urlParams_.Encode() 4137 req, err := http.NewRequest("GET", urls, body) 4138 if err != nil { 4139 return nil, err 4140 } 4141 req.Header = reqHeaders 4142 googleapi.Expand(req.URL, map[string]string{ 4143 "parent": c.parent, 4144 }) 4145 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4146 } 4147 4148 // Do executes the "alloydb.projects.locations.backups.list" call. 4149 // Any non-2xx status code is an error. Response headers are in either 4150 // *ListBackupsResponse.ServerResponse.Header or (if a response was returned at 4151 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4152 // check whether the returned error was because http.StatusNotModified was 4153 // returned. 4154 func (c *ProjectsLocationsBackupsListCall) Do(opts ...googleapi.CallOption) (*ListBackupsResponse, error) { 4155 gensupport.SetOptions(c.urlParams_, opts...) 4156 res, err := c.doRequest("json") 4157 if res != nil && res.StatusCode == http.StatusNotModified { 4158 if res.Body != nil { 4159 res.Body.Close() 4160 } 4161 return nil, gensupport.WrapError(&googleapi.Error{ 4162 Code: res.StatusCode, 4163 Header: res.Header, 4164 }) 4165 } 4166 if err != nil { 4167 return nil, err 4168 } 4169 defer googleapi.CloseBody(res) 4170 if err := googleapi.CheckResponse(res); err != nil { 4171 return nil, gensupport.WrapError(err) 4172 } 4173 ret := &ListBackupsResponse{ 4174 ServerResponse: googleapi.ServerResponse{ 4175 Header: res.Header, 4176 HTTPStatusCode: res.StatusCode, 4177 }, 4178 } 4179 target := &ret 4180 if err := gensupport.DecodeResponse(target, res); err != nil { 4181 return nil, err 4182 } 4183 return ret, nil 4184 } 4185 4186 // Pages invokes f for each page of results. 4187 // A non-nil error returned from f will halt the iteration. 4188 // The provided context supersedes any context provided to the Context method. 4189 func (c *ProjectsLocationsBackupsListCall) Pages(ctx context.Context, f func(*ListBackupsResponse) error) error { 4190 c.ctx_ = ctx 4191 defer c.PageToken(c.urlParams_.Get("pageToken")) 4192 for { 4193 x, err := c.Do() 4194 if err != nil { 4195 return err 4196 } 4197 if err := f(x); err != nil { 4198 return err 4199 } 4200 if x.NextPageToken == "" { 4201 return nil 4202 } 4203 c.PageToken(x.NextPageToken) 4204 } 4205 } 4206 4207 type ProjectsLocationsBackupsPatchCall struct { 4208 s *Service 4209 name string 4210 backup *Backup 4211 urlParams_ gensupport.URLParams 4212 ctx_ context.Context 4213 header_ http.Header 4214 } 4215 4216 // Patch: Updates the parameters of a single Backup. 4217 // 4218 // - name: Output only. The name of the backup resource with the format: * 4219 // projects/{project}/locations/{region}/backups/{backup_id} where the 4220 // cluster and backup ID segments should satisfy the regex expression 4221 // `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters of lowercase 4222 // letters, numbers, and dashes, starting with a letter, and ending with a 4223 // letter or number. For more details see https://google.aip.dev/122. The 4224 // prefix of the backup resource name is the name of the parent resource: * 4225 // projects/{project}/locations/{region}. 4226 func (r *ProjectsLocationsBackupsService) Patch(name string, backup *Backup) *ProjectsLocationsBackupsPatchCall { 4227 c := &ProjectsLocationsBackupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4228 c.name = name 4229 c.backup = backup 4230 return c 4231 } 4232 4233 // AllowMissing sets the optional parameter "allowMissing": If set to true, 4234 // update succeeds even if instance is not found. In that case, a new backup is 4235 // created and `update_mask` is ignored. 4236 func (c *ProjectsLocationsBackupsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsBackupsPatchCall { 4237 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) 4238 return c 4239 } 4240 4241 // RequestId sets the optional parameter "requestId": An optional request ID to 4242 // identify requests. Specify a unique request ID so that if you must retry 4243 // your request, the server will know to ignore the request if it has already 4244 // been completed. The server will guarantee that for at least 60 minutes since 4245 // the first request. For example, consider a situation where you make an 4246 // initial request and the request times out. If you make the request again 4247 // with the same request ID, the server can check if original operation with 4248 // the same request ID was received, and if so, will ignore the second request. 4249 // This prevents clients from accidentally creating duplicate commitments. The 4250 // request ID must be a valid UUID with the exception that zero UUID is not 4251 // supported (00000000-0000-0000-0000-000000000000). 4252 func (c *ProjectsLocationsBackupsPatchCall) RequestId(requestId string) *ProjectsLocationsBackupsPatchCall { 4253 c.urlParams_.Set("requestId", requestId) 4254 return c 4255 } 4256 4257 // UpdateMask sets the optional parameter "updateMask": Field mask is used to 4258 // specify the fields to be overwritten in the Backup resource by the update. 4259 // The fields specified in the update_mask are relative to the resource, not 4260 // the full request. A field will be overwritten if it is in the mask. If the 4261 // user does not provide a mask then all fields will be overwritten. 4262 func (c *ProjectsLocationsBackupsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBackupsPatchCall { 4263 c.urlParams_.Set("updateMask", updateMask) 4264 return c 4265 } 4266 4267 // ValidateOnly sets the optional parameter "validateOnly": If set, the backend 4268 // validates the request, but doesn't actually execute it. 4269 func (c *ProjectsLocationsBackupsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsBackupsPatchCall { 4270 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 4271 return c 4272 } 4273 4274 // Fields allows partial responses to be retrieved. See 4275 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4276 // details. 4277 func (c *ProjectsLocationsBackupsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBackupsPatchCall { 4278 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4279 return c 4280 } 4281 4282 // Context sets the context to be used in this call's Do method. 4283 func (c *ProjectsLocationsBackupsPatchCall) Context(ctx context.Context) *ProjectsLocationsBackupsPatchCall { 4284 c.ctx_ = ctx 4285 return c 4286 } 4287 4288 // Header returns a http.Header that can be modified by the caller to add 4289 // headers to the request. 4290 func (c *ProjectsLocationsBackupsPatchCall) Header() http.Header { 4291 if c.header_ == nil { 4292 c.header_ = make(http.Header) 4293 } 4294 return c.header_ 4295 } 4296 4297 func (c *ProjectsLocationsBackupsPatchCall) doRequest(alt string) (*http.Response, error) { 4298 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4299 var body io.Reader = nil 4300 body, err := googleapi.WithoutDataWrapper.JSONReader(c.backup) 4301 if err != nil { 4302 return nil, err 4303 } 4304 c.urlParams_.Set("alt", alt) 4305 c.urlParams_.Set("prettyPrint", "false") 4306 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4307 urls += "?" + c.urlParams_.Encode() 4308 req, err := http.NewRequest("PATCH", urls, body) 4309 if err != nil { 4310 return nil, err 4311 } 4312 req.Header = reqHeaders 4313 googleapi.Expand(req.URL, map[string]string{ 4314 "name": c.name, 4315 }) 4316 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4317 } 4318 4319 // Do executes the "alloydb.projects.locations.backups.patch" call. 4320 // Any non-2xx status code is an error. Response headers are in either 4321 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4322 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4323 // whether the returned error was because http.StatusNotModified was returned. 4324 func (c *ProjectsLocationsBackupsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4325 gensupport.SetOptions(c.urlParams_, opts...) 4326 res, err := c.doRequest("json") 4327 if res != nil && res.StatusCode == http.StatusNotModified { 4328 if res.Body != nil { 4329 res.Body.Close() 4330 } 4331 return nil, gensupport.WrapError(&googleapi.Error{ 4332 Code: res.StatusCode, 4333 Header: res.Header, 4334 }) 4335 } 4336 if err != nil { 4337 return nil, err 4338 } 4339 defer googleapi.CloseBody(res) 4340 if err := googleapi.CheckResponse(res); err != nil { 4341 return nil, gensupport.WrapError(err) 4342 } 4343 ret := &Operation{ 4344 ServerResponse: googleapi.ServerResponse{ 4345 Header: res.Header, 4346 HTTPStatusCode: res.StatusCode, 4347 }, 4348 } 4349 target := &ret 4350 if err := gensupport.DecodeResponse(target, res); err != nil { 4351 return nil, err 4352 } 4353 return ret, nil 4354 } 4355 4356 type ProjectsLocationsClustersCreateCall struct { 4357 s *Service 4358 parent string 4359 cluster *Cluster 4360 urlParams_ gensupport.URLParams 4361 ctx_ context.Context 4362 header_ http.Header 4363 } 4364 4365 // Create: Creates a new Cluster in a given project and location. 4366 // 4367 // - parent: The location of the new cluster. For the required format, see the 4368 // comment on the Cluster.name field. 4369 func (r *ProjectsLocationsClustersService) Create(parent string, cluster *Cluster) *ProjectsLocationsClustersCreateCall { 4370 c := &ProjectsLocationsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4371 c.parent = parent 4372 c.cluster = cluster 4373 return c 4374 } 4375 4376 // ClusterId sets the optional parameter "clusterId": Required. ID of the 4377 // requesting object. 4378 func (c *ProjectsLocationsClustersCreateCall) ClusterId(clusterId string) *ProjectsLocationsClustersCreateCall { 4379 c.urlParams_.Set("clusterId", clusterId) 4380 return c 4381 } 4382 4383 // RequestId sets the optional parameter "requestId": An optional request ID to 4384 // identify requests. Specify a unique request ID so that if you must retry 4385 // your request, the server will know to ignore the request if it has already 4386 // been completed. The server will guarantee that for at least 60 minutes since 4387 // the first request. For example, consider a situation where you make an 4388 // initial request and the request times out. If you make the request again 4389 // with the same request ID, the server can check if original operation with 4390 // the same request ID was received, and if so, will ignore the second request. 4391 // This prevents clients from accidentally creating duplicate commitments. The 4392 // request ID must be a valid UUID with the exception that zero UUID is not 4393 // supported (00000000-0000-0000-0000-000000000000). 4394 func (c *ProjectsLocationsClustersCreateCall) RequestId(requestId string) *ProjectsLocationsClustersCreateCall { 4395 c.urlParams_.Set("requestId", requestId) 4396 return c 4397 } 4398 4399 // ValidateOnly sets the optional parameter "validateOnly": If set, performs 4400 // request validation (e.g. permission checks and any other type of 4401 // validation), but do not actually execute the create request. 4402 func (c *ProjectsLocationsClustersCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsClustersCreateCall { 4403 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 4404 return c 4405 } 4406 4407 // Fields allows partial responses to be retrieved. See 4408 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4409 // details. 4410 func (c *ProjectsLocationsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersCreateCall { 4411 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4412 return c 4413 } 4414 4415 // Context sets the context to be used in this call's Do method. 4416 func (c *ProjectsLocationsClustersCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersCreateCall { 4417 c.ctx_ = ctx 4418 return c 4419 } 4420 4421 // Header returns a http.Header that can be modified by the caller to add 4422 // headers to the request. 4423 func (c *ProjectsLocationsClustersCreateCall) Header() http.Header { 4424 if c.header_ == nil { 4425 c.header_ = make(http.Header) 4426 } 4427 return c.header_ 4428 } 4429 4430 func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) { 4431 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4432 var body io.Reader = nil 4433 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) 4434 if err != nil { 4435 return nil, err 4436 } 4437 c.urlParams_.Set("alt", alt) 4438 c.urlParams_.Set("prettyPrint", "false") 4439 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters") 4440 urls += "?" + c.urlParams_.Encode() 4441 req, err := http.NewRequest("POST", urls, body) 4442 if err != nil { 4443 return nil, err 4444 } 4445 req.Header = reqHeaders 4446 googleapi.Expand(req.URL, map[string]string{ 4447 "parent": c.parent, 4448 }) 4449 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4450 } 4451 4452 // Do executes the "alloydb.projects.locations.clusters.create" call. 4453 // Any non-2xx status code is an error. Response headers are in either 4454 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4455 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4456 // whether the returned error was because http.StatusNotModified was returned. 4457 func (c *ProjectsLocationsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4458 gensupport.SetOptions(c.urlParams_, opts...) 4459 res, err := c.doRequest("json") 4460 if res != nil && res.StatusCode == http.StatusNotModified { 4461 if res.Body != nil { 4462 res.Body.Close() 4463 } 4464 return nil, gensupport.WrapError(&googleapi.Error{ 4465 Code: res.StatusCode, 4466 Header: res.Header, 4467 }) 4468 } 4469 if err != nil { 4470 return nil, err 4471 } 4472 defer googleapi.CloseBody(res) 4473 if err := googleapi.CheckResponse(res); err != nil { 4474 return nil, gensupport.WrapError(err) 4475 } 4476 ret := &Operation{ 4477 ServerResponse: googleapi.ServerResponse{ 4478 Header: res.Header, 4479 HTTPStatusCode: res.StatusCode, 4480 }, 4481 } 4482 target := &ret 4483 if err := gensupport.DecodeResponse(target, res); err != nil { 4484 return nil, err 4485 } 4486 return ret, nil 4487 } 4488 4489 type ProjectsLocationsClustersCreatesecondaryCall struct { 4490 s *Service 4491 parent string 4492 cluster *Cluster 4493 urlParams_ gensupport.URLParams 4494 ctx_ context.Context 4495 header_ http.Header 4496 } 4497 4498 // Createsecondary: Creates a cluster of type SECONDARY in the given location 4499 // using the primary cluster as the source. 4500 // 4501 // - parent: The location of the new cluster. For the required format, see the 4502 // comment on the Cluster.name field. 4503 func (r *ProjectsLocationsClustersService) Createsecondary(parent string, cluster *Cluster) *ProjectsLocationsClustersCreatesecondaryCall { 4504 c := &ProjectsLocationsClustersCreatesecondaryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4505 c.parent = parent 4506 c.cluster = cluster 4507 return c 4508 } 4509 4510 // ClusterId sets the optional parameter "clusterId": Required. ID of the 4511 // requesting object (the secondary cluster). 4512 func (c *ProjectsLocationsClustersCreatesecondaryCall) ClusterId(clusterId string) *ProjectsLocationsClustersCreatesecondaryCall { 4513 c.urlParams_.Set("clusterId", clusterId) 4514 return c 4515 } 4516 4517 // RequestId sets the optional parameter "requestId": An optional request ID to 4518 // identify requests. Specify a unique request ID so that if you must retry 4519 // your request, the server will know to ignore the request if it has already 4520 // been completed. The server will guarantee that for at least 60 minutes since 4521 // the first request. For example, consider a situation where you make an 4522 // initial request and the request times out. If you make the request again 4523 // with the same request ID, the server can check if original operation with 4524 // the same request ID was received, and if so, will ignore the second request. 4525 // This prevents clients from accidentally creating duplicate commitments. The 4526 // request ID must be a valid UUID with the exception that zero UUID is not 4527 // supported (00000000-0000-0000-0000-000000000000). 4528 func (c *ProjectsLocationsClustersCreatesecondaryCall) RequestId(requestId string) *ProjectsLocationsClustersCreatesecondaryCall { 4529 c.urlParams_.Set("requestId", requestId) 4530 return c 4531 } 4532 4533 // ValidateOnly sets the optional parameter "validateOnly": If set, performs 4534 // request validation (e.g. permission checks and any other type of 4535 // validation), but do not actually execute the create request. 4536 func (c *ProjectsLocationsClustersCreatesecondaryCall) ValidateOnly(validateOnly bool) *ProjectsLocationsClustersCreatesecondaryCall { 4537 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 4538 return c 4539 } 4540 4541 // Fields allows partial responses to be retrieved. See 4542 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4543 // details. 4544 func (c *ProjectsLocationsClustersCreatesecondaryCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersCreatesecondaryCall { 4545 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4546 return c 4547 } 4548 4549 // Context sets the context to be used in this call's Do method. 4550 func (c *ProjectsLocationsClustersCreatesecondaryCall) Context(ctx context.Context) *ProjectsLocationsClustersCreatesecondaryCall { 4551 c.ctx_ = ctx 4552 return c 4553 } 4554 4555 // Header returns a http.Header that can be modified by the caller to add 4556 // headers to the request. 4557 func (c *ProjectsLocationsClustersCreatesecondaryCall) Header() http.Header { 4558 if c.header_ == nil { 4559 c.header_ = make(http.Header) 4560 } 4561 return c.header_ 4562 } 4563 4564 func (c *ProjectsLocationsClustersCreatesecondaryCall) doRequest(alt string) (*http.Response, error) { 4565 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4566 var body io.Reader = nil 4567 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) 4568 if err != nil { 4569 return nil, err 4570 } 4571 c.urlParams_.Set("alt", alt) 4572 c.urlParams_.Set("prettyPrint", "false") 4573 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters:createsecondary") 4574 urls += "?" + c.urlParams_.Encode() 4575 req, err := http.NewRequest("POST", urls, body) 4576 if err != nil { 4577 return nil, err 4578 } 4579 req.Header = reqHeaders 4580 googleapi.Expand(req.URL, map[string]string{ 4581 "parent": c.parent, 4582 }) 4583 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4584 } 4585 4586 // Do executes the "alloydb.projects.locations.clusters.createsecondary" call. 4587 // Any non-2xx status code is an error. Response headers are in either 4588 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4589 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4590 // whether the returned error was because http.StatusNotModified was returned. 4591 func (c *ProjectsLocationsClustersCreatesecondaryCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4592 gensupport.SetOptions(c.urlParams_, opts...) 4593 res, err := c.doRequest("json") 4594 if res != nil && res.StatusCode == http.StatusNotModified { 4595 if res.Body != nil { 4596 res.Body.Close() 4597 } 4598 return nil, gensupport.WrapError(&googleapi.Error{ 4599 Code: res.StatusCode, 4600 Header: res.Header, 4601 }) 4602 } 4603 if err != nil { 4604 return nil, err 4605 } 4606 defer googleapi.CloseBody(res) 4607 if err := googleapi.CheckResponse(res); err != nil { 4608 return nil, gensupport.WrapError(err) 4609 } 4610 ret := &Operation{ 4611 ServerResponse: googleapi.ServerResponse{ 4612 Header: res.Header, 4613 HTTPStatusCode: res.StatusCode, 4614 }, 4615 } 4616 target := &ret 4617 if err := gensupport.DecodeResponse(target, res); err != nil { 4618 return nil, err 4619 } 4620 return ret, nil 4621 } 4622 4623 type ProjectsLocationsClustersDeleteCall struct { 4624 s *Service 4625 name string 4626 urlParams_ gensupport.URLParams 4627 ctx_ context.Context 4628 header_ http.Header 4629 } 4630 4631 // Delete: Deletes a single Cluster. 4632 // 4633 // - name: The name of the resource. For the required format, see the comment 4634 // on the Cluster.name field. 4635 func (r *ProjectsLocationsClustersService) Delete(name string) *ProjectsLocationsClustersDeleteCall { 4636 c := &ProjectsLocationsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4637 c.name = name 4638 return c 4639 } 4640 4641 // Etag sets the optional parameter "etag": The current etag of the Cluster. If 4642 // an etag is provided and does not match the current etag of the Cluster, 4643 // deletion will be blocked and an ABORTED error will be returned. 4644 func (c *ProjectsLocationsClustersDeleteCall) Etag(etag string) *ProjectsLocationsClustersDeleteCall { 4645 c.urlParams_.Set("etag", etag) 4646 return c 4647 } 4648 4649 // Force sets the optional parameter "force": Whether to cascade delete child 4650 // instances for given cluster. 4651 func (c *ProjectsLocationsClustersDeleteCall) Force(force bool) *ProjectsLocationsClustersDeleteCall { 4652 c.urlParams_.Set("force", fmt.Sprint(force)) 4653 return c 4654 } 4655 4656 // RequestId sets the optional parameter "requestId": An optional request ID to 4657 // identify requests. Specify a unique request ID so that if you must retry 4658 // your request, the server will know to ignore the request if it has already 4659 // been completed. The server will guarantee that for at least 60 minutes after 4660 // the first request. For example, consider a situation where you make an 4661 // initial request and the request times out. If you make the request again 4662 // with the same request ID, the server can check if original operation with 4663 // the same request ID was received, and if so, will ignore the second request. 4664 // This prevents clients from accidentally creating duplicate commitments. The 4665 // request ID must be a valid UUID with the exception that zero UUID is not 4666 // supported (00000000-0000-0000-0000-000000000000). 4667 func (c *ProjectsLocationsClustersDeleteCall) RequestId(requestId string) *ProjectsLocationsClustersDeleteCall { 4668 c.urlParams_.Set("requestId", requestId) 4669 return c 4670 } 4671 4672 // ValidateOnly sets the optional parameter "validateOnly": If set, performs 4673 // request validation (e.g. permission checks and any other type of 4674 // validation), but do not actually execute the delete. 4675 func (c *ProjectsLocationsClustersDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsClustersDeleteCall { 4676 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 4677 return c 4678 } 4679 4680 // Fields allows partial responses to be retrieved. See 4681 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4682 // details. 4683 func (c *ProjectsLocationsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersDeleteCall { 4684 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4685 return c 4686 } 4687 4688 // Context sets the context to be used in this call's Do method. 4689 func (c *ProjectsLocationsClustersDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersDeleteCall { 4690 c.ctx_ = ctx 4691 return c 4692 } 4693 4694 // Header returns a http.Header that can be modified by the caller to add 4695 // headers to the request. 4696 func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header { 4697 if c.header_ == nil { 4698 c.header_ = make(http.Header) 4699 } 4700 return c.header_ 4701 } 4702 4703 func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { 4704 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4705 var body io.Reader = nil 4706 c.urlParams_.Set("alt", alt) 4707 c.urlParams_.Set("prettyPrint", "false") 4708 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4709 urls += "?" + c.urlParams_.Encode() 4710 req, err := http.NewRequest("DELETE", urls, body) 4711 if err != nil { 4712 return nil, err 4713 } 4714 req.Header = reqHeaders 4715 googleapi.Expand(req.URL, map[string]string{ 4716 "name": c.name, 4717 }) 4718 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4719 } 4720 4721 // Do executes the "alloydb.projects.locations.clusters.delete" call. 4722 // Any non-2xx status code is an error. Response headers are in either 4723 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4724 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4725 // whether the returned error was because http.StatusNotModified was returned. 4726 func (c *ProjectsLocationsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4727 gensupport.SetOptions(c.urlParams_, opts...) 4728 res, err := c.doRequest("json") 4729 if res != nil && res.StatusCode == http.StatusNotModified { 4730 if res.Body != nil { 4731 res.Body.Close() 4732 } 4733 return nil, gensupport.WrapError(&googleapi.Error{ 4734 Code: res.StatusCode, 4735 Header: res.Header, 4736 }) 4737 } 4738 if err != nil { 4739 return nil, err 4740 } 4741 defer googleapi.CloseBody(res) 4742 if err := googleapi.CheckResponse(res); err != nil { 4743 return nil, gensupport.WrapError(err) 4744 } 4745 ret := &Operation{ 4746 ServerResponse: googleapi.ServerResponse{ 4747 Header: res.Header, 4748 HTTPStatusCode: res.StatusCode, 4749 }, 4750 } 4751 target := &ret 4752 if err := gensupport.DecodeResponse(target, res); err != nil { 4753 return nil, err 4754 } 4755 return ret, nil 4756 } 4757 4758 type ProjectsLocationsClustersGetCall struct { 4759 s *Service 4760 name string 4761 urlParams_ gensupport.URLParams 4762 ifNoneMatch_ string 4763 ctx_ context.Context 4764 header_ http.Header 4765 } 4766 4767 // Get: Gets details of a single Cluster. 4768 // 4769 // - name: The name of the resource. For the required format, see the comment 4770 // on the Cluster.name field. 4771 func (r *ProjectsLocationsClustersService) Get(name string) *ProjectsLocationsClustersGetCall { 4772 c := &ProjectsLocationsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4773 c.name = name 4774 return c 4775 } 4776 4777 // View sets the optional parameter "view": The view of the cluster to return. 4778 // Returns all default fields if not set. 4779 // 4780 // Possible values: 4781 // 4782 // "CLUSTER_VIEW_UNSPECIFIED" - CLUSTER_VIEW_UNSPECIFIED Not specified, 4783 // 4784 // equivalent to BASIC. 4785 // 4786 // "CLUSTER_VIEW_BASIC" - BASIC server responses include all the relevant 4787 // 4788 // cluster details, excluding 4789 // Cluster.ContinuousBackupInfo.EarliestRestorableTime and other view-specific 4790 // fields. The default value. 4791 // 4792 // "CLUSTER_VIEW_CONTINUOUS_BACKUP" - CONTINUOUS_BACKUP response returns all 4793 // 4794 // the fields from BASIC plus the earliest restorable time if continuous 4795 // backups are enabled. May increase latency. 4796 func (c *ProjectsLocationsClustersGetCall) View(view string) *ProjectsLocationsClustersGetCall { 4797 c.urlParams_.Set("view", view) 4798 return c 4799 } 4800 4801 // Fields allows partial responses to be retrieved. See 4802 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4803 // details. 4804 func (c *ProjectsLocationsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersGetCall { 4805 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4806 return c 4807 } 4808 4809 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4810 // object's ETag matches the given value. This is useful for getting updates 4811 // only after the object has changed since the last request. 4812 func (c *ProjectsLocationsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersGetCall { 4813 c.ifNoneMatch_ = entityTag 4814 return c 4815 } 4816 4817 // Context sets the context to be used in this call's Do method. 4818 func (c *ProjectsLocationsClustersGetCall) Context(ctx context.Context) *ProjectsLocationsClustersGetCall { 4819 c.ctx_ = ctx 4820 return c 4821 } 4822 4823 // Header returns a http.Header that can be modified by the caller to add 4824 // headers to the request. 4825 func (c *ProjectsLocationsClustersGetCall) Header() http.Header { 4826 if c.header_ == nil { 4827 c.header_ = make(http.Header) 4828 } 4829 return c.header_ 4830 } 4831 4832 func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response, error) { 4833 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4834 if c.ifNoneMatch_ != "" { 4835 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4836 } 4837 var body io.Reader = nil 4838 c.urlParams_.Set("alt", alt) 4839 c.urlParams_.Set("prettyPrint", "false") 4840 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4841 urls += "?" + c.urlParams_.Encode() 4842 req, err := http.NewRequest("GET", urls, body) 4843 if err != nil { 4844 return nil, err 4845 } 4846 req.Header = reqHeaders 4847 googleapi.Expand(req.URL, map[string]string{ 4848 "name": c.name, 4849 }) 4850 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4851 } 4852 4853 // Do executes the "alloydb.projects.locations.clusters.get" call. 4854 // Any non-2xx status code is an error. Response headers are in either 4855 // *Cluster.ServerResponse.Header or (if a response was returned at all) in 4856 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4857 // whether the returned error was because http.StatusNotModified was returned. 4858 func (c *ProjectsLocationsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) { 4859 gensupport.SetOptions(c.urlParams_, opts...) 4860 res, err := c.doRequest("json") 4861 if res != nil && res.StatusCode == http.StatusNotModified { 4862 if res.Body != nil { 4863 res.Body.Close() 4864 } 4865 return nil, gensupport.WrapError(&googleapi.Error{ 4866 Code: res.StatusCode, 4867 Header: res.Header, 4868 }) 4869 } 4870 if err != nil { 4871 return nil, err 4872 } 4873 defer googleapi.CloseBody(res) 4874 if err := googleapi.CheckResponse(res); err != nil { 4875 return nil, gensupport.WrapError(err) 4876 } 4877 ret := &Cluster{ 4878 ServerResponse: googleapi.ServerResponse{ 4879 Header: res.Header, 4880 HTTPStatusCode: res.StatusCode, 4881 }, 4882 } 4883 target := &ret 4884 if err := gensupport.DecodeResponse(target, res); err != nil { 4885 return nil, err 4886 } 4887 return ret, nil 4888 } 4889 4890 type ProjectsLocationsClustersListCall struct { 4891 s *Service 4892 parent string 4893 urlParams_ gensupport.URLParams 4894 ifNoneMatch_ string 4895 ctx_ context.Context 4896 header_ http.Header 4897 } 4898 4899 // List: Lists Clusters in a given project and location. 4900 // 4901 // - parent: The name of the parent resource. For the required format, see the 4902 // comment on the Cluster.name field. Additionally, you can perform an 4903 // aggregated list operation by specifying a value with the following format: 4904 // - projects/{project}/locations/-. 4905 func (r *ProjectsLocationsClustersService) List(parent string) *ProjectsLocationsClustersListCall { 4906 c := &ProjectsLocationsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4907 c.parent = parent 4908 return c 4909 } 4910 4911 // Filter sets the optional parameter "filter": Filtering results 4912 func (c *ProjectsLocationsClustersListCall) Filter(filter string) *ProjectsLocationsClustersListCall { 4913 c.urlParams_.Set("filter", filter) 4914 return c 4915 } 4916 4917 // OrderBy sets the optional parameter "orderBy": Hint for how to order the 4918 // results 4919 func (c *ProjectsLocationsClustersListCall) OrderBy(orderBy string) *ProjectsLocationsClustersListCall { 4920 c.urlParams_.Set("orderBy", orderBy) 4921 return c 4922 } 4923 4924 // PageSize sets the optional parameter "pageSize": Requested page size. Server 4925 // may return fewer items than requested. If unspecified, server will pick an 4926 // appropriate default. 4927 func (c *ProjectsLocationsClustersListCall) PageSize(pageSize int64) *ProjectsLocationsClustersListCall { 4928 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4929 return c 4930 } 4931 4932 // PageToken sets the optional parameter "pageToken": A token identifying a 4933 // page of results the server should return. 4934 func (c *ProjectsLocationsClustersListCall) PageToken(pageToken string) *ProjectsLocationsClustersListCall { 4935 c.urlParams_.Set("pageToken", pageToken) 4936 return c 4937 } 4938 4939 // Fields allows partial responses to be retrieved. See 4940 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4941 // details. 4942 func (c *ProjectsLocationsClustersListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersListCall { 4943 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4944 return c 4945 } 4946 4947 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4948 // object's ETag matches the given value. This is useful for getting updates 4949 // only after the object has changed since the last request. 4950 func (c *ProjectsLocationsClustersListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersListCall { 4951 c.ifNoneMatch_ = entityTag 4952 return c 4953 } 4954 4955 // Context sets the context to be used in this call's Do method. 4956 func (c *ProjectsLocationsClustersListCall) Context(ctx context.Context) *ProjectsLocationsClustersListCall { 4957 c.ctx_ = ctx 4958 return c 4959 } 4960 4961 // Header returns a http.Header that can be modified by the caller to add 4962 // headers to the request. 4963 func (c *ProjectsLocationsClustersListCall) Header() http.Header { 4964 if c.header_ == nil { 4965 c.header_ = make(http.Header) 4966 } 4967 return c.header_ 4968 } 4969 4970 func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Response, error) { 4971 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4972 if c.ifNoneMatch_ != "" { 4973 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4974 } 4975 var body io.Reader = nil 4976 c.urlParams_.Set("alt", alt) 4977 c.urlParams_.Set("prettyPrint", "false") 4978 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters") 4979 urls += "?" + c.urlParams_.Encode() 4980 req, err := http.NewRequest("GET", urls, body) 4981 if err != nil { 4982 return nil, err 4983 } 4984 req.Header = reqHeaders 4985 googleapi.Expand(req.URL, map[string]string{ 4986 "parent": c.parent, 4987 }) 4988 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4989 } 4990 4991 // Do executes the "alloydb.projects.locations.clusters.list" call. 4992 // Any non-2xx status code is an error. Response headers are in either 4993 // *ListClustersResponse.ServerResponse.Header or (if a response was returned 4994 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4995 // check whether the returned error was because http.StatusNotModified was 4996 // returned. 4997 func (c *ProjectsLocationsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) { 4998 gensupport.SetOptions(c.urlParams_, opts...) 4999 res, err := c.doRequest("json") 5000 if res != nil && res.StatusCode == http.StatusNotModified { 5001 if res.Body != nil { 5002 res.Body.Close() 5003 } 5004 return nil, gensupport.WrapError(&googleapi.Error{ 5005 Code: res.StatusCode, 5006 Header: res.Header, 5007 }) 5008 } 5009 if err != nil { 5010 return nil, err 5011 } 5012 defer googleapi.CloseBody(res) 5013 if err := googleapi.CheckResponse(res); err != nil { 5014 return nil, gensupport.WrapError(err) 5015 } 5016 ret := &ListClustersResponse{ 5017 ServerResponse: googleapi.ServerResponse{ 5018 Header: res.Header, 5019 HTTPStatusCode: res.StatusCode, 5020 }, 5021 } 5022 target := &ret 5023 if err := gensupport.DecodeResponse(target, res); err != nil { 5024 return nil, err 5025 } 5026 return ret, nil 5027 } 5028 5029 // Pages invokes f for each page of results. 5030 // A non-nil error returned from f will halt the iteration. 5031 // The provided context supersedes any context provided to the Context method. 5032 func (c *ProjectsLocationsClustersListCall) Pages(ctx context.Context, f func(*ListClustersResponse) error) error { 5033 c.ctx_ = ctx 5034 defer c.PageToken(c.urlParams_.Get("pageToken")) 5035 for { 5036 x, err := c.Do() 5037 if err != nil { 5038 return err 5039 } 5040 if err := f(x); err != nil { 5041 return err 5042 } 5043 if x.NextPageToken == "" { 5044 return nil 5045 } 5046 c.PageToken(x.NextPageToken) 5047 } 5048 } 5049 5050 type ProjectsLocationsClustersPatchCall struct { 5051 s *Service 5052 name string 5053 cluster *Cluster 5054 urlParams_ gensupport.URLParams 5055 ctx_ context.Context 5056 header_ http.Header 5057 } 5058 5059 // Patch: Updates the parameters of a single Cluster. 5060 // 5061 // - name: Output only. The name of the cluster resource with the format: * 5062 // projects/{project}/locations/{region}/clusters/{cluster_id} where the 5063 // cluster ID segment should satisfy the regex expression `[a-z0-9-]+`. For 5064 // more details see https://google.aip.dev/122. The prefix of the cluster 5065 // resource name is the name of the parent resource: * 5066 // projects/{project}/locations/{region}. 5067 func (r *ProjectsLocationsClustersService) Patch(name string, cluster *Cluster) *ProjectsLocationsClustersPatchCall { 5068 c := &ProjectsLocationsClustersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5069 c.name = name 5070 c.cluster = cluster 5071 return c 5072 } 5073 5074 // AllowMissing sets the optional parameter "allowMissing": If set to true, 5075 // update succeeds even if cluster is not found. In that case, a new cluster is 5076 // created and `update_mask` is ignored. 5077 func (c *ProjectsLocationsClustersPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsClustersPatchCall { 5078 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) 5079 return c 5080 } 5081 5082 // RequestId sets the optional parameter "requestId": An optional request ID to 5083 // identify requests. Specify a unique request ID so that if you must retry 5084 // your request, the server will know to ignore the request if it has already 5085 // been completed. The server will guarantee that for at least 60 minutes since 5086 // the first request. For example, consider a situation where you make an 5087 // initial request and the request times out. If you make the request again 5088 // with the same request ID, the server can check if original operation with 5089 // the same request ID was received, and if so, will ignore the second request. 5090 // This prevents clients from accidentally creating duplicate commitments. The 5091 // request ID must be a valid UUID with the exception that zero UUID is not 5092 // supported (00000000-0000-0000-0000-000000000000). 5093 func (c *ProjectsLocationsClustersPatchCall) RequestId(requestId string) *ProjectsLocationsClustersPatchCall { 5094 c.urlParams_.Set("requestId", requestId) 5095 return c 5096 } 5097 5098 // UpdateMask sets the optional parameter "updateMask": Field mask is used to 5099 // specify the fields to be overwritten in the Cluster resource by the update. 5100 // The fields specified in the update_mask are relative to the resource, not 5101 // the full request. A field will be overwritten if it is in the mask. If the 5102 // user does not provide a mask then all fields will be overwritten. 5103 func (c *ProjectsLocationsClustersPatchCall) UpdateMask(updateMask string) *ProjectsLocationsClustersPatchCall { 5104 c.urlParams_.Set("updateMask", updateMask) 5105 return c 5106 } 5107 5108 // ValidateOnly sets the optional parameter "validateOnly": If set, performs 5109 // request validation (e.g. permission checks and any other type of 5110 // validation), but do not actually execute the update request. 5111 func (c *ProjectsLocationsClustersPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsClustersPatchCall { 5112 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 5113 return c 5114 } 5115 5116 // Fields allows partial responses to be retrieved. See 5117 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5118 // details. 5119 func (c *ProjectsLocationsClustersPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersPatchCall { 5120 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5121 return c 5122 } 5123 5124 // Context sets the context to be used in this call's Do method. 5125 func (c *ProjectsLocationsClustersPatchCall) Context(ctx context.Context) *ProjectsLocationsClustersPatchCall { 5126 c.ctx_ = ctx 5127 return c 5128 } 5129 5130 // Header returns a http.Header that can be modified by the caller to add 5131 // headers to the request. 5132 func (c *ProjectsLocationsClustersPatchCall) Header() http.Header { 5133 if c.header_ == nil { 5134 c.header_ = make(http.Header) 5135 } 5136 return c.header_ 5137 } 5138 5139 func (c *ProjectsLocationsClustersPatchCall) doRequest(alt string) (*http.Response, error) { 5140 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5141 var body io.Reader = nil 5142 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) 5143 if err != nil { 5144 return nil, err 5145 } 5146 c.urlParams_.Set("alt", alt) 5147 c.urlParams_.Set("prettyPrint", "false") 5148 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5149 urls += "?" + c.urlParams_.Encode() 5150 req, err := http.NewRequest("PATCH", urls, body) 5151 if err != nil { 5152 return nil, err 5153 } 5154 req.Header = reqHeaders 5155 googleapi.Expand(req.URL, map[string]string{ 5156 "name": c.name, 5157 }) 5158 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5159 } 5160 5161 // Do executes the "alloydb.projects.locations.clusters.patch" call. 5162 // Any non-2xx status code is an error. Response headers are in either 5163 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5164 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5165 // whether the returned error was because http.StatusNotModified was returned. 5166 func (c *ProjectsLocationsClustersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5167 gensupport.SetOptions(c.urlParams_, opts...) 5168 res, err := c.doRequest("json") 5169 if res != nil && res.StatusCode == http.StatusNotModified { 5170 if res.Body != nil { 5171 res.Body.Close() 5172 } 5173 return nil, gensupport.WrapError(&googleapi.Error{ 5174 Code: res.StatusCode, 5175 Header: res.Header, 5176 }) 5177 } 5178 if err != nil { 5179 return nil, err 5180 } 5181 defer googleapi.CloseBody(res) 5182 if err := googleapi.CheckResponse(res); err != nil { 5183 return nil, gensupport.WrapError(err) 5184 } 5185 ret := &Operation{ 5186 ServerResponse: googleapi.ServerResponse{ 5187 Header: res.Header, 5188 HTTPStatusCode: res.StatusCode, 5189 }, 5190 } 5191 target := &ret 5192 if err := gensupport.DecodeResponse(target, res); err != nil { 5193 return nil, err 5194 } 5195 return ret, nil 5196 } 5197 5198 type ProjectsLocationsClustersPromoteCall struct { 5199 s *Service 5200 name string 5201 promoteclusterrequest *PromoteClusterRequest 5202 urlParams_ gensupport.URLParams 5203 ctx_ context.Context 5204 header_ http.Header 5205 } 5206 5207 // Promote: Promotes a SECONDARY cluster. This turns down replication from the 5208 // PRIMARY cluster and promotes a secondary cluster into its own standalone 5209 // cluster. Imperative only. 5210 // 5211 // - name: The name of the resource. For the required format, see the comment 5212 // on the Cluster.name field. 5213 func (r *ProjectsLocationsClustersService) Promote(name string, promoteclusterrequest *PromoteClusterRequest) *ProjectsLocationsClustersPromoteCall { 5214 c := &ProjectsLocationsClustersPromoteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5215 c.name = name 5216 c.promoteclusterrequest = promoteclusterrequest 5217 return c 5218 } 5219 5220 // Fields allows partial responses to be retrieved. See 5221 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5222 // details. 5223 func (c *ProjectsLocationsClustersPromoteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersPromoteCall { 5224 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5225 return c 5226 } 5227 5228 // Context sets the context to be used in this call's Do method. 5229 func (c *ProjectsLocationsClustersPromoteCall) Context(ctx context.Context) *ProjectsLocationsClustersPromoteCall { 5230 c.ctx_ = ctx 5231 return c 5232 } 5233 5234 // Header returns a http.Header that can be modified by the caller to add 5235 // headers to the request. 5236 func (c *ProjectsLocationsClustersPromoteCall) Header() http.Header { 5237 if c.header_ == nil { 5238 c.header_ = make(http.Header) 5239 } 5240 return c.header_ 5241 } 5242 5243 func (c *ProjectsLocationsClustersPromoteCall) doRequest(alt string) (*http.Response, error) { 5244 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5245 var body io.Reader = nil 5246 body, err := googleapi.WithoutDataWrapper.JSONReader(c.promoteclusterrequest) 5247 if err != nil { 5248 return nil, err 5249 } 5250 c.urlParams_.Set("alt", alt) 5251 c.urlParams_.Set("prettyPrint", "false") 5252 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:promote") 5253 urls += "?" + c.urlParams_.Encode() 5254 req, err := http.NewRequest("POST", urls, body) 5255 if err != nil { 5256 return nil, err 5257 } 5258 req.Header = reqHeaders 5259 googleapi.Expand(req.URL, map[string]string{ 5260 "name": c.name, 5261 }) 5262 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5263 } 5264 5265 // Do executes the "alloydb.projects.locations.clusters.promote" call. 5266 // Any non-2xx status code is an error. Response headers are in either 5267 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5268 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5269 // whether the returned error was because http.StatusNotModified was returned. 5270 func (c *ProjectsLocationsClustersPromoteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5271 gensupport.SetOptions(c.urlParams_, opts...) 5272 res, err := c.doRequest("json") 5273 if res != nil && res.StatusCode == http.StatusNotModified { 5274 if res.Body != nil { 5275 res.Body.Close() 5276 } 5277 return nil, gensupport.WrapError(&googleapi.Error{ 5278 Code: res.StatusCode, 5279 Header: res.Header, 5280 }) 5281 } 5282 if err != nil { 5283 return nil, err 5284 } 5285 defer googleapi.CloseBody(res) 5286 if err := googleapi.CheckResponse(res); err != nil { 5287 return nil, gensupport.WrapError(err) 5288 } 5289 ret := &Operation{ 5290 ServerResponse: googleapi.ServerResponse{ 5291 Header: res.Header, 5292 HTTPStatusCode: res.StatusCode, 5293 }, 5294 } 5295 target := &ret 5296 if err := gensupport.DecodeResponse(target, res); err != nil { 5297 return nil, err 5298 } 5299 return ret, nil 5300 } 5301 5302 type ProjectsLocationsClustersRestoreCall struct { 5303 s *Service 5304 parent string 5305 restoreclusterrequest *RestoreClusterRequest 5306 urlParams_ gensupport.URLParams 5307 ctx_ context.Context 5308 header_ http.Header 5309 } 5310 5311 // Restore: Creates a new Cluster in a given project and location, with a 5312 // volume restored from the provided source, either a backup ID or a 5313 // point-in-time and a source cluster. 5314 // 5315 // - parent: The name of the parent resource. For the required format, see the 5316 // comment on the Cluster.name field. 5317 func (r *ProjectsLocationsClustersService) Restore(parent string, restoreclusterrequest *RestoreClusterRequest) *ProjectsLocationsClustersRestoreCall { 5318 c := &ProjectsLocationsClustersRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5319 c.parent = parent 5320 c.restoreclusterrequest = restoreclusterrequest 5321 return c 5322 } 5323 5324 // Fields allows partial responses to be retrieved. See 5325 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5326 // details. 5327 func (c *ProjectsLocationsClustersRestoreCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersRestoreCall { 5328 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5329 return c 5330 } 5331 5332 // Context sets the context to be used in this call's Do method. 5333 func (c *ProjectsLocationsClustersRestoreCall) Context(ctx context.Context) *ProjectsLocationsClustersRestoreCall { 5334 c.ctx_ = ctx 5335 return c 5336 } 5337 5338 // Header returns a http.Header that can be modified by the caller to add 5339 // headers to the request. 5340 func (c *ProjectsLocationsClustersRestoreCall) Header() http.Header { 5341 if c.header_ == nil { 5342 c.header_ = make(http.Header) 5343 } 5344 return c.header_ 5345 } 5346 5347 func (c *ProjectsLocationsClustersRestoreCall) doRequest(alt string) (*http.Response, error) { 5348 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5349 var body io.Reader = nil 5350 body, err := googleapi.WithoutDataWrapper.JSONReader(c.restoreclusterrequest) 5351 if err != nil { 5352 return nil, err 5353 } 5354 c.urlParams_.Set("alt", alt) 5355 c.urlParams_.Set("prettyPrint", "false") 5356 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters:restore") 5357 urls += "?" + c.urlParams_.Encode() 5358 req, err := http.NewRequest("POST", urls, body) 5359 if err != nil { 5360 return nil, err 5361 } 5362 req.Header = reqHeaders 5363 googleapi.Expand(req.URL, map[string]string{ 5364 "parent": c.parent, 5365 }) 5366 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5367 } 5368 5369 // Do executes the "alloydb.projects.locations.clusters.restore" call. 5370 // Any non-2xx status code is an error. Response headers are in either 5371 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5372 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5373 // whether the returned error was because http.StatusNotModified was returned. 5374 func (c *ProjectsLocationsClustersRestoreCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5375 gensupport.SetOptions(c.urlParams_, opts...) 5376 res, err := c.doRequest("json") 5377 if res != nil && res.StatusCode == http.StatusNotModified { 5378 if res.Body != nil { 5379 res.Body.Close() 5380 } 5381 return nil, gensupport.WrapError(&googleapi.Error{ 5382 Code: res.StatusCode, 5383 Header: res.Header, 5384 }) 5385 } 5386 if err != nil { 5387 return nil, err 5388 } 5389 defer googleapi.CloseBody(res) 5390 if err := googleapi.CheckResponse(res); err != nil { 5391 return nil, gensupport.WrapError(err) 5392 } 5393 ret := &Operation{ 5394 ServerResponse: googleapi.ServerResponse{ 5395 Header: res.Header, 5396 HTTPStatusCode: res.StatusCode, 5397 }, 5398 } 5399 target := &ret 5400 if err := gensupport.DecodeResponse(target, res); err != nil { 5401 return nil, err 5402 } 5403 return ret, nil 5404 } 5405 5406 type ProjectsLocationsClustersInstancesCreateCall struct { 5407 s *Service 5408 parent string 5409 instance *Instance 5410 urlParams_ gensupport.URLParams 5411 ctx_ context.Context 5412 header_ http.Header 5413 } 5414 5415 // Create: Creates a new Instance in a given project and location. 5416 // 5417 // - parent: The name of the parent resource. For the required format, see the 5418 // comment on the Instance.name field. 5419 func (r *ProjectsLocationsClustersInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsClustersInstancesCreateCall { 5420 c := &ProjectsLocationsClustersInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5421 c.parent = parent 5422 c.instance = instance 5423 return c 5424 } 5425 5426 // InstanceId sets the optional parameter "instanceId": Required. ID of the 5427 // requesting object. 5428 func (c *ProjectsLocationsClustersInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsClustersInstancesCreateCall { 5429 c.urlParams_.Set("instanceId", instanceId) 5430 return c 5431 } 5432 5433 // RequestId sets the optional parameter "requestId": An optional request ID to 5434 // identify requests. Specify a unique request ID so that if you must retry 5435 // your request, the server will know to ignore the request if it has already 5436 // been completed. The server will guarantee that for at least 60 minutes since 5437 // the first request. For example, consider a situation where you make an 5438 // initial request and the request times out. If you make the request again 5439 // with the same request ID, the server can check if original operation with 5440 // the same request ID was received, and if so, will ignore the second request. 5441 // This prevents clients from accidentally creating duplicate commitments. The 5442 // request ID must be a valid UUID with the exception that zero UUID is not 5443 // supported (00000000-0000-0000-0000-000000000000). 5444 func (c *ProjectsLocationsClustersInstancesCreateCall) RequestId(requestId string) *ProjectsLocationsClustersInstancesCreateCall { 5445 c.urlParams_.Set("requestId", requestId) 5446 return c 5447 } 5448 5449 // ValidateOnly sets the optional parameter "validateOnly": If set, performs 5450 // request validation (e.g. permission checks and any other type of 5451 // validation), but do not actually execute the create request. 5452 func (c *ProjectsLocationsClustersInstancesCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsClustersInstancesCreateCall { 5453 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 5454 return c 5455 } 5456 5457 // Fields allows partial responses to be retrieved. See 5458 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5459 // details. 5460 func (c *ProjectsLocationsClustersInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersInstancesCreateCall { 5461 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5462 return c 5463 } 5464 5465 // Context sets the context to be used in this call's Do method. 5466 func (c *ProjectsLocationsClustersInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersInstancesCreateCall { 5467 c.ctx_ = ctx 5468 return c 5469 } 5470 5471 // Header returns a http.Header that can be modified by the caller to add 5472 // headers to the request. 5473 func (c *ProjectsLocationsClustersInstancesCreateCall) Header() http.Header { 5474 if c.header_ == nil { 5475 c.header_ = make(http.Header) 5476 } 5477 return c.header_ 5478 } 5479 5480 func (c *ProjectsLocationsClustersInstancesCreateCall) doRequest(alt string) (*http.Response, error) { 5481 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5482 var body io.Reader = nil 5483 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) 5484 if err != nil { 5485 return nil, err 5486 } 5487 c.urlParams_.Set("alt", alt) 5488 c.urlParams_.Set("prettyPrint", "false") 5489 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances") 5490 urls += "?" + c.urlParams_.Encode() 5491 req, err := http.NewRequest("POST", urls, body) 5492 if err != nil { 5493 return nil, err 5494 } 5495 req.Header = reqHeaders 5496 googleapi.Expand(req.URL, map[string]string{ 5497 "parent": c.parent, 5498 }) 5499 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5500 } 5501 5502 // Do executes the "alloydb.projects.locations.clusters.instances.create" call. 5503 // Any non-2xx status code is an error. Response headers are in either 5504 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5505 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5506 // whether the returned error was because http.StatusNotModified was returned. 5507 func (c *ProjectsLocationsClustersInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5508 gensupport.SetOptions(c.urlParams_, opts...) 5509 res, err := c.doRequest("json") 5510 if res != nil && res.StatusCode == http.StatusNotModified { 5511 if res.Body != nil { 5512 res.Body.Close() 5513 } 5514 return nil, gensupport.WrapError(&googleapi.Error{ 5515 Code: res.StatusCode, 5516 Header: res.Header, 5517 }) 5518 } 5519 if err != nil { 5520 return nil, err 5521 } 5522 defer googleapi.CloseBody(res) 5523 if err := googleapi.CheckResponse(res); err != nil { 5524 return nil, gensupport.WrapError(err) 5525 } 5526 ret := &Operation{ 5527 ServerResponse: googleapi.ServerResponse{ 5528 Header: res.Header, 5529 HTTPStatusCode: res.StatusCode, 5530 }, 5531 } 5532 target := &ret 5533 if err := gensupport.DecodeResponse(target, res); err != nil { 5534 return nil, err 5535 } 5536 return ret, nil 5537 } 5538 5539 type ProjectsLocationsClustersInstancesCreatesecondaryCall struct { 5540 s *Service 5541 parent string 5542 instance *Instance 5543 urlParams_ gensupport.URLParams 5544 ctx_ context.Context 5545 header_ http.Header 5546 } 5547 5548 // Createsecondary: Creates a new SECONDARY Instance in a given project and 5549 // location. 5550 // 5551 // - parent: The name of the parent resource. For the required format, see the 5552 // comment on the Instance.name field. 5553 func (r *ProjectsLocationsClustersInstancesService) Createsecondary(parent string, instance *Instance) *ProjectsLocationsClustersInstancesCreatesecondaryCall { 5554 c := &ProjectsLocationsClustersInstancesCreatesecondaryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5555 c.parent = parent 5556 c.instance = instance 5557 return c 5558 } 5559 5560 // InstanceId sets the optional parameter "instanceId": Required. ID of the 5561 // requesting object. 5562 func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) InstanceId(instanceId string) *ProjectsLocationsClustersInstancesCreatesecondaryCall { 5563 c.urlParams_.Set("instanceId", instanceId) 5564 return c 5565 } 5566 5567 // RequestId sets the optional parameter "requestId": An optional request ID to 5568 // identify requests. Specify a unique request ID so that if you must retry 5569 // your request, the server will know to ignore the request if it has already 5570 // been completed. The server will guarantee that for at least 60 minutes since 5571 // the first request. For example, consider a situation where you make an 5572 // initial request and the request times out. If you make the request again 5573 // with the same request ID, the server can check if original operation with 5574 // the same request ID was received, and if so, will ignore the second request. 5575 // This prevents clients from accidentally creating duplicate commitments. The 5576 // request ID must be a valid UUID with the exception that zero UUID is not 5577 // supported (00000000-0000-0000-0000-000000000000). 5578 func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) RequestId(requestId string) *ProjectsLocationsClustersInstancesCreatesecondaryCall { 5579 c.urlParams_.Set("requestId", requestId) 5580 return c 5581 } 5582 5583 // ValidateOnly sets the optional parameter "validateOnly": If set, performs 5584 // request validation (e.g. permission checks and any other type of 5585 // validation), but do not actually execute the create request. 5586 func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) ValidateOnly(validateOnly bool) *ProjectsLocationsClustersInstancesCreatesecondaryCall { 5587 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 5588 return c 5589 } 5590 5591 // Fields allows partial responses to be retrieved. See 5592 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5593 // details. 5594 func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersInstancesCreatesecondaryCall { 5595 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5596 return c 5597 } 5598 5599 // Context sets the context to be used in this call's Do method. 5600 func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) Context(ctx context.Context) *ProjectsLocationsClustersInstancesCreatesecondaryCall { 5601 c.ctx_ = ctx 5602 return c 5603 } 5604 5605 // Header returns a http.Header that can be modified by the caller to add 5606 // headers to the request. 5607 func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) Header() http.Header { 5608 if c.header_ == nil { 5609 c.header_ = make(http.Header) 5610 } 5611 return c.header_ 5612 } 5613 5614 func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) doRequest(alt string) (*http.Response, error) { 5615 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5616 var body io.Reader = nil 5617 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) 5618 if err != nil { 5619 return nil, err 5620 } 5621 c.urlParams_.Set("alt", alt) 5622 c.urlParams_.Set("prettyPrint", "false") 5623 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances:createsecondary") 5624 urls += "?" + c.urlParams_.Encode() 5625 req, err := http.NewRequest("POST", urls, body) 5626 if err != nil { 5627 return nil, err 5628 } 5629 req.Header = reqHeaders 5630 googleapi.Expand(req.URL, map[string]string{ 5631 "parent": c.parent, 5632 }) 5633 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5634 } 5635 5636 // Do executes the "alloydb.projects.locations.clusters.instances.createsecondary" call. 5637 // Any non-2xx status code is an error. Response headers are in either 5638 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5639 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5640 // whether the returned error was because http.StatusNotModified was returned. 5641 func (c *ProjectsLocationsClustersInstancesCreatesecondaryCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5642 gensupport.SetOptions(c.urlParams_, opts...) 5643 res, err := c.doRequest("json") 5644 if res != nil && res.StatusCode == http.StatusNotModified { 5645 if res.Body != nil { 5646 res.Body.Close() 5647 } 5648 return nil, gensupport.WrapError(&googleapi.Error{ 5649 Code: res.StatusCode, 5650 Header: res.Header, 5651 }) 5652 } 5653 if err != nil { 5654 return nil, err 5655 } 5656 defer googleapi.CloseBody(res) 5657 if err := googleapi.CheckResponse(res); err != nil { 5658 return nil, gensupport.WrapError(err) 5659 } 5660 ret := &Operation{ 5661 ServerResponse: googleapi.ServerResponse{ 5662 Header: res.Header, 5663 HTTPStatusCode: res.StatusCode, 5664 }, 5665 } 5666 target := &ret 5667 if err := gensupport.DecodeResponse(target, res); err != nil { 5668 return nil, err 5669 } 5670 return ret, nil 5671 } 5672 5673 type ProjectsLocationsClustersInstancesDeleteCall struct { 5674 s *Service 5675 name string 5676 urlParams_ gensupport.URLParams 5677 ctx_ context.Context 5678 header_ http.Header 5679 } 5680 5681 // Delete: Deletes a single Instance. 5682 // 5683 // - name: The name of the resource. For the required format, see the comment 5684 // on the Instance.name field. 5685 func (r *ProjectsLocationsClustersInstancesService) Delete(name string) *ProjectsLocationsClustersInstancesDeleteCall { 5686 c := &ProjectsLocationsClustersInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5687 c.name = name 5688 return c 5689 } 5690 5691 // Etag sets the optional parameter "etag": The current etag of the Instance. 5692 // If an etag is provided and does not match the current etag of the Instance, 5693 // deletion will be blocked and an ABORTED error will be returned. 5694 func (c *ProjectsLocationsClustersInstancesDeleteCall) Etag(etag string) *ProjectsLocationsClustersInstancesDeleteCall { 5695 c.urlParams_.Set("etag", etag) 5696 return c 5697 } 5698 5699 // RequestId sets the optional parameter "requestId": An optional request ID to 5700 // identify requests. Specify a unique request ID so that if you must retry 5701 // your request, the server will know to ignore the request if it has already 5702 // been completed. The server will guarantee that for at least 60 minutes after 5703 // the first request. For example, consider a situation where you make an 5704 // initial request and the request times out. If you make the request again 5705 // with the same request ID, the server can check if original operation with 5706 // the same request ID was received, and if so, will ignore the second request. 5707 // This prevents clients from accidentally creating duplicate commitments. The 5708 // request ID must be a valid UUID with the exception that zero UUID is not 5709 // supported (00000000-0000-0000-0000-000000000000). 5710 func (c *ProjectsLocationsClustersInstancesDeleteCall) RequestId(requestId string) *ProjectsLocationsClustersInstancesDeleteCall { 5711 c.urlParams_.Set("requestId", requestId) 5712 return c 5713 } 5714 5715 // ValidateOnly sets the optional parameter "validateOnly": If set, performs 5716 // request validation (e.g. permission checks and any other type of 5717 // validation), but do not actually execute the delete. 5718 func (c *ProjectsLocationsClustersInstancesDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsClustersInstancesDeleteCall { 5719 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 5720 return c 5721 } 5722 5723 // Fields allows partial responses to be retrieved. See 5724 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5725 // details. 5726 func (c *ProjectsLocationsClustersInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersInstancesDeleteCall { 5727 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5728 return c 5729 } 5730 5731 // Context sets the context to be used in this call's Do method. 5732 func (c *ProjectsLocationsClustersInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersInstancesDeleteCall { 5733 c.ctx_ = ctx 5734 return c 5735 } 5736 5737 // Header returns a http.Header that can be modified by the caller to add 5738 // headers to the request. 5739 func (c *ProjectsLocationsClustersInstancesDeleteCall) Header() http.Header { 5740 if c.header_ == nil { 5741 c.header_ = make(http.Header) 5742 } 5743 return c.header_ 5744 } 5745 5746 func (c *ProjectsLocationsClustersInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { 5747 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5748 var body io.Reader = nil 5749 c.urlParams_.Set("alt", alt) 5750 c.urlParams_.Set("prettyPrint", "false") 5751 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5752 urls += "?" + c.urlParams_.Encode() 5753 req, err := http.NewRequest("DELETE", urls, body) 5754 if err != nil { 5755 return nil, err 5756 } 5757 req.Header = reqHeaders 5758 googleapi.Expand(req.URL, map[string]string{ 5759 "name": c.name, 5760 }) 5761 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5762 } 5763 5764 // Do executes the "alloydb.projects.locations.clusters.instances.delete" call. 5765 // Any non-2xx status code is an error. Response headers are in either 5766 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5767 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5768 // whether the returned error was because http.StatusNotModified was returned. 5769 func (c *ProjectsLocationsClustersInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5770 gensupport.SetOptions(c.urlParams_, opts...) 5771 res, err := c.doRequest("json") 5772 if res != nil && res.StatusCode == http.StatusNotModified { 5773 if res.Body != nil { 5774 res.Body.Close() 5775 } 5776 return nil, gensupport.WrapError(&googleapi.Error{ 5777 Code: res.StatusCode, 5778 Header: res.Header, 5779 }) 5780 } 5781 if err != nil { 5782 return nil, err 5783 } 5784 defer googleapi.CloseBody(res) 5785 if err := googleapi.CheckResponse(res); err != nil { 5786 return nil, gensupport.WrapError(err) 5787 } 5788 ret := &Operation{ 5789 ServerResponse: googleapi.ServerResponse{ 5790 Header: res.Header, 5791 HTTPStatusCode: res.StatusCode, 5792 }, 5793 } 5794 target := &ret 5795 if err := gensupport.DecodeResponse(target, res); err != nil { 5796 return nil, err 5797 } 5798 return ret, nil 5799 } 5800 5801 type ProjectsLocationsClustersInstancesFailoverCall struct { 5802 s *Service 5803 name string 5804 failoverinstancerequest *FailoverInstanceRequest 5805 urlParams_ gensupport.URLParams 5806 ctx_ context.Context 5807 header_ http.Header 5808 } 5809 5810 // Failover: Forces a Failover for a highly available instance. Failover 5811 // promotes the HA standby instance as the new primary. Imperative only. 5812 // 5813 // - name: The name of the resource. For the required format, see the comment 5814 // on the Instance.name field. 5815 func (r *ProjectsLocationsClustersInstancesService) Failover(name string, failoverinstancerequest *FailoverInstanceRequest) *ProjectsLocationsClustersInstancesFailoverCall { 5816 c := &ProjectsLocationsClustersInstancesFailoverCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5817 c.name = name 5818 c.failoverinstancerequest = failoverinstancerequest 5819 return c 5820 } 5821 5822 // Fields allows partial responses to be retrieved. See 5823 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5824 // details. 5825 func (c *ProjectsLocationsClustersInstancesFailoverCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersInstancesFailoverCall { 5826 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5827 return c 5828 } 5829 5830 // Context sets the context to be used in this call's Do method. 5831 func (c *ProjectsLocationsClustersInstancesFailoverCall) Context(ctx context.Context) *ProjectsLocationsClustersInstancesFailoverCall { 5832 c.ctx_ = ctx 5833 return c 5834 } 5835 5836 // Header returns a http.Header that can be modified by the caller to add 5837 // headers to the request. 5838 func (c *ProjectsLocationsClustersInstancesFailoverCall) Header() http.Header { 5839 if c.header_ == nil { 5840 c.header_ = make(http.Header) 5841 } 5842 return c.header_ 5843 } 5844 5845 func (c *ProjectsLocationsClustersInstancesFailoverCall) doRequest(alt string) (*http.Response, error) { 5846 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5847 var body io.Reader = nil 5848 body, err := googleapi.WithoutDataWrapper.JSONReader(c.failoverinstancerequest) 5849 if err != nil { 5850 return nil, err 5851 } 5852 c.urlParams_.Set("alt", alt) 5853 c.urlParams_.Set("prettyPrint", "false") 5854 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:failover") 5855 urls += "?" + c.urlParams_.Encode() 5856 req, err := http.NewRequest("POST", urls, body) 5857 if err != nil { 5858 return nil, err 5859 } 5860 req.Header = reqHeaders 5861 googleapi.Expand(req.URL, map[string]string{ 5862 "name": c.name, 5863 }) 5864 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5865 } 5866 5867 // Do executes the "alloydb.projects.locations.clusters.instances.failover" call. 5868 // Any non-2xx status code is an error. Response headers are in either 5869 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5870 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5871 // whether the returned error was because http.StatusNotModified was returned. 5872 func (c *ProjectsLocationsClustersInstancesFailoverCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5873 gensupport.SetOptions(c.urlParams_, opts...) 5874 res, err := c.doRequest("json") 5875 if res != nil && res.StatusCode == http.StatusNotModified { 5876 if res.Body != nil { 5877 res.Body.Close() 5878 } 5879 return nil, gensupport.WrapError(&googleapi.Error{ 5880 Code: res.StatusCode, 5881 Header: res.Header, 5882 }) 5883 } 5884 if err != nil { 5885 return nil, err 5886 } 5887 defer googleapi.CloseBody(res) 5888 if err := googleapi.CheckResponse(res); err != nil { 5889 return nil, gensupport.WrapError(err) 5890 } 5891 ret := &Operation{ 5892 ServerResponse: googleapi.ServerResponse{ 5893 Header: res.Header, 5894 HTTPStatusCode: res.StatusCode, 5895 }, 5896 } 5897 target := &ret 5898 if err := gensupport.DecodeResponse(target, res); err != nil { 5899 return nil, err 5900 } 5901 return ret, nil 5902 } 5903 5904 type ProjectsLocationsClustersInstancesGetCall struct { 5905 s *Service 5906 name string 5907 urlParams_ gensupport.URLParams 5908 ifNoneMatch_ string 5909 ctx_ context.Context 5910 header_ http.Header 5911 } 5912 5913 // Get: Gets details of a single Instance. 5914 // 5915 // - name: The name of the resource. For the required format, see the comment 5916 // on the Instance.name field. 5917 func (r *ProjectsLocationsClustersInstancesService) Get(name string) *ProjectsLocationsClustersInstancesGetCall { 5918 c := &ProjectsLocationsClustersInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5919 c.name = name 5920 return c 5921 } 5922 5923 // View sets the optional parameter "view": The view of the instance to return. 5924 // 5925 // Possible values: 5926 // 5927 // "INSTANCE_VIEW_UNSPECIFIED" - INSTANCE_VIEW_UNSPECIFIED Not specified, 5928 // 5929 // equivalent to BASIC. 5930 // 5931 // "INSTANCE_VIEW_BASIC" - BASIC server responses for a primary or read 5932 // 5933 // instance include all the relevant instance details, excluding the details of 5934 // each node in the instance. The default value. 5935 // 5936 // "INSTANCE_VIEW_FULL" - FULL response is equivalent to BASIC for primary 5937 // 5938 // instance (for now). For read pool instance, this includes details of each 5939 // node in the pool. 5940 func (c *ProjectsLocationsClustersInstancesGetCall) View(view string) *ProjectsLocationsClustersInstancesGetCall { 5941 c.urlParams_.Set("view", view) 5942 return c 5943 } 5944 5945 // Fields allows partial responses to be retrieved. See 5946 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5947 // details. 5948 func (c *ProjectsLocationsClustersInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersInstancesGetCall { 5949 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5950 return c 5951 } 5952 5953 // IfNoneMatch sets an optional parameter which makes the operation fail if the 5954 // object's ETag matches the given value. This is useful for getting updates 5955 // only after the object has changed since the last request. 5956 func (c *ProjectsLocationsClustersInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersInstancesGetCall { 5957 c.ifNoneMatch_ = entityTag 5958 return c 5959 } 5960 5961 // Context sets the context to be used in this call's Do method. 5962 func (c *ProjectsLocationsClustersInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsClustersInstancesGetCall { 5963 c.ctx_ = ctx 5964 return c 5965 } 5966 5967 // Header returns a http.Header that can be modified by the caller to add 5968 // headers to the request. 5969 func (c *ProjectsLocationsClustersInstancesGetCall) Header() http.Header { 5970 if c.header_ == nil { 5971 c.header_ = make(http.Header) 5972 } 5973 return c.header_ 5974 } 5975 5976 func (c *ProjectsLocationsClustersInstancesGetCall) doRequest(alt string) (*http.Response, error) { 5977 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5978 if c.ifNoneMatch_ != "" { 5979 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5980 } 5981 var body io.Reader = nil 5982 c.urlParams_.Set("alt", alt) 5983 c.urlParams_.Set("prettyPrint", "false") 5984 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5985 urls += "?" + c.urlParams_.Encode() 5986 req, err := http.NewRequest("GET", urls, body) 5987 if err != nil { 5988 return nil, err 5989 } 5990 req.Header = reqHeaders 5991 googleapi.Expand(req.URL, map[string]string{ 5992 "name": c.name, 5993 }) 5994 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5995 } 5996 5997 // Do executes the "alloydb.projects.locations.clusters.instances.get" call. 5998 // Any non-2xx status code is an error. Response headers are in either 5999 // *Instance.ServerResponse.Header or (if a response was returned at all) in 6000 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6001 // whether the returned error was because http.StatusNotModified was returned. 6002 func (c *ProjectsLocationsClustersInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) { 6003 gensupport.SetOptions(c.urlParams_, opts...) 6004 res, err := c.doRequest("json") 6005 if res != nil && res.StatusCode == http.StatusNotModified { 6006 if res.Body != nil { 6007 res.Body.Close() 6008 } 6009 return nil, gensupport.WrapError(&googleapi.Error{ 6010 Code: res.StatusCode, 6011 Header: res.Header, 6012 }) 6013 } 6014 if err != nil { 6015 return nil, err 6016 } 6017 defer googleapi.CloseBody(res) 6018 if err := googleapi.CheckResponse(res); err != nil { 6019 return nil, gensupport.WrapError(err) 6020 } 6021 ret := &Instance{ 6022 ServerResponse: googleapi.ServerResponse{ 6023 Header: res.Header, 6024 HTTPStatusCode: res.StatusCode, 6025 }, 6026 } 6027 target := &ret 6028 if err := gensupport.DecodeResponse(target, res); err != nil { 6029 return nil, err 6030 } 6031 return ret, nil 6032 } 6033 6034 type ProjectsLocationsClustersInstancesGetConnectionInfoCall struct { 6035 s *Service 6036 parent string 6037 urlParams_ gensupport.URLParams 6038 ifNoneMatch_ string 6039 ctx_ context.Context 6040 header_ http.Header 6041 } 6042 6043 // GetConnectionInfo: Get instance metadata used for a connection. 6044 // 6045 // - parent: The name of the parent resource. The required format is: 6046 // projects/{project}/locations/{location}/clusters/{cluster}/instances/{insta 6047 // nce}. 6048 func (r *ProjectsLocationsClustersInstancesService) GetConnectionInfo(parent string) *ProjectsLocationsClustersInstancesGetConnectionInfoCall { 6049 c := &ProjectsLocationsClustersInstancesGetConnectionInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6050 c.parent = parent 6051 return c 6052 } 6053 6054 // RequestId sets the optional parameter "requestId": An optional request ID to 6055 // identify requests. Specify a unique request ID so that if you must retry 6056 // your request, the server will know to ignore the request if it has already 6057 // been completed. The server will guarantee that for at least 60 minutes after 6058 // the first request. For example, consider a situation where you make an 6059 // initial request and the request times out. If you make the request again 6060 // with the same request ID, the server can check if original operation with 6061 // the same request ID was received, and if so, will ignore the second request. 6062 // This prevents clients from accidentally creating duplicate commitments. The 6063 // request ID must be a valid UUID with the exception that zero UUID is not 6064 // supported (00000000-0000-0000-0000-000000000000). 6065 func (c *ProjectsLocationsClustersInstancesGetConnectionInfoCall) RequestId(requestId string) *ProjectsLocationsClustersInstancesGetConnectionInfoCall { 6066 c.urlParams_.Set("requestId", requestId) 6067 return c 6068 } 6069 6070 // Fields allows partial responses to be retrieved. See 6071 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6072 // details. 6073 func (c *ProjectsLocationsClustersInstancesGetConnectionInfoCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersInstancesGetConnectionInfoCall { 6074 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6075 return c 6076 } 6077 6078 // IfNoneMatch sets an optional parameter which makes the operation fail if the 6079 // object's ETag matches the given value. This is useful for getting updates 6080 // only after the object has changed since the last request. 6081 func (c *ProjectsLocationsClustersInstancesGetConnectionInfoCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersInstancesGetConnectionInfoCall { 6082 c.ifNoneMatch_ = entityTag 6083 return c 6084 } 6085 6086 // Context sets the context to be used in this call's Do method. 6087 func (c *ProjectsLocationsClustersInstancesGetConnectionInfoCall) Context(ctx context.Context) *ProjectsLocationsClustersInstancesGetConnectionInfoCall { 6088 c.ctx_ = ctx 6089 return c 6090 } 6091 6092 // Header returns a http.Header that can be modified by the caller to add 6093 // headers to the request. 6094 func (c *ProjectsLocationsClustersInstancesGetConnectionInfoCall) Header() http.Header { 6095 if c.header_ == nil { 6096 c.header_ = make(http.Header) 6097 } 6098 return c.header_ 6099 } 6100 6101 func (c *ProjectsLocationsClustersInstancesGetConnectionInfoCall) doRequest(alt string) (*http.Response, error) { 6102 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 6103 if c.ifNoneMatch_ != "" { 6104 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6105 } 6106 var body io.Reader = nil 6107 c.urlParams_.Set("alt", alt) 6108 c.urlParams_.Set("prettyPrint", "false") 6109 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/connectionInfo") 6110 urls += "?" + c.urlParams_.Encode() 6111 req, err := http.NewRequest("GET", urls, body) 6112 if err != nil { 6113 return nil, err 6114 } 6115 req.Header = reqHeaders 6116 googleapi.Expand(req.URL, map[string]string{ 6117 "parent": c.parent, 6118 }) 6119 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6120 } 6121 6122 // Do executes the "alloydb.projects.locations.clusters.instances.getConnectionInfo" call. 6123 // Any non-2xx status code is an error. Response headers are in either 6124 // *ConnectionInfo.ServerResponse.Header or (if a response was returned at all) 6125 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6126 // whether the returned error was because http.StatusNotModified was returned. 6127 func (c *ProjectsLocationsClustersInstancesGetConnectionInfoCall) Do(opts ...googleapi.CallOption) (*ConnectionInfo, error) { 6128 gensupport.SetOptions(c.urlParams_, opts...) 6129 res, err := c.doRequest("json") 6130 if res != nil && res.StatusCode == http.StatusNotModified { 6131 if res.Body != nil { 6132 res.Body.Close() 6133 } 6134 return nil, gensupport.WrapError(&googleapi.Error{ 6135 Code: res.StatusCode, 6136 Header: res.Header, 6137 }) 6138 } 6139 if err != nil { 6140 return nil, err 6141 } 6142 defer googleapi.CloseBody(res) 6143 if err := googleapi.CheckResponse(res); err != nil { 6144 return nil, gensupport.WrapError(err) 6145 } 6146 ret := &ConnectionInfo{ 6147 ServerResponse: googleapi.ServerResponse{ 6148 Header: res.Header, 6149 HTTPStatusCode: res.StatusCode, 6150 }, 6151 } 6152 target := &ret 6153 if err := gensupport.DecodeResponse(target, res); err != nil { 6154 return nil, err 6155 } 6156 return ret, nil 6157 } 6158 6159 type ProjectsLocationsClustersInstancesInjectFaultCall struct { 6160 s *Service 6161 name string 6162 injectfaultrequest *InjectFaultRequest 6163 urlParams_ gensupport.URLParams 6164 ctx_ context.Context 6165 header_ http.Header 6166 } 6167 6168 // InjectFault: Injects fault in an instance. Imperative only. 6169 // 6170 // - name: The name of the resource. For the required format, see the comment 6171 // on the Instance.name field. 6172 func (r *ProjectsLocationsClustersInstancesService) InjectFault(name string, injectfaultrequest *InjectFaultRequest) *ProjectsLocationsClustersInstancesInjectFaultCall { 6173 c := &ProjectsLocationsClustersInstancesInjectFaultCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6174 c.name = name 6175 c.injectfaultrequest = injectfaultrequest 6176 return c 6177 } 6178 6179 // Fields allows partial responses to be retrieved. See 6180 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6181 // details. 6182 func (c *ProjectsLocationsClustersInstancesInjectFaultCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersInstancesInjectFaultCall { 6183 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6184 return c 6185 } 6186 6187 // Context sets the context to be used in this call's Do method. 6188 func (c *ProjectsLocationsClustersInstancesInjectFaultCall) Context(ctx context.Context) *ProjectsLocationsClustersInstancesInjectFaultCall { 6189 c.ctx_ = ctx 6190 return c 6191 } 6192 6193 // Header returns a http.Header that can be modified by the caller to add 6194 // headers to the request. 6195 func (c *ProjectsLocationsClustersInstancesInjectFaultCall) Header() http.Header { 6196 if c.header_ == nil { 6197 c.header_ = make(http.Header) 6198 } 6199 return c.header_ 6200 } 6201 6202 func (c *ProjectsLocationsClustersInstancesInjectFaultCall) doRequest(alt string) (*http.Response, error) { 6203 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 6204 var body io.Reader = nil 6205 body, err := googleapi.WithoutDataWrapper.JSONReader(c.injectfaultrequest) 6206 if err != nil { 6207 return nil, err 6208 } 6209 c.urlParams_.Set("alt", alt) 6210 c.urlParams_.Set("prettyPrint", "false") 6211 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:injectFault") 6212 urls += "?" + c.urlParams_.Encode() 6213 req, err := http.NewRequest("POST", urls, body) 6214 if err != nil { 6215 return nil, err 6216 } 6217 req.Header = reqHeaders 6218 googleapi.Expand(req.URL, map[string]string{ 6219 "name": c.name, 6220 }) 6221 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6222 } 6223 6224 // Do executes the "alloydb.projects.locations.clusters.instances.injectFault" call. 6225 // Any non-2xx status code is an error. Response headers are in either 6226 // *Operation.ServerResponse.Header or (if a response was returned at all) in 6227 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6228 // whether the returned error was because http.StatusNotModified was returned. 6229 func (c *ProjectsLocationsClustersInstancesInjectFaultCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6230 gensupport.SetOptions(c.urlParams_, opts...) 6231 res, err := c.doRequest("json") 6232 if res != nil && res.StatusCode == http.StatusNotModified { 6233 if res.Body != nil { 6234 res.Body.Close() 6235 } 6236 return nil, gensupport.WrapError(&googleapi.Error{ 6237 Code: res.StatusCode, 6238 Header: res.Header, 6239 }) 6240 } 6241 if err != nil { 6242 return nil, err 6243 } 6244 defer googleapi.CloseBody(res) 6245 if err := googleapi.CheckResponse(res); err != nil { 6246 return nil, gensupport.WrapError(err) 6247 } 6248 ret := &Operation{ 6249 ServerResponse: googleapi.ServerResponse{ 6250 Header: res.Header, 6251 HTTPStatusCode: res.StatusCode, 6252 }, 6253 } 6254 target := &ret 6255 if err := gensupport.DecodeResponse(target, res); err != nil { 6256 return nil, err 6257 } 6258 return ret, nil 6259 } 6260 6261 type ProjectsLocationsClustersInstancesListCall struct { 6262 s *Service 6263 parent string 6264 urlParams_ gensupport.URLParams 6265 ifNoneMatch_ string 6266 ctx_ context.Context 6267 header_ http.Header 6268 } 6269 6270 // List: Lists Instances in a given project and location. 6271 // 6272 // - parent: The name of the parent resource. For the required format, see the 6273 // comment on the Instance.name field. Additionally, you can perform an 6274 // aggregated list operation by specifying a value with one of the following 6275 // formats: * projects/{project}/locations/-/clusters/- * 6276 // projects/{project}/locations/{region}/clusters/-. 6277 func (r *ProjectsLocationsClustersInstancesService) List(parent string) *ProjectsLocationsClustersInstancesListCall { 6278 c := &ProjectsLocationsClustersInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6279 c.parent = parent 6280 return c 6281 } 6282 6283 // Filter sets the optional parameter "filter": Filtering results 6284 func (c *ProjectsLocationsClustersInstancesListCall) Filter(filter string) *ProjectsLocationsClustersInstancesListCall { 6285 c.urlParams_.Set("filter", filter) 6286 return c 6287 } 6288 6289 // OrderBy sets the optional parameter "orderBy": Hint for how to order the 6290 // results 6291 func (c *ProjectsLocationsClustersInstancesListCall) OrderBy(orderBy string) *ProjectsLocationsClustersInstancesListCall { 6292 c.urlParams_.Set("orderBy", orderBy) 6293 return c 6294 } 6295 6296 // PageSize sets the optional parameter "pageSize": Requested page size. Server 6297 // may return fewer items than requested. If unspecified, server will pick an 6298 // appropriate default. 6299 func (c *ProjectsLocationsClustersInstancesListCall) PageSize(pageSize int64) *ProjectsLocationsClustersInstancesListCall { 6300 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6301 return c 6302 } 6303 6304 // PageToken sets the optional parameter "pageToken": A token identifying a 6305 // page of results the server should return. 6306 func (c *ProjectsLocationsClustersInstancesListCall) PageToken(pageToken string) *ProjectsLocationsClustersInstancesListCall { 6307 c.urlParams_.Set("pageToken", pageToken) 6308 return c 6309 } 6310 6311 // Fields allows partial responses to be retrieved. See 6312 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6313 // details. 6314 func (c *ProjectsLocationsClustersInstancesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersInstancesListCall { 6315 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6316 return c 6317 } 6318 6319 // IfNoneMatch sets an optional parameter which makes the operation fail if the 6320 // object's ETag matches the given value. This is useful for getting updates 6321 // only after the object has changed since the last request. 6322 func (c *ProjectsLocationsClustersInstancesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersInstancesListCall { 6323 c.ifNoneMatch_ = entityTag 6324 return c 6325 } 6326 6327 // Context sets the context to be used in this call's Do method. 6328 func (c *ProjectsLocationsClustersInstancesListCall) Context(ctx context.Context) *ProjectsLocationsClustersInstancesListCall { 6329 c.ctx_ = ctx 6330 return c 6331 } 6332 6333 // Header returns a http.Header that can be modified by the caller to add 6334 // headers to the request. 6335 func (c *ProjectsLocationsClustersInstancesListCall) Header() http.Header { 6336 if c.header_ == nil { 6337 c.header_ = make(http.Header) 6338 } 6339 return c.header_ 6340 } 6341 6342 func (c *ProjectsLocationsClustersInstancesListCall) doRequest(alt string) (*http.Response, error) { 6343 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 6344 if c.ifNoneMatch_ != "" { 6345 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6346 } 6347 var body io.Reader = nil 6348 c.urlParams_.Set("alt", alt) 6349 c.urlParams_.Set("prettyPrint", "false") 6350 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances") 6351 urls += "?" + c.urlParams_.Encode() 6352 req, err := http.NewRequest("GET", urls, body) 6353 if err != nil { 6354 return nil, err 6355 } 6356 req.Header = reqHeaders 6357 googleapi.Expand(req.URL, map[string]string{ 6358 "parent": c.parent, 6359 }) 6360 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6361 } 6362 6363 // Do executes the "alloydb.projects.locations.clusters.instances.list" call. 6364 // Any non-2xx status code is an error. Response headers are in either 6365 // *ListInstancesResponse.ServerResponse.Header or (if a response was returned 6366 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6367 // check whether the returned error was because http.StatusNotModified was 6368 // returned. 6369 func (c *ProjectsLocationsClustersInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) { 6370 gensupport.SetOptions(c.urlParams_, opts...) 6371 res, err := c.doRequest("json") 6372 if res != nil && res.StatusCode == http.StatusNotModified { 6373 if res.Body != nil { 6374 res.Body.Close() 6375 } 6376 return nil, gensupport.WrapError(&googleapi.Error{ 6377 Code: res.StatusCode, 6378 Header: res.Header, 6379 }) 6380 } 6381 if err != nil { 6382 return nil, err 6383 } 6384 defer googleapi.CloseBody(res) 6385 if err := googleapi.CheckResponse(res); err != nil { 6386 return nil, gensupport.WrapError(err) 6387 } 6388 ret := &ListInstancesResponse{ 6389 ServerResponse: googleapi.ServerResponse{ 6390 Header: res.Header, 6391 HTTPStatusCode: res.StatusCode, 6392 }, 6393 } 6394 target := &ret 6395 if err := gensupport.DecodeResponse(target, res); err != nil { 6396 return nil, err 6397 } 6398 return ret, nil 6399 } 6400 6401 // Pages invokes f for each page of results. 6402 // A non-nil error returned from f will halt the iteration. 6403 // The provided context supersedes any context provided to the Context method. 6404 func (c *ProjectsLocationsClustersInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error { 6405 c.ctx_ = ctx 6406 defer c.PageToken(c.urlParams_.Get("pageToken")) 6407 for { 6408 x, err := c.Do() 6409 if err != nil { 6410 return err 6411 } 6412 if err := f(x); err != nil { 6413 return err 6414 } 6415 if x.NextPageToken == "" { 6416 return nil 6417 } 6418 c.PageToken(x.NextPageToken) 6419 } 6420 } 6421 6422 type ProjectsLocationsClustersInstancesPatchCall struct { 6423 s *Service 6424 name string 6425 instance *Instance 6426 urlParams_ gensupport.URLParams 6427 ctx_ context.Context 6428 header_ http.Header 6429 } 6430 6431 // Patch: Updates the parameters of a single Instance. 6432 // 6433 // - name: Output only. The name of the instance resource with the format: * 6434 // projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{inst 6435 // ance_id} where the cluster and instance ID segments should satisfy the 6436 // regex expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`, e.g. 1-63 characters 6437 // of lowercase letters, numbers, and dashes, starting with a letter, and 6438 // ending with a letter or number. For more details see 6439 // https://google.aip.dev/122. The prefix of the instance resource name is 6440 // the name of the parent resource: * 6441 // projects/{project}/locations/{region}/clusters/{cluster_id}. 6442 func (r *ProjectsLocationsClustersInstancesService) Patch(name string, instance *Instance) *ProjectsLocationsClustersInstancesPatchCall { 6443 c := &ProjectsLocationsClustersInstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6444 c.name = name 6445 c.instance = instance 6446 return c 6447 } 6448 6449 // AllowMissing sets the optional parameter "allowMissing": If set to true, 6450 // update succeeds even if instance is not found. In that case, a new instance 6451 // is created and `update_mask` is ignored. 6452 func (c *ProjectsLocationsClustersInstancesPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsClustersInstancesPatchCall { 6453 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) 6454 return c 6455 } 6456 6457 // RequestId sets the optional parameter "requestId": An optional request ID to 6458 // identify requests. Specify a unique request ID so that if you must retry 6459 // your request, the server will know to ignore the request if it has already 6460 // been completed. The server will guarantee that for at least 60 minutes since 6461 // the first request. For example, consider a situation where you make an 6462 // initial request and the request times out. If you make the request again 6463 // with the same request ID, the server can check if original operation with 6464 // the same request ID was received, and if so, will ignore the second request. 6465 // This prevents clients from accidentally creating duplicate commitments. The 6466 // request ID must be a valid UUID with the exception that zero UUID is not 6467 // supported (00000000-0000-0000-0000-000000000000). 6468 func (c *ProjectsLocationsClustersInstancesPatchCall) RequestId(requestId string) *ProjectsLocationsClustersInstancesPatchCall { 6469 c.urlParams_.Set("requestId", requestId) 6470 return c 6471 } 6472 6473 // UpdateMask sets the optional parameter "updateMask": Field mask is used to 6474 // specify the fields to be overwritten in the Instance resource by the update. 6475 // The fields specified in the update_mask are relative to the resource, not 6476 // the full request. A field will be overwritten if it is in the mask. If the 6477 // user does not provide a mask then all fields will be overwritten. 6478 func (c *ProjectsLocationsClustersInstancesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsClustersInstancesPatchCall { 6479 c.urlParams_.Set("updateMask", updateMask) 6480 return c 6481 } 6482 6483 // ValidateOnly sets the optional parameter "validateOnly": If set, performs 6484 // request validation (e.g. permission checks and any other type of 6485 // validation), but do not actually execute the update request. 6486 func (c *ProjectsLocationsClustersInstancesPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsClustersInstancesPatchCall { 6487 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 6488 return c 6489 } 6490 6491 // Fields allows partial responses to be retrieved. See 6492 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6493 // details. 6494 func (c *ProjectsLocationsClustersInstancesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersInstancesPatchCall { 6495 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6496 return c 6497 } 6498 6499 // Context sets the context to be used in this call's Do method. 6500 func (c *ProjectsLocationsClustersInstancesPatchCall) Context(ctx context.Context) *ProjectsLocationsClustersInstancesPatchCall { 6501 c.ctx_ = ctx 6502 return c 6503 } 6504 6505 // Header returns a http.Header that can be modified by the caller to add 6506 // headers to the request. 6507 func (c *ProjectsLocationsClustersInstancesPatchCall) Header() http.Header { 6508 if c.header_ == nil { 6509 c.header_ = make(http.Header) 6510 } 6511 return c.header_ 6512 } 6513 6514 func (c *ProjectsLocationsClustersInstancesPatchCall) doRequest(alt string) (*http.Response, error) { 6515 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 6516 var body io.Reader = nil 6517 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) 6518 if err != nil { 6519 return nil, err 6520 } 6521 c.urlParams_.Set("alt", alt) 6522 c.urlParams_.Set("prettyPrint", "false") 6523 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 6524 urls += "?" + c.urlParams_.Encode() 6525 req, err := http.NewRequest("PATCH", urls, body) 6526 if err != nil { 6527 return nil, err 6528 } 6529 req.Header = reqHeaders 6530 googleapi.Expand(req.URL, map[string]string{ 6531 "name": c.name, 6532 }) 6533 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6534 } 6535 6536 // Do executes the "alloydb.projects.locations.clusters.instances.patch" call. 6537 // Any non-2xx status code is an error. Response headers are in either 6538 // *Operation.ServerResponse.Header or (if a response was returned at all) in 6539 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6540 // whether the returned error was because http.StatusNotModified was returned. 6541 func (c *ProjectsLocationsClustersInstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6542 gensupport.SetOptions(c.urlParams_, opts...) 6543 res, err := c.doRequest("json") 6544 if res != nil && res.StatusCode == http.StatusNotModified { 6545 if res.Body != nil { 6546 res.Body.Close() 6547 } 6548 return nil, gensupport.WrapError(&googleapi.Error{ 6549 Code: res.StatusCode, 6550 Header: res.Header, 6551 }) 6552 } 6553 if err != nil { 6554 return nil, err 6555 } 6556 defer googleapi.CloseBody(res) 6557 if err := googleapi.CheckResponse(res); err != nil { 6558 return nil, gensupport.WrapError(err) 6559 } 6560 ret := &Operation{ 6561 ServerResponse: googleapi.ServerResponse{ 6562 Header: res.Header, 6563 HTTPStatusCode: res.StatusCode, 6564 }, 6565 } 6566 target := &ret 6567 if err := gensupport.DecodeResponse(target, res); err != nil { 6568 return nil, err 6569 } 6570 return ret, nil 6571 } 6572 6573 type ProjectsLocationsClustersInstancesRestartCall struct { 6574 s *Service 6575 name string 6576 restartinstancerequest *RestartInstanceRequest 6577 urlParams_ gensupport.URLParams 6578 ctx_ context.Context 6579 header_ http.Header 6580 } 6581 6582 // Restart: Restart an Instance in a cluster. Imperative only. 6583 // 6584 // - name: The name of the resource. For the required format, see the comment 6585 // on the Instance.name field. 6586 func (r *ProjectsLocationsClustersInstancesService) Restart(name string, restartinstancerequest *RestartInstanceRequest) *ProjectsLocationsClustersInstancesRestartCall { 6587 c := &ProjectsLocationsClustersInstancesRestartCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6588 c.name = name 6589 c.restartinstancerequest = restartinstancerequest 6590 return c 6591 } 6592 6593 // Fields allows partial responses to be retrieved. See 6594 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6595 // details. 6596 func (c *ProjectsLocationsClustersInstancesRestartCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersInstancesRestartCall { 6597 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6598 return c 6599 } 6600 6601 // Context sets the context to be used in this call's Do method. 6602 func (c *ProjectsLocationsClustersInstancesRestartCall) Context(ctx context.Context) *ProjectsLocationsClustersInstancesRestartCall { 6603 c.ctx_ = ctx 6604 return c 6605 } 6606 6607 // Header returns a http.Header that can be modified by the caller to add 6608 // headers to the request. 6609 func (c *ProjectsLocationsClustersInstancesRestartCall) Header() http.Header { 6610 if c.header_ == nil { 6611 c.header_ = make(http.Header) 6612 } 6613 return c.header_ 6614 } 6615 6616 func (c *ProjectsLocationsClustersInstancesRestartCall) doRequest(alt string) (*http.Response, error) { 6617 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 6618 var body io.Reader = nil 6619 body, err := googleapi.WithoutDataWrapper.JSONReader(c.restartinstancerequest) 6620 if err != nil { 6621 return nil, err 6622 } 6623 c.urlParams_.Set("alt", alt) 6624 c.urlParams_.Set("prettyPrint", "false") 6625 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:restart") 6626 urls += "?" + c.urlParams_.Encode() 6627 req, err := http.NewRequest("POST", urls, body) 6628 if err != nil { 6629 return nil, err 6630 } 6631 req.Header = reqHeaders 6632 googleapi.Expand(req.URL, map[string]string{ 6633 "name": c.name, 6634 }) 6635 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6636 } 6637 6638 // Do executes the "alloydb.projects.locations.clusters.instances.restart" call. 6639 // Any non-2xx status code is an error. Response headers are in either 6640 // *Operation.ServerResponse.Header or (if a response was returned at all) in 6641 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6642 // whether the returned error was because http.StatusNotModified was returned. 6643 func (c *ProjectsLocationsClustersInstancesRestartCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6644 gensupport.SetOptions(c.urlParams_, opts...) 6645 res, err := c.doRequest("json") 6646 if res != nil && res.StatusCode == http.StatusNotModified { 6647 if res.Body != nil { 6648 res.Body.Close() 6649 } 6650 return nil, gensupport.WrapError(&googleapi.Error{ 6651 Code: res.StatusCode, 6652 Header: res.Header, 6653 }) 6654 } 6655 if err != nil { 6656 return nil, err 6657 } 6658 defer googleapi.CloseBody(res) 6659 if err := googleapi.CheckResponse(res); err != nil { 6660 return nil, gensupport.WrapError(err) 6661 } 6662 ret := &Operation{ 6663 ServerResponse: googleapi.ServerResponse{ 6664 Header: res.Header, 6665 HTTPStatusCode: res.StatusCode, 6666 }, 6667 } 6668 target := &ret 6669 if err := gensupport.DecodeResponse(target, res); err != nil { 6670 return nil, err 6671 } 6672 return ret, nil 6673 } 6674 6675 type ProjectsLocationsClustersUsersCreateCall struct { 6676 s *Service 6677 parent string 6678 user *User 6679 urlParams_ gensupport.URLParams 6680 ctx_ context.Context 6681 header_ http.Header 6682 } 6683 6684 // Create: Creates a new User in a given project, location, and cluster. 6685 // 6686 // - parent: Value for parent. 6687 func (r *ProjectsLocationsClustersUsersService) Create(parent string, user *User) *ProjectsLocationsClustersUsersCreateCall { 6688 c := &ProjectsLocationsClustersUsersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6689 c.parent = parent 6690 c.user = user 6691 return c 6692 } 6693 6694 // RequestId sets the optional parameter "requestId": An optional request ID to 6695 // identify requests. Specify a unique request ID so that if you must retry 6696 // your request, the server will know to ignore the request if it has already 6697 // been completed. The server will guarantee that for at least 60 minutes since 6698 // the first request. For example, consider a situation where you make an 6699 // initial request and the request times out. If you make the request again 6700 // with the same request ID, the server can check if original operation with 6701 // the same request ID was received, and if so, will ignore the second request. 6702 // This prevents clients from accidentally creating duplicate commitments. The 6703 // request ID must be a valid UUID with the exception that zero UUID is not 6704 // supported (00000000-0000-0000-0000-000000000000). 6705 func (c *ProjectsLocationsClustersUsersCreateCall) RequestId(requestId string) *ProjectsLocationsClustersUsersCreateCall { 6706 c.urlParams_.Set("requestId", requestId) 6707 return c 6708 } 6709 6710 // UserId sets the optional parameter "userId": Required. ID of the requesting 6711 // object. 6712 func (c *ProjectsLocationsClustersUsersCreateCall) UserId(userId string) *ProjectsLocationsClustersUsersCreateCall { 6713 c.urlParams_.Set("userId", userId) 6714 return c 6715 } 6716 6717 // ValidateOnly sets the optional parameter "validateOnly": If set, the backend 6718 // validates the request, but doesn't actually execute it. 6719 func (c *ProjectsLocationsClustersUsersCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsClustersUsersCreateCall { 6720 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 6721 return c 6722 } 6723 6724 // Fields allows partial responses to be retrieved. See 6725 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6726 // details. 6727 func (c *ProjectsLocationsClustersUsersCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUsersCreateCall { 6728 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6729 return c 6730 } 6731 6732 // Context sets the context to be used in this call's Do method. 6733 func (c *ProjectsLocationsClustersUsersCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersUsersCreateCall { 6734 c.ctx_ = ctx 6735 return c 6736 } 6737 6738 // Header returns a http.Header that can be modified by the caller to add 6739 // headers to the request. 6740 func (c *ProjectsLocationsClustersUsersCreateCall) Header() http.Header { 6741 if c.header_ == nil { 6742 c.header_ = make(http.Header) 6743 } 6744 return c.header_ 6745 } 6746 6747 func (c *ProjectsLocationsClustersUsersCreateCall) doRequest(alt string) (*http.Response, error) { 6748 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 6749 var body io.Reader = nil 6750 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 6751 if err != nil { 6752 return nil, err 6753 } 6754 c.urlParams_.Set("alt", alt) 6755 c.urlParams_.Set("prettyPrint", "false") 6756 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/users") 6757 urls += "?" + c.urlParams_.Encode() 6758 req, err := http.NewRequest("POST", urls, body) 6759 if err != nil { 6760 return nil, err 6761 } 6762 req.Header = reqHeaders 6763 googleapi.Expand(req.URL, map[string]string{ 6764 "parent": c.parent, 6765 }) 6766 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6767 } 6768 6769 // Do executes the "alloydb.projects.locations.clusters.users.create" call. 6770 // Any non-2xx status code is an error. Response headers are in either 6771 // *User.ServerResponse.Header or (if a response was returned at all) in 6772 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6773 // whether the returned error was because http.StatusNotModified was returned. 6774 func (c *ProjectsLocationsClustersUsersCreateCall) Do(opts ...googleapi.CallOption) (*User, error) { 6775 gensupport.SetOptions(c.urlParams_, opts...) 6776 res, err := c.doRequest("json") 6777 if res != nil && res.StatusCode == http.StatusNotModified { 6778 if res.Body != nil { 6779 res.Body.Close() 6780 } 6781 return nil, gensupport.WrapError(&googleapi.Error{ 6782 Code: res.StatusCode, 6783 Header: res.Header, 6784 }) 6785 } 6786 if err != nil { 6787 return nil, err 6788 } 6789 defer googleapi.CloseBody(res) 6790 if err := googleapi.CheckResponse(res); err != nil { 6791 return nil, gensupport.WrapError(err) 6792 } 6793 ret := &User{ 6794 ServerResponse: googleapi.ServerResponse{ 6795 Header: res.Header, 6796 HTTPStatusCode: res.StatusCode, 6797 }, 6798 } 6799 target := &ret 6800 if err := gensupport.DecodeResponse(target, res); err != nil { 6801 return nil, err 6802 } 6803 return ret, nil 6804 } 6805 6806 type ProjectsLocationsClustersUsersDeleteCall struct { 6807 s *Service 6808 name string 6809 urlParams_ gensupport.URLParams 6810 ctx_ context.Context 6811 header_ http.Header 6812 } 6813 6814 // Delete: Deletes a single User. 6815 // 6816 // - name: The name of the resource. For the required format, see the comment 6817 // on the User.name field. 6818 func (r *ProjectsLocationsClustersUsersService) Delete(name string) *ProjectsLocationsClustersUsersDeleteCall { 6819 c := &ProjectsLocationsClustersUsersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6820 c.name = name 6821 return c 6822 } 6823 6824 // RequestId sets the optional parameter "requestId": An optional request ID to 6825 // identify requests. Specify a unique request ID so that if you must retry 6826 // your request, the server will know to ignore the request if it has already 6827 // been completed. The server will guarantee that for at least 60 minutes after 6828 // the first request. For example, consider a situation where you make an 6829 // initial request and the request times out. If you make the request again 6830 // with the same request ID, the server can check if original operation with 6831 // the same request ID was received, and if so, will ignore the second request. 6832 // This prevents clients from accidentally creating duplicate commitments. The 6833 // request ID must be a valid UUID with the exception that zero UUID is not 6834 // supported (00000000-0000-0000-0000-000000000000). 6835 func (c *ProjectsLocationsClustersUsersDeleteCall) RequestId(requestId string) *ProjectsLocationsClustersUsersDeleteCall { 6836 c.urlParams_.Set("requestId", requestId) 6837 return c 6838 } 6839 6840 // ValidateOnly sets the optional parameter "validateOnly": If set, the backend 6841 // validates the request, but doesn't actually execute it. 6842 func (c *ProjectsLocationsClustersUsersDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsClustersUsersDeleteCall { 6843 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 6844 return c 6845 } 6846 6847 // Fields allows partial responses to be retrieved. See 6848 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6849 // details. 6850 func (c *ProjectsLocationsClustersUsersDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUsersDeleteCall { 6851 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6852 return c 6853 } 6854 6855 // Context sets the context to be used in this call's Do method. 6856 func (c *ProjectsLocationsClustersUsersDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersUsersDeleteCall { 6857 c.ctx_ = ctx 6858 return c 6859 } 6860 6861 // Header returns a http.Header that can be modified by the caller to add 6862 // headers to the request. 6863 func (c *ProjectsLocationsClustersUsersDeleteCall) Header() http.Header { 6864 if c.header_ == nil { 6865 c.header_ = make(http.Header) 6866 } 6867 return c.header_ 6868 } 6869 6870 func (c *ProjectsLocationsClustersUsersDeleteCall) doRequest(alt string) (*http.Response, error) { 6871 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 6872 var body io.Reader = nil 6873 c.urlParams_.Set("alt", alt) 6874 c.urlParams_.Set("prettyPrint", "false") 6875 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 6876 urls += "?" + c.urlParams_.Encode() 6877 req, err := http.NewRequest("DELETE", urls, body) 6878 if err != nil { 6879 return nil, err 6880 } 6881 req.Header = reqHeaders 6882 googleapi.Expand(req.URL, map[string]string{ 6883 "name": c.name, 6884 }) 6885 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6886 } 6887 6888 // Do executes the "alloydb.projects.locations.clusters.users.delete" call. 6889 // Any non-2xx status code is an error. Response headers are in either 6890 // *Empty.ServerResponse.Header or (if a response was returned at all) in 6891 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6892 // whether the returned error was because http.StatusNotModified was returned. 6893 func (c *ProjectsLocationsClustersUsersDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 6894 gensupport.SetOptions(c.urlParams_, opts...) 6895 res, err := c.doRequest("json") 6896 if res != nil && res.StatusCode == http.StatusNotModified { 6897 if res.Body != nil { 6898 res.Body.Close() 6899 } 6900 return nil, gensupport.WrapError(&googleapi.Error{ 6901 Code: res.StatusCode, 6902 Header: res.Header, 6903 }) 6904 } 6905 if err != nil { 6906 return nil, err 6907 } 6908 defer googleapi.CloseBody(res) 6909 if err := googleapi.CheckResponse(res); err != nil { 6910 return nil, gensupport.WrapError(err) 6911 } 6912 ret := &Empty{ 6913 ServerResponse: googleapi.ServerResponse{ 6914 Header: res.Header, 6915 HTTPStatusCode: res.StatusCode, 6916 }, 6917 } 6918 target := &ret 6919 if err := gensupport.DecodeResponse(target, res); err != nil { 6920 return nil, err 6921 } 6922 return ret, nil 6923 } 6924 6925 type ProjectsLocationsClustersUsersGetCall struct { 6926 s *Service 6927 name string 6928 urlParams_ gensupport.URLParams 6929 ifNoneMatch_ string 6930 ctx_ context.Context 6931 header_ http.Header 6932 } 6933 6934 // Get: Gets details of a single User. 6935 // 6936 // - name: The name of the resource. For the required format, see the comment 6937 // on the User.name field. 6938 func (r *ProjectsLocationsClustersUsersService) Get(name string) *ProjectsLocationsClustersUsersGetCall { 6939 c := &ProjectsLocationsClustersUsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6940 c.name = name 6941 return c 6942 } 6943 6944 // Fields allows partial responses to be retrieved. See 6945 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6946 // details. 6947 func (c *ProjectsLocationsClustersUsersGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUsersGetCall { 6948 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6949 return c 6950 } 6951 6952 // IfNoneMatch sets an optional parameter which makes the operation fail if the 6953 // object's ETag matches the given value. This is useful for getting updates 6954 // only after the object has changed since the last request. 6955 func (c *ProjectsLocationsClustersUsersGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersUsersGetCall { 6956 c.ifNoneMatch_ = entityTag 6957 return c 6958 } 6959 6960 // Context sets the context to be used in this call's Do method. 6961 func (c *ProjectsLocationsClustersUsersGetCall) Context(ctx context.Context) *ProjectsLocationsClustersUsersGetCall { 6962 c.ctx_ = ctx 6963 return c 6964 } 6965 6966 // Header returns a http.Header that can be modified by the caller to add 6967 // headers to the request. 6968 func (c *ProjectsLocationsClustersUsersGetCall) Header() http.Header { 6969 if c.header_ == nil { 6970 c.header_ = make(http.Header) 6971 } 6972 return c.header_ 6973 } 6974 6975 func (c *ProjectsLocationsClustersUsersGetCall) doRequest(alt string) (*http.Response, error) { 6976 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 6977 if c.ifNoneMatch_ != "" { 6978 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6979 } 6980 var body io.Reader = nil 6981 c.urlParams_.Set("alt", alt) 6982 c.urlParams_.Set("prettyPrint", "false") 6983 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 6984 urls += "?" + c.urlParams_.Encode() 6985 req, err := http.NewRequest("GET", urls, body) 6986 if err != nil { 6987 return nil, err 6988 } 6989 req.Header = reqHeaders 6990 googleapi.Expand(req.URL, map[string]string{ 6991 "name": c.name, 6992 }) 6993 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6994 } 6995 6996 // Do executes the "alloydb.projects.locations.clusters.users.get" call. 6997 // Any non-2xx status code is an error. Response headers are in either 6998 // *User.ServerResponse.Header or (if a response was returned at all) in 6999 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7000 // whether the returned error was because http.StatusNotModified was returned. 7001 func (c *ProjectsLocationsClustersUsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) { 7002 gensupport.SetOptions(c.urlParams_, opts...) 7003 res, err := c.doRequest("json") 7004 if res != nil && res.StatusCode == http.StatusNotModified { 7005 if res.Body != nil { 7006 res.Body.Close() 7007 } 7008 return nil, gensupport.WrapError(&googleapi.Error{ 7009 Code: res.StatusCode, 7010 Header: res.Header, 7011 }) 7012 } 7013 if err != nil { 7014 return nil, err 7015 } 7016 defer googleapi.CloseBody(res) 7017 if err := googleapi.CheckResponse(res); err != nil { 7018 return nil, gensupport.WrapError(err) 7019 } 7020 ret := &User{ 7021 ServerResponse: googleapi.ServerResponse{ 7022 Header: res.Header, 7023 HTTPStatusCode: res.StatusCode, 7024 }, 7025 } 7026 target := &ret 7027 if err := gensupport.DecodeResponse(target, res); err != nil { 7028 return nil, err 7029 } 7030 return ret, nil 7031 } 7032 7033 type ProjectsLocationsClustersUsersListCall struct { 7034 s *Service 7035 parent string 7036 urlParams_ gensupport.URLParams 7037 ifNoneMatch_ string 7038 ctx_ context.Context 7039 header_ http.Header 7040 } 7041 7042 // List: Lists Users in a given project and location. 7043 // 7044 // - parent: Parent value for ListUsersRequest. 7045 func (r *ProjectsLocationsClustersUsersService) List(parent string) *ProjectsLocationsClustersUsersListCall { 7046 c := &ProjectsLocationsClustersUsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7047 c.parent = parent 7048 return c 7049 } 7050 7051 // Filter sets the optional parameter "filter": Filtering results 7052 func (c *ProjectsLocationsClustersUsersListCall) Filter(filter string) *ProjectsLocationsClustersUsersListCall { 7053 c.urlParams_.Set("filter", filter) 7054 return c 7055 } 7056 7057 // OrderBy sets the optional parameter "orderBy": Hint for how to order the 7058 // results 7059 func (c *ProjectsLocationsClustersUsersListCall) OrderBy(orderBy string) *ProjectsLocationsClustersUsersListCall { 7060 c.urlParams_.Set("orderBy", orderBy) 7061 return c 7062 } 7063 7064 // PageSize sets the optional parameter "pageSize": Requested page size. Server 7065 // may return fewer items than requested. If unspecified, server will pick an 7066 // appropriate default. 7067 func (c *ProjectsLocationsClustersUsersListCall) PageSize(pageSize int64) *ProjectsLocationsClustersUsersListCall { 7068 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7069 return c 7070 } 7071 7072 // PageToken sets the optional parameter "pageToken": A token identifying a 7073 // page of results the server should return. 7074 func (c *ProjectsLocationsClustersUsersListCall) PageToken(pageToken string) *ProjectsLocationsClustersUsersListCall { 7075 c.urlParams_.Set("pageToken", pageToken) 7076 return c 7077 } 7078 7079 // Fields allows partial responses to be retrieved. See 7080 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7081 // details. 7082 func (c *ProjectsLocationsClustersUsersListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUsersListCall { 7083 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7084 return c 7085 } 7086 7087 // IfNoneMatch sets an optional parameter which makes the operation fail if the 7088 // object's ETag matches the given value. This is useful for getting updates 7089 // only after the object has changed since the last request. 7090 func (c *ProjectsLocationsClustersUsersListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersUsersListCall { 7091 c.ifNoneMatch_ = entityTag 7092 return c 7093 } 7094 7095 // Context sets the context to be used in this call's Do method. 7096 func (c *ProjectsLocationsClustersUsersListCall) Context(ctx context.Context) *ProjectsLocationsClustersUsersListCall { 7097 c.ctx_ = ctx 7098 return c 7099 } 7100 7101 // Header returns a http.Header that can be modified by the caller to add 7102 // headers to the request. 7103 func (c *ProjectsLocationsClustersUsersListCall) Header() http.Header { 7104 if c.header_ == nil { 7105 c.header_ = make(http.Header) 7106 } 7107 return c.header_ 7108 } 7109 7110 func (c *ProjectsLocationsClustersUsersListCall) doRequest(alt string) (*http.Response, error) { 7111 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 7112 if c.ifNoneMatch_ != "" { 7113 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7114 } 7115 var body io.Reader = nil 7116 c.urlParams_.Set("alt", alt) 7117 c.urlParams_.Set("prettyPrint", "false") 7118 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/users") 7119 urls += "?" + c.urlParams_.Encode() 7120 req, err := http.NewRequest("GET", urls, body) 7121 if err != nil { 7122 return nil, err 7123 } 7124 req.Header = reqHeaders 7125 googleapi.Expand(req.URL, map[string]string{ 7126 "parent": c.parent, 7127 }) 7128 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7129 } 7130 7131 // Do executes the "alloydb.projects.locations.clusters.users.list" call. 7132 // Any non-2xx status code is an error. Response headers are in either 7133 // *ListUsersResponse.ServerResponse.Header or (if a response was returned at 7134 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7135 // check whether the returned error was because http.StatusNotModified was 7136 // returned. 7137 func (c *ProjectsLocationsClustersUsersListCall) Do(opts ...googleapi.CallOption) (*ListUsersResponse, error) { 7138 gensupport.SetOptions(c.urlParams_, opts...) 7139 res, err := c.doRequest("json") 7140 if res != nil && res.StatusCode == http.StatusNotModified { 7141 if res.Body != nil { 7142 res.Body.Close() 7143 } 7144 return nil, gensupport.WrapError(&googleapi.Error{ 7145 Code: res.StatusCode, 7146 Header: res.Header, 7147 }) 7148 } 7149 if err != nil { 7150 return nil, err 7151 } 7152 defer googleapi.CloseBody(res) 7153 if err := googleapi.CheckResponse(res); err != nil { 7154 return nil, gensupport.WrapError(err) 7155 } 7156 ret := &ListUsersResponse{ 7157 ServerResponse: googleapi.ServerResponse{ 7158 Header: res.Header, 7159 HTTPStatusCode: res.StatusCode, 7160 }, 7161 } 7162 target := &ret 7163 if err := gensupport.DecodeResponse(target, res); err != nil { 7164 return nil, err 7165 } 7166 return ret, nil 7167 } 7168 7169 // Pages invokes f for each page of results. 7170 // A non-nil error returned from f will halt the iteration. 7171 // The provided context supersedes any context provided to the Context method. 7172 func (c *ProjectsLocationsClustersUsersListCall) Pages(ctx context.Context, f func(*ListUsersResponse) error) error { 7173 c.ctx_ = ctx 7174 defer c.PageToken(c.urlParams_.Get("pageToken")) 7175 for { 7176 x, err := c.Do() 7177 if err != nil { 7178 return err 7179 } 7180 if err := f(x); err != nil { 7181 return err 7182 } 7183 if x.NextPageToken == "" { 7184 return nil 7185 } 7186 c.PageToken(x.NextPageToken) 7187 } 7188 } 7189 7190 type ProjectsLocationsClustersUsersPatchCall struct { 7191 s *Service 7192 name string 7193 user *User 7194 urlParams_ gensupport.URLParams 7195 ctx_ context.Context 7196 header_ http.Header 7197 } 7198 7199 // Patch: Updates the parameters of a single User. 7200 // 7201 // - name: Output only. Name of the resource in the form of 7202 // projects/{project}/locations/{location}/cluster/{cluster}/users/{user}. 7203 func (r *ProjectsLocationsClustersUsersService) Patch(name string, user *User) *ProjectsLocationsClustersUsersPatchCall { 7204 c := &ProjectsLocationsClustersUsersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7205 c.name = name 7206 c.user = user 7207 return c 7208 } 7209 7210 // AllowMissing sets the optional parameter "allowMissing": Allow missing 7211 // fields in the update mask. 7212 func (c *ProjectsLocationsClustersUsersPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsClustersUsersPatchCall { 7213 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) 7214 return c 7215 } 7216 7217 // RequestId sets the optional parameter "requestId": An optional request ID to 7218 // identify requests. Specify a unique request ID so that if you must retry 7219 // your request, the server will know to ignore the request if it has already 7220 // been completed. The server will guarantee that for at least 60 minutes since 7221 // the first request. For example, consider a situation where you make an 7222 // initial request and the request times out. If you make the request again 7223 // with the same request ID, the server can check if original operation with 7224 // the same request ID was received, and if so, will ignore the second request. 7225 // This prevents clients from accidentally creating duplicate commitments. The 7226 // request ID must be a valid UUID with the exception that zero UUID is not 7227 // supported (00000000-0000-0000-0000-000000000000). 7228 func (c *ProjectsLocationsClustersUsersPatchCall) RequestId(requestId string) *ProjectsLocationsClustersUsersPatchCall { 7229 c.urlParams_.Set("requestId", requestId) 7230 return c 7231 } 7232 7233 // UpdateMask sets the optional parameter "updateMask": Field mask is used to 7234 // specify the fields to be overwritten in the User resource by the update. The 7235 // fields specified in the update_mask are relative to the resource, not the 7236 // full request. A field will be overwritten if it is in the mask. If the user 7237 // does not provide a mask then all fields will be overwritten. 7238 func (c *ProjectsLocationsClustersUsersPatchCall) UpdateMask(updateMask string) *ProjectsLocationsClustersUsersPatchCall { 7239 c.urlParams_.Set("updateMask", updateMask) 7240 return c 7241 } 7242 7243 // ValidateOnly sets the optional parameter "validateOnly": If set, the backend 7244 // validates the request, but doesn't actually execute it. 7245 func (c *ProjectsLocationsClustersUsersPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsClustersUsersPatchCall { 7246 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 7247 return c 7248 } 7249 7250 // Fields allows partial responses to be retrieved. See 7251 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7252 // details. 7253 func (c *ProjectsLocationsClustersUsersPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUsersPatchCall { 7254 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7255 return c 7256 } 7257 7258 // Context sets the context to be used in this call's Do method. 7259 func (c *ProjectsLocationsClustersUsersPatchCall) Context(ctx context.Context) *ProjectsLocationsClustersUsersPatchCall { 7260 c.ctx_ = ctx 7261 return c 7262 } 7263 7264 // Header returns a http.Header that can be modified by the caller to add 7265 // headers to the request. 7266 func (c *ProjectsLocationsClustersUsersPatchCall) Header() http.Header { 7267 if c.header_ == nil { 7268 c.header_ = make(http.Header) 7269 } 7270 return c.header_ 7271 } 7272 7273 func (c *ProjectsLocationsClustersUsersPatchCall) doRequest(alt string) (*http.Response, error) { 7274 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 7275 var body io.Reader = nil 7276 body, err := googleapi.WithoutDataWrapper.JSONReader(c.user) 7277 if err != nil { 7278 return nil, err 7279 } 7280 c.urlParams_.Set("alt", alt) 7281 c.urlParams_.Set("prettyPrint", "false") 7282 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7283 urls += "?" + c.urlParams_.Encode() 7284 req, err := http.NewRequest("PATCH", urls, body) 7285 if err != nil { 7286 return nil, err 7287 } 7288 req.Header = reqHeaders 7289 googleapi.Expand(req.URL, map[string]string{ 7290 "name": c.name, 7291 }) 7292 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7293 } 7294 7295 // Do executes the "alloydb.projects.locations.clusters.users.patch" call. 7296 // Any non-2xx status code is an error. Response headers are in either 7297 // *User.ServerResponse.Header or (if a response was returned at all) in 7298 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7299 // whether the returned error was because http.StatusNotModified was returned. 7300 func (c *ProjectsLocationsClustersUsersPatchCall) Do(opts ...googleapi.CallOption) (*User, error) { 7301 gensupport.SetOptions(c.urlParams_, opts...) 7302 res, err := c.doRequest("json") 7303 if res != nil && res.StatusCode == http.StatusNotModified { 7304 if res.Body != nil { 7305 res.Body.Close() 7306 } 7307 return nil, gensupport.WrapError(&googleapi.Error{ 7308 Code: res.StatusCode, 7309 Header: res.Header, 7310 }) 7311 } 7312 if err != nil { 7313 return nil, err 7314 } 7315 defer googleapi.CloseBody(res) 7316 if err := googleapi.CheckResponse(res); err != nil { 7317 return nil, gensupport.WrapError(err) 7318 } 7319 ret := &User{ 7320 ServerResponse: googleapi.ServerResponse{ 7321 Header: res.Header, 7322 HTTPStatusCode: res.StatusCode, 7323 }, 7324 } 7325 target := &ret 7326 if err := gensupport.DecodeResponse(target, res); err != nil { 7327 return nil, err 7328 } 7329 return ret, nil 7330 } 7331 7332 type ProjectsLocationsOperationsCancelCall struct { 7333 s *Service 7334 name string 7335 canceloperationrequest *CancelOperationRequest 7336 urlParams_ gensupport.URLParams 7337 ctx_ context.Context 7338 header_ http.Header 7339 } 7340 7341 // Cancel: Starts asynchronous cancellation on a long-running operation. The 7342 // server makes a best effort to cancel the operation, but success is not 7343 // guaranteed. If the server doesn't support this method, it returns 7344 // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or 7345 // other methods to check whether the cancellation succeeded or whether the 7346 // operation completed despite cancellation. On successful cancellation, the 7347 // operation is not deleted; instead, it becomes an operation with an 7348 // Operation.error value with a google.rpc.Status.code of 1, corresponding to 7349 // `Code.CANCELLED`. 7350 // 7351 // - name: The name of the operation resource to be cancelled. 7352 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall { 7353 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7354 c.name = name 7355 c.canceloperationrequest = canceloperationrequest 7356 return c 7357 } 7358 7359 // Fields allows partial responses to be retrieved. See 7360 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7361 // details. 7362 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { 7363 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7364 return c 7365 } 7366 7367 // Context sets the context to be used in this call's Do method. 7368 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { 7369 c.ctx_ = ctx 7370 return c 7371 } 7372 7373 // Header returns a http.Header that can be modified by the caller to add 7374 // headers to the request. 7375 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { 7376 if c.header_ == nil { 7377 c.header_ = make(http.Header) 7378 } 7379 return c.header_ 7380 } 7381 7382 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 7383 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 7384 var body io.Reader = nil 7385 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 7386 if err != nil { 7387 return nil, err 7388 } 7389 c.urlParams_.Set("alt", alt) 7390 c.urlParams_.Set("prettyPrint", "false") 7391 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") 7392 urls += "?" + c.urlParams_.Encode() 7393 req, err := http.NewRequest("POST", urls, body) 7394 if err != nil { 7395 return nil, err 7396 } 7397 req.Header = reqHeaders 7398 googleapi.Expand(req.URL, map[string]string{ 7399 "name": c.name, 7400 }) 7401 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7402 } 7403 7404 // Do executes the "alloydb.projects.locations.operations.cancel" call. 7405 // Any non-2xx status code is an error. Response headers are in either 7406 // *Empty.ServerResponse.Header or (if a response was returned at all) in 7407 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7408 // whether the returned error was because http.StatusNotModified was returned. 7409 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 7410 gensupport.SetOptions(c.urlParams_, opts...) 7411 res, err := c.doRequest("json") 7412 if res != nil && res.StatusCode == http.StatusNotModified { 7413 if res.Body != nil { 7414 res.Body.Close() 7415 } 7416 return nil, gensupport.WrapError(&googleapi.Error{ 7417 Code: res.StatusCode, 7418 Header: res.Header, 7419 }) 7420 } 7421 if err != nil { 7422 return nil, err 7423 } 7424 defer googleapi.CloseBody(res) 7425 if err := googleapi.CheckResponse(res); err != nil { 7426 return nil, gensupport.WrapError(err) 7427 } 7428 ret := &Empty{ 7429 ServerResponse: googleapi.ServerResponse{ 7430 Header: res.Header, 7431 HTTPStatusCode: res.StatusCode, 7432 }, 7433 } 7434 target := &ret 7435 if err := gensupport.DecodeResponse(target, res); err != nil { 7436 return nil, err 7437 } 7438 return ret, nil 7439 } 7440 7441 type ProjectsLocationsOperationsDeleteCall struct { 7442 s *Service 7443 name string 7444 urlParams_ gensupport.URLParams 7445 ctx_ context.Context 7446 header_ http.Header 7447 } 7448 7449 // Delete: Deletes a long-running operation. This method indicates that the 7450 // client is no longer interested in the operation result. It does not cancel 7451 // the operation. If the server doesn't support this method, it returns 7452 // `google.rpc.Code.UNIMPLEMENTED`. 7453 // 7454 // - name: The name of the operation resource to be deleted. 7455 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall { 7456 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7457 c.name = name 7458 return c 7459 } 7460 7461 // Fields allows partial responses to be retrieved. See 7462 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7463 // details. 7464 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall { 7465 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7466 return c 7467 } 7468 7469 // Context sets the context to be used in this call's Do method. 7470 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall { 7471 c.ctx_ = ctx 7472 return c 7473 } 7474 7475 // Header returns a http.Header that can be modified by the caller to add 7476 // headers to the request. 7477 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { 7478 if c.header_ == nil { 7479 c.header_ = make(http.Header) 7480 } 7481 return c.header_ 7482 } 7483 7484 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 7485 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 7486 var body io.Reader = nil 7487 c.urlParams_.Set("alt", alt) 7488 c.urlParams_.Set("prettyPrint", "false") 7489 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7490 urls += "?" + c.urlParams_.Encode() 7491 req, err := http.NewRequest("DELETE", urls, body) 7492 if err != nil { 7493 return nil, err 7494 } 7495 req.Header = reqHeaders 7496 googleapi.Expand(req.URL, map[string]string{ 7497 "name": c.name, 7498 }) 7499 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7500 } 7501 7502 // Do executes the "alloydb.projects.locations.operations.delete" call. 7503 // Any non-2xx status code is an error. Response headers are in either 7504 // *Empty.ServerResponse.Header or (if a response was returned at all) in 7505 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7506 // whether the returned error was because http.StatusNotModified was returned. 7507 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 7508 gensupport.SetOptions(c.urlParams_, opts...) 7509 res, err := c.doRequest("json") 7510 if res != nil && res.StatusCode == http.StatusNotModified { 7511 if res.Body != nil { 7512 res.Body.Close() 7513 } 7514 return nil, gensupport.WrapError(&googleapi.Error{ 7515 Code: res.StatusCode, 7516 Header: res.Header, 7517 }) 7518 } 7519 if err != nil { 7520 return nil, err 7521 } 7522 defer googleapi.CloseBody(res) 7523 if err := googleapi.CheckResponse(res); err != nil { 7524 return nil, gensupport.WrapError(err) 7525 } 7526 ret := &Empty{ 7527 ServerResponse: googleapi.ServerResponse{ 7528 Header: res.Header, 7529 HTTPStatusCode: res.StatusCode, 7530 }, 7531 } 7532 target := &ret 7533 if err := gensupport.DecodeResponse(target, res); err != nil { 7534 return nil, err 7535 } 7536 return ret, nil 7537 } 7538 7539 type ProjectsLocationsOperationsGetCall struct { 7540 s *Service 7541 name string 7542 urlParams_ gensupport.URLParams 7543 ifNoneMatch_ string 7544 ctx_ context.Context 7545 header_ http.Header 7546 } 7547 7548 // Get: Gets the latest state of a long-running operation. Clients can use this 7549 // method to poll the operation result at intervals as recommended by the API 7550 // service. 7551 // 7552 // - name: The name of the operation resource. 7553 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 7554 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7555 c.name = name 7556 return c 7557 } 7558 7559 // Fields allows partial responses to be retrieved. See 7560 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7561 // details. 7562 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 7563 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7564 return c 7565 } 7566 7567 // IfNoneMatch sets an optional parameter which makes the operation fail if the 7568 // object's ETag matches the given value. This is useful for getting updates 7569 // only after the object has changed since the last request. 7570 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 7571 c.ifNoneMatch_ = entityTag 7572 return c 7573 } 7574 7575 // Context sets the context to be used in this call's Do method. 7576 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 7577 c.ctx_ = ctx 7578 return c 7579 } 7580 7581 // Header returns a http.Header that can be modified by the caller to add 7582 // headers to the request. 7583 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 7584 if c.header_ == nil { 7585 c.header_ = make(http.Header) 7586 } 7587 return c.header_ 7588 } 7589 7590 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 7591 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 7592 if c.ifNoneMatch_ != "" { 7593 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7594 } 7595 var body io.Reader = nil 7596 c.urlParams_.Set("alt", alt) 7597 c.urlParams_.Set("prettyPrint", "false") 7598 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7599 urls += "?" + c.urlParams_.Encode() 7600 req, err := http.NewRequest("GET", urls, body) 7601 if err != nil { 7602 return nil, err 7603 } 7604 req.Header = reqHeaders 7605 googleapi.Expand(req.URL, map[string]string{ 7606 "name": c.name, 7607 }) 7608 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7609 } 7610 7611 // Do executes the "alloydb.projects.locations.operations.get" call. 7612 // Any non-2xx status code is an error. Response headers are in either 7613 // *Operation.ServerResponse.Header or (if a response was returned at all) in 7614 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7615 // whether the returned error was because http.StatusNotModified was returned. 7616 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7617 gensupport.SetOptions(c.urlParams_, opts...) 7618 res, err := c.doRequest("json") 7619 if res != nil && res.StatusCode == http.StatusNotModified { 7620 if res.Body != nil { 7621 res.Body.Close() 7622 } 7623 return nil, gensupport.WrapError(&googleapi.Error{ 7624 Code: res.StatusCode, 7625 Header: res.Header, 7626 }) 7627 } 7628 if err != nil { 7629 return nil, err 7630 } 7631 defer googleapi.CloseBody(res) 7632 if err := googleapi.CheckResponse(res); err != nil { 7633 return nil, gensupport.WrapError(err) 7634 } 7635 ret := &Operation{ 7636 ServerResponse: googleapi.ServerResponse{ 7637 Header: res.Header, 7638 HTTPStatusCode: res.StatusCode, 7639 }, 7640 } 7641 target := &ret 7642 if err := gensupport.DecodeResponse(target, res); err != nil { 7643 return nil, err 7644 } 7645 return ret, nil 7646 } 7647 7648 type ProjectsLocationsOperationsListCall struct { 7649 s *Service 7650 name string 7651 urlParams_ gensupport.URLParams 7652 ifNoneMatch_ string 7653 ctx_ context.Context 7654 header_ http.Header 7655 } 7656 7657 // List: Lists operations that match the specified filter in the request. If 7658 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 7659 // 7660 // - name: The name of the operation's parent resource. 7661 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { 7662 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7663 c.name = name 7664 return c 7665 } 7666 7667 // Filter sets the optional parameter "filter": The standard list filter. 7668 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { 7669 c.urlParams_.Set("filter", filter) 7670 return c 7671 } 7672 7673 // PageSize sets the optional parameter "pageSize": The standard list page 7674 // size. 7675 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { 7676 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7677 return c 7678 } 7679 7680 // PageToken sets the optional parameter "pageToken": The standard list page 7681 // token. 7682 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { 7683 c.urlParams_.Set("pageToken", pageToken) 7684 return c 7685 } 7686 7687 // Fields allows partial responses to be retrieved. See 7688 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7689 // details. 7690 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { 7691 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7692 return c 7693 } 7694 7695 // IfNoneMatch sets an optional parameter which makes the operation fail if the 7696 // object's ETag matches the given value. This is useful for getting updates 7697 // only after the object has changed since the last request. 7698 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { 7699 c.ifNoneMatch_ = entityTag 7700 return c 7701 } 7702 7703 // Context sets the context to be used in this call's Do method. 7704 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { 7705 c.ctx_ = ctx 7706 return c 7707 } 7708 7709 // Header returns a http.Header that can be modified by the caller to add 7710 // headers to the request. 7711 func (c *ProjectsLocationsOperationsListCall) Header() http.Header { 7712 if c.header_ == nil { 7713 c.header_ = make(http.Header) 7714 } 7715 return c.header_ 7716 } 7717 7718 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { 7719 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 7720 if c.ifNoneMatch_ != "" { 7721 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7722 } 7723 var body io.Reader = nil 7724 c.urlParams_.Set("alt", alt) 7725 c.urlParams_.Set("prettyPrint", "false") 7726 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") 7727 urls += "?" + c.urlParams_.Encode() 7728 req, err := http.NewRequest("GET", urls, body) 7729 if err != nil { 7730 return nil, err 7731 } 7732 req.Header = reqHeaders 7733 googleapi.Expand(req.URL, map[string]string{ 7734 "name": c.name, 7735 }) 7736 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7737 } 7738 7739 // Do executes the "alloydb.projects.locations.operations.list" call. 7740 // Any non-2xx status code is an error. Response headers are in either 7741 // *ListOperationsResponse.ServerResponse.Header or (if a response was returned 7742 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7743 // check whether the returned error was because http.StatusNotModified was 7744 // returned. 7745 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 7746 gensupport.SetOptions(c.urlParams_, opts...) 7747 res, err := c.doRequest("json") 7748 if res != nil && res.StatusCode == http.StatusNotModified { 7749 if res.Body != nil { 7750 res.Body.Close() 7751 } 7752 return nil, gensupport.WrapError(&googleapi.Error{ 7753 Code: res.StatusCode, 7754 Header: res.Header, 7755 }) 7756 } 7757 if err != nil { 7758 return nil, err 7759 } 7760 defer googleapi.CloseBody(res) 7761 if err := googleapi.CheckResponse(res); err != nil { 7762 return nil, gensupport.WrapError(err) 7763 } 7764 ret := &ListOperationsResponse{ 7765 ServerResponse: googleapi.ServerResponse{ 7766 Header: res.Header, 7767 HTTPStatusCode: res.StatusCode, 7768 }, 7769 } 7770 target := &ret 7771 if err := gensupport.DecodeResponse(target, res); err != nil { 7772 return nil, err 7773 } 7774 return ret, nil 7775 } 7776 7777 // Pages invokes f for each page of results. 7778 // A non-nil error returned from f will halt the iteration. 7779 // The provided context supersedes any context provided to the Context method. 7780 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 7781 c.ctx_ = ctx 7782 defer c.PageToken(c.urlParams_.Get("pageToken")) 7783 for { 7784 x, err := c.Do() 7785 if err != nil { 7786 return err 7787 } 7788 if err := f(x); err != nil { 7789 return err 7790 } 7791 if x.NextPageToken == "" { 7792 return nil 7793 } 7794 c.PageToken(x.NextPageToken) 7795 } 7796 } 7797 7798 type ProjectsLocationsSupportedDatabaseFlagsListCall struct { 7799 s *Service 7800 parent string 7801 urlParams_ gensupport.URLParams 7802 ifNoneMatch_ string 7803 ctx_ context.Context 7804 header_ http.Header 7805 } 7806 7807 // List: Lists SupportedDatabaseFlags for a given project and location. 7808 // 7809 // - parent: The name of the parent resource. The required format is: * 7810 // projects/{project}/locations/{location} Regardless of the parent specified 7811 // here, as long it is contains a valid project and location, the service 7812 // will return a static list of supported flags resources. Note that we do 7813 // not yet support region-specific flags. 7814 func (r *ProjectsLocationsSupportedDatabaseFlagsService) List(parent string) *ProjectsLocationsSupportedDatabaseFlagsListCall { 7815 c := &ProjectsLocationsSupportedDatabaseFlagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7816 c.parent = parent 7817 return c 7818 } 7819 7820 // PageSize sets the optional parameter "pageSize": Requested page size. Server 7821 // may return fewer items than requested. If unspecified, server will pick an 7822 // appropriate default. 7823 func (c *ProjectsLocationsSupportedDatabaseFlagsListCall) PageSize(pageSize int64) *ProjectsLocationsSupportedDatabaseFlagsListCall { 7824 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7825 return c 7826 } 7827 7828 // PageToken sets the optional parameter "pageToken": A token identifying a 7829 // page of results the server should return. 7830 func (c *ProjectsLocationsSupportedDatabaseFlagsListCall) PageToken(pageToken string) *ProjectsLocationsSupportedDatabaseFlagsListCall { 7831 c.urlParams_.Set("pageToken", pageToken) 7832 return c 7833 } 7834 7835 // Fields allows partial responses to be retrieved. See 7836 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7837 // details. 7838 func (c *ProjectsLocationsSupportedDatabaseFlagsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsSupportedDatabaseFlagsListCall { 7839 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7840 return c 7841 } 7842 7843 // IfNoneMatch sets an optional parameter which makes the operation fail if the 7844 // object's ETag matches the given value. This is useful for getting updates 7845 // only after the object has changed since the last request. 7846 func (c *ProjectsLocationsSupportedDatabaseFlagsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsSupportedDatabaseFlagsListCall { 7847 c.ifNoneMatch_ = entityTag 7848 return c 7849 } 7850 7851 // Context sets the context to be used in this call's Do method. 7852 func (c *ProjectsLocationsSupportedDatabaseFlagsListCall) Context(ctx context.Context) *ProjectsLocationsSupportedDatabaseFlagsListCall { 7853 c.ctx_ = ctx 7854 return c 7855 } 7856 7857 // Header returns a http.Header that can be modified by the caller to add 7858 // headers to the request. 7859 func (c *ProjectsLocationsSupportedDatabaseFlagsListCall) Header() http.Header { 7860 if c.header_ == nil { 7861 c.header_ = make(http.Header) 7862 } 7863 return c.header_ 7864 } 7865 7866 func (c *ProjectsLocationsSupportedDatabaseFlagsListCall) doRequest(alt string) (*http.Response, error) { 7867 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 7868 if c.ifNoneMatch_ != "" { 7869 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7870 } 7871 var body io.Reader = nil 7872 c.urlParams_.Set("alt", alt) 7873 c.urlParams_.Set("prettyPrint", "false") 7874 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/supportedDatabaseFlags") 7875 urls += "?" + c.urlParams_.Encode() 7876 req, err := http.NewRequest("GET", urls, body) 7877 if err != nil { 7878 return nil, err 7879 } 7880 req.Header = reqHeaders 7881 googleapi.Expand(req.URL, map[string]string{ 7882 "parent": c.parent, 7883 }) 7884 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7885 } 7886 7887 // Do executes the "alloydb.projects.locations.supportedDatabaseFlags.list" call. 7888 // Any non-2xx status code is an error. Response headers are in either 7889 // *ListSupportedDatabaseFlagsResponse.ServerResponse.Header or (if a response 7890 // was returned at all) in error.(*googleapi.Error).Header. Use 7891 // googleapi.IsNotModified to check whether the returned error was because 7892 // http.StatusNotModified was returned. 7893 func (c *ProjectsLocationsSupportedDatabaseFlagsListCall) Do(opts ...googleapi.CallOption) (*ListSupportedDatabaseFlagsResponse, error) { 7894 gensupport.SetOptions(c.urlParams_, opts...) 7895 res, err := c.doRequest("json") 7896 if res != nil && res.StatusCode == http.StatusNotModified { 7897 if res.Body != nil { 7898 res.Body.Close() 7899 } 7900 return nil, gensupport.WrapError(&googleapi.Error{ 7901 Code: res.StatusCode, 7902 Header: res.Header, 7903 }) 7904 } 7905 if err != nil { 7906 return nil, err 7907 } 7908 defer googleapi.CloseBody(res) 7909 if err := googleapi.CheckResponse(res); err != nil { 7910 return nil, gensupport.WrapError(err) 7911 } 7912 ret := &ListSupportedDatabaseFlagsResponse{ 7913 ServerResponse: googleapi.ServerResponse{ 7914 Header: res.Header, 7915 HTTPStatusCode: res.StatusCode, 7916 }, 7917 } 7918 target := &ret 7919 if err := gensupport.DecodeResponse(target, res); err != nil { 7920 return nil, err 7921 } 7922 return ret, nil 7923 } 7924 7925 // Pages invokes f for each page of results. 7926 // A non-nil error returned from f will halt the iteration. 7927 // The provided context supersedes any context provided to the Context method. 7928 func (c *ProjectsLocationsSupportedDatabaseFlagsListCall) Pages(ctx context.Context, f func(*ListSupportedDatabaseFlagsResponse) error) error { 7929 c.ctx_ = ctx 7930 defer c.PageToken(c.urlParams_.Get("pageToken")) 7931 for { 7932 x, err := c.Do() 7933 if err != nil { 7934 return err 7935 } 7936 if err := f(x); err != nil { 7937 return err 7938 } 7939 if x.NextPageToken == "" { 7940 return nil 7941 } 7942 c.PageToken(x.NextPageToken) 7943 } 7944 } 7945