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