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 redis provides access to the Google Cloud Memorystore for Redis API. 8 // 9 // This package is DEPRECATED. Use package cloud.google.com/go/redis/apiv1 instead. 10 // 11 // For product documentation, see: https://cloud.google.com/memorystore/docs/redis/ 12 // 13 // # Library status 14 // 15 // These client libraries are officially supported by Google. However, this 16 // library is considered complete and is in maintenance mode. This means 17 // that we will address critical bugs and security issues but will not add 18 // any new features. 19 // 20 // When possible, we recommend using our newer 21 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 22 // that are still actively being worked and iterated on. 23 // 24 // # Creating a client 25 // 26 // Usage example: 27 // 28 // import "google.golang.org/api/redis/v1" 29 // ... 30 // ctx := context.Background() 31 // redisService, err := redis.NewService(ctx) 32 // 33 // In this example, Google Application Default Credentials are used for 34 // authentication. For information on how to create and obtain Application 35 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 36 // 37 // # Other authentication options 38 // 39 // To use an API key for authentication (note: some APIs do not support API 40 // keys), use [google.golang.org/api/option.WithAPIKey]: 41 // 42 // redisService, err := redis.NewService(ctx, option.WithAPIKey("AIza...")) 43 // 44 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 45 // flow, use [google.golang.org/api/option.WithTokenSource]: 46 // 47 // config := &oauth2.Config{...} 48 // // ... 49 // token, err := config.Exchange(ctx, ...) 50 // redisService, err := redis.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 51 // 52 // See [google.golang.org/api/option.ClientOption] for details on options. 53 package redis // import "google.golang.org/api/redis/v1" 54 55 import ( 56 "bytes" 57 "context" 58 "encoding/json" 59 "errors" 60 "fmt" 61 "io" 62 "net/http" 63 "net/url" 64 "strconv" 65 "strings" 66 67 googleapi "google.golang.org/api/googleapi" 68 internal "google.golang.org/api/internal" 69 gensupport "google.golang.org/api/internal/gensupport" 70 option "google.golang.org/api/option" 71 internaloption "google.golang.org/api/option/internaloption" 72 htransport "google.golang.org/api/transport/http" 73 ) 74 75 // Always reference these packages, just in case the auto-generated code 76 // below doesn't. 77 var _ = bytes.NewBuffer 78 var _ = strconv.Itoa 79 var _ = fmt.Sprintf 80 var _ = json.NewDecoder 81 var _ = io.Copy 82 var _ = url.Parse 83 var _ = gensupport.MarshalJSON 84 var _ = googleapi.Version 85 var _ = errors.New 86 var _ = strings.Replace 87 var _ = context.Canceled 88 var _ = internaloption.WithDefaultEndpoint 89 var _ = internal.Version 90 91 const apiId = "redis:v1" 92 const apiName = "redis" 93 const apiVersion = "v1" 94 const basePath = "https://redis.googleapis.com/" 95 const basePathTemplate = "https://redis.UNIVERSE_DOMAIN/" 96 const mtlsBasePath = "https://redis.mtls.googleapis.com/" 97 98 // OAuth2 scopes used by this API. 99 const ( 100 // See, edit, configure, and delete your Google Cloud data and see the email 101 // address for your Google Account. 102 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 103 ) 104 105 // NewService creates a new Service. 106 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 107 scopesOption := internaloption.WithDefaultScopes( 108 "https://www.googleapis.com/auth/cloud-platform", 109 ) 110 // NOTE: prepend, so we don't override user-specified scopes. 111 opts = append([]option.ClientOption{scopesOption}, opts...) 112 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 113 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 114 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 115 opts = append(opts, internaloption.EnableNewAuthLibrary()) 116 client, endpoint, err := htransport.NewClient(ctx, opts...) 117 if err != nil { 118 return nil, err 119 } 120 s, err := New(client) 121 if err != nil { 122 return nil, err 123 } 124 if endpoint != "" { 125 s.BasePath = endpoint 126 } 127 return s, nil 128 } 129 130 // New creates a new Service. It uses the provided http.Client for requests. 131 // 132 // Deprecated: please use NewService instead. 133 // To provide a custom HTTP client, use option.WithHTTPClient. 134 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 135 func New(client *http.Client) (*Service, error) { 136 if client == nil { 137 return nil, errors.New("client is nil") 138 } 139 s := &Service{client: client, BasePath: basePath} 140 s.Projects = NewProjectsService(s) 141 return s, nil 142 } 143 144 type Service struct { 145 client *http.Client 146 BasePath string // API endpoint base URL 147 UserAgent string // optional additional User-Agent fragment 148 149 Projects *ProjectsService 150 } 151 152 func (s *Service) userAgent() string { 153 if s.UserAgent == "" { 154 return googleapi.UserAgent 155 } 156 return googleapi.UserAgent + " " + s.UserAgent 157 } 158 159 func NewProjectsService(s *Service) *ProjectsService { 160 rs := &ProjectsService{s: s} 161 rs.Locations = NewProjectsLocationsService(s) 162 return rs 163 } 164 165 type ProjectsService struct { 166 s *Service 167 168 Locations *ProjectsLocationsService 169 } 170 171 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 172 rs := &ProjectsLocationsService{s: s} 173 rs.Clusters = NewProjectsLocationsClustersService(s) 174 rs.Instances = NewProjectsLocationsInstancesService(s) 175 rs.Operations = NewProjectsLocationsOperationsService(s) 176 return rs 177 } 178 179 type ProjectsLocationsService struct { 180 s *Service 181 182 Clusters *ProjectsLocationsClustersService 183 184 Instances *ProjectsLocationsInstancesService 185 186 Operations *ProjectsLocationsOperationsService 187 } 188 189 func NewProjectsLocationsClustersService(s *Service) *ProjectsLocationsClustersService { 190 rs := &ProjectsLocationsClustersService{s: s} 191 return rs 192 } 193 194 type ProjectsLocationsClustersService struct { 195 s *Service 196 } 197 198 func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService { 199 rs := &ProjectsLocationsInstancesService{s: s} 200 return rs 201 } 202 203 type ProjectsLocationsInstancesService struct { 204 s *Service 205 } 206 207 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 208 rs := &ProjectsLocationsOperationsService{s: s} 209 return rs 210 } 211 212 type ProjectsLocationsOperationsService struct { 213 s *Service 214 } 215 216 // AOFConfig: Configuration of the AOF based persistence. 217 type AOFConfig struct { 218 // AppendFsync: Optional. fsync configuration. 219 // 220 // Possible values: 221 // "APPEND_FSYNC_UNSPECIFIED" - Not set. Default: EVERYSEC 222 // "NO" - Never fsync. Normally Linux will flush data every 30 seconds with 223 // this configuration, but it's up to the kernel's exact tuning. 224 // "EVERYSEC" - fsync every second. Fast enough, and you may lose 1 second of 225 // data if there is a disaster 226 // "ALWAYS" - fsync every time new commands are appended to the AOF. It has 227 // the best data loss protection at the cost of performance 228 AppendFsync string `json:"appendFsync,omitempty"` 229 // ForceSendFields is a list of field names (e.g. "AppendFsync") to 230 // unconditionally include in API requests. By default, fields with empty or 231 // default values are omitted from API requests. See 232 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 233 // details. 234 ForceSendFields []string `json:"-"` 235 // NullFields is a list of field names (e.g. "AppendFsync") to include in API 236 // requests with the JSON null value. By default, fields with empty values are 237 // omitted from API requests. See 238 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 239 NullFields []string `json:"-"` 240 } 241 242 func (s *AOFConfig) MarshalJSON() ([]byte, error) { 243 type NoMethod AOFConfig 244 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 245 } 246 247 // AvailabilityConfiguration: Configuration for availability of database 248 // instance 249 type AvailabilityConfiguration struct { 250 // AvailabilityType: Availability type. Potential values: * `ZONAL`: The 251 // instance serves data from only one zone. Outages in that zone affect data 252 // accessibility. * `REGIONAL`: The instance can serve data from more than one 253 // zone in a region (it is highly available). 254 // 255 // Possible values: 256 // "AVAILABILITY_TYPE_UNSPECIFIED" 257 // "ZONAL" - Zonal available instance. 258 // "REGIONAL" - Regional available instance. 259 // "MULTI_REGIONAL" - Multi regional instance 260 // "AVAILABILITY_TYPE_OTHER" - For rest of the other category 261 AvailabilityType string `json:"availabilityType,omitempty"` 262 // CrossRegionReplicaConfigured: Checks for resources that are configured to 263 // have redundancy, and ongoing replication across regions 264 CrossRegionReplicaConfigured bool `json:"crossRegionReplicaConfigured,omitempty"` 265 ExternalReplicaConfigured bool `json:"externalReplicaConfigured,omitempty"` 266 PromotableReplicaConfigured bool `json:"promotableReplicaConfigured,omitempty"` 267 // ForceSendFields is a list of field names (e.g. "AvailabilityType") to 268 // unconditionally include in API requests. By default, fields with empty or 269 // default values are omitted from API requests. See 270 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 271 // details. 272 ForceSendFields []string `json:"-"` 273 // NullFields is a list of field names (e.g. "AvailabilityType") to include in 274 // API requests with the JSON null value. By default, fields with empty values 275 // are omitted from API requests. See 276 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 277 NullFields []string `json:"-"` 278 } 279 280 func (s *AvailabilityConfiguration) MarshalJSON() ([]byte, error) { 281 type NoMethod AvailabilityConfiguration 282 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 283 } 284 285 // BackupConfiguration: Configuration for automatic backups 286 type BackupConfiguration struct { 287 // AutomatedBackupEnabled: Whether customer visible automated backups are 288 // enabled on the instance. 289 AutomatedBackupEnabled bool `json:"automatedBackupEnabled,omitempty"` 290 // BackupRetentionSettings: Backup retention settings. 291 BackupRetentionSettings *RetentionSettings `json:"backupRetentionSettings,omitempty"` 292 // PointInTimeRecoveryEnabled: Whether point-in-time recovery is enabled. This 293 // is optional field, if the database service does not have this feature or 294 // metadata is not available in control plane, this can be omitted. 295 PointInTimeRecoveryEnabled bool `json:"pointInTimeRecoveryEnabled,omitempty"` 296 // ForceSendFields is a list of field names (e.g. "AutomatedBackupEnabled") to 297 // unconditionally include in API requests. By default, fields with empty or 298 // default values are omitted from API requests. See 299 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 300 // details. 301 ForceSendFields []string `json:"-"` 302 // NullFields is a list of field names (e.g. "AutomatedBackupEnabled") to 303 // include in API requests with the JSON null value. By default, fields with 304 // empty values are omitted from API requests. See 305 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 306 NullFields []string `json:"-"` 307 } 308 309 func (s *BackupConfiguration) MarshalJSON() ([]byte, error) { 310 type NoMethod BackupConfiguration 311 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 312 } 313 314 // BackupRun: A backup run. 315 type BackupRun struct { 316 // EndTime: The time the backup operation completed. REQUIRED 317 EndTime string `json:"endTime,omitempty"` 318 // Error: Information about why the backup operation failed. This is only 319 // present if the run has the FAILED status. OPTIONAL 320 Error *OperationError `json:"error,omitempty"` 321 // StartTime: The time the backup operation started. REQUIRED 322 StartTime string `json:"startTime,omitempty"` 323 // Status: The status of this run. REQUIRED 324 // 325 // Possible values: 326 // "STATUS_UNSPECIFIED" 327 // "SUCCESSFUL" - The backup was successful. 328 // "FAILED" - The backup was unsuccessful. 329 Status string `json:"status,omitempty"` 330 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally 331 // include in API requests. By default, fields with empty or default values are 332 // omitted from API requests. See 333 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 334 // details. 335 ForceSendFields []string `json:"-"` 336 // NullFields is a list of field names (e.g. "EndTime") to include in API 337 // requests with the JSON null value. By default, fields with empty values are 338 // omitted from API requests. See 339 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 340 NullFields []string `json:"-"` 341 } 342 343 func (s *BackupRun) MarshalJSON() ([]byte, error) { 344 type NoMethod BackupRun 345 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 346 } 347 348 type CertChain struct { 349 // Certificates: The certificates that form the CA chain, from leaf to root 350 // order. 351 Certificates []string `json:"certificates,omitempty"` 352 // ForceSendFields is a list of field names (e.g. "Certificates") to 353 // unconditionally include in API requests. By default, fields with empty or 354 // default values are omitted from API requests. See 355 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 356 // details. 357 ForceSendFields []string `json:"-"` 358 // NullFields is a list of field names (e.g. "Certificates") to include in API 359 // requests with the JSON null value. By default, fields with empty values are 360 // omitted from API requests. See 361 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 362 NullFields []string `json:"-"` 363 } 364 365 func (s *CertChain) MarshalJSON() ([]byte, error) { 366 type NoMethod CertChain 367 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 368 } 369 370 // CertificateAuthority: Redis cluster certificate authority 371 type CertificateAuthority struct { 372 ManagedServerCa *ManagedCertificateAuthority `json:"managedServerCa,omitempty"` 373 // Name: Identifier. Unique name of the resource in this scope including 374 // project, location and cluster using the form: 375 // `projects/{project}/locations/{location}/clusters/{cluster}/certificateAuthor 376 // ity` 377 Name string `json:"name,omitempty"` 378 379 // ServerResponse contains the HTTP response code and headers from the server. 380 googleapi.ServerResponse `json:"-"` 381 // ForceSendFields is a list of field names (e.g. "ManagedServerCa") to 382 // unconditionally include in API requests. By default, fields with empty or 383 // default values are omitted from API requests. See 384 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 385 // details. 386 ForceSendFields []string `json:"-"` 387 // NullFields is a list of field names (e.g. "ManagedServerCa") to include in 388 // API requests with the JSON null value. By default, fields with empty values 389 // are omitted from API requests. See 390 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 391 NullFields []string `json:"-"` 392 } 393 394 func (s *CertificateAuthority) MarshalJSON() ([]byte, error) { 395 type NoMethod CertificateAuthority 396 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 397 } 398 399 // Cluster: A cluster instance. 400 type Cluster struct { 401 // AuthorizationMode: Optional. The authorization mode of the Redis cluster. If 402 // not provided, auth feature is disabled for the cluster. 403 // 404 // Possible values: 405 // "AUTH_MODE_UNSPECIFIED" - Not set. 406 // "AUTH_MODE_IAM_AUTH" - IAM basic authorization mode 407 // "AUTH_MODE_DISABLED" - Authorization disabled mode 408 AuthorizationMode string `json:"authorizationMode,omitempty"` 409 // CreateTime: Output only. The timestamp associated with the cluster creation 410 // request. 411 CreateTime string `json:"createTime,omitempty"` 412 // DeletionProtectionEnabled: Optional. The delete operation will fail when the 413 // value is set to true. 414 DeletionProtectionEnabled bool `json:"deletionProtectionEnabled,omitempty"` 415 // DiscoveryEndpoints: Output only. Endpoints created on each given network, 416 // for Redis clients to connect to the cluster. Currently only one discovery 417 // endpoint is supported. 418 DiscoveryEndpoints []*DiscoveryEndpoint `json:"discoveryEndpoints,omitempty"` 419 // Name: Required. Unique name of the resource in this scope including project 420 // and location using the form: 421 // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` 422 Name string `json:"name,omitempty"` 423 // NodeType: Optional. The type of a redis node in the cluster. NodeType 424 // determines the underlying machine-type of a redis node. 425 // 426 // Possible values: 427 // "NODE_TYPE_UNSPECIFIED" 428 // "REDIS_SHARED_CORE_NANO" - Redis shared core nano node_type. 429 // "REDIS_HIGHMEM_MEDIUM" - Redis highmem medium node_type. 430 // "REDIS_HIGHMEM_XLARGE" - Redis highmem xlarge node_type. 431 // "REDIS_STANDARD_SMALL" - Redis standard small node_type. 432 NodeType string `json:"nodeType,omitempty"` 433 // PersistenceConfig: Optional. Persistence config (RDB, AOF) for the cluster. 434 PersistenceConfig *ClusterPersistenceConfig `json:"persistenceConfig,omitempty"` 435 // PreciseSizeGb: Output only. Precise value of redis memory size in GB for the 436 // entire cluster. 437 PreciseSizeGb float64 `json:"preciseSizeGb,omitempty"` 438 // PscConfigs: Required. Each PscConfig configures the consumer network where 439 // IPs will be designated to the cluster for client access through Private 440 // Service Connect Automation. Currently, only one PscConfig is supported. 441 PscConfigs []*PscConfig `json:"pscConfigs,omitempty"` 442 // PscConnections: Output only. PSC connections for discovery of the cluster 443 // topology and accessing the cluster. 444 PscConnections []*PscConnection `json:"pscConnections,omitempty"` 445 // RedisConfigs: Optional. Key/Value pairs of customer overrides for mutable 446 // Redis Configs 447 RedisConfigs map[string]string `json:"redisConfigs,omitempty"` 448 // ReplicaCount: Optional. The number of replica nodes per shard. 449 ReplicaCount int64 `json:"replicaCount,omitempty"` 450 // ShardCount: Required. Number of shards for the Redis cluster. 451 ShardCount int64 `json:"shardCount,omitempty"` 452 // SizeGb: Output only. Redis memory size in GB for the entire cluster rounded 453 // up to the next integer. 454 SizeGb int64 `json:"sizeGb,omitempty"` 455 // State: Output only. The current state of this cluster. Can be CREATING, 456 // READY, UPDATING, DELETING and SUSPENDED 457 // 458 // Possible values: 459 // "STATE_UNSPECIFIED" - Not set. 460 // "CREATING" - Redis cluster is being created. 461 // "ACTIVE" - Redis cluster has been created and is fully usable. 462 // "UPDATING" - Redis cluster configuration is being updated. 463 // "DELETING" - Redis cluster is being deleted. 464 State string `json:"state,omitempty"` 465 // StateInfo: Output only. Additional information about the current state of 466 // the cluster. 467 StateInfo *StateInfo `json:"stateInfo,omitempty"` 468 // TransitEncryptionMode: Optional. The in-transit encryption for the Redis 469 // cluster. If not provided, encryption is disabled for the cluster. 470 // 471 // Possible values: 472 // "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED" - In-transit encryption not set. 473 // "TRANSIT_ENCRYPTION_MODE_DISABLED" - In-transit encryption disabled. 474 // "TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION" - Use server managed 475 // encryption for in-transit encryption. 476 TransitEncryptionMode string `json:"transitEncryptionMode,omitempty"` 477 // Uid: Output only. System assigned, unique identifier for the cluster. 478 Uid string `json:"uid,omitempty"` 479 480 // ServerResponse contains the HTTP response code and headers from the server. 481 googleapi.ServerResponse `json:"-"` 482 // ForceSendFields is a list of field names (e.g. "AuthorizationMode") to 483 // unconditionally include in API requests. By default, fields with empty or 484 // default values are omitted from API requests. See 485 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 486 // details. 487 ForceSendFields []string `json:"-"` 488 // NullFields is a list of field names (e.g. "AuthorizationMode") to include in 489 // API requests with the JSON null value. By default, fields with empty values 490 // are omitted from API requests. See 491 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 492 NullFields []string `json:"-"` 493 } 494 495 func (s *Cluster) MarshalJSON() ([]byte, error) { 496 type NoMethod Cluster 497 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 498 } 499 500 func (s *Cluster) UnmarshalJSON(data []byte) error { 501 type NoMethod Cluster 502 var s1 struct { 503 PreciseSizeGb gensupport.JSONFloat64 `json:"preciseSizeGb"` 504 *NoMethod 505 } 506 s1.NoMethod = (*NoMethod)(s) 507 if err := json.Unmarshal(data, &s1); err != nil { 508 return err 509 } 510 s.PreciseSizeGb = float64(s1.PreciseSizeGb) 511 return nil 512 } 513 514 // ClusterPersistenceConfig: Configuration of the persistence functionality. 515 type ClusterPersistenceConfig struct { 516 // AofConfig: Optional. AOF configuration. This field will be ignored if mode 517 // is not AOF. 518 AofConfig *AOFConfig `json:"aofConfig,omitempty"` 519 // Mode: Optional. The mode of persistence. 520 // 521 // Possible values: 522 // "PERSISTENCE_MODE_UNSPECIFIED" - Not set. 523 // "DISABLED" - Persistence is disabled, and any snapshot data is deleted. 524 // "RDB" - RDB based persistence is enabled. 525 // "AOF" - AOF based persistence is enabled. 526 Mode string `json:"mode,omitempty"` 527 // RdbConfig: Optional. RDB configuration. This field will be ignored if mode 528 // is not RDB. 529 RdbConfig *RDBConfig `json:"rdbConfig,omitempty"` 530 // ForceSendFields is a list of field names (e.g. "AofConfig") to 531 // unconditionally include in API requests. By default, fields with empty or 532 // default values are omitted from API requests. See 533 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 534 // details. 535 ForceSendFields []string `json:"-"` 536 // NullFields is a list of field names (e.g. "AofConfig") to include in API 537 // requests with the JSON null value. By default, fields with empty values are 538 // omitted from API requests. See 539 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 540 NullFields []string `json:"-"` 541 } 542 543 func (s *ClusterPersistenceConfig) MarshalJSON() ([]byte, error) { 544 type NoMethod ClusterPersistenceConfig 545 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 546 } 547 548 // Compliance: Contains compliance information about a security standard 549 // indicating unmet recommendations. 550 type Compliance struct { 551 // Standard: Industry-wide compliance standards or benchmarks, such as CIS, 552 // PCI, and OWASP. 553 Standard string `json:"standard,omitempty"` 554 // Version: Version of the standard or benchmark, for example, 1.1 555 Version string `json:"version,omitempty"` 556 // ForceSendFields is a list of field names (e.g. "Standard") to 557 // unconditionally include in API requests. By default, fields with empty or 558 // default values are omitted from API requests. See 559 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 560 // details. 561 ForceSendFields []string `json:"-"` 562 // NullFields is a list of field names (e.g. "Standard") to include in API 563 // requests with the JSON null value. By default, fields with empty values are 564 // omitted from API requests. See 565 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 566 NullFields []string `json:"-"` 567 } 568 569 func (s *Compliance) MarshalJSON() ([]byte, error) { 570 type NoMethod Compliance 571 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 572 } 573 574 // CustomMetadataData: Any custom metadata associated with the resource. i.e. A 575 // spanner instance can have multiple databases with its own unique metadata. 576 // Information for these individual databases can be captured in custom 577 // metadata data 578 type CustomMetadataData struct { 579 DatabaseMetadata []*DatabaseMetadata `json:"databaseMetadata,omitempty"` 580 // ForceSendFields is a list of field names (e.g. "DatabaseMetadata") to 581 // unconditionally include in API requests. By default, fields with empty or 582 // default values are omitted from API requests. See 583 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 584 // details. 585 ForceSendFields []string `json:"-"` 586 // NullFields is a list of field names (e.g. "DatabaseMetadata") to include in 587 // API requests with the JSON null value. By default, fields with empty values 588 // are omitted from API requests. See 589 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 590 NullFields []string `json:"-"` 591 } 592 593 func (s *CustomMetadataData) MarshalJSON() ([]byte, error) { 594 type NoMethod CustomMetadataData 595 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 596 } 597 598 // DatabaseMetadata: Metadata for individual databases created in an instance. 599 // i.e. spanner instance can have multiple databases with unique configuration 600 // settings. 601 type DatabaseMetadata struct { 602 // BackupConfiguration: Backup configuration for this database 603 BackupConfiguration *BackupConfiguration `json:"backupConfiguration,omitempty"` 604 // BackupRun: Information about the last backup attempt for this database 605 BackupRun *BackupRun `json:"backupRun,omitempty"` 606 Product *Product `json:"product,omitempty"` 607 ResourceId *DatabaseResourceId `json:"resourceId,omitempty"` 608 // ResourceName: Required. Database name. Resource name to follow CAIS 609 // resource_name format as noted here go/condor-common-datamodel 610 ResourceName string `json:"resourceName,omitempty"` 611 // ForceSendFields is a list of field names (e.g. "BackupConfiguration") to 612 // unconditionally include in API requests. By default, fields with empty or 613 // default values are omitted from API requests. See 614 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 615 // details. 616 ForceSendFields []string `json:"-"` 617 // NullFields is a list of field names (e.g. "BackupConfiguration") to include 618 // in API requests with the JSON null value. By default, fields with empty 619 // values are omitted from API requests. See 620 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 621 NullFields []string `json:"-"` 622 } 623 624 func (s *DatabaseMetadata) MarshalJSON() ([]byte, error) { 625 type NoMethod DatabaseMetadata 626 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 627 } 628 629 // DatabaseResourceFeed: DatabaseResourceFeed is the top level proto to be used 630 // to ingest different database resource level events into Condor platform. 631 type DatabaseResourceFeed struct { 632 // FeedTimestamp: Required. Timestamp when feed is generated. 633 FeedTimestamp string `json:"feedTimestamp,omitempty"` 634 // FeedType: Required. Type feed to be ingested into condor 635 // 636 // Possible values: 637 // "FEEDTYPE_UNSPECIFIED" 638 // "RESOURCE_METADATA" - Database resource metadata feed from control plane 639 // "OBSERVABILITY_DATA" - Database resource monitoring data 640 // "SECURITY_FINDING_DATA" - Database resource security health signal data 641 // "RECOMMENDATION_SIGNAL_DATA" - Database resource recommendation signal 642 // data 643 FeedType string `json:"feedType,omitempty"` 644 // RecommendationSignalData: More feed data would be added in subsequent CLs 645 RecommendationSignalData *DatabaseResourceRecommendationSignalData `json:"recommendationSignalData,omitempty"` 646 ResourceHealthSignalData *DatabaseResourceHealthSignalData `json:"resourceHealthSignalData,omitempty"` 647 // ResourceId: Primary key associated with the Resource. resource_id is 648 // available in individual feed level as well. 649 ResourceId *DatabaseResourceId `json:"resourceId,omitempty"` 650 ResourceMetadata *DatabaseResourceMetadata `json:"resourceMetadata,omitempty"` 651 // ForceSendFields is a list of field names (e.g. "FeedTimestamp") to 652 // unconditionally include in API requests. By default, fields with empty or 653 // default values are omitted from API requests. See 654 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 655 // details. 656 ForceSendFields []string `json:"-"` 657 // NullFields is a list of field names (e.g. "FeedTimestamp") to include in API 658 // requests with the JSON null value. By default, fields with empty values are 659 // omitted from API requests. See 660 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 661 NullFields []string `json:"-"` 662 } 663 664 func (s *DatabaseResourceFeed) MarshalJSON() ([]byte, error) { 665 type NoMethod DatabaseResourceFeed 666 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 667 } 668 669 // DatabaseResourceHealthSignalData: Common model for database resource health 670 // signal data. 671 type DatabaseResourceHealthSignalData struct { 672 // AdditionalMetadata: Any other additional metadata 673 AdditionalMetadata googleapi.RawMessage `json:"additionalMetadata,omitempty"` 674 // Compliance: Industry standards associated with this signal; if this signal 675 // is an issue, that could be a violation of the associated industry 676 // standard(s). For example, AUTO_BACKUP_DISABLED signal is associated with CIS 677 // GCP 1.1, CIS GCP 1.2, CIS GCP 1.3, NIST 800-53 and ISO-27001 compliance 678 // standards. If a database resource does not have automated backup enable, it 679 // will violate these following industry standards. 680 Compliance []*Compliance `json:"compliance,omitempty"` 681 // Description: Description associated with signal 682 Description string `json:"description,omitempty"` 683 // EventTime: Required. The last time at which the event described by this 684 // signal took place 685 EventTime string `json:"eventTime,omitempty"` 686 // ExternalUri: The external-uri of the signal, using which more information 687 // about this signal can be obtained. In GCP, this will take user to SCC page 688 // to get more details about signals. 689 ExternalUri string `json:"externalUri,omitempty"` 690 // Name: Required. The name of the signal, ex: PUBLIC_SQL_INSTANCE, 691 // SQL_LOG_ERROR_VERBOSITY etc. 692 Name string `json:"name,omitempty"` 693 // Provider: Cloud provider name. Ex: GCP/AWS/Azure/OnPrem/SelfManaged 694 // 695 // Possible values: 696 // "PROVIDER_UNSPECIFIED" 697 // "GCP" - Google cloud platform provider 698 // "AWS" - Amazon web service 699 // "AZURE" - Azure web service 700 // "ONPREM" - On-prem database resources. 701 // "SELFMANAGED" - Self-managed database provider. These are resources on a 702 // cloud platform, e.g., database resource installed in a GCE VM, but not a 703 // managed database service. 704 // "PROVIDER_OTHER" - For the rest of the other categories. Other refers to 705 // the rest of other database service providers, this could be smaller cloud 706 // provider. This needs to be provided when the provider is known, but it is 707 // not present in the existing set of enum values. 708 Provider string `json:"provider,omitempty"` 709 // ResourceContainer: Closest parent container of this resource. In GCP, 710 // 'container' refers to a Cloud Resource Manager project. It must be resource 711 // name of a Cloud Resource Manager project with the format of "provider//", 712 // such as "projects/123". For GCP provided resources, number should be project 713 // number. 714 ResourceContainer string `json:"resourceContainer,omitempty"` 715 // ResourceName: Required. Database resource name associated with the signal. 716 // Resource name to follow CAIS resource_name format as noted here 717 // go/condor-common-datamodel 718 ResourceName string `json:"resourceName,omitempty"` 719 // SignalClass: Required. The class of the signal, such as if it's a THREAT or 720 // VULNERABILITY. 721 // 722 // Possible values: 723 // "CLASS_UNSPECIFIED" - Unspecified signal class. 724 // "THREAT" - Describes unwanted or malicious activity. 725 // "VULNERABILITY" - Describes a potential weakness in software that 726 // increases risk to Confidentiality & Integrity & Availability. 727 // "MISCONFIGURATION" - Describes a potential weakness in cloud 728 // resource/asset configuration that increases risk. 729 // "OBSERVATION" - Describes a security observation that is for informational 730 // purposes. 731 // "ERROR" - Describes an error that prevents some SCC functionality. 732 SignalClass string `json:"signalClass,omitempty"` 733 // SignalId: Required. Unique identifier for the signal. This is an unique id 734 // which would be mainatined by partner to identify a signal. 735 SignalId string `json:"signalId,omitempty"` 736 // SignalType: Required. Type of signal, for example, 737 // `AVAILABLE_IN_MULTIPLE_ZONES`, `LOGGING_MOST_ERRORS`, etc. 738 // 739 // Possible values: 740 // "SIGNAL_TYPE_UNSPECIFIED" - Unspecified. 741 // "SIGNAL_TYPE_NOT_PROTECTED_BY_AUTOMATIC_FAILOVER" - Represents if a 742 // resource is protected by automatic failover. Checks for resources that are 743 // configured to have redundancy within a region that enables automatic 744 // failover. 745 // "SIGNAL_TYPE_GROUP_NOT_REPLICATING_ACROSS_REGIONS" - Represents if a group 746 // is replicating across regions. Checks for resources that are configured to 747 // have redundancy, and ongoing replication, across regions. 748 // "SIGNAL_TYPE_NOT_AVAILABLE_IN_MULTIPLE_ZONES" - Represents if the resource 749 // is available in multiple zones or not. 750 // "SIGNAL_TYPE_NOT_AVAILABLE_IN_MULTIPLE_REGIONS" - Represents if a resource 751 // is available in multiple regions. 752 // "SIGNAL_TYPE_NO_PROMOTABLE_REPLICA" - Represents if a resource has a 753 // promotable replica. 754 // "SIGNAL_TYPE_NO_AUTOMATED_BACKUP_POLICY" - Represents if a resource has an 755 // automated backup policy. 756 // "SIGNAL_TYPE_SHORT_BACKUP_RETENTION" - Represents if a resources has a 757 // short backup retention period. 758 // "SIGNAL_TYPE_LAST_BACKUP_FAILED" - Represents if the last backup of a 759 // resource failed. 760 // "SIGNAL_TYPE_LAST_BACKUP_OLD" - Represents if the last backup of a 761 // resource is older than some threshold value. 762 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_2_0" - Represents if a resource 763 // violates CIS GCP Foundation 2.0. 764 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_3" - Represents if a resource 765 // violates CIS GCP Foundation 1.3. 766 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_2" - Represents if a resource 767 // violates CIS GCP Foundation 1.2. 768 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_1" - Represents if a resource 769 // violates CIS GCP Foundation 1.1. 770 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_0" - Represents if a resource 771 // violates CIS GCP Foundation 1.0. 772 // "SIGNAL_TYPE_VIOLATES_NIST_800_53" - Represents if a resource violates 773 // NIST 800-53. 774 // "SIGNAL_TYPE_VIOLATES_ISO_27001" - Represents if a resource violates 775 // ISO-27001. 776 // "SIGNAL_TYPE_VIOLATES_PCI_DSS_V3_2_1" - Represents if a resource violates 777 // PCI-DSS v3.2.1. 778 // "SIGNAL_TYPE_LOGS_NOT_OPTIMIZED_FOR_TROUBLESHOOTING" - Represents if 779 // log_checkpoints database flag for a Cloud SQL for PostgreSQL instance is not 780 // set to on. 781 // "SIGNAL_TYPE_QUERY_DURATIONS_NOT_LOGGED" - Represents if the log_duration 782 // database flag for a Cloud SQL for PostgreSQL instance is not set to on. 783 // "SIGNAL_TYPE_VERBOSE_ERROR_LOGGING" - Represents if the 784 // log_error_verbosity database flag for a Cloud SQL for PostgreSQL instance is 785 // not set to default or stricter (default or terse). 786 // "SIGNAL_TYPE_QUERY_LOCK_WAITS_NOT_LOGGED" - Represents if the 787 // log_lock_waits database flag for a Cloud SQL for PostgreSQL instance is not 788 // set to on. 789 // "SIGNAL_TYPE_LOGGING_MOST_ERRORS" - Represents if the 790 // log_min_error_statement database flag for a Cloud SQL for PostgreSQL 791 // instance is not set appropriately. 792 // "SIGNAL_TYPE_LOGGING_ONLY_CRITICAL_ERRORS" - Represents if the 793 // log_min_error_statement database flag for a Cloud SQL for PostgreSQL 794 // instance does not have an appropriate severity level. 795 // "SIGNAL_TYPE_MINIMAL_ERROR_LOGGING" - Represents if the log_min_messages 796 // database flag for a Cloud SQL for PostgreSQL instance is not set to warning 797 // or another recommended value. 798 // "SIGNAL_TYPE_QUERY_STATISTICS_LOGGED" - Represents if the databaseFlags 799 // property of instance metadata for the log_executor_status field is set to 800 // on. 801 // "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_CLIENT_HOSTNAME" - Represents if the 802 // log_hostname database flag for a Cloud SQL for PostgreSQL instance is not 803 // set to off. 804 // "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PARSER_STATISTICS" - Represents if the 805 // log_parser_stats database flag for a Cloud SQL for PostgreSQL instance is 806 // not set to off. 807 // "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PLANNER_STATISTICS" - Represents if the 808 // log_planner_stats database flag for a Cloud SQL for PostgreSQL instance is 809 // not set to off. 810 // "SIGNAL_TYPE_NOT_LOGGING_ONLY_DDL_STATEMENTS" - Represents if the 811 // log_statement database flag for a Cloud SQL for PostgreSQL instance is not 812 // set to DDL (all data definition statements). 813 // "SIGNAL_TYPE_LOGGING_QUERY_STATISTICS" - Represents if the 814 // log_statement_stats database flag for a Cloud SQL for PostgreSQL instance is 815 // not set to off. 816 // "SIGNAL_TYPE_NOT_LOGGING_TEMPORARY_FILES" - Represents if the 817 // log_temp_files database flag for a Cloud SQL for PostgreSQL instance is not 818 // set to "0". (NOTE: 0 = ON) 819 // "SIGNAL_TYPE_CONNECTION_MAX_NOT_CONFIGURED" - Represents if the user 820 // connections database flag for a Cloud SQL for SQL Server instance is 821 // configured. 822 // "SIGNAL_TYPE_USER_OPTIONS_CONFIGURED" - Represents if the user options 823 // database flag for Cloud SQL SQL Server instance is configured or not. 824 // "SIGNAL_TYPE_EXPOSED_TO_PUBLIC_ACCESS" - Represents if a resource is 825 // exposed to public access. 826 // "SIGNAL_TYPE_UNENCRYPTED_CONNECTIONS" - Represents if a resources requires 827 // all incoming connections to use SSL or not. 828 // "SIGNAL_TYPE_NO_ROOT_PASSWORD" - Represents if a Cloud SQL database has a 829 // password configured for the root account or not. 830 // "SIGNAL_TYPE_WEAK_ROOT_PASSWORD" - Represents if a Cloud SQL database has 831 // a weak password configured for the root account. 832 // "SIGNAL_TYPE_ENCRYPTION_KEY_NOT_CUSTOMER_MANAGED" - Represents if a SQL 833 // database instance is not encrypted with customer-managed encryption keys 834 // (CMEK). 835 // "SIGNAL_TYPE_SERVER_AUTHENTICATION_NOT_REQUIRED" - Represents if The 836 // contained database authentication database flag for a Cloud SQL for SQL 837 // Server instance is not set to off. 838 // "SIGNAL_TYPE_EXPOSED_BY_OWNERSHIP_CHAINING" - Represents if the 839 // cross_db_ownership_chaining database flag for a Cloud SQL for SQL Server 840 // instance is not set to off. 841 // "SIGNAL_TYPE_EXPOSED_TO_EXTERNAL_SCRIPTS" - Represents if he external 842 // scripts enabled database flag for a Cloud SQL for SQL Server instance is not 843 // set to off. 844 // "SIGNAL_TYPE_EXPOSED_TO_LOCAL_DATA_LOADS" - Represents if the local_infile 845 // database flag for a Cloud SQL for MySQL instance is not set to off. 846 // "SIGNAL_TYPE_CONNECTION_ATTEMPTS_NOT_LOGGED" - Represents if the 847 // log_connections database flag for a Cloud SQL for PostgreSQL instance is not 848 // set to on. 849 // "SIGNAL_TYPE_DISCONNECTIONS_NOT_LOGGED" - Represents if the 850 // log_disconnections database flag for a Cloud SQL for PostgreSQL instance is 851 // not set to on. 852 // "SIGNAL_TYPE_LOGGING_EXCESSIVE_STATEMENT_INFO" - Represents if the 853 // log_min_duration_statement database flag for a Cloud SQL for PostgreSQL 854 // instance is not set to -1. 855 // "SIGNAL_TYPE_EXPOSED_TO_REMOTE_ACCESS" - Represents if the remote access 856 // database flag for a Cloud SQL for SQL Server instance is not set to off. 857 // "SIGNAL_TYPE_DATABASE_NAMES_EXPOSED" - Represents if the 858 // skip_show_database database flag for a Cloud SQL for MySQL instance is not 859 // set to on. 860 // "SIGNAL_TYPE_SENSITIVE_TRACE_INFO_NOT_MASKED" - Represents if the 3625 861 // (trace flag) database flag for a Cloud SQL for SQL Server instance is not 862 // set to on. 863 // "SIGNAL_TYPE_PUBLIC_IP_ENABLED" - Represents if public IP is enabled. 864 // "SIGNAL_TYPE_IDLE" - Represents Idle instance helps to reduce costs. 865 // "SIGNAL_TYPE_OVERPROVISIONED" - Represents instances that are 866 // unnecessarily large for given workload. 867 // "SIGNAL_TYPE_HIGH_NUMBER_OF_OPEN_TABLES" - Represents high number of 868 // concurrently opened tables. 869 // "SIGNAL_TYPE_HIGH_NUMBER_OF_TABLES" - Represents high table count close to 870 // SLA limit. 871 // "SIGNAL_TYPE_HIGH_TRANSACTION_ID_UTILIZATION" - Represents high number of 872 // unvacuumed transactions 873 // "SIGNAL_TYPE_UNDERPROVISIONED" - Represents need for more CPU and/or 874 // memory 875 // "SIGNAL_TYPE_OUT_OF_DISK" - Represents out of disk. 876 // "SIGNAL_TYPE_SERVER_CERTIFICATE_NEAR_EXPIRY" - Represents server 877 // certificate is near expiry. 878 // "SIGNAL_TYPE_DATABASE_AUDITING_DISABLED" - Represents database auditing is 879 // disabled. 880 // "SIGNAL_TYPE_RESTRICT_AUTHORIZED_NETWORKS" - Represents not restricted to 881 // authorized networks. 882 // "SIGNAL_TYPE_VIOLATE_POLICY_RESTRICT_PUBLIC_IP" - Represents violate org 883 // policy restrict public ip. 884 // "SIGNAL_TYPE_QUOTA_LIMIT" - Cluster nearing quota limit 885 // "SIGNAL_TYPE_NO_PASSWORD_POLICY" - No password policy set on resources 886 // "SIGNAL_TYPE_CONNECTIONS_PERFORMANCE_IMPACT" - Performance impact of 887 // connections settings 888 // "SIGNAL_TYPE_TMP_TABLES_PERFORMANCE_IMPACT" - Performance impact of 889 // temporary tables settings 890 // "SIGNAL_TYPE_TRANS_LOGS_PERFORMANCE_IMPACT" - Performance impact of 891 // transaction logs settings 892 // "SIGNAL_TYPE_HIGH_JOINS_WITHOUT_INDEXES" - Performance impact of high 893 // joins without indexes 894 SignalType string `json:"signalType,omitempty"` 895 // Possible values: 896 // "STATE_UNSPECIFIED" - Unspecified state. 897 // "ACTIVE" - The signal requires attention and has not been addressed yet. 898 // "RESOLVED" - The signal has been fixed, triaged as a non-issue or 899 // otherwise addressed and is no longer active. 900 // "MUTED" - The signal has been muted. 901 State string `json:"state,omitempty"` 902 // ForceSendFields is a list of field names (e.g. "AdditionalMetadata") to 903 // unconditionally include in API requests. By default, fields with empty or 904 // default values are omitted from API requests. See 905 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 906 // details. 907 ForceSendFields []string `json:"-"` 908 // NullFields is a list of field names (e.g. "AdditionalMetadata") to include 909 // in API requests with the JSON null value. By default, fields with empty 910 // values are omitted from API requests. See 911 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 912 NullFields []string `json:"-"` 913 } 914 915 func (s *DatabaseResourceHealthSignalData) MarshalJSON() ([]byte, error) { 916 type NoMethod DatabaseResourceHealthSignalData 917 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 918 } 919 920 // DatabaseResourceId: DatabaseResourceId will serve as primary key for any 921 // resource ingestion event. 922 type DatabaseResourceId struct { 923 // Provider: Required. Cloud provider name. Ex: 924 // GCP/AWS/Azure/OnPrem/SelfManaged 925 // 926 // Possible values: 927 // "PROVIDER_UNSPECIFIED" 928 // "GCP" - Google cloud platform provider 929 // "AWS" - Amazon web service 930 // "AZURE" - Azure web service 931 // "ONPREM" - On-prem database resources. 932 // "SELFMANAGED" - Self-managed database provider. These are resources on a 933 // cloud platform, e.g., database resource installed in a GCE VM, but not a 934 // managed database service. 935 // "PROVIDER_OTHER" - For the rest of the other categories. Other refers to 936 // the rest of other database service providers, this could be smaller cloud 937 // provider. This needs to be provided when the provider is known, but it is 938 // not present in the existing set of enum values. 939 Provider string `json:"provider,omitempty"` 940 // ProviderDescription: Optional. Needs to be used only when the provider is 941 // PROVIDER_OTHER. 942 ProviderDescription string `json:"providerDescription,omitempty"` 943 // ResourceType: Required. The type of resource this ID is identifying. Ex 944 // redis.googleapis.com/Instance, redis.googleapis.com/Cluster, 945 // alloydb.googleapis.com/Cluster, alloydb.googleapis.com/Instance, 946 // spanner.googleapis.com/Instance REQUIRED Please refer 947 // go/condor-common-datamodel 948 ResourceType string `json:"resourceType,omitempty"` 949 // UniqueId: Required. A service-local token that distinguishes this resource 950 // from other resources within the same service. 951 UniqueId string `json:"uniqueId,omitempty"` 952 // ForceSendFields is a list of field names (e.g. "Provider") to 953 // unconditionally include in API requests. By default, fields with empty or 954 // default values are omitted from API requests. See 955 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 956 // details. 957 ForceSendFields []string `json:"-"` 958 // NullFields is a list of field names (e.g. "Provider") to include in API 959 // requests with the JSON null value. By default, fields with empty values are 960 // omitted from API requests. See 961 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 962 NullFields []string `json:"-"` 963 } 964 965 func (s *DatabaseResourceId) MarshalJSON() ([]byte, error) { 966 type NoMethod DatabaseResourceId 967 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 968 } 969 970 // DatabaseResourceMetadata: Common model for database resource instance 971 // metadata. 972 type DatabaseResourceMetadata struct { 973 // AvailabilityConfiguration: Availability configuration for this instance 974 AvailabilityConfiguration *AvailabilityConfiguration `json:"availabilityConfiguration,omitempty"` 975 // BackupConfiguration: Backup configuration for this instance 976 BackupConfiguration *BackupConfiguration `json:"backupConfiguration,omitempty"` 977 // BackupRun: Latest backup run information for this instance 978 BackupRun *BackupRun `json:"backupRun,omitempty"` 979 // CreationTime: The creation time of the resource, i.e. the time when resource 980 // is created and recorded in partner service. 981 CreationTime string `json:"creationTime,omitempty"` 982 // CurrentState: Current state of the instance. 983 // 984 // Possible values: 985 // "STATE_UNSPECIFIED" 986 // "HEALTHY" - The instance is running. 987 // "UNHEALTHY" - Instance being created, updated, deleted or under 988 // maintenance 989 // "SUSPENDED" - When instance is suspended 990 // "DELETED" - Instance is deleted. 991 // "STATE_OTHER" - For rest of the other category 992 CurrentState string `json:"currentState,omitempty"` 993 // CustomMetadata: Any custom metadata associated with the resource 994 CustomMetadata *CustomMetadataData `json:"customMetadata,omitempty"` 995 // Entitlements: Entitlements associated with the resource 996 Entitlements []*Entitlement `json:"entitlements,omitempty"` 997 // ExpectedState: The state that the instance is expected to be in. For 998 // example, an instance state can transition to UNHEALTHY due to wrong patch 999 // update, while the expected state will remain at the HEALTHY. 1000 // 1001 // Possible values: 1002 // "STATE_UNSPECIFIED" 1003 // "HEALTHY" - The instance is running. 1004 // "UNHEALTHY" - Instance being created, updated, deleted or under 1005 // maintenance 1006 // "SUSPENDED" - When instance is suspended 1007 // "DELETED" - Instance is deleted. 1008 // "STATE_OTHER" - For rest of the other category 1009 ExpectedState string `json:"expectedState,omitempty"` 1010 // Id: Required. Unique identifier for a Database resource 1011 Id *DatabaseResourceId `json:"id,omitempty"` 1012 // InstanceType: The type of the instance. Specified at creation time. 1013 // 1014 // Possible values: 1015 // "INSTANCE_TYPE_UNSPECIFIED" 1016 // "SUB_RESOURCE_TYPE_UNSPECIFIED" - For rest of the other categories. 1017 // "PRIMARY" - A regular primary database instance. 1018 // "SECONDARY" - A cluster or an instance acting as a secondary. 1019 // "READ_REPLICA" - An instance acting as a read-replica. 1020 // "OTHER" - For rest of the other categories. 1021 // "SUB_RESOURCE_TYPE_PRIMARY" - A regular primary database instance. 1022 // "SUB_RESOURCE_TYPE_SECONDARY" - A cluster or an instance acting as a 1023 // secondary. 1024 // "SUB_RESOURCE_TYPE_READ_REPLICA" - An instance acting as a read-replica. 1025 // "SUB_RESOURCE_TYPE_OTHER" - For rest of the other categories. 1026 InstanceType string `json:"instanceType,omitempty"` 1027 // Location: The resource location. REQUIRED 1028 Location string `json:"location,omitempty"` 1029 // PrimaryResourceId: Identifier for this resource's immediate parent/primary 1030 // resource if the current resource is a replica or derived form of another 1031 // Database resource. Else it would be NULL. REQUIRED if the immediate parent 1032 // exists when first time resource is getting ingested, otherwise optional. 1033 PrimaryResourceId *DatabaseResourceId `json:"primaryResourceId,omitempty"` 1034 // Product: The product this resource represents. 1035 Product *Product `json:"product,omitempty"` 1036 // ResourceContainer: Closest parent Cloud Resource Manager container of this 1037 // resource. It must be resource name of a Cloud Resource Manager project with 1038 // the format of "/", such as "projects/123". For GCP provided resources, 1039 // number should be project number. 1040 ResourceContainer string `json:"resourceContainer,omitempty"` 1041 // ResourceName: Required. Different from DatabaseResourceId.unique_id, a 1042 // resource name can be reused over time. That is, after a resource named "ABC" 1043 // is deleted, the name "ABC" can be used to to create a new resource within 1044 // the same source. Resource name to follow CAIS resource_name format as noted 1045 // here go/condor-common-datamodel 1046 ResourceName string `json:"resourceName,omitempty"` 1047 // UpdationTime: The time at which the resource was updated and recorded at 1048 // partner service. 1049 UpdationTime string `json:"updationTime,omitempty"` 1050 // UserLabelSet: User-provided labels associated with the resource 1051 UserLabelSet *UserLabels `json:"userLabelSet,omitempty"` 1052 // UserLabels: User-provided labels, represented as a dictionary where each 1053 // label is a single key value pair. 1054 UserLabels map[string]string `json:"userLabels,omitempty"` 1055 // ForceSendFields is a list of field names (e.g. "AvailabilityConfiguration") 1056 // to unconditionally include in API requests. By default, fields with empty or 1057 // default values are omitted from API requests. See 1058 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1059 // details. 1060 ForceSendFields []string `json:"-"` 1061 // NullFields is a list of field names (e.g. "AvailabilityConfiguration") to 1062 // include in API requests with the JSON null value. By default, fields with 1063 // empty values are omitted from API requests. See 1064 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1065 NullFields []string `json:"-"` 1066 } 1067 1068 func (s *DatabaseResourceMetadata) MarshalJSON() ([]byte, error) { 1069 type NoMethod DatabaseResourceMetadata 1070 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1071 } 1072 1073 // DatabaseResourceRecommendationSignalData: Common model for database resource 1074 // recommendation signal data. 1075 type DatabaseResourceRecommendationSignalData struct { 1076 // AdditionalMetadata: Optional. Any other additional metadata specific to 1077 // recommendation 1078 AdditionalMetadata googleapi.RawMessage `json:"additionalMetadata,omitempty"` 1079 // LastRefreshTime: Required. last time recommendationw as refreshed 1080 LastRefreshTime string `json:"lastRefreshTime,omitempty"` 1081 // RecommendationState: Required. Recommendation state 1082 // 1083 // Possible values: 1084 // "UNSPECIFIED" 1085 // "ACTIVE" - Recommendation is active and can be applied. ACTIVE 1086 // recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED. 1087 // "CLAIMED" - Recommendation is in claimed state. Recommendations content is 1088 // immutable and cannot be updated by Google. CLAIMED recommendations can be 1089 // marked as CLAIMED, SUCCEEDED, or FAILED. 1090 // "SUCCEEDED" - Recommendation is in succeeded state. Recommendations 1091 // content is immutable and cannot be updated by Google. SUCCEEDED 1092 // recommendations can be marked as SUCCEEDED, or FAILED. 1093 // "FAILED" - Recommendation is in failed state. Recommendations content is 1094 // immutable and cannot be updated by Google. FAILED recommendations can be 1095 // marked as SUCCEEDED, or FAILED. 1096 // "DISMISSED" - Recommendation is in dismissed state. Recommendation content 1097 // can be updated by Google. DISMISSED recommendations can be marked as ACTIVE. 1098 RecommendationState string `json:"recommendationState,omitempty"` 1099 // Recommender: Required. Name of recommendation. Examples: 1100 // organizations/1234/locations/us-central1/recommenders/google.cloudsql.instanc 1101 // e.PerformanceRecommender/recommendations/9876 1102 Recommender string `json:"recommender,omitempty"` 1103 // RecommenderId: Required. ID of recommender. Examples: 1104 // "google.cloudsql.instance.PerformanceRecommender" 1105 RecommenderId string `json:"recommenderId,omitempty"` 1106 // RecommenderSubtype: Required. Contains an identifier for a subtype of 1107 // recommendations produced for the same recommender. Subtype is a function of 1108 // content and impact, meaning a new subtype might be added when significant 1109 // changes to `content` or `primary_impact.category` are introduced. See the 1110 // Recommenders section to see a list of subtypes for a given Recommender. 1111 // Examples: For recommender = 1112 // "google.cloudsql.instance.PerformanceRecommender", recommender_subtype can 1113 // be 1114 // "MYSQL_HIGH_NUMBER_OF_OPEN_TABLES_BEST_PRACTICE"/"POSTGRES_HIGH_TRANSACTION_I 1115 // D_UTILIZATION_BEST_PRACTICE" 1116 RecommenderSubtype string `json:"recommenderSubtype,omitempty"` 1117 // ResourceName: Required. Database resource name associated with the signal. 1118 // Resource name to follow CAIS resource_name format as noted here 1119 // go/condor-common-datamodel 1120 ResourceName string `json:"resourceName,omitempty"` 1121 // SignalType: Required. Type of signal, for example, `SIGNAL_TYPE_IDLE`, 1122 // `SIGNAL_TYPE_HIGH_NUMBER_OF_TABLES`, etc. 1123 // 1124 // Possible values: 1125 // "SIGNAL_TYPE_UNSPECIFIED" - Unspecified. 1126 // "SIGNAL_TYPE_NOT_PROTECTED_BY_AUTOMATIC_FAILOVER" - Represents if a 1127 // resource is protected by automatic failover. Checks for resources that are 1128 // configured to have redundancy within a region that enables automatic 1129 // failover. 1130 // "SIGNAL_TYPE_GROUP_NOT_REPLICATING_ACROSS_REGIONS" - Represents if a group 1131 // is replicating across regions. Checks for resources that are configured to 1132 // have redundancy, and ongoing replication, across regions. 1133 // "SIGNAL_TYPE_NOT_AVAILABLE_IN_MULTIPLE_ZONES" - Represents if the resource 1134 // is available in multiple zones or not. 1135 // "SIGNAL_TYPE_NOT_AVAILABLE_IN_MULTIPLE_REGIONS" - Represents if a resource 1136 // is available in multiple regions. 1137 // "SIGNAL_TYPE_NO_PROMOTABLE_REPLICA" - Represents if a resource has a 1138 // promotable replica. 1139 // "SIGNAL_TYPE_NO_AUTOMATED_BACKUP_POLICY" - Represents if a resource has an 1140 // automated backup policy. 1141 // "SIGNAL_TYPE_SHORT_BACKUP_RETENTION" - Represents if a resources has a 1142 // short backup retention period. 1143 // "SIGNAL_TYPE_LAST_BACKUP_FAILED" - Represents if the last backup of a 1144 // resource failed. 1145 // "SIGNAL_TYPE_LAST_BACKUP_OLD" - Represents if the last backup of a 1146 // resource is older than some threshold value. 1147 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_2_0" - Represents if a resource 1148 // violates CIS GCP Foundation 2.0. 1149 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_3" - Represents if a resource 1150 // violates CIS GCP Foundation 1.3. 1151 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_2" - Represents if a resource 1152 // violates CIS GCP Foundation 1.2. 1153 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_1" - Represents if a resource 1154 // violates CIS GCP Foundation 1.1. 1155 // "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_0" - Represents if a resource 1156 // violates CIS GCP Foundation 1.0. 1157 // "SIGNAL_TYPE_VIOLATES_NIST_800_53" - Represents if a resource violates 1158 // NIST 800-53. 1159 // "SIGNAL_TYPE_VIOLATES_ISO_27001" - Represents if a resource violates 1160 // ISO-27001. 1161 // "SIGNAL_TYPE_VIOLATES_PCI_DSS_V3_2_1" - Represents if a resource violates 1162 // PCI-DSS v3.2.1. 1163 // "SIGNAL_TYPE_LOGS_NOT_OPTIMIZED_FOR_TROUBLESHOOTING" - Represents if 1164 // log_checkpoints database flag for a Cloud SQL for PostgreSQL instance is not 1165 // set to on. 1166 // "SIGNAL_TYPE_QUERY_DURATIONS_NOT_LOGGED" - Represents if the log_duration 1167 // database flag for a Cloud SQL for PostgreSQL instance is not set to on. 1168 // "SIGNAL_TYPE_VERBOSE_ERROR_LOGGING" - Represents if the 1169 // log_error_verbosity database flag for a Cloud SQL for PostgreSQL instance is 1170 // not set to default or stricter (default or terse). 1171 // "SIGNAL_TYPE_QUERY_LOCK_WAITS_NOT_LOGGED" - Represents if the 1172 // log_lock_waits database flag for a Cloud SQL for PostgreSQL instance is not 1173 // set to on. 1174 // "SIGNAL_TYPE_LOGGING_MOST_ERRORS" - Represents if the 1175 // log_min_error_statement database flag for a Cloud SQL for PostgreSQL 1176 // instance is not set appropriately. 1177 // "SIGNAL_TYPE_LOGGING_ONLY_CRITICAL_ERRORS" - Represents if the 1178 // log_min_error_statement database flag for a Cloud SQL for PostgreSQL 1179 // instance does not have an appropriate severity level. 1180 // "SIGNAL_TYPE_MINIMAL_ERROR_LOGGING" - Represents if the log_min_messages 1181 // database flag for a Cloud SQL for PostgreSQL instance is not set to warning 1182 // or another recommended value. 1183 // "SIGNAL_TYPE_QUERY_STATISTICS_LOGGED" - Represents if the databaseFlags 1184 // property of instance metadata for the log_executor_status field is set to 1185 // on. 1186 // "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_CLIENT_HOSTNAME" - Represents if the 1187 // log_hostname database flag for a Cloud SQL for PostgreSQL instance is not 1188 // set to off. 1189 // "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PARSER_STATISTICS" - Represents if the 1190 // log_parser_stats database flag for a Cloud SQL for PostgreSQL instance is 1191 // not set to off. 1192 // "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PLANNER_STATISTICS" - Represents if the 1193 // log_planner_stats database flag for a Cloud SQL for PostgreSQL instance is 1194 // not set to off. 1195 // "SIGNAL_TYPE_NOT_LOGGING_ONLY_DDL_STATEMENTS" - Represents if the 1196 // log_statement database flag for a Cloud SQL for PostgreSQL instance is not 1197 // set to DDL (all data definition statements). 1198 // "SIGNAL_TYPE_LOGGING_QUERY_STATISTICS" - Represents if the 1199 // log_statement_stats database flag for a Cloud SQL for PostgreSQL instance is 1200 // not set to off. 1201 // "SIGNAL_TYPE_NOT_LOGGING_TEMPORARY_FILES" - Represents if the 1202 // log_temp_files database flag for a Cloud SQL for PostgreSQL instance is not 1203 // set to "0". (NOTE: 0 = ON) 1204 // "SIGNAL_TYPE_CONNECTION_MAX_NOT_CONFIGURED" - Represents if the user 1205 // connections database flag for a Cloud SQL for SQL Server instance is 1206 // configured. 1207 // "SIGNAL_TYPE_USER_OPTIONS_CONFIGURED" - Represents if the user options 1208 // database flag for Cloud SQL SQL Server instance is configured or not. 1209 // "SIGNAL_TYPE_EXPOSED_TO_PUBLIC_ACCESS" - Represents if a resource is 1210 // exposed to public access. 1211 // "SIGNAL_TYPE_UNENCRYPTED_CONNECTIONS" - Represents if a resources requires 1212 // all incoming connections to use SSL or not. 1213 // "SIGNAL_TYPE_NO_ROOT_PASSWORD" - Represents if a Cloud SQL database has a 1214 // password configured for the root account or not. 1215 // "SIGNAL_TYPE_WEAK_ROOT_PASSWORD" - Represents if a Cloud SQL database has 1216 // a weak password configured for the root account. 1217 // "SIGNAL_TYPE_ENCRYPTION_KEY_NOT_CUSTOMER_MANAGED" - Represents if a SQL 1218 // database instance is not encrypted with customer-managed encryption keys 1219 // (CMEK). 1220 // "SIGNAL_TYPE_SERVER_AUTHENTICATION_NOT_REQUIRED" - Represents if The 1221 // contained database authentication database flag for a Cloud SQL for SQL 1222 // Server instance is not set to off. 1223 // "SIGNAL_TYPE_EXPOSED_BY_OWNERSHIP_CHAINING" - Represents if the 1224 // cross_db_ownership_chaining database flag for a Cloud SQL for SQL Server 1225 // instance is not set to off. 1226 // "SIGNAL_TYPE_EXPOSED_TO_EXTERNAL_SCRIPTS" - Represents if he external 1227 // scripts enabled database flag for a Cloud SQL for SQL Server instance is not 1228 // set to off. 1229 // "SIGNAL_TYPE_EXPOSED_TO_LOCAL_DATA_LOADS" - Represents if the local_infile 1230 // database flag for a Cloud SQL for MySQL instance is not set to off. 1231 // "SIGNAL_TYPE_CONNECTION_ATTEMPTS_NOT_LOGGED" - Represents if the 1232 // log_connections database flag for a Cloud SQL for PostgreSQL instance is not 1233 // set to on. 1234 // "SIGNAL_TYPE_DISCONNECTIONS_NOT_LOGGED" - Represents if the 1235 // log_disconnections database flag for a Cloud SQL for PostgreSQL instance is 1236 // not set to on. 1237 // "SIGNAL_TYPE_LOGGING_EXCESSIVE_STATEMENT_INFO" - Represents if the 1238 // log_min_duration_statement database flag for a Cloud SQL for PostgreSQL 1239 // instance is not set to -1. 1240 // "SIGNAL_TYPE_EXPOSED_TO_REMOTE_ACCESS" - Represents if the remote access 1241 // database flag for a Cloud SQL for SQL Server instance is not set to off. 1242 // "SIGNAL_TYPE_DATABASE_NAMES_EXPOSED" - Represents if the 1243 // skip_show_database database flag for a Cloud SQL for MySQL instance is not 1244 // set to on. 1245 // "SIGNAL_TYPE_SENSITIVE_TRACE_INFO_NOT_MASKED" - Represents if the 3625 1246 // (trace flag) database flag for a Cloud SQL for SQL Server instance is not 1247 // set to on. 1248 // "SIGNAL_TYPE_PUBLIC_IP_ENABLED" - Represents if public IP is enabled. 1249 // "SIGNAL_TYPE_IDLE" - Represents Idle instance helps to reduce costs. 1250 // "SIGNAL_TYPE_OVERPROVISIONED" - Represents instances that are 1251 // unnecessarily large for given workload. 1252 // "SIGNAL_TYPE_HIGH_NUMBER_OF_OPEN_TABLES" - Represents high number of 1253 // concurrently opened tables. 1254 // "SIGNAL_TYPE_HIGH_NUMBER_OF_TABLES" - Represents high table count close to 1255 // SLA limit. 1256 // "SIGNAL_TYPE_HIGH_TRANSACTION_ID_UTILIZATION" - Represents high number of 1257 // unvacuumed transactions 1258 // "SIGNAL_TYPE_UNDERPROVISIONED" - Represents need for more CPU and/or 1259 // memory 1260 // "SIGNAL_TYPE_OUT_OF_DISK" - Represents out of disk. 1261 // "SIGNAL_TYPE_SERVER_CERTIFICATE_NEAR_EXPIRY" - Represents server 1262 // certificate is near expiry. 1263 // "SIGNAL_TYPE_DATABASE_AUDITING_DISABLED" - Represents database auditing is 1264 // disabled. 1265 // "SIGNAL_TYPE_RESTRICT_AUTHORIZED_NETWORKS" - Represents not restricted to 1266 // authorized networks. 1267 // "SIGNAL_TYPE_VIOLATE_POLICY_RESTRICT_PUBLIC_IP" - Represents violate org 1268 // policy restrict public ip. 1269 // "SIGNAL_TYPE_QUOTA_LIMIT" - Cluster nearing quota limit 1270 // "SIGNAL_TYPE_NO_PASSWORD_POLICY" - No password policy set on resources 1271 // "SIGNAL_TYPE_CONNECTIONS_PERFORMANCE_IMPACT" - Performance impact of 1272 // connections settings 1273 // "SIGNAL_TYPE_TMP_TABLES_PERFORMANCE_IMPACT" - Performance impact of 1274 // temporary tables settings 1275 // "SIGNAL_TYPE_TRANS_LOGS_PERFORMANCE_IMPACT" - Performance impact of 1276 // transaction logs settings 1277 // "SIGNAL_TYPE_HIGH_JOINS_WITHOUT_INDEXES" - Performance impact of high 1278 // joins without indexes 1279 SignalType string `json:"signalType,omitempty"` 1280 // ForceSendFields is a list of field names (e.g. "AdditionalMetadata") to 1281 // unconditionally include in API requests. By default, fields with empty or 1282 // default values are omitted from API requests. See 1283 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1284 // details. 1285 ForceSendFields []string `json:"-"` 1286 // NullFields is a list of field names (e.g. "AdditionalMetadata") to include 1287 // in API requests with the JSON null value. By default, fields with empty 1288 // values are omitted from API requests. See 1289 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1290 NullFields []string `json:"-"` 1291 } 1292 1293 func (s *DatabaseResourceRecommendationSignalData) MarshalJSON() ([]byte, error) { 1294 type NoMethod DatabaseResourceRecommendationSignalData 1295 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1296 } 1297 1298 // DiscoveryEndpoint: Endpoints on each network, for Redis clients to connect 1299 // to the cluster. 1300 type DiscoveryEndpoint struct { 1301 // Address: Output only. Address of the exposed Redis endpoint used by clients 1302 // to connect to the service. The address could be either IP or hostname. 1303 Address string `json:"address,omitempty"` 1304 // Port: Output only. The port number of the exposed Redis endpoint. 1305 Port int64 `json:"port,omitempty"` 1306 // PscConfig: Output only. Customer configuration for where the endpoint is 1307 // created and accessed from. 1308 PscConfig *PscConfig `json:"pscConfig,omitempty"` 1309 // ForceSendFields is a list of field names (e.g. "Address") to unconditionally 1310 // include in API requests. By default, fields with empty or default values are 1311 // omitted from API requests. See 1312 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1313 // details. 1314 ForceSendFields []string `json:"-"` 1315 // NullFields is a list of field names (e.g. "Address") to include in API 1316 // requests with the JSON null value. By default, fields with empty values are 1317 // omitted from API requests. See 1318 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1319 NullFields []string `json:"-"` 1320 } 1321 1322 func (s *DiscoveryEndpoint) MarshalJSON() ([]byte, error) { 1323 type NoMethod DiscoveryEndpoint 1324 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1325 } 1326 1327 // Empty: A generic empty message that you can re-use to avoid defining 1328 // duplicated empty messages in your APIs. A typical example is to use it as 1329 // the request or the response type of an API method. For instance: service Foo 1330 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } 1331 type Empty struct { 1332 // ServerResponse contains the HTTP response code and headers from the server. 1333 googleapi.ServerResponse `json:"-"` 1334 } 1335 1336 // Entitlement: Proto representing the access that a user has to a specific 1337 // feature/service. NextId: 3. 1338 type Entitlement struct { 1339 // EntitlementState: The current state of user's accessibility to a 1340 // feature/benefit. 1341 // 1342 // Possible values: 1343 // "ENTITLEMENT_STATE_UNSPECIFIED" 1344 // "ENTITLED" - User is entitled to a feature/benefit, but whether it has 1345 // been successfully provisioned is decided by provisioning state. 1346 // "REVOKED" - User is entitled to a feature/benefit, but it was requested to 1347 // be revoked. Whether the revoke has been successful is decided by 1348 // provisioning state. 1349 EntitlementState string `json:"entitlementState,omitempty"` 1350 // Type: An enum that represents the type of this entitlement. 1351 // 1352 // Possible values: 1353 // "ENTITLEMENT_TYPE_UNSPECIFIED" 1354 // "GEMINI" - The root entitlement representing Gemini package ownership. 1355 Type string `json:"type,omitempty"` 1356 // ForceSendFields is a list of field names (e.g. "EntitlementState") to 1357 // unconditionally include in API requests. By default, fields with empty or 1358 // default values are omitted from API requests. See 1359 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1360 // details. 1361 ForceSendFields []string `json:"-"` 1362 // NullFields is a list of field names (e.g. "EntitlementState") to include in 1363 // API requests with the JSON null value. By default, fields with empty values 1364 // are omitted from API requests. See 1365 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1366 NullFields []string `json:"-"` 1367 } 1368 1369 func (s *Entitlement) MarshalJSON() ([]byte, error) { 1370 type NoMethod Entitlement 1371 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1372 } 1373 1374 // ExportInstanceRequest: Request for Export. 1375 type ExportInstanceRequest struct { 1376 // OutputConfig: Required. Specify data to be exported. 1377 OutputConfig *OutputConfig `json:"outputConfig,omitempty"` 1378 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 1379 // unconditionally include in API requests. By default, fields with empty or 1380 // default values are omitted from API requests. See 1381 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1382 // details. 1383 ForceSendFields []string `json:"-"` 1384 // NullFields is a list of field names (e.g. "OutputConfig") to include in API 1385 // requests with the JSON null value. By default, fields with empty values are 1386 // omitted from API requests. See 1387 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1388 NullFields []string `json:"-"` 1389 } 1390 1391 func (s *ExportInstanceRequest) MarshalJSON() ([]byte, error) { 1392 type NoMethod ExportInstanceRequest 1393 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1394 } 1395 1396 // FailoverInstanceRequest: Request for Failover. 1397 type FailoverInstanceRequest struct { 1398 // DataProtectionMode: Optional. Available data protection modes that the user 1399 // can choose. If it's unspecified, data protection mode will be 1400 // LIMITED_DATA_LOSS by default. 1401 // 1402 // Possible values: 1403 // "DATA_PROTECTION_MODE_UNSPECIFIED" - Defaults to LIMITED_DATA_LOSS if a 1404 // data protection mode is not specified. 1405 // "LIMITED_DATA_LOSS" - Instance failover will be protected with data loss 1406 // control. More specifically, the failover will only be performed if the 1407 // current replication offset diff between primary and replica is under a 1408 // certain threshold. 1409 // "FORCE_DATA_LOSS" - Instance failover will be performed without data loss 1410 // control. 1411 DataProtectionMode string `json:"dataProtectionMode,omitempty"` 1412 // ForceSendFields is a list of field names (e.g. "DataProtectionMode") 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. "DataProtectionMode") to include 1419 // in API requests with the JSON null value. By default, fields with empty 1420 // values are 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 *FailoverInstanceRequest) MarshalJSON() ([]byte, error) { 1426 type NoMethod FailoverInstanceRequest 1427 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1428 } 1429 1430 // GcsDestination: The Cloud Storage location for the output content 1431 type GcsDestination struct { 1432 // Uri: Required. Data destination URI (e.g. 'gs://my_bucket/my_object'). 1433 // Existing files will be overwritten. 1434 Uri string `json:"uri,omitempty"` 1435 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally 1436 // include in API requests. By default, fields with empty or default values are 1437 // omitted from API requests. See 1438 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1439 // details. 1440 ForceSendFields []string `json:"-"` 1441 // NullFields is a list of field names (e.g. "Uri") to include in API requests 1442 // with the JSON null value. By default, fields with empty values are omitted 1443 // from API requests. See 1444 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1445 NullFields []string `json:"-"` 1446 } 1447 1448 func (s *GcsDestination) MarshalJSON() ([]byte, error) { 1449 type NoMethod GcsDestination 1450 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1451 } 1452 1453 // GcsSource: The Cloud Storage location for the input content 1454 type GcsSource struct { 1455 // Uri: Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). 1456 Uri string `json:"uri,omitempty"` 1457 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally 1458 // include in API requests. By default, fields with empty or default values are 1459 // omitted from API requests. See 1460 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1461 // details. 1462 ForceSendFields []string `json:"-"` 1463 // NullFields is a list of field names (e.g. "Uri") to include in API requests 1464 // with the JSON null value. By default, fields with empty values are omitted 1465 // from API requests. See 1466 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1467 NullFields []string `json:"-"` 1468 } 1469 1470 func (s *GcsSource) MarshalJSON() ([]byte, error) { 1471 type NoMethod GcsSource 1472 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1473 } 1474 1475 // GoogleCloudRedisV1LocationMetadata: This location metadata represents 1476 // additional configuration options for a given location where a Redis instance 1477 // may be created. All fields are output only. It is returned as content of the 1478 // `google.cloud.location.Location.metadata` field. 1479 type GoogleCloudRedisV1LocationMetadata struct { 1480 // AvailableZones: Output only. The set of available zones in the location. The 1481 // map is keyed by the lowercase ID of each zone, as defined by GCE. These keys 1482 // can be specified in `location_id` or `alternative_location_id` fields when 1483 // creating a Redis instance. 1484 AvailableZones map[string]GoogleCloudRedisV1ZoneMetadata `json:"availableZones,omitempty"` 1485 // ForceSendFields is a list of field names (e.g. "AvailableZones") to 1486 // unconditionally include in API requests. By default, fields with empty or 1487 // default values are omitted from API requests. See 1488 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1489 // details. 1490 ForceSendFields []string `json:"-"` 1491 // NullFields is a list of field names (e.g. "AvailableZones") to include in 1492 // API requests with the JSON null value. By default, fields with empty values 1493 // are omitted from API requests. See 1494 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1495 NullFields []string `json:"-"` 1496 } 1497 1498 func (s *GoogleCloudRedisV1LocationMetadata) MarshalJSON() ([]byte, error) { 1499 type NoMethod GoogleCloudRedisV1LocationMetadata 1500 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1501 } 1502 1503 // GoogleCloudRedisV1OperationMetadata: Represents the v1 metadata of the 1504 // long-running operation. 1505 type GoogleCloudRedisV1OperationMetadata struct { 1506 // ApiVersion: API version. 1507 ApiVersion string `json:"apiVersion,omitempty"` 1508 // CancelRequested: Specifies if cancellation was requested for the operation. 1509 CancelRequested bool `json:"cancelRequested,omitempty"` 1510 // CreateTime: Creation timestamp. 1511 CreateTime string `json:"createTime,omitempty"` 1512 // EndTime: End timestamp. 1513 EndTime string `json:"endTime,omitempty"` 1514 // StatusDetail: Operation status details. 1515 StatusDetail string `json:"statusDetail,omitempty"` 1516 // Target: Operation target. 1517 Target string `json:"target,omitempty"` 1518 // Verb: Operation verb. 1519 Verb string `json:"verb,omitempty"` 1520 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1521 // unconditionally include in API requests. By default, fields with empty or 1522 // default values are omitted from API requests. See 1523 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1524 // details. 1525 ForceSendFields []string `json:"-"` 1526 // NullFields is a list of field names (e.g. "ApiVersion") to include in API 1527 // requests with the JSON null value. By default, fields with empty values are 1528 // omitted from API requests. See 1529 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1530 NullFields []string `json:"-"` 1531 } 1532 1533 func (s *GoogleCloudRedisV1OperationMetadata) MarshalJSON() ([]byte, error) { 1534 type NoMethod GoogleCloudRedisV1OperationMetadata 1535 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1536 } 1537 1538 // GoogleCloudRedisV1ZoneMetadata: Defines specific information for a 1539 // particular zone. Currently empty and reserved for future use only. 1540 type GoogleCloudRedisV1ZoneMetadata struct { 1541 } 1542 1543 // ImportInstanceRequest: Request for Import. 1544 type ImportInstanceRequest struct { 1545 // InputConfig: Required. Specify data to be imported. 1546 InputConfig *InputConfig `json:"inputConfig,omitempty"` 1547 // ForceSendFields is a list of field names (e.g. "InputConfig") 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. "InputConfig") 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 *ImportInstanceRequest) MarshalJSON() ([]byte, error) { 1561 type NoMethod ImportInstanceRequest 1562 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1563 } 1564 1565 // InputConfig: The input content 1566 type InputConfig struct { 1567 // GcsSource: Google Cloud Storage location where input content is located. 1568 GcsSource *GcsSource `json:"gcsSource,omitempty"` 1569 // ForceSendFields is a list of field names (e.g. "GcsSource") to 1570 // unconditionally include in API requests. By default, fields with empty or 1571 // default values are omitted from API requests. See 1572 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1573 // details. 1574 ForceSendFields []string `json:"-"` 1575 // NullFields is a list of field names (e.g. "GcsSource") to include in API 1576 // requests with the JSON null value. By default, fields with empty values are 1577 // omitted from API requests. See 1578 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1579 NullFields []string `json:"-"` 1580 } 1581 1582 func (s *InputConfig) MarshalJSON() ([]byte, error) { 1583 type NoMethod InputConfig 1584 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1585 } 1586 1587 // Instance: A Memorystore for Redis instance. 1588 type Instance struct { 1589 // AlternativeLocationId: Optional. If specified, at least one node will be 1590 // provisioned in this zone in addition to the zone specified in location_id. 1591 // Only applicable to standard tier. If provided, it must be a different zone 1592 // from the one provided in [location_id]. Additional nodes beyond the first 2 1593 // will be placed in zones selected by the service. 1594 AlternativeLocationId string `json:"alternativeLocationId,omitempty"` 1595 // AuthEnabled: Optional. Indicates whether OSS Redis AUTH is enabled for the 1596 // instance. If set to "true" AUTH is enabled on the instance. Default value is 1597 // "false" meaning AUTH is disabled. 1598 AuthEnabled bool `json:"authEnabled,omitempty"` 1599 // AuthorizedNetwork: Optional. The full name of the Google Compute Engine 1600 // network (https://cloud.google.com/vpc/docs/vpc) to which the instance is 1601 // connected. If left unspecified, the `default` network will be used. 1602 AuthorizedNetwork string `json:"authorizedNetwork,omitempty"` 1603 // AvailableMaintenanceVersions: Optional. The available maintenance versions 1604 // that an instance could update to. 1605 AvailableMaintenanceVersions []string `json:"availableMaintenanceVersions,omitempty"` 1606 // ConnectMode: Optional. The network connect mode of the Redis instance. If 1607 // not provided, the connect mode defaults to DIRECT_PEERING. 1608 // 1609 // Possible values: 1610 // "CONNECT_MODE_UNSPECIFIED" - Not set. 1611 // "DIRECT_PEERING" - Connect via direct peering to the Memorystore for Redis 1612 // hosted service. 1613 // "PRIVATE_SERVICE_ACCESS" - Connect your Memorystore for Redis instance 1614 // using Private Service Access. Private services access provides an IP address 1615 // range for multiple Google Cloud services, including Memorystore. 1616 ConnectMode string `json:"connectMode,omitempty"` 1617 // CreateTime: Output only. The time the instance was created. 1618 CreateTime string `json:"createTime,omitempty"` 1619 // CurrentLocationId: Output only. The current zone where the Redis primary 1620 // node is located. In basic tier, this will always be the same as 1621 // [location_id]. In standard tier, this can be the zone of any node in the 1622 // instance. 1623 CurrentLocationId string `json:"currentLocationId,omitempty"` 1624 // CustomerManagedKey: Optional. The KMS key reference that the customer 1625 // provides when trying to create the instance. 1626 CustomerManagedKey string `json:"customerManagedKey,omitempty"` 1627 // DisplayName: An arbitrary and optional user-provided name for the instance. 1628 DisplayName string `json:"displayName,omitempty"` 1629 // Host: Output only. Hostname or IP address of the exposed Redis endpoint used 1630 // by clients to connect to the service. 1631 Host string `json:"host,omitempty"` 1632 // Labels: Resource labels to represent user provided metadata 1633 Labels map[string]string `json:"labels,omitempty"` 1634 // LocationId: Optional. The zone where the instance will be provisioned. If 1635 // not provided, the service will choose a zone from the specified region for 1636 // the instance. For standard tier, additional nodes will be added across 1637 // multiple zones for protection against zonal failures. If specified, at least 1638 // one node will be provisioned in this zone. 1639 LocationId string `json:"locationId,omitempty"` 1640 // MaintenancePolicy: Optional. The maintenance policy for the instance. If not 1641 // provided, maintenance events can be performed at any time. 1642 MaintenancePolicy *MaintenancePolicy `json:"maintenancePolicy,omitempty"` 1643 // MaintenanceSchedule: Output only. Date and time of upcoming maintenance 1644 // events which have been scheduled. 1645 MaintenanceSchedule *MaintenanceSchedule `json:"maintenanceSchedule,omitempty"` 1646 // MaintenanceVersion: Optional. The self service update maintenance version. 1647 // The version is date based such as "20210712_00_00". 1648 MaintenanceVersion string `json:"maintenanceVersion,omitempty"` 1649 // MemorySizeGb: Required. Redis memory size in GiB. 1650 MemorySizeGb int64 `json:"memorySizeGb,omitempty"` 1651 // Name: Required. Unique name of the resource in this scope including project 1652 // and location using the form: 1653 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` 1654 // Note: Redis instances are managed and addressed at regional level so 1655 // location_id here refers to a GCP region; however, users may choose which 1656 // specific zone (or collection of zones for cross-zone instances) an instance 1657 // should be provisioned in. Refer to location_id and alternative_location_id 1658 // fields for more details. 1659 Name string `json:"name,omitempty"` 1660 // Nodes: Output only. Info per node. 1661 Nodes []*NodeInfo `json:"nodes,omitempty"` 1662 // PersistenceConfig: Optional. Persistence configuration parameters 1663 PersistenceConfig *PersistenceConfig `json:"persistenceConfig,omitempty"` 1664 // PersistenceIamIdentity: Output only. Cloud IAM identity used by import / 1665 // export operations to transfer data to/from Cloud Storage. Format is 1666 // "serviceAccount:". The value may change over time for a given instance so 1667 // should be checked before each import/export operation. 1668 PersistenceIamIdentity string `json:"persistenceIamIdentity,omitempty"` 1669 // Port: Output only. The port number of the exposed Redis endpoint. 1670 Port int64 `json:"port,omitempty"` 1671 // ReadEndpoint: Output only. Hostname or IP address of the exposed readonly 1672 // Redis endpoint. Standard tier only. Targets all healthy replica nodes in 1673 // instance. Replication is asynchronous and replica nodes will exhibit some 1674 // lag behind the primary. Write requests must target 'host'. 1675 ReadEndpoint string `json:"readEndpoint,omitempty"` 1676 // ReadEndpointPort: Output only. The port number of the exposed readonly redis 1677 // endpoint. Standard tier only. Write requests should target 'port'. 1678 ReadEndpointPort int64 `json:"readEndpointPort,omitempty"` 1679 // ReadReplicasMode: Optional. Read replicas mode for the instance. Defaults to 1680 // READ_REPLICAS_DISABLED. 1681 // 1682 // Possible values: 1683 // "READ_REPLICAS_MODE_UNSPECIFIED" - If not set, Memorystore Redis backend 1684 // will default to READ_REPLICAS_DISABLED. 1685 // "READ_REPLICAS_DISABLED" - If disabled, read endpoint will not be provided 1686 // and the instance cannot scale up or down the number of replicas. 1687 // "READ_REPLICAS_ENABLED" - If enabled, read endpoint will be provided and 1688 // the instance can scale up and down the number of replicas. Not valid for 1689 // basic tier. 1690 ReadReplicasMode string `json:"readReplicasMode,omitempty"` 1691 // RedisConfigs: Optional. Redis configuration parameters, according to 1692 // http://redis.io/topics/config. Currently, the only supported parameters are: 1693 // Redis version 3.2 and newer: * maxmemory-policy * notify-keyspace-events 1694 // Redis version 4.0 and newer: * activedefrag * lfu-decay-time * 1695 // lfu-log-factor * maxmemory-gb Redis version 5.0 and newer: * 1696 // stream-node-max-bytes * stream-node-max-entries 1697 RedisConfigs map[string]string `json:"redisConfigs,omitempty"` 1698 // RedisVersion: Optional. The version of Redis software. If not provided, 1699 // latest supported version will be used. Currently, the supported values are: 1700 // * `REDIS_3_2` for Redis 3.2 compatibility * `REDIS_4_0` for Redis 4.0 1701 // compatibility (default) * `REDIS_5_0` for Redis 5.0 compatibility * 1702 // `REDIS_6_X` for Redis 6.x compatibility * `REDIS_7_0` for Redis 7.0 1703 // compatibility 1704 RedisVersion string `json:"redisVersion,omitempty"` 1705 // ReplicaCount: Optional. The number of replica nodes. The valid range for the 1706 // Standard Tier with read replicas enabled is [1-5] and defaults to 2. If read 1707 // replicas are not enabled for a Standard Tier instance, the only valid value 1708 // is 1 and the default is 1. The valid value for basic tier is 0 and the 1709 // default is also 0. 1710 ReplicaCount int64 `json:"replicaCount,omitempty"` 1711 // ReservedIpRange: Optional. For DIRECT_PEERING mode, the CIDR range of 1712 // internal addresses that are reserved for this instance. Range must be unique 1713 // and non-overlapping with existing subnets in an authorized network. For 1714 // PRIVATE_SERVICE_ACCESS mode, the name of one allocated IP address ranges 1715 // associated with this private service access connection. If not provided, the 1716 // service will choose an unused /29 block, for example, 10.0.0.0/29 or 1717 // 192.168.0.0/29. For READ_REPLICAS_ENABLED the default block size is /28. 1718 ReservedIpRange string `json:"reservedIpRange,omitempty"` 1719 // SatisfiesPzi: Optional. Output only. Reserved for future use. 1720 SatisfiesPzi bool `json:"satisfiesPzi,omitempty"` 1721 // SatisfiesPzs: Optional. Output only. Reserved for future use. 1722 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"` 1723 // SecondaryIpRange: Optional. Additional IP range for node placement. Required 1724 // when enabling read replicas on an existing instance. For DIRECT_PEERING mode 1725 // value must be a CIDR range of size /28, or "auto". For 1726 // PRIVATE_SERVICE_ACCESS mode value must be the name of an allocated address 1727 // range associated with the private service access connection, or "auto". 1728 SecondaryIpRange string `json:"secondaryIpRange,omitempty"` 1729 // ServerCaCerts: Output only. List of server CA certificates for the instance. 1730 ServerCaCerts []*TlsCertificate `json:"serverCaCerts,omitempty"` 1731 // State: Output only. The current state of this instance. 1732 // 1733 // Possible values: 1734 // "STATE_UNSPECIFIED" - Not set. 1735 // "CREATING" - Redis instance is being created. 1736 // "READY" - Redis instance has been created and is fully usable. 1737 // "UPDATING" - Redis instance configuration is being updated. Certain kinds 1738 // of updates may cause the instance to become unusable while the update is in 1739 // progress. 1740 // "DELETING" - Redis instance is being deleted. 1741 // "REPAIRING" - Redis instance is being repaired and may be unusable. 1742 // "MAINTENANCE" - Maintenance is being performed on this Redis instance. 1743 // "IMPORTING" - Redis instance is importing data (availability may be 1744 // affected). 1745 // "FAILING_OVER" - Redis instance is failing over (availability may be 1746 // affected). 1747 State string `json:"state,omitempty"` 1748 // StatusMessage: Output only. Additional information about the current status 1749 // of this instance, if available. 1750 StatusMessage string `json:"statusMessage,omitempty"` 1751 // SuspensionReasons: Optional. reasons that causes instance in "SUSPENDED" 1752 // state. 1753 // 1754 // Possible values: 1755 // "SUSPENSION_REASON_UNSPECIFIED" - Not set. 1756 // "CUSTOMER_MANAGED_KEY_ISSUE" - Something wrong with the CMEK key provided 1757 // by customer. 1758 SuspensionReasons []string `json:"suspensionReasons,omitempty"` 1759 // Tier: Required. The service tier of the instance. 1760 // 1761 // Possible values: 1762 // "TIER_UNSPECIFIED" - Not set. 1763 // "BASIC" - BASIC tier: standalone instance 1764 // "STANDARD_HA" - STANDARD_HA tier: highly available primary/replica 1765 // instances 1766 Tier string `json:"tier,omitempty"` 1767 // TransitEncryptionMode: Optional. The TLS mode of the Redis instance. If not 1768 // provided, TLS is disabled for the instance. 1769 // 1770 // Possible values: 1771 // "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED" - Not set. 1772 // "SERVER_AUTHENTICATION" - Client to Server traffic encryption enabled with 1773 // server authentication. 1774 // "DISABLED" - TLS is disabled for the instance. 1775 TransitEncryptionMode string `json:"transitEncryptionMode,omitempty"` 1776 1777 // ServerResponse contains the HTTP response code and headers from the server. 1778 googleapi.ServerResponse `json:"-"` 1779 // ForceSendFields is a list of field names (e.g. "AlternativeLocationId") to 1780 // unconditionally include in API requests. By default, fields with empty or 1781 // default values are omitted from API requests. See 1782 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1783 // details. 1784 ForceSendFields []string `json:"-"` 1785 // NullFields is a list of field names (e.g. "AlternativeLocationId") to 1786 // include in API requests with the JSON null value. By default, fields with 1787 // empty values are omitted from API requests. See 1788 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1789 NullFields []string `json:"-"` 1790 } 1791 1792 func (s *Instance) MarshalJSON() ([]byte, error) { 1793 type NoMethod Instance 1794 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1795 } 1796 1797 // InstanceAuthString: Instance AUTH string details. 1798 type InstanceAuthString struct { 1799 // AuthString: AUTH string set on the instance. 1800 AuthString string `json:"authString,omitempty"` 1801 1802 // ServerResponse contains the HTTP response code and headers from the server. 1803 googleapi.ServerResponse `json:"-"` 1804 // ForceSendFields is a list of field names (e.g. "AuthString") to 1805 // unconditionally include in API requests. By default, fields with empty or 1806 // default values are omitted from API requests. See 1807 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1808 // details. 1809 ForceSendFields []string `json:"-"` 1810 // NullFields is a list of field names (e.g. "AuthString") to include in API 1811 // requests with the JSON null value. By default, fields with empty values are 1812 // omitted from API requests. See 1813 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1814 NullFields []string `json:"-"` 1815 } 1816 1817 func (s *InstanceAuthString) MarshalJSON() ([]byte, error) { 1818 type NoMethod InstanceAuthString 1819 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1820 } 1821 1822 // ListClustersResponse: Response for ListClusters. 1823 type ListClustersResponse struct { 1824 // Clusters: A list of Redis clusters in the project in the specified location, 1825 // or across all locations. If the `location_id` in the parent field of the 1826 // request is "-", all regions available to the project are queried, and the 1827 // results aggregated. If in such an aggregated query a location is 1828 // unavailable, a placeholder Redis entry is included in the response with the 1829 // `name` field set to a value of the form 1830 // `projects/{project_id}/locations/{location_id}/clusters/`- and the `status` 1831 // field set to ERROR and `status_message` field set to "location not available 1832 // for ListClusters". 1833 Clusters []*Cluster `json:"clusters,omitempty"` 1834 // NextPageToken: Token to retrieve the next page of results, or empty if there 1835 // are no more results in the list. 1836 NextPageToken string `json:"nextPageToken,omitempty"` 1837 // Unreachable: Locations that could not be reached. 1838 Unreachable []string `json:"unreachable,omitempty"` 1839 1840 // ServerResponse contains the HTTP response code and headers from the server. 1841 googleapi.ServerResponse `json:"-"` 1842 // ForceSendFields is a list of field names (e.g. "Clusters") to 1843 // unconditionally include in API requests. By default, fields with empty or 1844 // default values are omitted from API requests. See 1845 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1846 // details. 1847 ForceSendFields []string `json:"-"` 1848 // NullFields is a list of field names (e.g. "Clusters") to include in API 1849 // requests with the JSON null value. By default, fields with empty values are 1850 // omitted from API requests. See 1851 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1852 NullFields []string `json:"-"` 1853 } 1854 1855 func (s *ListClustersResponse) MarshalJSON() ([]byte, error) { 1856 type NoMethod ListClustersResponse 1857 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1858 } 1859 1860 // ListInstancesResponse: Response for ListInstances. 1861 type ListInstancesResponse struct { 1862 // Instances: A list of Redis instances in the project in the specified 1863 // location, or across all locations. If the `location_id` in the parent field 1864 // of the request is "-", all regions available to the project are queried, and 1865 // the results aggregated. If in such an aggregated query a location is 1866 // unavailable, a placeholder Redis entry is included in the response with the 1867 // `name` field set to a value of the form 1868 // `projects/{project_id}/locations/{location_id}/instances/`- and the `status` 1869 // field set to ERROR and `status_message` field set to "location not available 1870 // for ListInstances". 1871 Instances []*Instance `json:"instances,omitempty"` 1872 // NextPageToken: Token to retrieve the next page of results, or empty if there 1873 // are no more results in the list. 1874 NextPageToken string `json:"nextPageToken,omitempty"` 1875 // Unreachable: Locations that could not be reached. 1876 Unreachable []string `json:"unreachable,omitempty"` 1877 1878 // ServerResponse contains the HTTP response code and headers from the server. 1879 googleapi.ServerResponse `json:"-"` 1880 // ForceSendFields is a list of field names (e.g. "Instances") to 1881 // unconditionally include in API requests. By default, fields with empty or 1882 // default values are omitted from API requests. See 1883 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1884 // details. 1885 ForceSendFields []string `json:"-"` 1886 // NullFields is a list of field names (e.g. "Instances") to include in API 1887 // requests with the JSON null value. By default, fields with empty values are 1888 // omitted from API requests. See 1889 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1890 NullFields []string `json:"-"` 1891 } 1892 1893 func (s *ListInstancesResponse) MarshalJSON() ([]byte, error) { 1894 type NoMethod ListInstancesResponse 1895 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1896 } 1897 1898 // ListLocationsResponse: The response message for Locations.ListLocations. 1899 type ListLocationsResponse struct { 1900 // Locations: A list of locations that matches the specified filter in the 1901 // request. 1902 Locations []*Location `json:"locations,omitempty"` 1903 // NextPageToken: The standard List next-page token. 1904 NextPageToken string `json:"nextPageToken,omitempty"` 1905 1906 // ServerResponse contains the HTTP response code and headers from the server. 1907 googleapi.ServerResponse `json:"-"` 1908 // ForceSendFields is a list of field names (e.g. "Locations") to 1909 // unconditionally include in API requests. By default, fields with empty or 1910 // default values are omitted from API requests. See 1911 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1912 // details. 1913 ForceSendFields []string `json:"-"` 1914 // NullFields is a list of field names (e.g. "Locations") to include in API 1915 // requests with the JSON null value. By default, fields with empty values are 1916 // omitted from API requests. See 1917 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1918 NullFields []string `json:"-"` 1919 } 1920 1921 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) { 1922 type NoMethod ListLocationsResponse 1923 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1924 } 1925 1926 // ListOperationsResponse: The response message for Operations.ListOperations. 1927 type ListOperationsResponse struct { 1928 // NextPageToken: The standard List next-page token. 1929 NextPageToken string `json:"nextPageToken,omitempty"` 1930 // Operations: A list of operations that matches the specified filter in the 1931 // request. 1932 Operations []*Operation `json:"operations,omitempty"` 1933 1934 // ServerResponse contains the HTTP response code and headers from the server. 1935 googleapi.ServerResponse `json:"-"` 1936 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1937 // unconditionally include in API requests. By default, fields with empty or 1938 // default values are omitted from API requests. See 1939 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1940 // details. 1941 ForceSendFields []string `json:"-"` 1942 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 1943 // requests with the JSON null value. By default, fields with empty values are 1944 // omitted from API requests. See 1945 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1946 NullFields []string `json:"-"` 1947 } 1948 1949 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 1950 type NoMethod ListOperationsResponse 1951 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1952 } 1953 1954 // Location: A resource that represents a Google Cloud location. 1955 type Location struct { 1956 // DisplayName: The friendly name for this location, typically a nearby city 1957 // name. For example, "Tokyo". 1958 DisplayName string `json:"displayName,omitempty"` 1959 // Labels: Cross-service attributes for the location. For example 1960 // {"cloud.googleapis.com/region": "us-east1"} 1961 Labels map[string]string `json:"labels,omitempty"` 1962 // LocationId: Resource ID for the region. For example: "us-east1". 1963 LocationId string `json:"locationId,omitempty"` 1964 // Metadata: Output only. The set of available zones in the location. The map 1965 // is keyed by the lowercase ID of each zone, as defined by Compute Engine. 1966 // These keys can be specified in `location_id` or `alternative_location_id` 1967 // fields when creating a Redis instance. 1968 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1969 // Name: Full resource name for the region. For example: 1970 // "projects/example-project/locations/us-east1". 1971 Name string `json:"name,omitempty"` 1972 1973 // ServerResponse contains the HTTP response code and headers from the server. 1974 googleapi.ServerResponse `json:"-"` 1975 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1976 // unconditionally include in API requests. By default, fields with empty or 1977 // default values are omitted from API requests. See 1978 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1979 // details. 1980 ForceSendFields []string `json:"-"` 1981 // NullFields is a list of field names (e.g. "DisplayName") to include in API 1982 // requests with the JSON null value. By default, fields with empty values are 1983 // omitted from API requests. See 1984 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1985 NullFields []string `json:"-"` 1986 } 1987 1988 func (s *Location) MarshalJSON() ([]byte, error) { 1989 type NoMethod Location 1990 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1991 } 1992 1993 // MaintenancePolicy: Maintenance policy for an instance. 1994 type MaintenancePolicy struct { 1995 // CreateTime: Output only. The time when the policy was created. 1996 CreateTime string `json:"createTime,omitempty"` 1997 // Description: Optional. Description of what this policy is for. Create/Update 1998 // methods return INVALID_ARGUMENT if the length is greater than 512. 1999 Description string `json:"description,omitempty"` 2000 // UpdateTime: Output only. The time when the policy was last updated. 2001 UpdateTime string `json:"updateTime,omitempty"` 2002 // WeeklyMaintenanceWindow: Optional. Maintenance window that is applied to 2003 // resources covered by this policy. Minimum 1. For the current version, the 2004 // maximum number of weekly_window is expected to be one. 2005 WeeklyMaintenanceWindow []*WeeklyMaintenanceWindow `json:"weeklyMaintenanceWindow,omitempty"` 2006 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2007 // unconditionally include in API requests. By default, fields with empty or 2008 // default values are omitted from API requests. See 2009 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2010 // details. 2011 ForceSendFields []string `json:"-"` 2012 // NullFields is a list of field names (e.g. "CreateTime") to include in API 2013 // requests with the JSON null value. By default, fields with empty values are 2014 // omitted from API requests. See 2015 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2016 NullFields []string `json:"-"` 2017 } 2018 2019 func (s *MaintenancePolicy) MarshalJSON() ([]byte, error) { 2020 type NoMethod MaintenancePolicy 2021 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2022 } 2023 2024 // MaintenanceSchedule: Upcoming maintenance schedule. If no maintenance is 2025 // scheduled, fields are not populated. 2026 type MaintenanceSchedule struct { 2027 // CanReschedule: If the scheduled maintenance can be rescheduled, default is 2028 // true. 2029 CanReschedule bool `json:"canReschedule,omitempty"` 2030 // EndTime: Output only. The end time of any upcoming scheduled maintenance for 2031 // this instance. 2032 EndTime string `json:"endTime,omitempty"` 2033 // ScheduleDeadlineTime: Output only. The deadline that the maintenance 2034 // schedule start time can not go beyond, including reschedule. 2035 ScheduleDeadlineTime string `json:"scheduleDeadlineTime,omitempty"` 2036 // StartTime: Output only. The start time of any upcoming scheduled maintenance 2037 // for this instance. 2038 StartTime string `json:"startTime,omitempty"` 2039 // ForceSendFields is a list of field names (e.g. "CanReschedule") to 2040 // unconditionally include in API requests. By default, fields with empty or 2041 // default values are omitted from API requests. See 2042 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2043 // details. 2044 ForceSendFields []string `json:"-"` 2045 // NullFields is a list of field names (e.g. "CanReschedule") to include in API 2046 // requests with the JSON null value. By default, fields with empty values are 2047 // omitted from API requests. See 2048 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2049 NullFields []string `json:"-"` 2050 } 2051 2052 func (s *MaintenanceSchedule) MarshalJSON() ([]byte, error) { 2053 type NoMethod MaintenanceSchedule 2054 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2055 } 2056 2057 type ManagedCertificateAuthority struct { 2058 // CaCerts: The PEM encoded CA certificate chains for redis managed server 2059 // authentication 2060 CaCerts []*CertChain `json:"caCerts,omitempty"` 2061 // ForceSendFields is a list of field names (e.g. "CaCerts") to unconditionally 2062 // include in API requests. By default, fields with empty or default values are 2063 // omitted from API requests. See 2064 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2065 // details. 2066 ForceSendFields []string `json:"-"` 2067 // NullFields is a list of field names (e.g. "CaCerts") to include in API 2068 // requests with the JSON null value. By default, fields with empty values are 2069 // omitted from API requests. See 2070 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2071 NullFields []string `json:"-"` 2072 } 2073 2074 func (s *ManagedCertificateAuthority) MarshalJSON() ([]byte, error) { 2075 type NoMethod ManagedCertificateAuthority 2076 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2077 } 2078 2079 // NodeInfo: Node specific properties. 2080 type NodeInfo struct { 2081 // Id: Output only. Node identifying string. e.g. 'node-0', 'node-1' 2082 Id string `json:"id,omitempty"` 2083 // Zone: Output only. Location of the node. 2084 Zone string `json:"zone,omitempty"` 2085 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally 2086 // include in API requests. By default, fields with empty or default values are 2087 // omitted from API requests. See 2088 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2089 // details. 2090 ForceSendFields []string `json:"-"` 2091 // NullFields is a list of field names (e.g. "Id") to include in API requests 2092 // with the JSON null value. By default, fields with empty values are omitted 2093 // from API requests. See 2094 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2095 NullFields []string `json:"-"` 2096 } 2097 2098 func (s *NodeInfo) MarshalJSON() ([]byte, error) { 2099 type NoMethod NodeInfo 2100 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2101 } 2102 2103 // Operation: This resource represents a long-running operation that is the 2104 // result of a network API call. 2105 type Operation struct { 2106 // Done: If the value is `false`, it means the operation is still in progress. 2107 // If `true`, the operation is completed, and either `error` or `response` is 2108 // available. 2109 Done bool `json:"done,omitempty"` 2110 // Error: The error result of the operation in case of failure or cancellation. 2111 Error *Status `json:"error,omitempty"` 2112 // Metadata: { `createTime`: The time the operation was created. `endTime`: The 2113 // time the operation finished running. `target`: Server-defined resource path 2114 // for the target of the operation. `verb`: Name of the verb executed by the 2115 // operation. `statusDetail`: Human-readable status of the operation, if any. 2116 // `cancelRequested`: Identifies whether the user has requested cancellation of 2117 // the operation. Operations that have successfully been cancelled have 2118 // Operation.error value with a google.rpc.Status.code of 1, corresponding to 2119 // `Code.CANCELLED`. `apiVersion`: API version used to start the operation. } 2120 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 2121 // Name: The server-assigned name, which is only unique within the same service 2122 // that originally returns it. If you use the default HTTP mapping, the `name` 2123 // should be a resource name ending with `operations/{unique_id}`. 2124 Name string `json:"name,omitempty"` 2125 // Response: The normal, successful response of the operation. If the original 2126 // method returns no data on success, such as `Delete`, the response is 2127 // `google.protobuf.Empty`. If the original method is standard 2128 // `Get`/`Create`/`Update`, the response should be the resource. For other 2129 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 2130 // original method name. For example, if the original method name is 2131 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 2132 Response googleapi.RawMessage `json:"response,omitempty"` 2133 2134 // ServerResponse contains the HTTP response code and headers from the server. 2135 googleapi.ServerResponse `json:"-"` 2136 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 2137 // include in API requests. By default, fields with empty or default values are 2138 // omitted from API requests. See 2139 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2140 // details. 2141 ForceSendFields []string `json:"-"` 2142 // NullFields is a list of field names (e.g. "Done") to include in API requests 2143 // with the JSON null value. By default, fields with empty values are omitted 2144 // from API requests. See 2145 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2146 NullFields []string `json:"-"` 2147 } 2148 2149 func (s *Operation) MarshalJSON() ([]byte, error) { 2150 type NoMethod Operation 2151 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2152 } 2153 2154 // OperationError: An error that occurred during a backup creation operation. 2155 type OperationError struct { 2156 // Code: Identifies the specific error that occurred. REQUIRED 2157 Code string `json:"code,omitempty"` 2158 // Possible values: 2159 // "OPERATION_ERROR_TYPE_UNSPECIFIED" - UNSPECIFIED means product type is not 2160 // known or available. 2161 // "KMS_KEY_ERROR" - key destroyed, expired, not found, unreachable or 2162 // permission denied. 2163 // "DATABASE_ERROR" - Database is not accessible 2164 // "STOCKOUT_ERROR" - The zone or region does not have sufficient resources 2165 // to handle the request at the moment 2166 // "CANCELLATION_ERROR" - User initiated cancellation 2167 // "SQLSERVER_ERROR" - SQL server specific error 2168 // "INTERNAL_ERROR" - Any other internal error. 2169 ErrorType string `json:"errorType,omitempty"` 2170 // Message: Additional information about the error encountered. REQUIRED 2171 Message string `json:"message,omitempty"` 2172 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 2173 // include in API requests. By default, fields with empty or default values are 2174 // omitted from API requests. See 2175 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2176 // details. 2177 ForceSendFields []string `json:"-"` 2178 // NullFields is a list of field names (e.g. "Code") to include in API requests 2179 // with the JSON null value. By default, fields with empty values are omitted 2180 // from API requests. See 2181 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2182 NullFields []string `json:"-"` 2183 } 2184 2185 func (s *OperationError) MarshalJSON() ([]byte, error) { 2186 type NoMethod OperationError 2187 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2188 } 2189 2190 // OperationMetadata: Pre-defined metadata fields. 2191 type OperationMetadata struct { 2192 // ApiVersion: Output only. API version used to start the operation. 2193 ApiVersion string `json:"apiVersion,omitempty"` 2194 // CreateTime: Output only. The time the operation was created. 2195 CreateTime string `json:"createTime,omitempty"` 2196 // EndTime: Output only. The time the operation finished running. 2197 EndTime string `json:"endTime,omitempty"` 2198 // RequestedCancellation: Output only. Identifies whether the user has 2199 // requested cancellation of the operation. Operations that have successfully 2200 // been cancelled have Operation.error value with a google.rpc.Status.code of 2201 // 1, corresponding to `Code.CANCELLED`. 2202 RequestedCancellation bool `json:"requestedCancellation,omitempty"` 2203 // StatusMessage: Output only. Human-readable status of the operation, if any. 2204 StatusMessage string `json:"statusMessage,omitempty"` 2205 // Target: Output only. Server-defined resource path for the target of the 2206 // operation. 2207 Target string `json:"target,omitempty"` 2208 // Verb: Output only. Name of the verb executed by the operation. 2209 Verb string `json:"verb,omitempty"` 2210 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 2211 // unconditionally include in API requests. By default, fields with empty or 2212 // default values are omitted from API requests. See 2213 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2214 // details. 2215 ForceSendFields []string `json:"-"` 2216 // NullFields is a list of field names (e.g. "ApiVersion") to include in API 2217 // requests with the JSON null value. By default, fields with empty values are 2218 // omitted from API requests. See 2219 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2220 NullFields []string `json:"-"` 2221 } 2222 2223 func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 2224 type NoMethod OperationMetadata 2225 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2226 } 2227 2228 // OutputConfig: The output content 2229 type OutputConfig struct { 2230 // GcsDestination: Google Cloud Storage destination for output content. 2231 GcsDestination *GcsDestination `json:"gcsDestination,omitempty"` 2232 // ForceSendFields is a list of field names (e.g. "GcsDestination") to 2233 // unconditionally include in API requests. By default, fields with empty or 2234 // default values are omitted from API requests. See 2235 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2236 // details. 2237 ForceSendFields []string `json:"-"` 2238 // NullFields is a list of field names (e.g. "GcsDestination") to include in 2239 // API requests with the JSON null value. By default, fields with empty values 2240 // are omitted from API requests. See 2241 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2242 NullFields []string `json:"-"` 2243 } 2244 2245 func (s *OutputConfig) MarshalJSON() ([]byte, error) { 2246 type NoMethod OutputConfig 2247 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2248 } 2249 2250 // PersistenceConfig: Configuration of the persistence functionality. 2251 type PersistenceConfig struct { 2252 // PersistenceMode: Optional. Controls whether Persistence features are 2253 // enabled. If not provided, the existing value will be used. 2254 // 2255 // Possible values: 2256 // "PERSISTENCE_MODE_UNSPECIFIED" - Not set. 2257 // "DISABLED" - Persistence is disabled for the instance, and any existing 2258 // snapshots are deleted. 2259 // "RDB" - RDB based Persistence is enabled. 2260 PersistenceMode string `json:"persistenceMode,omitempty"` 2261 // RdbNextSnapshotTime: Output only. The next time that a snapshot attempt is 2262 // scheduled to occur. 2263 RdbNextSnapshotTime string `json:"rdbNextSnapshotTime,omitempty"` 2264 // RdbSnapshotPeriod: Optional. Period between RDB snapshots. Snapshots will be 2265 // attempted every period starting from the provided snapshot start time. For 2266 // example, a start time of 01/01/2033 06:45 and SIX_HOURS snapshot period will 2267 // do nothing until 01/01/2033, and then trigger snapshots every day at 06:45, 2268 // 12:45, 18:45, and 00:45 the next day, and so on. If not provided, 2269 // TWENTY_FOUR_HOURS will be used as default. 2270 // 2271 // Possible values: 2272 // "SNAPSHOT_PERIOD_UNSPECIFIED" - Not set. 2273 // "ONE_HOUR" - Snapshot every 1 hour. 2274 // "SIX_HOURS" - Snapshot every 6 hours. 2275 // "TWELVE_HOURS" - Snapshot every 12 hours. 2276 // "TWENTY_FOUR_HOURS" - Snapshot every 24 hours. 2277 RdbSnapshotPeriod string `json:"rdbSnapshotPeriod,omitempty"` 2278 // RdbSnapshotStartTime: Optional. Date and time that the first snapshot 2279 // was/will be attempted, and to which future snapshots will be aligned. If not 2280 // provided, the current time will be used. 2281 RdbSnapshotStartTime string `json:"rdbSnapshotStartTime,omitempty"` 2282 // ForceSendFields is a list of field names (e.g. "PersistenceMode") to 2283 // unconditionally include in API requests. By default, fields with empty or 2284 // default values are omitted from API requests. See 2285 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2286 // details. 2287 ForceSendFields []string `json:"-"` 2288 // NullFields is a list of field names (e.g. "PersistenceMode") to include in 2289 // API requests with the JSON null value. By default, fields with empty values 2290 // are omitted from API requests. See 2291 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2292 NullFields []string `json:"-"` 2293 } 2294 2295 func (s *PersistenceConfig) MarshalJSON() ([]byte, error) { 2296 type NoMethod PersistenceConfig 2297 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2298 } 2299 2300 // Product: Product specification for Condor resources. 2301 type Product struct { 2302 // Engine: The specific engine that the underlying database is running. 2303 // 2304 // Possible values: 2305 // "ENGINE_UNSPECIFIED" - UNSPECIFIED means engine type is not known or 2306 // available. 2307 // "ENGINE_MYSQL" - MySQL binary running as an engine in the database 2308 // instance. 2309 // "MYSQL" - MySQL binary running as engine in database instance. 2310 // "ENGINE_POSTGRES" - Postgres binary running as engine in database 2311 // instance. 2312 // "POSTGRES" - Postgres binary running as engine in database instance. 2313 // "ENGINE_SQL_SERVER" - SQLServer binary running as engine in database 2314 // instance. 2315 // "SQL_SERVER" - SQLServer binary running as engine in database instance. 2316 // "ENGINE_NATIVE" - Native database binary running as engine in instance. 2317 // "NATIVE" - Native database binary running as engine in instance. 2318 // "ENGINE_CLOUD_SPANNER_WITH_POSTGRES_DIALECT" - Cloud Spanner with 2319 // PostgreSQL dialect. 2320 // "ENGINE_CLOUD_SPANNER_WITH_GOOGLESQL_DIALECT" - Cloud Spanner with Google 2321 // SQL dialect. 2322 // "ENGINE_MEMORYSTORE_FOR_REDIS" - Memorystore with Redis dialect. 2323 // "ENGINE_MEMORYSTORE_FOR_REDIS_CLUSTER" - Memorystore with Redis cluster 2324 // dialect. 2325 // "ENGINE_OTHER" - Other refers to rest of other database engine. This is to 2326 // be when engine is known, but it is not present in this enum. 2327 Engine string `json:"engine,omitempty"` 2328 // Type: Type of specific database product. It could be CloudSQL, AlloyDB etc.. 2329 // 2330 // Possible values: 2331 // "PRODUCT_TYPE_UNSPECIFIED" - UNSPECIFIED means product type is not known 2332 // or available. 2333 // "PRODUCT_TYPE_CLOUD_SQL" - Cloud SQL product area in GCP 2334 // "CLOUD_SQL" - Cloud SQL product area in GCP 2335 // "PRODUCT_TYPE_ALLOYDB" - AlloyDB product area in GCP 2336 // "ALLOYDB" - AlloyDB product area in GCP 2337 // "PRODUCT_TYPE_SPANNER" - Spanner product area in GCP 2338 // "PRODUCT_TYPE_ON_PREM" - On premises database product. 2339 // "ON_PREM" - On premises database product. 2340 // "PRODUCT_TYPE_MEMORYSTORE" - Memorystore product area in GCP 2341 // "PRODUCT_TYPE_BIGTABLE" - Bigtable product area in GCP 2342 // "PRODUCT_TYPE_OTHER" - Other refers to rest of other product type. This is 2343 // to be when product type is known, but it is not present in this enum. 2344 Type string `json:"type,omitempty"` 2345 // Version: Version of the underlying database engine. Example values: For 2346 // MySQL, it could be "8.0", "5.7" etc.. For Postgres, it could be "14", "15" 2347 // etc.. 2348 Version string `json:"version,omitempty"` 2349 // ForceSendFields is a list of field names (e.g. "Engine") to unconditionally 2350 // include in API requests. By default, fields with empty or default values are 2351 // omitted from API requests. See 2352 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2353 // details. 2354 ForceSendFields []string `json:"-"` 2355 // NullFields is a list of field names (e.g. "Engine") to include in API 2356 // requests with the JSON null value. By default, fields with empty values are 2357 // omitted from API requests. See 2358 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2359 NullFields []string `json:"-"` 2360 } 2361 2362 func (s *Product) MarshalJSON() ([]byte, error) { 2363 type NoMethod Product 2364 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2365 } 2366 2367 type PscConfig struct { 2368 // Network: Required. The network where the IP address of the discovery 2369 // endpoint will be reserved, in the form of 2370 // projects/{network_project}/global/networks/{network_id}. 2371 Network string `json:"network,omitempty"` 2372 // ForceSendFields is a list of field names (e.g. "Network") to unconditionally 2373 // include in API requests. By default, fields with empty or default values are 2374 // omitted from API requests. See 2375 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2376 // details. 2377 ForceSendFields []string `json:"-"` 2378 // NullFields is a list of field names (e.g. "Network") to include in API 2379 // requests with the JSON null value. By default, fields with empty values are 2380 // omitted from API requests. See 2381 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2382 NullFields []string `json:"-"` 2383 } 2384 2385 func (s *PscConfig) MarshalJSON() ([]byte, error) { 2386 type NoMethod PscConfig 2387 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2388 } 2389 2390 // PscConnection: Details of consumer resources in a PSC connection. 2391 type PscConnection struct { 2392 // Address: Output only. The IP allocated on the consumer network for the PSC 2393 // forwarding rule. 2394 Address string `json:"address,omitempty"` 2395 // ForwardingRule: Output only. The URI of the consumer side forwarding rule. 2396 // Example: 2397 // projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. 2398 ForwardingRule string `json:"forwardingRule,omitempty"` 2399 // Network: The consumer network where the IP address resides, in the form of 2400 // projects/{project_id}/global/networks/{network_id}. 2401 Network string `json:"network,omitempty"` 2402 // ProjectId: Output only. The consumer project_id where the forwarding rule is 2403 // created from. 2404 ProjectId string `json:"projectId,omitempty"` 2405 // PscConnectionId: Output only. The PSC connection id of the forwarding rule 2406 // connected to the service attachment. 2407 PscConnectionId string `json:"pscConnectionId,omitempty"` 2408 // ForceSendFields is a list of field names (e.g. "Address") to unconditionally 2409 // include in API requests. By default, fields with empty or default values are 2410 // omitted from API requests. See 2411 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2412 // details. 2413 ForceSendFields []string `json:"-"` 2414 // NullFields is a list of field names (e.g. "Address") to include in API 2415 // requests with the JSON null value. By default, fields with empty values are 2416 // omitted from API requests. See 2417 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2418 NullFields []string `json:"-"` 2419 } 2420 2421 func (s *PscConnection) MarshalJSON() ([]byte, error) { 2422 type NoMethod PscConnection 2423 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2424 } 2425 2426 // RDBConfig: Configuration of the RDB based persistence. 2427 type RDBConfig struct { 2428 // RdbSnapshotPeriod: Optional. Period between RDB snapshots. 2429 // 2430 // Possible values: 2431 // "SNAPSHOT_PERIOD_UNSPECIFIED" - Not set. 2432 // "ONE_HOUR" - One hour. 2433 // "SIX_HOURS" - Six hours. 2434 // "TWELVE_HOURS" - Twelve hours. 2435 // "TWENTY_FOUR_HOURS" - Twenty four hours. 2436 RdbSnapshotPeriod string `json:"rdbSnapshotPeriod,omitempty"` 2437 // RdbSnapshotStartTime: Optional. The time that the first snapshot was/will be 2438 // attempted, and to which future snapshots will be aligned. If not provided, 2439 // the current time will be used. 2440 RdbSnapshotStartTime string `json:"rdbSnapshotStartTime,omitempty"` 2441 // ForceSendFields is a list of field names (e.g. "RdbSnapshotPeriod") 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. "RdbSnapshotPeriod") to include in 2448 // API requests with the JSON null value. By default, fields with empty values 2449 // 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 *RDBConfig) MarshalJSON() ([]byte, error) { 2455 type NoMethod RDBConfig 2456 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2457 } 2458 2459 // ReconciliationOperationMetadata: Operation metadata returned by the CLH 2460 // during resource state reconciliation. 2461 type ReconciliationOperationMetadata struct { 2462 // DeleteResource: DEPRECATED. Use exclusive_action instead. 2463 DeleteResource bool `json:"deleteResource,omitempty"` 2464 // ExclusiveAction: Excluisive action returned by the CLH. 2465 // 2466 // Possible values: 2467 // "UNKNOWN_REPAIR_ACTION" - Unknown repair action. 2468 // "DELETE" - The resource has to be deleted. When using this bit, the CLH 2469 // should fail the operation. DEPRECATED. Instead use DELETE_RESOURCE 2470 // OperationSignal in SideChannel. 2471 // "RETRY" - This resource could not be repaired but the repair should be 2472 // tried again at a later time. This can happen if there is a dependency that 2473 // needs to be resolved first- e.g. if a parent resource must be repaired 2474 // before a child resource. 2475 ExclusiveAction string `json:"exclusiveAction,omitempty"` 2476 // ForceSendFields is a list of field names (e.g. "DeleteResource") to 2477 // unconditionally include in API requests. By default, fields with empty or 2478 // default values are omitted from API requests. See 2479 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2480 // details. 2481 ForceSendFields []string `json:"-"` 2482 // NullFields is a list of field names (e.g. "DeleteResource") to include in 2483 // API requests with the JSON null value. By default, fields with empty values 2484 // are omitted from API requests. See 2485 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2486 NullFields []string `json:"-"` 2487 } 2488 2489 func (s *ReconciliationOperationMetadata) MarshalJSON() ([]byte, error) { 2490 type NoMethod ReconciliationOperationMetadata 2491 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2492 } 2493 2494 // RescheduleMaintenanceRequest: Request for RescheduleMaintenance. 2495 type RescheduleMaintenanceRequest struct { 2496 // RescheduleType: Required. If reschedule type is SPECIFIC_TIME, must set up 2497 // schedule_time as well. 2498 // 2499 // Possible values: 2500 // "RESCHEDULE_TYPE_UNSPECIFIED" - Not set. 2501 // "IMMEDIATE" - If the user wants to schedule the maintenance to happen now. 2502 // "NEXT_AVAILABLE_WINDOW" - If the user wants to use the existing 2503 // maintenance policy to find the next available window. 2504 // "SPECIFIC_TIME" - If the user wants to reschedule the maintenance to a 2505 // specific time. 2506 RescheduleType string `json:"rescheduleType,omitempty"` 2507 // ScheduleTime: Optional. Timestamp when the maintenance shall be rescheduled 2508 // to if reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for example 2509 // `2012-11-15T16:19:00.094Z`. 2510 ScheduleTime string `json:"scheduleTime,omitempty"` 2511 // ForceSendFields is a list of field names (e.g. "RescheduleType") to 2512 // unconditionally include in API requests. By default, fields with empty or 2513 // default values are omitted from API requests. See 2514 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2515 // details. 2516 ForceSendFields []string `json:"-"` 2517 // NullFields is a list of field names (e.g. "RescheduleType") to include in 2518 // API requests with the JSON null value. By default, fields with empty values 2519 // are omitted from API requests. See 2520 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2521 NullFields []string `json:"-"` 2522 } 2523 2524 func (s *RescheduleMaintenanceRequest) MarshalJSON() ([]byte, error) { 2525 type NoMethod RescheduleMaintenanceRequest 2526 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2527 } 2528 2529 type RetentionSettings struct { 2530 QuantityBasedRetention int64 `json:"quantityBasedRetention,omitempty"` 2531 // RetentionUnit: The unit that 'retained_backups' represents. 2532 // 2533 // Possible values: 2534 // "RETENTION_UNIT_UNSPECIFIED" - Backup retention unit is unspecified, will 2535 // be treated as COUNT. 2536 // "COUNT" - Retention will be by count, eg. "retain the most recent 7 2537 // backups". 2538 // "TIME" - Retention will be by Time, eg. "retain the last 7 days backups". 2539 // "RETENTION_UNIT_OTHER" - For rest of the other category 2540 RetentionUnit string `json:"retentionUnit,omitempty"` 2541 TimeBasedRetention string `json:"timeBasedRetention,omitempty"` 2542 // ForceSendFields is a list of field names (e.g. "QuantityBasedRetention") to 2543 // unconditionally include in API requests. By default, fields with empty or 2544 // default values are omitted from API requests. See 2545 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2546 // details. 2547 ForceSendFields []string `json:"-"` 2548 // NullFields is a list of field names (e.g. "QuantityBasedRetention") to 2549 // include in API requests with the JSON null value. By default, fields with 2550 // empty values are omitted from API requests. See 2551 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2552 NullFields []string `json:"-"` 2553 } 2554 2555 func (s *RetentionSettings) MarshalJSON() ([]byte, error) { 2556 type NoMethod RetentionSettings 2557 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2558 } 2559 2560 // StateInfo: Represents additional information about the state of the cluster. 2561 type StateInfo struct { 2562 // UpdateInfo: Describes ongoing update on the cluster when cluster state is 2563 // UPDATING. 2564 UpdateInfo *UpdateInfo `json:"updateInfo,omitempty"` 2565 // ForceSendFields is a list of field names (e.g. "UpdateInfo") to 2566 // unconditionally include in API requests. By default, fields with empty or 2567 // default values are omitted from API requests. See 2568 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2569 // details. 2570 ForceSendFields []string `json:"-"` 2571 // NullFields is a list of field names (e.g. "UpdateInfo") to include in API 2572 // requests with the JSON null value. By default, fields with empty values are 2573 // omitted from API requests. See 2574 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2575 NullFields []string `json:"-"` 2576 } 2577 2578 func (s *StateInfo) MarshalJSON() ([]byte, error) { 2579 type NoMethod StateInfo 2580 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2581 } 2582 2583 // Status: The `Status` type defines a logical error model that is suitable for 2584 // different programming environments, including REST APIs and RPC APIs. It is 2585 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 2586 // pieces of data: error code, error message, and error details. You can find 2587 // out more about this error model and how to work with it in the API Design 2588 // Guide (https://cloud.google.com/apis/design/errors). 2589 type Status struct { 2590 // Code: The status code, which should be an enum value of google.rpc.Code. 2591 Code int64 `json:"code,omitempty"` 2592 // Details: A list of messages that carry the error details. There is a common 2593 // set of message types for APIs to use. 2594 Details []googleapi.RawMessage `json:"details,omitempty"` 2595 // Message: A developer-facing error message, which should be in English. Any 2596 // user-facing error message should be localized and sent in the 2597 // google.rpc.Status.details field, or localized by the client. 2598 Message string `json:"message,omitempty"` 2599 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 2600 // include in API requests. By default, fields with empty or default values are 2601 // omitted from API requests. See 2602 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2603 // details. 2604 ForceSendFields []string `json:"-"` 2605 // NullFields is a list of field names (e.g. "Code") to include in API requests 2606 // with the JSON null value. By default, fields with empty values are omitted 2607 // from API requests. See 2608 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2609 NullFields []string `json:"-"` 2610 } 2611 2612 func (s *Status) MarshalJSON() ([]byte, error) { 2613 type NoMethod Status 2614 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2615 } 2616 2617 // TimeOfDay: Represents a time of day. The date and time zone are either not 2618 // significant or are specified elsewhere. An API may choose to allow leap 2619 // seconds. Related types are google.type.Date and `google.protobuf.Timestamp`. 2620 type TimeOfDay struct { 2621 // Hours: Hours of day in 24 hour format. Should be from 0 to 23. An API may 2622 // choose to allow the value "24:00:00" for scenarios like business closing 2623 // time. 2624 Hours int64 `json:"hours,omitempty"` 2625 // Minutes: Minutes of hour of day. Must be from 0 to 59. 2626 Minutes int64 `json:"minutes,omitempty"` 2627 // Nanos: Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. 2628 Nanos int64 `json:"nanos,omitempty"` 2629 // Seconds: Seconds of minutes of the time. Must normally be from 0 to 59. An 2630 // API may allow the value 60 if it allows leap-seconds. 2631 Seconds int64 `json:"seconds,omitempty"` 2632 // ForceSendFields is a list of field names (e.g. "Hours") to unconditionally 2633 // include in API requests. By default, fields with empty or default values are 2634 // omitted from API requests. See 2635 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2636 // details. 2637 ForceSendFields []string `json:"-"` 2638 // NullFields is a list of field names (e.g. "Hours") to include in API 2639 // requests with the JSON null value. By default, fields with empty values are 2640 // omitted from API requests. See 2641 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2642 NullFields []string `json:"-"` 2643 } 2644 2645 func (s *TimeOfDay) MarshalJSON() ([]byte, error) { 2646 type NoMethod TimeOfDay 2647 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2648 } 2649 2650 // TlsCertificate: TlsCertificate Resource 2651 type TlsCertificate struct { 2652 // Cert: PEM representation. 2653 Cert string `json:"cert,omitempty"` 2654 // CreateTime: Output only. The time when the certificate was created in RFC 2655 // 3339 (https://tools.ietf.org/html/rfc3339) format, for example 2656 // `2020-05-18T00:00:00.094Z`. 2657 CreateTime string `json:"createTime,omitempty"` 2658 // ExpireTime: Output only. The time when the certificate expires in RFC 3339 2659 // (https://tools.ietf.org/html/rfc3339) format, for example 2660 // `2020-05-18T00:00:00.094Z`. 2661 ExpireTime string `json:"expireTime,omitempty"` 2662 // SerialNumber: Serial number, as extracted from the certificate. 2663 SerialNumber string `json:"serialNumber,omitempty"` 2664 // Sha1Fingerprint: Sha1 Fingerprint of the certificate. 2665 Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"` 2666 // ForceSendFields is a list of field names (e.g. "Cert") to unconditionally 2667 // include in API requests. By default, fields with empty or default values are 2668 // omitted from API requests. See 2669 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2670 // details. 2671 ForceSendFields []string `json:"-"` 2672 // NullFields is a list of field names (e.g. "Cert") to include in API requests 2673 // with the JSON null value. By default, fields with empty values are omitted 2674 // from API requests. See 2675 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2676 NullFields []string `json:"-"` 2677 } 2678 2679 func (s *TlsCertificate) MarshalJSON() ([]byte, error) { 2680 type NoMethod TlsCertificate 2681 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2682 } 2683 2684 // UpdateInfo: Represents information about an updating cluster. 2685 type UpdateInfo struct { 2686 // TargetReplicaCount: Target number of replica nodes per shard. 2687 TargetReplicaCount int64 `json:"targetReplicaCount,omitempty"` 2688 // TargetShardCount: Target number of shards for redis cluster 2689 TargetShardCount int64 `json:"targetShardCount,omitempty"` 2690 // ForceSendFields is a list of field names (e.g. "TargetReplicaCount") to 2691 // unconditionally include in API requests. By default, fields with empty or 2692 // default values are omitted from API requests. See 2693 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2694 // details. 2695 ForceSendFields []string `json:"-"` 2696 // NullFields is a list of field names (e.g. "TargetReplicaCount") to include 2697 // in API requests with the JSON null value. By default, fields with empty 2698 // values are omitted from API requests. See 2699 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2700 NullFields []string `json:"-"` 2701 } 2702 2703 func (s *UpdateInfo) MarshalJSON() ([]byte, error) { 2704 type NoMethod UpdateInfo 2705 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2706 } 2707 2708 // UpgradeInstanceRequest: Request for UpgradeInstance. 2709 type UpgradeInstanceRequest struct { 2710 // RedisVersion: Required. Specifies the target version of Redis software to 2711 // upgrade to. 2712 RedisVersion string `json:"redisVersion,omitempty"` 2713 // ForceSendFields is a list of field names (e.g. "RedisVersion") to 2714 // unconditionally include in API requests. By default, fields with empty or 2715 // default values are omitted from API requests. See 2716 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2717 // details. 2718 ForceSendFields []string `json:"-"` 2719 // NullFields is a list of field names (e.g. "RedisVersion") to include in API 2720 // requests with the JSON null value. By default, fields with empty values are 2721 // omitted from API requests. See 2722 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2723 NullFields []string `json:"-"` 2724 } 2725 2726 func (s *UpgradeInstanceRequest) MarshalJSON() ([]byte, error) { 2727 type NoMethod UpgradeInstanceRequest 2728 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2729 } 2730 2731 // UserLabels: Message type for storing user labels. User labels are used to 2732 // tag App Engine resources, allowing users to search for resources matching a 2733 // set of labels and to aggregate usage data by labels. 2734 type UserLabels struct { 2735 Labels map[string]string `json:"labels,omitempty"` 2736 // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally 2737 // include in API requests. By default, fields with empty or default values are 2738 // omitted from API requests. See 2739 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2740 // details. 2741 ForceSendFields []string `json:"-"` 2742 // NullFields is a list of field names (e.g. "Labels") to include in API 2743 // requests with the JSON null value. By default, fields with empty values are 2744 // omitted from API requests. See 2745 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2746 NullFields []string `json:"-"` 2747 } 2748 2749 func (s *UserLabels) MarshalJSON() ([]byte, error) { 2750 type NoMethod UserLabels 2751 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2752 } 2753 2754 // WeeklyMaintenanceWindow: Time window in which disruptive maintenance updates 2755 // occur. Non-disruptive updates can occur inside or outside this window. 2756 type WeeklyMaintenanceWindow struct { 2757 // Day: Required. The day of week that maintenance updates occur. 2758 // 2759 // Possible values: 2760 // "DAY_OF_WEEK_UNSPECIFIED" - The day of the week is unspecified. 2761 // "MONDAY" - Monday 2762 // "TUESDAY" - Tuesday 2763 // "WEDNESDAY" - Wednesday 2764 // "THURSDAY" - Thursday 2765 // "FRIDAY" - Friday 2766 // "SATURDAY" - Saturday 2767 // "SUNDAY" - Sunday 2768 Day string `json:"day,omitempty"` 2769 // Duration: Output only. Duration of the maintenance window. The current 2770 // window is fixed at 1 hour. 2771 Duration string `json:"duration,omitempty"` 2772 // StartTime: Required. Start time of the window in UTC time. 2773 StartTime *TimeOfDay `json:"startTime,omitempty"` 2774 // ForceSendFields is a list of field names (e.g. "Day") to unconditionally 2775 // include in API requests. By default, fields with empty or default values are 2776 // omitted from API requests. See 2777 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2778 // details. 2779 ForceSendFields []string `json:"-"` 2780 // NullFields is a list of field names (e.g. "Day") to include in API requests 2781 // with the JSON null value. By default, fields with empty values are omitted 2782 // from API requests. See 2783 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2784 NullFields []string `json:"-"` 2785 } 2786 2787 func (s *WeeklyMaintenanceWindow) MarshalJSON() ([]byte, error) { 2788 type NoMethod WeeklyMaintenanceWindow 2789 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2790 } 2791 2792 type ProjectsLocationsGetCall struct { 2793 s *Service 2794 name string 2795 urlParams_ gensupport.URLParams 2796 ifNoneMatch_ string 2797 ctx_ context.Context 2798 header_ http.Header 2799 } 2800 2801 // Get: Gets information about a location. 2802 // 2803 // - name: Resource name for the location. 2804 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { 2805 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2806 c.name = name 2807 return c 2808 } 2809 2810 // Fields allows partial responses to be retrieved. See 2811 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2812 // details. 2813 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { 2814 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2815 return c 2816 } 2817 2818 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2819 // object's ETag matches the given value. This is useful for getting updates 2820 // only after the object has changed since the last request. 2821 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { 2822 c.ifNoneMatch_ = entityTag 2823 return c 2824 } 2825 2826 // Context sets the context to be used in this call's Do method. 2827 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { 2828 c.ctx_ = ctx 2829 return c 2830 } 2831 2832 // Header returns a http.Header that can be modified by the caller to add 2833 // headers to the request. 2834 func (c *ProjectsLocationsGetCall) Header() http.Header { 2835 if c.header_ == nil { 2836 c.header_ = make(http.Header) 2837 } 2838 return c.header_ 2839 } 2840 2841 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { 2842 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2843 if c.ifNoneMatch_ != "" { 2844 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2845 } 2846 var body io.Reader = nil 2847 c.urlParams_.Set("alt", alt) 2848 c.urlParams_.Set("prettyPrint", "false") 2849 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2850 urls += "?" + c.urlParams_.Encode() 2851 req, err := http.NewRequest("GET", urls, body) 2852 if err != nil { 2853 return nil, err 2854 } 2855 req.Header = reqHeaders 2856 googleapi.Expand(req.URL, map[string]string{ 2857 "name": c.name, 2858 }) 2859 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2860 } 2861 2862 // Do executes the "redis.projects.locations.get" call. 2863 // Any non-2xx status code is an error. Response headers are in either 2864 // *Location.ServerResponse.Header or (if a response was returned at all) in 2865 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2866 // whether the returned error was because http.StatusNotModified was returned. 2867 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { 2868 gensupport.SetOptions(c.urlParams_, opts...) 2869 res, err := c.doRequest("json") 2870 if res != nil && res.StatusCode == http.StatusNotModified { 2871 if res.Body != nil { 2872 res.Body.Close() 2873 } 2874 return nil, gensupport.WrapError(&googleapi.Error{ 2875 Code: res.StatusCode, 2876 Header: res.Header, 2877 }) 2878 } 2879 if err != nil { 2880 return nil, err 2881 } 2882 defer googleapi.CloseBody(res) 2883 if err := googleapi.CheckResponse(res); err != nil { 2884 return nil, gensupport.WrapError(err) 2885 } 2886 ret := &Location{ 2887 ServerResponse: googleapi.ServerResponse{ 2888 Header: res.Header, 2889 HTTPStatusCode: res.StatusCode, 2890 }, 2891 } 2892 target := &ret 2893 if err := gensupport.DecodeResponse(target, res); err != nil { 2894 return nil, err 2895 } 2896 return ret, nil 2897 } 2898 2899 type ProjectsLocationsListCall struct { 2900 s *Service 2901 name string 2902 urlParams_ gensupport.URLParams 2903 ifNoneMatch_ string 2904 ctx_ context.Context 2905 header_ http.Header 2906 } 2907 2908 // List: Lists information about the supported locations for this service. 2909 // 2910 // - name: The resource that owns the locations collection, if applicable. 2911 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { 2912 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2913 c.name = name 2914 return c 2915 } 2916 2917 // Filter sets the optional parameter "filter": A filter to narrow down results 2918 // to a preferred subset. The filtering language accepts strings like 2919 // "displayName=tokyo", and is documented in more detail in AIP-160 2920 // (https://google.aip.dev/160). 2921 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { 2922 c.urlParams_.Set("filter", filter) 2923 return c 2924 } 2925 2926 // PageSize sets the optional parameter "pageSize": The maximum number of 2927 // results to return. If not set, the service selects a default. 2928 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { 2929 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2930 return c 2931 } 2932 2933 // PageToken sets the optional parameter "pageToken": A page token received 2934 // from the `next_page_token` field in the response. Send that page token to 2935 // receive the subsequent page. 2936 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { 2937 c.urlParams_.Set("pageToken", pageToken) 2938 return c 2939 } 2940 2941 // Fields allows partial responses to be retrieved. See 2942 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2943 // details. 2944 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { 2945 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2946 return c 2947 } 2948 2949 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2950 // object's ETag matches the given value. This is useful for getting updates 2951 // only after the object has changed since the last request. 2952 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { 2953 c.ifNoneMatch_ = entityTag 2954 return c 2955 } 2956 2957 // Context sets the context to be used in this call's Do method. 2958 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { 2959 c.ctx_ = ctx 2960 return c 2961 } 2962 2963 // Header returns a http.Header that can be modified by the caller to add 2964 // headers to the request. 2965 func (c *ProjectsLocationsListCall) Header() http.Header { 2966 if c.header_ == nil { 2967 c.header_ = make(http.Header) 2968 } 2969 return c.header_ 2970 } 2971 2972 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { 2973 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2974 if c.ifNoneMatch_ != "" { 2975 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2976 } 2977 var body io.Reader = nil 2978 c.urlParams_.Set("alt", alt) 2979 c.urlParams_.Set("prettyPrint", "false") 2980 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations") 2981 urls += "?" + c.urlParams_.Encode() 2982 req, err := http.NewRequest("GET", urls, body) 2983 if err != nil { 2984 return nil, err 2985 } 2986 req.Header = reqHeaders 2987 googleapi.Expand(req.URL, map[string]string{ 2988 "name": c.name, 2989 }) 2990 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2991 } 2992 2993 // Do executes the "redis.projects.locations.list" call. 2994 // Any non-2xx status code is an error. Response headers are in either 2995 // *ListLocationsResponse.ServerResponse.Header or (if a response was returned 2996 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2997 // check whether the returned error was because http.StatusNotModified was 2998 // returned. 2999 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { 3000 gensupport.SetOptions(c.urlParams_, opts...) 3001 res, err := c.doRequest("json") 3002 if res != nil && res.StatusCode == http.StatusNotModified { 3003 if res.Body != nil { 3004 res.Body.Close() 3005 } 3006 return nil, gensupport.WrapError(&googleapi.Error{ 3007 Code: res.StatusCode, 3008 Header: res.Header, 3009 }) 3010 } 3011 if err != nil { 3012 return nil, err 3013 } 3014 defer googleapi.CloseBody(res) 3015 if err := googleapi.CheckResponse(res); err != nil { 3016 return nil, gensupport.WrapError(err) 3017 } 3018 ret := &ListLocationsResponse{ 3019 ServerResponse: googleapi.ServerResponse{ 3020 Header: res.Header, 3021 HTTPStatusCode: res.StatusCode, 3022 }, 3023 } 3024 target := &ret 3025 if err := gensupport.DecodeResponse(target, res); err != nil { 3026 return nil, err 3027 } 3028 return ret, nil 3029 } 3030 3031 // Pages invokes f for each page of results. 3032 // A non-nil error returned from f will halt the iteration. 3033 // The provided context supersedes any context provided to the Context method. 3034 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { 3035 c.ctx_ = ctx 3036 defer c.PageToken(c.urlParams_.Get("pageToken")) 3037 for { 3038 x, err := c.Do() 3039 if err != nil { 3040 return err 3041 } 3042 if err := f(x); err != nil { 3043 return err 3044 } 3045 if x.NextPageToken == "" { 3046 return nil 3047 } 3048 c.PageToken(x.NextPageToken) 3049 } 3050 } 3051 3052 type ProjectsLocationsClustersCreateCall struct { 3053 s *Service 3054 parent string 3055 cluster *Cluster 3056 urlParams_ gensupport.URLParams 3057 ctx_ context.Context 3058 header_ http.Header 3059 } 3060 3061 // Create: Creates a Redis cluster based on the specified properties. The 3062 // creation is executed asynchronously and callers may check the returned 3063 // operation to track its progress. Once the operation is completed the Redis 3064 // cluster will be fully functional. The completed longrunning.Operation will 3065 // contain the new cluster object in the response field. The returned operation 3066 // is automatically deleted after a few hours, so there is no need to call 3067 // DeleteOperation. 3068 // 3069 // - parent: The resource name of the cluster location using the form: 3070 // `projects/{project_id}/locations/{location_id}` where `location_id` refers 3071 // to a GCP region. 3072 func (r *ProjectsLocationsClustersService) Create(parent string, cluster *Cluster) *ProjectsLocationsClustersCreateCall { 3073 c := &ProjectsLocationsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3074 c.parent = parent 3075 c.cluster = cluster 3076 return c 3077 } 3078 3079 // ClusterId sets the optional parameter "clusterId": Required. The logical 3080 // name of the Redis cluster in the customer project with the following 3081 // restrictions: * Must contain only lowercase letters, numbers, and hyphens. * 3082 // Must start with a letter. * Must be between 1-63 characters. * Must end with 3083 // a number or a letter. * Must be unique within the customer project / 3084 // location 3085 func (c *ProjectsLocationsClustersCreateCall) ClusterId(clusterId string) *ProjectsLocationsClustersCreateCall { 3086 c.urlParams_.Set("clusterId", clusterId) 3087 return c 3088 } 3089 3090 // RequestId sets the optional parameter "requestId": Idempotent request UUID. 3091 func (c *ProjectsLocationsClustersCreateCall) RequestId(requestId string) *ProjectsLocationsClustersCreateCall { 3092 c.urlParams_.Set("requestId", requestId) 3093 return c 3094 } 3095 3096 // Fields allows partial responses to be retrieved. See 3097 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3098 // details. 3099 func (c *ProjectsLocationsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersCreateCall { 3100 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3101 return c 3102 } 3103 3104 // Context sets the context to be used in this call's Do method. 3105 func (c *ProjectsLocationsClustersCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersCreateCall { 3106 c.ctx_ = ctx 3107 return c 3108 } 3109 3110 // Header returns a http.Header that can be modified by the caller to add 3111 // headers to the request. 3112 func (c *ProjectsLocationsClustersCreateCall) Header() http.Header { 3113 if c.header_ == nil { 3114 c.header_ = make(http.Header) 3115 } 3116 return c.header_ 3117 } 3118 3119 func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) { 3120 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3121 var body io.Reader = nil 3122 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) 3123 if err != nil { 3124 return nil, err 3125 } 3126 c.urlParams_.Set("alt", alt) 3127 c.urlParams_.Set("prettyPrint", "false") 3128 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters") 3129 urls += "?" + c.urlParams_.Encode() 3130 req, err := http.NewRequest("POST", urls, body) 3131 if err != nil { 3132 return nil, err 3133 } 3134 req.Header = reqHeaders 3135 googleapi.Expand(req.URL, map[string]string{ 3136 "parent": c.parent, 3137 }) 3138 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3139 } 3140 3141 // Do executes the "redis.projects.locations.clusters.create" call. 3142 // Any non-2xx status code is an error. Response headers are in either 3143 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3144 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3145 // whether the returned error was because http.StatusNotModified was returned. 3146 func (c *ProjectsLocationsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3147 gensupport.SetOptions(c.urlParams_, opts...) 3148 res, err := c.doRequest("json") 3149 if res != nil && res.StatusCode == http.StatusNotModified { 3150 if res.Body != nil { 3151 res.Body.Close() 3152 } 3153 return nil, gensupport.WrapError(&googleapi.Error{ 3154 Code: res.StatusCode, 3155 Header: res.Header, 3156 }) 3157 } 3158 if err != nil { 3159 return nil, err 3160 } 3161 defer googleapi.CloseBody(res) 3162 if err := googleapi.CheckResponse(res); err != nil { 3163 return nil, gensupport.WrapError(err) 3164 } 3165 ret := &Operation{ 3166 ServerResponse: googleapi.ServerResponse{ 3167 Header: res.Header, 3168 HTTPStatusCode: res.StatusCode, 3169 }, 3170 } 3171 target := &ret 3172 if err := gensupport.DecodeResponse(target, res); err != nil { 3173 return nil, err 3174 } 3175 return ret, nil 3176 } 3177 3178 type ProjectsLocationsClustersDeleteCall struct { 3179 s *Service 3180 name string 3181 urlParams_ gensupport.URLParams 3182 ctx_ context.Context 3183 header_ http.Header 3184 } 3185 3186 // Delete: Deletes a specific Redis cluster. Cluster stops serving and data is 3187 // deleted. 3188 // 3189 // - name: Redis cluster resource name using the form: 3190 // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` 3191 // where `location_id` refers to a GCP region. 3192 func (r *ProjectsLocationsClustersService) Delete(name string) *ProjectsLocationsClustersDeleteCall { 3193 c := &ProjectsLocationsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3194 c.name = name 3195 return c 3196 } 3197 3198 // RequestId sets the optional parameter "requestId": Idempotent request UUID. 3199 func (c *ProjectsLocationsClustersDeleteCall) RequestId(requestId string) *ProjectsLocationsClustersDeleteCall { 3200 c.urlParams_.Set("requestId", requestId) 3201 return c 3202 } 3203 3204 // Fields allows partial responses to be retrieved. See 3205 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3206 // details. 3207 func (c *ProjectsLocationsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersDeleteCall { 3208 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3209 return c 3210 } 3211 3212 // Context sets the context to be used in this call's Do method. 3213 func (c *ProjectsLocationsClustersDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersDeleteCall { 3214 c.ctx_ = ctx 3215 return c 3216 } 3217 3218 // Header returns a http.Header that can be modified by the caller to add 3219 // headers to the request. 3220 func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header { 3221 if c.header_ == nil { 3222 c.header_ = make(http.Header) 3223 } 3224 return c.header_ 3225 } 3226 3227 func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { 3228 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3229 var body io.Reader = nil 3230 c.urlParams_.Set("alt", alt) 3231 c.urlParams_.Set("prettyPrint", "false") 3232 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3233 urls += "?" + c.urlParams_.Encode() 3234 req, err := http.NewRequest("DELETE", urls, body) 3235 if err != nil { 3236 return nil, err 3237 } 3238 req.Header = reqHeaders 3239 googleapi.Expand(req.URL, map[string]string{ 3240 "name": c.name, 3241 }) 3242 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3243 } 3244 3245 // Do executes the "redis.projects.locations.clusters.delete" call. 3246 // Any non-2xx status code is an error. Response headers are in either 3247 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3248 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3249 // whether the returned error was because http.StatusNotModified was returned. 3250 func (c *ProjectsLocationsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3251 gensupport.SetOptions(c.urlParams_, opts...) 3252 res, err := c.doRequest("json") 3253 if res != nil && res.StatusCode == http.StatusNotModified { 3254 if res.Body != nil { 3255 res.Body.Close() 3256 } 3257 return nil, gensupport.WrapError(&googleapi.Error{ 3258 Code: res.StatusCode, 3259 Header: res.Header, 3260 }) 3261 } 3262 if err != nil { 3263 return nil, err 3264 } 3265 defer googleapi.CloseBody(res) 3266 if err := googleapi.CheckResponse(res); err != nil { 3267 return nil, gensupport.WrapError(err) 3268 } 3269 ret := &Operation{ 3270 ServerResponse: googleapi.ServerResponse{ 3271 Header: res.Header, 3272 HTTPStatusCode: res.StatusCode, 3273 }, 3274 } 3275 target := &ret 3276 if err := gensupport.DecodeResponse(target, res); err != nil { 3277 return nil, err 3278 } 3279 return ret, nil 3280 } 3281 3282 type ProjectsLocationsClustersGetCall struct { 3283 s *Service 3284 name string 3285 urlParams_ gensupport.URLParams 3286 ifNoneMatch_ string 3287 ctx_ context.Context 3288 header_ http.Header 3289 } 3290 3291 // Get: Gets the details of a specific Redis cluster. 3292 // 3293 // - name: Redis cluster resource name using the form: 3294 // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` 3295 // where `location_id` refers to a GCP region. 3296 func (r *ProjectsLocationsClustersService) Get(name string) *ProjectsLocationsClustersGetCall { 3297 c := &ProjectsLocationsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3298 c.name = name 3299 return c 3300 } 3301 3302 // Fields allows partial responses to be retrieved. See 3303 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3304 // details. 3305 func (c *ProjectsLocationsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersGetCall { 3306 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3307 return c 3308 } 3309 3310 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3311 // object's ETag matches the given value. This is useful for getting updates 3312 // only after the object has changed since the last request. 3313 func (c *ProjectsLocationsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersGetCall { 3314 c.ifNoneMatch_ = entityTag 3315 return c 3316 } 3317 3318 // Context sets the context to be used in this call's Do method. 3319 func (c *ProjectsLocationsClustersGetCall) Context(ctx context.Context) *ProjectsLocationsClustersGetCall { 3320 c.ctx_ = ctx 3321 return c 3322 } 3323 3324 // Header returns a http.Header that can be modified by the caller to add 3325 // headers to the request. 3326 func (c *ProjectsLocationsClustersGetCall) Header() http.Header { 3327 if c.header_ == nil { 3328 c.header_ = make(http.Header) 3329 } 3330 return c.header_ 3331 } 3332 3333 func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response, error) { 3334 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3335 if c.ifNoneMatch_ != "" { 3336 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3337 } 3338 var body io.Reader = nil 3339 c.urlParams_.Set("alt", alt) 3340 c.urlParams_.Set("prettyPrint", "false") 3341 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3342 urls += "?" + c.urlParams_.Encode() 3343 req, err := http.NewRequest("GET", urls, body) 3344 if err != nil { 3345 return nil, err 3346 } 3347 req.Header = reqHeaders 3348 googleapi.Expand(req.URL, map[string]string{ 3349 "name": c.name, 3350 }) 3351 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3352 } 3353 3354 // Do executes the "redis.projects.locations.clusters.get" call. 3355 // Any non-2xx status code is an error. Response headers are in either 3356 // *Cluster.ServerResponse.Header or (if a response was returned at all) in 3357 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3358 // whether the returned error was because http.StatusNotModified was returned. 3359 func (c *ProjectsLocationsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) { 3360 gensupport.SetOptions(c.urlParams_, opts...) 3361 res, err := c.doRequest("json") 3362 if res != nil && res.StatusCode == http.StatusNotModified { 3363 if res.Body != nil { 3364 res.Body.Close() 3365 } 3366 return nil, gensupport.WrapError(&googleapi.Error{ 3367 Code: res.StatusCode, 3368 Header: res.Header, 3369 }) 3370 } 3371 if err != nil { 3372 return nil, err 3373 } 3374 defer googleapi.CloseBody(res) 3375 if err := googleapi.CheckResponse(res); err != nil { 3376 return nil, gensupport.WrapError(err) 3377 } 3378 ret := &Cluster{ 3379 ServerResponse: googleapi.ServerResponse{ 3380 Header: res.Header, 3381 HTTPStatusCode: res.StatusCode, 3382 }, 3383 } 3384 target := &ret 3385 if err := gensupport.DecodeResponse(target, res); err != nil { 3386 return nil, err 3387 } 3388 return ret, nil 3389 } 3390 3391 type ProjectsLocationsClustersGetCertificateAuthorityCall struct { 3392 s *Service 3393 name string 3394 urlParams_ gensupport.URLParams 3395 ifNoneMatch_ string 3396 ctx_ context.Context 3397 header_ http.Header 3398 } 3399 3400 // GetCertificateAuthority: Gets the details of certificate authority 3401 // information for Redis cluster. 3402 // 3403 // - name: Redis cluster certificate authority resource name using the form: 3404 // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}/certif 3405 // icateAuthority` where `location_id` refers to a GCP region. 3406 func (r *ProjectsLocationsClustersService) GetCertificateAuthority(name string) *ProjectsLocationsClustersGetCertificateAuthorityCall { 3407 c := &ProjectsLocationsClustersGetCertificateAuthorityCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3408 c.name = name 3409 return c 3410 } 3411 3412 // Fields allows partial responses to be retrieved. See 3413 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3414 // details. 3415 func (c *ProjectsLocationsClustersGetCertificateAuthorityCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersGetCertificateAuthorityCall { 3416 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3417 return c 3418 } 3419 3420 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3421 // object's ETag matches the given value. This is useful for getting updates 3422 // only after the object has changed since the last request. 3423 func (c *ProjectsLocationsClustersGetCertificateAuthorityCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersGetCertificateAuthorityCall { 3424 c.ifNoneMatch_ = entityTag 3425 return c 3426 } 3427 3428 // Context sets the context to be used in this call's Do method. 3429 func (c *ProjectsLocationsClustersGetCertificateAuthorityCall) Context(ctx context.Context) *ProjectsLocationsClustersGetCertificateAuthorityCall { 3430 c.ctx_ = ctx 3431 return c 3432 } 3433 3434 // Header returns a http.Header that can be modified by the caller to add 3435 // headers to the request. 3436 func (c *ProjectsLocationsClustersGetCertificateAuthorityCall) Header() http.Header { 3437 if c.header_ == nil { 3438 c.header_ = make(http.Header) 3439 } 3440 return c.header_ 3441 } 3442 3443 func (c *ProjectsLocationsClustersGetCertificateAuthorityCall) doRequest(alt string) (*http.Response, error) { 3444 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3445 if c.ifNoneMatch_ != "" { 3446 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3447 } 3448 var body io.Reader = nil 3449 c.urlParams_.Set("alt", alt) 3450 c.urlParams_.Set("prettyPrint", "false") 3451 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3452 urls += "?" + c.urlParams_.Encode() 3453 req, err := http.NewRequest("GET", urls, body) 3454 if err != nil { 3455 return nil, err 3456 } 3457 req.Header = reqHeaders 3458 googleapi.Expand(req.URL, map[string]string{ 3459 "name": c.name, 3460 }) 3461 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3462 } 3463 3464 // Do executes the "redis.projects.locations.clusters.getCertificateAuthority" call. 3465 // Any non-2xx status code is an error. Response headers are in either 3466 // *CertificateAuthority.ServerResponse.Header or (if a response was returned 3467 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3468 // check whether the returned error was because http.StatusNotModified was 3469 // returned. 3470 func (c *ProjectsLocationsClustersGetCertificateAuthorityCall) Do(opts ...googleapi.CallOption) (*CertificateAuthority, error) { 3471 gensupport.SetOptions(c.urlParams_, opts...) 3472 res, err := c.doRequest("json") 3473 if res != nil && res.StatusCode == http.StatusNotModified { 3474 if res.Body != nil { 3475 res.Body.Close() 3476 } 3477 return nil, gensupport.WrapError(&googleapi.Error{ 3478 Code: res.StatusCode, 3479 Header: res.Header, 3480 }) 3481 } 3482 if err != nil { 3483 return nil, err 3484 } 3485 defer googleapi.CloseBody(res) 3486 if err := googleapi.CheckResponse(res); err != nil { 3487 return nil, gensupport.WrapError(err) 3488 } 3489 ret := &CertificateAuthority{ 3490 ServerResponse: googleapi.ServerResponse{ 3491 Header: res.Header, 3492 HTTPStatusCode: res.StatusCode, 3493 }, 3494 } 3495 target := &ret 3496 if err := gensupport.DecodeResponse(target, res); err != nil { 3497 return nil, err 3498 } 3499 return ret, nil 3500 } 3501 3502 type ProjectsLocationsClustersListCall struct { 3503 s *Service 3504 parent string 3505 urlParams_ gensupport.URLParams 3506 ifNoneMatch_ string 3507 ctx_ context.Context 3508 header_ http.Header 3509 } 3510 3511 // List: Lists all Redis clusters owned by a project in either the specified 3512 // location (region) or all locations. The location should have the following 3513 // format: * `projects/{project_id}/locations/{location_id}` If `location_id` 3514 // is specified as `-` (wildcard), then all regions available to the project 3515 // are queried, and the results are aggregated. 3516 // 3517 // - parent: The resource name of the cluster location using the form: 3518 // `projects/{project_id}/locations/{location_id}` where `location_id` refers 3519 // to a GCP region. 3520 func (r *ProjectsLocationsClustersService) List(parent string) *ProjectsLocationsClustersListCall { 3521 c := &ProjectsLocationsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3522 c.parent = parent 3523 return c 3524 } 3525 3526 // PageSize sets the optional parameter "pageSize": The maximum number of items 3527 // to return. If not specified, a default value of 1000 will be used by the 3528 // service. Regardless of the page_size value, the response may include a 3529 // partial list and a caller should only rely on response's `next_page_token` 3530 // to determine if there are more clusters left to be queried. 3531 func (c *ProjectsLocationsClustersListCall) PageSize(pageSize int64) *ProjectsLocationsClustersListCall { 3532 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3533 return c 3534 } 3535 3536 // PageToken sets the optional parameter "pageToken": The `next_page_token` 3537 // value returned from a previous ListClusters request, if any. 3538 func (c *ProjectsLocationsClustersListCall) PageToken(pageToken string) *ProjectsLocationsClustersListCall { 3539 c.urlParams_.Set("pageToken", pageToken) 3540 return c 3541 } 3542 3543 // Fields allows partial responses to be retrieved. See 3544 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3545 // details. 3546 func (c *ProjectsLocationsClustersListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersListCall { 3547 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3548 return c 3549 } 3550 3551 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3552 // object's ETag matches the given value. This is useful for getting updates 3553 // only after the object has changed since the last request. 3554 func (c *ProjectsLocationsClustersListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersListCall { 3555 c.ifNoneMatch_ = entityTag 3556 return c 3557 } 3558 3559 // Context sets the context to be used in this call's Do method. 3560 func (c *ProjectsLocationsClustersListCall) Context(ctx context.Context) *ProjectsLocationsClustersListCall { 3561 c.ctx_ = ctx 3562 return c 3563 } 3564 3565 // Header returns a http.Header that can be modified by the caller to add 3566 // headers to the request. 3567 func (c *ProjectsLocationsClustersListCall) Header() http.Header { 3568 if c.header_ == nil { 3569 c.header_ = make(http.Header) 3570 } 3571 return c.header_ 3572 } 3573 3574 func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Response, error) { 3575 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3576 if c.ifNoneMatch_ != "" { 3577 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3578 } 3579 var body io.Reader = nil 3580 c.urlParams_.Set("alt", alt) 3581 c.urlParams_.Set("prettyPrint", "false") 3582 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters") 3583 urls += "?" + c.urlParams_.Encode() 3584 req, err := http.NewRequest("GET", urls, body) 3585 if err != nil { 3586 return nil, err 3587 } 3588 req.Header = reqHeaders 3589 googleapi.Expand(req.URL, map[string]string{ 3590 "parent": c.parent, 3591 }) 3592 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3593 } 3594 3595 // Do executes the "redis.projects.locations.clusters.list" call. 3596 // Any non-2xx status code is an error. Response headers are in either 3597 // *ListClustersResponse.ServerResponse.Header or (if a response was returned 3598 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3599 // check whether the returned error was because http.StatusNotModified was 3600 // returned. 3601 func (c *ProjectsLocationsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) { 3602 gensupport.SetOptions(c.urlParams_, opts...) 3603 res, err := c.doRequest("json") 3604 if res != nil && res.StatusCode == http.StatusNotModified { 3605 if res.Body != nil { 3606 res.Body.Close() 3607 } 3608 return nil, gensupport.WrapError(&googleapi.Error{ 3609 Code: res.StatusCode, 3610 Header: res.Header, 3611 }) 3612 } 3613 if err != nil { 3614 return nil, err 3615 } 3616 defer googleapi.CloseBody(res) 3617 if err := googleapi.CheckResponse(res); err != nil { 3618 return nil, gensupport.WrapError(err) 3619 } 3620 ret := &ListClustersResponse{ 3621 ServerResponse: googleapi.ServerResponse{ 3622 Header: res.Header, 3623 HTTPStatusCode: res.StatusCode, 3624 }, 3625 } 3626 target := &ret 3627 if err := gensupport.DecodeResponse(target, res); err != nil { 3628 return nil, err 3629 } 3630 return ret, nil 3631 } 3632 3633 // Pages invokes f for each page of results. 3634 // A non-nil error returned from f will halt the iteration. 3635 // The provided context supersedes any context provided to the Context method. 3636 func (c *ProjectsLocationsClustersListCall) Pages(ctx context.Context, f func(*ListClustersResponse) error) error { 3637 c.ctx_ = ctx 3638 defer c.PageToken(c.urlParams_.Get("pageToken")) 3639 for { 3640 x, err := c.Do() 3641 if err != nil { 3642 return err 3643 } 3644 if err := f(x); err != nil { 3645 return err 3646 } 3647 if x.NextPageToken == "" { 3648 return nil 3649 } 3650 c.PageToken(x.NextPageToken) 3651 } 3652 } 3653 3654 type ProjectsLocationsClustersPatchCall struct { 3655 s *Service 3656 name string 3657 cluster *Cluster 3658 urlParams_ gensupport.URLParams 3659 ctx_ context.Context 3660 header_ http.Header 3661 } 3662 3663 // Patch: Updates the metadata and configuration of a specific Redis cluster. 3664 // Completed longrunning.Operation will contain the new cluster object in the 3665 // response field. The returned operation is automatically deleted after a few 3666 // hours, so there is no need to call DeleteOperation. 3667 // 3668 // - name: Unique name of the resource in this scope including project and 3669 // location using the form: 3670 // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`. 3671 func (r *ProjectsLocationsClustersService) Patch(name string, cluster *Cluster) *ProjectsLocationsClustersPatchCall { 3672 c := &ProjectsLocationsClustersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3673 c.name = name 3674 c.cluster = cluster 3675 return c 3676 } 3677 3678 // RequestId sets the optional parameter "requestId": Idempotent request UUID. 3679 func (c *ProjectsLocationsClustersPatchCall) RequestId(requestId string) *ProjectsLocationsClustersPatchCall { 3680 c.urlParams_.Set("requestId", requestId) 3681 return c 3682 } 3683 3684 // UpdateMask sets the optional parameter "updateMask": Required. Mask of 3685 // fields to update. At least one path must be supplied in this field. The 3686 // elements of the repeated paths field may only include these fields from 3687 // Cluster: * `size_gb` * `replica_count` 3688 func (c *ProjectsLocationsClustersPatchCall) UpdateMask(updateMask string) *ProjectsLocationsClustersPatchCall { 3689 c.urlParams_.Set("updateMask", updateMask) 3690 return c 3691 } 3692 3693 // Fields allows partial responses to be retrieved. See 3694 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3695 // details. 3696 func (c *ProjectsLocationsClustersPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersPatchCall { 3697 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3698 return c 3699 } 3700 3701 // Context sets the context to be used in this call's Do method. 3702 func (c *ProjectsLocationsClustersPatchCall) Context(ctx context.Context) *ProjectsLocationsClustersPatchCall { 3703 c.ctx_ = ctx 3704 return c 3705 } 3706 3707 // Header returns a http.Header that can be modified by the caller to add 3708 // headers to the request. 3709 func (c *ProjectsLocationsClustersPatchCall) Header() http.Header { 3710 if c.header_ == nil { 3711 c.header_ = make(http.Header) 3712 } 3713 return c.header_ 3714 } 3715 3716 func (c *ProjectsLocationsClustersPatchCall) doRequest(alt string) (*http.Response, error) { 3717 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3718 var body io.Reader = nil 3719 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) 3720 if err != nil { 3721 return nil, err 3722 } 3723 c.urlParams_.Set("alt", alt) 3724 c.urlParams_.Set("prettyPrint", "false") 3725 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3726 urls += "?" + c.urlParams_.Encode() 3727 req, err := http.NewRequest("PATCH", urls, body) 3728 if err != nil { 3729 return nil, err 3730 } 3731 req.Header = reqHeaders 3732 googleapi.Expand(req.URL, map[string]string{ 3733 "name": c.name, 3734 }) 3735 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3736 } 3737 3738 // Do executes the "redis.projects.locations.clusters.patch" call. 3739 // Any non-2xx status code is an error. Response headers are in either 3740 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3741 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3742 // whether the returned error was because http.StatusNotModified was returned. 3743 func (c *ProjectsLocationsClustersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3744 gensupport.SetOptions(c.urlParams_, opts...) 3745 res, err := c.doRequest("json") 3746 if res != nil && res.StatusCode == http.StatusNotModified { 3747 if res.Body != nil { 3748 res.Body.Close() 3749 } 3750 return nil, gensupport.WrapError(&googleapi.Error{ 3751 Code: res.StatusCode, 3752 Header: res.Header, 3753 }) 3754 } 3755 if err != nil { 3756 return nil, err 3757 } 3758 defer googleapi.CloseBody(res) 3759 if err := googleapi.CheckResponse(res); err != nil { 3760 return nil, gensupport.WrapError(err) 3761 } 3762 ret := &Operation{ 3763 ServerResponse: googleapi.ServerResponse{ 3764 Header: res.Header, 3765 HTTPStatusCode: res.StatusCode, 3766 }, 3767 } 3768 target := &ret 3769 if err := gensupport.DecodeResponse(target, res); err != nil { 3770 return nil, err 3771 } 3772 return ret, nil 3773 } 3774 3775 type ProjectsLocationsInstancesCreateCall struct { 3776 s *Service 3777 parent string 3778 instance *Instance 3779 urlParams_ gensupport.URLParams 3780 ctx_ context.Context 3781 header_ http.Header 3782 } 3783 3784 // Create: Creates a Redis instance based on the specified tier and memory 3785 // size. By default, the instance is accessible from the project's default 3786 // network (https://cloud.google.com/vpc/docs/vpc). The creation is executed 3787 // asynchronously and callers may check the returned operation to track its 3788 // progress. Once the operation is completed the Redis instance will be fully 3789 // functional. Completed longrunning.Operation will contain the new instance 3790 // object in the response field. The returned operation is automatically 3791 // deleted after a few hours, so there is no need to call DeleteOperation. 3792 // 3793 // - parent: The resource name of the instance location using the form: 3794 // `projects/{project_id}/locations/{location_id}` where `location_id` refers 3795 // to a GCP region. 3796 func (r *ProjectsLocationsInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsInstancesCreateCall { 3797 c := &ProjectsLocationsInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3798 c.parent = parent 3799 c.instance = instance 3800 return c 3801 } 3802 3803 // InstanceId sets the optional parameter "instanceId": Required. The logical 3804 // name of the Redis instance in the customer project with the following 3805 // restrictions: * Must contain only lowercase letters, numbers, and hyphens. * 3806 // Must start with a letter. * Must be between 1-40 characters. * Must end with 3807 // a number or a letter. * Must be unique within the customer project / 3808 // location 3809 func (c *ProjectsLocationsInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsInstancesCreateCall { 3810 c.urlParams_.Set("instanceId", instanceId) 3811 return c 3812 } 3813 3814 // Fields allows partial responses to be retrieved. See 3815 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3816 // details. 3817 func (c *ProjectsLocationsInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCreateCall { 3818 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3819 return c 3820 } 3821 3822 // Context sets the context to be used in this call's Do method. 3823 func (c *ProjectsLocationsInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesCreateCall { 3824 c.ctx_ = ctx 3825 return c 3826 } 3827 3828 // Header returns a http.Header that can be modified by the caller to add 3829 // headers to the request. 3830 func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { 3831 if c.header_ == nil { 3832 c.header_ = make(http.Header) 3833 } 3834 return c.header_ 3835 } 3836 3837 func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { 3838 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3839 var body io.Reader = nil 3840 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) 3841 if err != nil { 3842 return nil, err 3843 } 3844 c.urlParams_.Set("alt", alt) 3845 c.urlParams_.Set("prettyPrint", "false") 3846 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances") 3847 urls += "?" + c.urlParams_.Encode() 3848 req, err := http.NewRequest("POST", urls, body) 3849 if err != nil { 3850 return nil, err 3851 } 3852 req.Header = reqHeaders 3853 googleapi.Expand(req.URL, map[string]string{ 3854 "parent": c.parent, 3855 }) 3856 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3857 } 3858 3859 // Do executes the "redis.projects.locations.instances.create" call. 3860 // Any non-2xx status code is an error. Response headers are in either 3861 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3862 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3863 // whether the returned error was because http.StatusNotModified was returned. 3864 func (c *ProjectsLocationsInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3865 gensupport.SetOptions(c.urlParams_, opts...) 3866 res, err := c.doRequest("json") 3867 if res != nil && res.StatusCode == http.StatusNotModified { 3868 if res.Body != nil { 3869 res.Body.Close() 3870 } 3871 return nil, gensupport.WrapError(&googleapi.Error{ 3872 Code: res.StatusCode, 3873 Header: res.Header, 3874 }) 3875 } 3876 if err != nil { 3877 return nil, err 3878 } 3879 defer googleapi.CloseBody(res) 3880 if err := googleapi.CheckResponse(res); err != nil { 3881 return nil, gensupport.WrapError(err) 3882 } 3883 ret := &Operation{ 3884 ServerResponse: googleapi.ServerResponse{ 3885 Header: res.Header, 3886 HTTPStatusCode: res.StatusCode, 3887 }, 3888 } 3889 target := &ret 3890 if err := gensupport.DecodeResponse(target, res); err != nil { 3891 return nil, err 3892 } 3893 return ret, nil 3894 } 3895 3896 type ProjectsLocationsInstancesDeleteCall struct { 3897 s *Service 3898 name string 3899 urlParams_ gensupport.URLParams 3900 ctx_ context.Context 3901 header_ http.Header 3902 } 3903 3904 // Delete: Deletes a specific Redis instance. Instance stops serving and data 3905 // is deleted. 3906 // 3907 // - name: Redis instance resource name using the form: 3908 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` 3909 // where `location_id` refers to a GCP region. 3910 func (r *ProjectsLocationsInstancesService) Delete(name string) *ProjectsLocationsInstancesDeleteCall { 3911 c := &ProjectsLocationsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3912 c.name = name 3913 return c 3914 } 3915 3916 // Fields allows partial responses to be retrieved. See 3917 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3918 // details. 3919 func (c *ProjectsLocationsInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDeleteCall { 3920 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3921 return c 3922 } 3923 3924 // Context sets the context to be used in this call's Do method. 3925 func (c *ProjectsLocationsInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDeleteCall { 3926 c.ctx_ = ctx 3927 return c 3928 } 3929 3930 // Header returns a http.Header that can be modified by the caller to add 3931 // headers to the request. 3932 func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { 3933 if c.header_ == nil { 3934 c.header_ = make(http.Header) 3935 } 3936 return c.header_ 3937 } 3938 3939 func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { 3940 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3941 var body io.Reader = nil 3942 c.urlParams_.Set("alt", alt) 3943 c.urlParams_.Set("prettyPrint", "false") 3944 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3945 urls += "?" + c.urlParams_.Encode() 3946 req, err := http.NewRequest("DELETE", urls, body) 3947 if err != nil { 3948 return nil, err 3949 } 3950 req.Header = reqHeaders 3951 googleapi.Expand(req.URL, map[string]string{ 3952 "name": c.name, 3953 }) 3954 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3955 } 3956 3957 // Do executes the "redis.projects.locations.instances.delete" call. 3958 // Any non-2xx status code is an error. Response headers are in either 3959 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3960 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3961 // whether the returned error was because http.StatusNotModified was returned. 3962 func (c *ProjectsLocationsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3963 gensupport.SetOptions(c.urlParams_, opts...) 3964 res, err := c.doRequest("json") 3965 if res != nil && res.StatusCode == http.StatusNotModified { 3966 if res.Body != nil { 3967 res.Body.Close() 3968 } 3969 return nil, gensupport.WrapError(&googleapi.Error{ 3970 Code: res.StatusCode, 3971 Header: res.Header, 3972 }) 3973 } 3974 if err != nil { 3975 return nil, err 3976 } 3977 defer googleapi.CloseBody(res) 3978 if err := googleapi.CheckResponse(res); err != nil { 3979 return nil, gensupport.WrapError(err) 3980 } 3981 ret := &Operation{ 3982 ServerResponse: googleapi.ServerResponse{ 3983 Header: res.Header, 3984 HTTPStatusCode: res.StatusCode, 3985 }, 3986 } 3987 target := &ret 3988 if err := gensupport.DecodeResponse(target, res); err != nil { 3989 return nil, err 3990 } 3991 return ret, nil 3992 } 3993 3994 type ProjectsLocationsInstancesExportCall struct { 3995 s *Service 3996 name string 3997 exportinstancerequest *ExportInstanceRequest 3998 urlParams_ gensupport.URLParams 3999 ctx_ context.Context 4000 header_ http.Header 4001 } 4002 4003 // Export: Export Redis instance data into a Redis RDB format file in Cloud 4004 // Storage. Redis will continue serving during this operation. The returned 4005 // operation is automatically deleted after a few hours, so there is no need to 4006 // call DeleteOperation. 4007 // 4008 // - name: Redis instance resource name using the form: 4009 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` 4010 // where `location_id` refers to a GCP region. 4011 func (r *ProjectsLocationsInstancesService) Export(name string, exportinstancerequest *ExportInstanceRequest) *ProjectsLocationsInstancesExportCall { 4012 c := &ProjectsLocationsInstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4013 c.name = name 4014 c.exportinstancerequest = exportinstancerequest 4015 return c 4016 } 4017 4018 // Fields allows partial responses to be retrieved. See 4019 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4020 // details. 4021 func (c *ProjectsLocationsInstancesExportCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesExportCall { 4022 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4023 return c 4024 } 4025 4026 // Context sets the context to be used in this call's Do method. 4027 func (c *ProjectsLocationsInstancesExportCall) Context(ctx context.Context) *ProjectsLocationsInstancesExportCall { 4028 c.ctx_ = ctx 4029 return c 4030 } 4031 4032 // Header returns a http.Header that can be modified by the caller to add 4033 // headers to the request. 4034 func (c *ProjectsLocationsInstancesExportCall) Header() http.Header { 4035 if c.header_ == nil { 4036 c.header_ = make(http.Header) 4037 } 4038 return c.header_ 4039 } 4040 4041 func (c *ProjectsLocationsInstancesExportCall) doRequest(alt string) (*http.Response, error) { 4042 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4043 var body io.Reader = nil 4044 body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportinstancerequest) 4045 if err != nil { 4046 return nil, err 4047 } 4048 c.urlParams_.Set("alt", alt) 4049 c.urlParams_.Set("prettyPrint", "false") 4050 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:export") 4051 urls += "?" + c.urlParams_.Encode() 4052 req, err := http.NewRequest("POST", urls, body) 4053 if err != nil { 4054 return nil, err 4055 } 4056 req.Header = reqHeaders 4057 googleapi.Expand(req.URL, map[string]string{ 4058 "name": c.name, 4059 }) 4060 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4061 } 4062 4063 // Do executes the "redis.projects.locations.instances.export" call. 4064 // Any non-2xx status code is an error. Response headers are in either 4065 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4066 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4067 // whether the returned error was because http.StatusNotModified was returned. 4068 func (c *ProjectsLocationsInstancesExportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4069 gensupport.SetOptions(c.urlParams_, opts...) 4070 res, err := c.doRequest("json") 4071 if res != nil && res.StatusCode == http.StatusNotModified { 4072 if res.Body != nil { 4073 res.Body.Close() 4074 } 4075 return nil, gensupport.WrapError(&googleapi.Error{ 4076 Code: res.StatusCode, 4077 Header: res.Header, 4078 }) 4079 } 4080 if err != nil { 4081 return nil, err 4082 } 4083 defer googleapi.CloseBody(res) 4084 if err := googleapi.CheckResponse(res); err != nil { 4085 return nil, gensupport.WrapError(err) 4086 } 4087 ret := &Operation{ 4088 ServerResponse: googleapi.ServerResponse{ 4089 Header: res.Header, 4090 HTTPStatusCode: res.StatusCode, 4091 }, 4092 } 4093 target := &ret 4094 if err := gensupport.DecodeResponse(target, res); err != nil { 4095 return nil, err 4096 } 4097 return ret, nil 4098 } 4099 4100 type ProjectsLocationsInstancesFailoverCall struct { 4101 s *Service 4102 name string 4103 failoverinstancerequest *FailoverInstanceRequest 4104 urlParams_ gensupport.URLParams 4105 ctx_ context.Context 4106 header_ http.Header 4107 } 4108 4109 // Failover: Initiates a failover of the primary node to current replica node 4110 // for a specific STANDARD tier Cloud Memorystore for Redis instance. 4111 // 4112 // - name: Redis instance resource name using the form: 4113 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` 4114 // where `location_id` refers to a GCP region. 4115 func (r *ProjectsLocationsInstancesService) Failover(name string, failoverinstancerequest *FailoverInstanceRequest) *ProjectsLocationsInstancesFailoverCall { 4116 c := &ProjectsLocationsInstancesFailoverCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4117 c.name = name 4118 c.failoverinstancerequest = failoverinstancerequest 4119 return c 4120 } 4121 4122 // Fields allows partial responses to be retrieved. See 4123 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4124 // details. 4125 func (c *ProjectsLocationsInstancesFailoverCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesFailoverCall { 4126 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4127 return c 4128 } 4129 4130 // Context sets the context to be used in this call's Do method. 4131 func (c *ProjectsLocationsInstancesFailoverCall) Context(ctx context.Context) *ProjectsLocationsInstancesFailoverCall { 4132 c.ctx_ = ctx 4133 return c 4134 } 4135 4136 // Header returns a http.Header that can be modified by the caller to add 4137 // headers to the request. 4138 func (c *ProjectsLocationsInstancesFailoverCall) Header() http.Header { 4139 if c.header_ == nil { 4140 c.header_ = make(http.Header) 4141 } 4142 return c.header_ 4143 } 4144 4145 func (c *ProjectsLocationsInstancesFailoverCall) doRequest(alt string) (*http.Response, error) { 4146 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4147 var body io.Reader = nil 4148 body, err := googleapi.WithoutDataWrapper.JSONReader(c.failoverinstancerequest) 4149 if err != nil { 4150 return nil, err 4151 } 4152 c.urlParams_.Set("alt", alt) 4153 c.urlParams_.Set("prettyPrint", "false") 4154 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:failover") 4155 urls += "?" + c.urlParams_.Encode() 4156 req, err := http.NewRequest("POST", urls, body) 4157 if err != nil { 4158 return nil, err 4159 } 4160 req.Header = reqHeaders 4161 googleapi.Expand(req.URL, map[string]string{ 4162 "name": c.name, 4163 }) 4164 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4165 } 4166 4167 // Do executes the "redis.projects.locations.instances.failover" call. 4168 // Any non-2xx status code is an error. Response headers are in either 4169 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4170 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4171 // whether the returned error was because http.StatusNotModified was returned. 4172 func (c *ProjectsLocationsInstancesFailoverCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4173 gensupport.SetOptions(c.urlParams_, opts...) 4174 res, err := c.doRequest("json") 4175 if res != nil && res.StatusCode == http.StatusNotModified { 4176 if res.Body != nil { 4177 res.Body.Close() 4178 } 4179 return nil, gensupport.WrapError(&googleapi.Error{ 4180 Code: res.StatusCode, 4181 Header: res.Header, 4182 }) 4183 } 4184 if err != nil { 4185 return nil, err 4186 } 4187 defer googleapi.CloseBody(res) 4188 if err := googleapi.CheckResponse(res); err != nil { 4189 return nil, gensupport.WrapError(err) 4190 } 4191 ret := &Operation{ 4192 ServerResponse: googleapi.ServerResponse{ 4193 Header: res.Header, 4194 HTTPStatusCode: res.StatusCode, 4195 }, 4196 } 4197 target := &ret 4198 if err := gensupport.DecodeResponse(target, res); err != nil { 4199 return nil, err 4200 } 4201 return ret, nil 4202 } 4203 4204 type ProjectsLocationsInstancesGetCall struct { 4205 s *Service 4206 name string 4207 urlParams_ gensupport.URLParams 4208 ifNoneMatch_ string 4209 ctx_ context.Context 4210 header_ http.Header 4211 } 4212 4213 // Get: Gets the details of a specific Redis instance. 4214 // 4215 // - name: Redis instance resource name using the form: 4216 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` 4217 // where `location_id` refers to a GCP region. 4218 func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall { 4219 c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4220 c.name = name 4221 return c 4222 } 4223 4224 // Fields allows partial responses to be retrieved. See 4225 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4226 // details. 4227 func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall { 4228 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4229 return c 4230 } 4231 4232 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4233 // object's ETag matches the given value. This is useful for getting updates 4234 // only after the object has changed since the last request. 4235 func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall { 4236 c.ifNoneMatch_ = entityTag 4237 return c 4238 } 4239 4240 // Context sets the context to be used in this call's Do method. 4241 func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall { 4242 c.ctx_ = ctx 4243 return c 4244 } 4245 4246 // Header returns a http.Header that can be modified by the caller to add 4247 // headers to the request. 4248 func (c *ProjectsLocationsInstancesGetCall) Header() http.Header { 4249 if c.header_ == nil { 4250 c.header_ = make(http.Header) 4251 } 4252 return c.header_ 4253 } 4254 4255 func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) { 4256 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4257 if c.ifNoneMatch_ != "" { 4258 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4259 } 4260 var body io.Reader = nil 4261 c.urlParams_.Set("alt", alt) 4262 c.urlParams_.Set("prettyPrint", "false") 4263 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4264 urls += "?" + c.urlParams_.Encode() 4265 req, err := http.NewRequest("GET", urls, body) 4266 if err != nil { 4267 return nil, err 4268 } 4269 req.Header = reqHeaders 4270 googleapi.Expand(req.URL, map[string]string{ 4271 "name": c.name, 4272 }) 4273 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4274 } 4275 4276 // Do executes the "redis.projects.locations.instances.get" call. 4277 // Any non-2xx status code is an error. Response headers are in either 4278 // *Instance.ServerResponse.Header or (if a response was returned at all) in 4279 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4280 // whether the returned error was because http.StatusNotModified was returned. 4281 func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) { 4282 gensupport.SetOptions(c.urlParams_, opts...) 4283 res, err := c.doRequest("json") 4284 if res != nil && res.StatusCode == http.StatusNotModified { 4285 if res.Body != nil { 4286 res.Body.Close() 4287 } 4288 return nil, gensupport.WrapError(&googleapi.Error{ 4289 Code: res.StatusCode, 4290 Header: res.Header, 4291 }) 4292 } 4293 if err != nil { 4294 return nil, err 4295 } 4296 defer googleapi.CloseBody(res) 4297 if err := googleapi.CheckResponse(res); err != nil { 4298 return nil, gensupport.WrapError(err) 4299 } 4300 ret := &Instance{ 4301 ServerResponse: googleapi.ServerResponse{ 4302 Header: res.Header, 4303 HTTPStatusCode: res.StatusCode, 4304 }, 4305 } 4306 target := &ret 4307 if err := gensupport.DecodeResponse(target, res); err != nil { 4308 return nil, err 4309 } 4310 return ret, nil 4311 } 4312 4313 type ProjectsLocationsInstancesGetAuthStringCall struct { 4314 s *Service 4315 name string 4316 urlParams_ gensupport.URLParams 4317 ifNoneMatch_ string 4318 ctx_ context.Context 4319 header_ http.Header 4320 } 4321 4322 // GetAuthString: Gets the AUTH string for a Redis instance. If AUTH is not 4323 // enabled for the instance the response will be empty. This information is not 4324 // included in the details returned to GetInstance. 4325 // 4326 // - name: Redis instance resource name using the form: 4327 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` 4328 // where `location_id` refers to a GCP region. 4329 func (r *ProjectsLocationsInstancesService) GetAuthString(name string) *ProjectsLocationsInstancesGetAuthStringCall { 4330 c := &ProjectsLocationsInstancesGetAuthStringCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4331 c.name = name 4332 return c 4333 } 4334 4335 // Fields allows partial responses to be retrieved. See 4336 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4337 // details. 4338 func (c *ProjectsLocationsInstancesGetAuthStringCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetAuthStringCall { 4339 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4340 return c 4341 } 4342 4343 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4344 // object's ETag matches the given value. This is useful for getting updates 4345 // only after the object has changed since the last request. 4346 func (c *ProjectsLocationsInstancesGetAuthStringCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetAuthStringCall { 4347 c.ifNoneMatch_ = entityTag 4348 return c 4349 } 4350 4351 // Context sets the context to be used in this call's Do method. 4352 func (c *ProjectsLocationsInstancesGetAuthStringCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetAuthStringCall { 4353 c.ctx_ = ctx 4354 return c 4355 } 4356 4357 // Header returns a http.Header that can be modified by the caller to add 4358 // headers to the request. 4359 func (c *ProjectsLocationsInstancesGetAuthStringCall) Header() http.Header { 4360 if c.header_ == nil { 4361 c.header_ = make(http.Header) 4362 } 4363 return c.header_ 4364 } 4365 4366 func (c *ProjectsLocationsInstancesGetAuthStringCall) doRequest(alt string) (*http.Response, error) { 4367 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4368 if c.ifNoneMatch_ != "" { 4369 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4370 } 4371 var body io.Reader = nil 4372 c.urlParams_.Set("alt", alt) 4373 c.urlParams_.Set("prettyPrint", "false") 4374 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/authString") 4375 urls += "?" + c.urlParams_.Encode() 4376 req, err := http.NewRequest("GET", urls, body) 4377 if err != nil { 4378 return nil, err 4379 } 4380 req.Header = reqHeaders 4381 googleapi.Expand(req.URL, map[string]string{ 4382 "name": c.name, 4383 }) 4384 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4385 } 4386 4387 // Do executes the "redis.projects.locations.instances.getAuthString" call. 4388 // Any non-2xx status code is an error. Response headers are in either 4389 // *InstanceAuthString.ServerResponse.Header or (if a response was returned at 4390 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4391 // check whether the returned error was because http.StatusNotModified was 4392 // returned. 4393 func (c *ProjectsLocationsInstancesGetAuthStringCall) Do(opts ...googleapi.CallOption) (*InstanceAuthString, error) { 4394 gensupport.SetOptions(c.urlParams_, opts...) 4395 res, err := c.doRequest("json") 4396 if res != nil && res.StatusCode == http.StatusNotModified { 4397 if res.Body != nil { 4398 res.Body.Close() 4399 } 4400 return nil, gensupport.WrapError(&googleapi.Error{ 4401 Code: res.StatusCode, 4402 Header: res.Header, 4403 }) 4404 } 4405 if err != nil { 4406 return nil, err 4407 } 4408 defer googleapi.CloseBody(res) 4409 if err := googleapi.CheckResponse(res); err != nil { 4410 return nil, gensupport.WrapError(err) 4411 } 4412 ret := &InstanceAuthString{ 4413 ServerResponse: googleapi.ServerResponse{ 4414 Header: res.Header, 4415 HTTPStatusCode: res.StatusCode, 4416 }, 4417 } 4418 target := &ret 4419 if err := gensupport.DecodeResponse(target, res); err != nil { 4420 return nil, err 4421 } 4422 return ret, nil 4423 } 4424 4425 type ProjectsLocationsInstancesImportCall struct { 4426 s *Service 4427 name string 4428 importinstancerequest *ImportInstanceRequest 4429 urlParams_ gensupport.URLParams 4430 ctx_ context.Context 4431 header_ http.Header 4432 } 4433 4434 // Import: Import a Redis RDB snapshot file from Cloud Storage into a Redis 4435 // instance. Redis may stop serving during this operation. Instance state will 4436 // be IMPORTING for entire operation. When complete, the instance will contain 4437 // only data from the imported file. The returned operation is automatically 4438 // deleted after a few hours, so there is no need to call DeleteOperation. 4439 // 4440 // - name: Redis instance resource name using the form: 4441 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` 4442 // where `location_id` refers to a GCP region. 4443 func (r *ProjectsLocationsInstancesService) Import(name string, importinstancerequest *ImportInstanceRequest) *ProjectsLocationsInstancesImportCall { 4444 c := &ProjectsLocationsInstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4445 c.name = name 4446 c.importinstancerequest = importinstancerequest 4447 return c 4448 } 4449 4450 // Fields allows partial responses to be retrieved. See 4451 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4452 // details. 4453 func (c *ProjectsLocationsInstancesImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesImportCall { 4454 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4455 return c 4456 } 4457 4458 // Context sets the context to be used in this call's Do method. 4459 func (c *ProjectsLocationsInstancesImportCall) Context(ctx context.Context) *ProjectsLocationsInstancesImportCall { 4460 c.ctx_ = ctx 4461 return c 4462 } 4463 4464 // Header returns a http.Header that can be modified by the caller to add 4465 // headers to the request. 4466 func (c *ProjectsLocationsInstancesImportCall) Header() http.Header { 4467 if c.header_ == nil { 4468 c.header_ = make(http.Header) 4469 } 4470 return c.header_ 4471 } 4472 4473 func (c *ProjectsLocationsInstancesImportCall) doRequest(alt string) (*http.Response, error) { 4474 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4475 var body io.Reader = nil 4476 body, err := googleapi.WithoutDataWrapper.JSONReader(c.importinstancerequest) 4477 if err != nil { 4478 return nil, err 4479 } 4480 c.urlParams_.Set("alt", alt) 4481 c.urlParams_.Set("prettyPrint", "false") 4482 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:import") 4483 urls += "?" + c.urlParams_.Encode() 4484 req, err := http.NewRequest("POST", urls, body) 4485 if err != nil { 4486 return nil, err 4487 } 4488 req.Header = reqHeaders 4489 googleapi.Expand(req.URL, map[string]string{ 4490 "name": c.name, 4491 }) 4492 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4493 } 4494 4495 // Do executes the "redis.projects.locations.instances.import" call. 4496 // Any non-2xx status code is an error. Response headers are in either 4497 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4498 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4499 // whether the returned error was because http.StatusNotModified was returned. 4500 func (c *ProjectsLocationsInstancesImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4501 gensupport.SetOptions(c.urlParams_, opts...) 4502 res, err := c.doRequest("json") 4503 if res != nil && res.StatusCode == http.StatusNotModified { 4504 if res.Body != nil { 4505 res.Body.Close() 4506 } 4507 return nil, gensupport.WrapError(&googleapi.Error{ 4508 Code: res.StatusCode, 4509 Header: res.Header, 4510 }) 4511 } 4512 if err != nil { 4513 return nil, err 4514 } 4515 defer googleapi.CloseBody(res) 4516 if err := googleapi.CheckResponse(res); err != nil { 4517 return nil, gensupport.WrapError(err) 4518 } 4519 ret := &Operation{ 4520 ServerResponse: googleapi.ServerResponse{ 4521 Header: res.Header, 4522 HTTPStatusCode: res.StatusCode, 4523 }, 4524 } 4525 target := &ret 4526 if err := gensupport.DecodeResponse(target, res); err != nil { 4527 return nil, err 4528 } 4529 return ret, nil 4530 } 4531 4532 type ProjectsLocationsInstancesListCall struct { 4533 s *Service 4534 parent string 4535 urlParams_ gensupport.URLParams 4536 ifNoneMatch_ string 4537 ctx_ context.Context 4538 header_ http.Header 4539 } 4540 4541 // List: Lists all Redis instances owned by a project in either the specified 4542 // location (region) or all locations. The location should have the following 4543 // format: * `projects/{project_id}/locations/{location_id}` If `location_id` 4544 // is specified as `-` (wildcard), then all regions available to the project 4545 // are queried, and the results are aggregated. 4546 // 4547 // - parent: The resource name of the instance location using the form: 4548 // `projects/{project_id}/locations/{location_id}` where `location_id` refers 4549 // to a GCP region. 4550 func (r *ProjectsLocationsInstancesService) List(parent string) *ProjectsLocationsInstancesListCall { 4551 c := &ProjectsLocationsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4552 c.parent = parent 4553 return c 4554 } 4555 4556 // PageSize sets the optional parameter "pageSize": The maximum number of items 4557 // to return. If not specified, a default value of 1000 will be used by the 4558 // service. Regardless of the page_size value, the response may include a 4559 // partial list and a caller should only rely on response's `next_page_token` 4560 // to determine if there are more instances left to be queried. 4561 func (c *ProjectsLocationsInstancesListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesListCall { 4562 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4563 return c 4564 } 4565 4566 // PageToken sets the optional parameter "pageToken": The `next_page_token` 4567 // value returned from a previous ListInstances request, if any. 4568 func (c *ProjectsLocationsInstancesListCall) PageToken(pageToken string) *ProjectsLocationsInstancesListCall { 4569 c.urlParams_.Set("pageToken", pageToken) 4570 return c 4571 } 4572 4573 // Fields allows partial responses to be retrieved. See 4574 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4575 // details. 4576 func (c *ProjectsLocationsInstancesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesListCall { 4577 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4578 return c 4579 } 4580 4581 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4582 // object's ETag matches the given value. This is useful for getting updates 4583 // only after the object has changed since the last request. 4584 func (c *ProjectsLocationsInstancesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesListCall { 4585 c.ifNoneMatch_ = entityTag 4586 return c 4587 } 4588 4589 // Context sets the context to be used in this call's Do method. 4590 func (c *ProjectsLocationsInstancesListCall) Context(ctx context.Context) *ProjectsLocationsInstancesListCall { 4591 c.ctx_ = ctx 4592 return c 4593 } 4594 4595 // Header returns a http.Header that can be modified by the caller to add 4596 // headers to the request. 4597 func (c *ProjectsLocationsInstancesListCall) Header() http.Header { 4598 if c.header_ == nil { 4599 c.header_ = make(http.Header) 4600 } 4601 return c.header_ 4602 } 4603 4604 func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Response, error) { 4605 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4606 if c.ifNoneMatch_ != "" { 4607 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4608 } 4609 var body io.Reader = nil 4610 c.urlParams_.Set("alt", alt) 4611 c.urlParams_.Set("prettyPrint", "false") 4612 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances") 4613 urls += "?" + c.urlParams_.Encode() 4614 req, err := http.NewRequest("GET", urls, body) 4615 if err != nil { 4616 return nil, err 4617 } 4618 req.Header = reqHeaders 4619 googleapi.Expand(req.URL, map[string]string{ 4620 "parent": c.parent, 4621 }) 4622 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4623 } 4624 4625 // Do executes the "redis.projects.locations.instances.list" call. 4626 // Any non-2xx status code is an error. Response headers are in either 4627 // *ListInstancesResponse.ServerResponse.Header or (if a response was returned 4628 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4629 // check whether the returned error was because http.StatusNotModified was 4630 // returned. 4631 func (c *ProjectsLocationsInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) { 4632 gensupport.SetOptions(c.urlParams_, opts...) 4633 res, err := c.doRequest("json") 4634 if res != nil && res.StatusCode == http.StatusNotModified { 4635 if res.Body != nil { 4636 res.Body.Close() 4637 } 4638 return nil, gensupport.WrapError(&googleapi.Error{ 4639 Code: res.StatusCode, 4640 Header: res.Header, 4641 }) 4642 } 4643 if err != nil { 4644 return nil, err 4645 } 4646 defer googleapi.CloseBody(res) 4647 if err := googleapi.CheckResponse(res); err != nil { 4648 return nil, gensupport.WrapError(err) 4649 } 4650 ret := &ListInstancesResponse{ 4651 ServerResponse: googleapi.ServerResponse{ 4652 Header: res.Header, 4653 HTTPStatusCode: res.StatusCode, 4654 }, 4655 } 4656 target := &ret 4657 if err := gensupport.DecodeResponse(target, res); err != nil { 4658 return nil, err 4659 } 4660 return ret, nil 4661 } 4662 4663 // Pages invokes f for each page of results. 4664 // A non-nil error returned from f will halt the iteration. 4665 // The provided context supersedes any context provided to the Context method. 4666 func (c *ProjectsLocationsInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error { 4667 c.ctx_ = ctx 4668 defer c.PageToken(c.urlParams_.Get("pageToken")) 4669 for { 4670 x, err := c.Do() 4671 if err != nil { 4672 return err 4673 } 4674 if err := f(x); err != nil { 4675 return err 4676 } 4677 if x.NextPageToken == "" { 4678 return nil 4679 } 4680 c.PageToken(x.NextPageToken) 4681 } 4682 } 4683 4684 type ProjectsLocationsInstancesPatchCall struct { 4685 s *Service 4686 name string 4687 instance *Instance 4688 urlParams_ gensupport.URLParams 4689 ctx_ context.Context 4690 header_ http.Header 4691 } 4692 4693 // Patch: Updates the metadata and configuration of a specific Redis instance. 4694 // Completed longrunning.Operation will contain the new instance object in the 4695 // response field. The returned operation is automatically deleted after a few 4696 // hours, so there is no need to call DeleteOperation. 4697 // 4698 // - name: Unique name of the resource in this scope including project and 4699 // location using the form: 4700 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` 4701 // Note: Redis instances are managed and addressed at regional level so 4702 // location_id here refers to a GCP region; however, users may choose which 4703 // specific zone (or collection of zones for cross-zone instances) an 4704 // instance should be provisioned in. Refer to location_id and 4705 // alternative_location_id fields for more details. 4706 func (r *ProjectsLocationsInstancesService) Patch(name string, instance *Instance) *ProjectsLocationsInstancesPatchCall { 4707 c := &ProjectsLocationsInstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4708 c.name = name 4709 c.instance = instance 4710 return c 4711 } 4712 4713 // UpdateMask sets the optional parameter "updateMask": Required. Mask of 4714 // fields to update. At least one path must be supplied in this field. The 4715 // elements of the repeated paths field may only include these fields from 4716 // Instance: * `displayName` * `labels` * `memorySizeGb` * `redisConfig` * 4717 // `replica_count` 4718 func (c *ProjectsLocationsInstancesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsInstancesPatchCall { 4719 c.urlParams_.Set("updateMask", updateMask) 4720 return c 4721 } 4722 4723 // Fields allows partial responses to be retrieved. See 4724 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4725 // details. 4726 func (c *ProjectsLocationsInstancesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesPatchCall { 4727 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4728 return c 4729 } 4730 4731 // Context sets the context to be used in this call's Do method. 4732 func (c *ProjectsLocationsInstancesPatchCall) Context(ctx context.Context) *ProjectsLocationsInstancesPatchCall { 4733 c.ctx_ = ctx 4734 return c 4735 } 4736 4737 // Header returns a http.Header that can be modified by the caller to add 4738 // headers to the request. 4739 func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { 4740 if c.header_ == nil { 4741 c.header_ = make(http.Header) 4742 } 4743 return c.header_ 4744 } 4745 4746 func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { 4747 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4748 var body io.Reader = nil 4749 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) 4750 if err != nil { 4751 return nil, err 4752 } 4753 c.urlParams_.Set("alt", alt) 4754 c.urlParams_.Set("prettyPrint", "false") 4755 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4756 urls += "?" + c.urlParams_.Encode() 4757 req, err := http.NewRequest("PATCH", urls, body) 4758 if err != nil { 4759 return nil, err 4760 } 4761 req.Header = reqHeaders 4762 googleapi.Expand(req.URL, map[string]string{ 4763 "name": c.name, 4764 }) 4765 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4766 } 4767 4768 // Do executes the "redis.projects.locations.instances.patch" call. 4769 // Any non-2xx status code is an error. Response headers are in either 4770 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4771 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4772 // whether the returned error was because http.StatusNotModified was returned. 4773 func (c *ProjectsLocationsInstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4774 gensupport.SetOptions(c.urlParams_, opts...) 4775 res, err := c.doRequest("json") 4776 if res != nil && res.StatusCode == http.StatusNotModified { 4777 if res.Body != nil { 4778 res.Body.Close() 4779 } 4780 return nil, gensupport.WrapError(&googleapi.Error{ 4781 Code: res.StatusCode, 4782 Header: res.Header, 4783 }) 4784 } 4785 if err != nil { 4786 return nil, err 4787 } 4788 defer googleapi.CloseBody(res) 4789 if err := googleapi.CheckResponse(res); err != nil { 4790 return nil, gensupport.WrapError(err) 4791 } 4792 ret := &Operation{ 4793 ServerResponse: googleapi.ServerResponse{ 4794 Header: res.Header, 4795 HTTPStatusCode: res.StatusCode, 4796 }, 4797 } 4798 target := &ret 4799 if err := gensupport.DecodeResponse(target, res); err != nil { 4800 return nil, err 4801 } 4802 return ret, nil 4803 } 4804 4805 type ProjectsLocationsInstancesRescheduleMaintenanceCall struct { 4806 s *Service 4807 name string 4808 reschedulemaintenancerequest *RescheduleMaintenanceRequest 4809 urlParams_ gensupport.URLParams 4810 ctx_ context.Context 4811 header_ http.Header 4812 } 4813 4814 // RescheduleMaintenance: Reschedule maintenance for a given instance in a 4815 // given project and location. 4816 // 4817 // - name: Redis instance resource name using the form: 4818 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` 4819 // where `location_id` refers to a GCP region. 4820 func (r *ProjectsLocationsInstancesService) RescheduleMaintenance(name string, reschedulemaintenancerequest *RescheduleMaintenanceRequest) *ProjectsLocationsInstancesRescheduleMaintenanceCall { 4821 c := &ProjectsLocationsInstancesRescheduleMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4822 c.name = name 4823 c.reschedulemaintenancerequest = reschedulemaintenancerequest 4824 return c 4825 } 4826 4827 // Fields allows partial responses to be retrieved. See 4828 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4829 // details. 4830 func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesRescheduleMaintenanceCall { 4831 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4832 return c 4833 } 4834 4835 // Context sets the context to be used in this call's Do method. 4836 func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Context(ctx context.Context) *ProjectsLocationsInstancesRescheduleMaintenanceCall { 4837 c.ctx_ = ctx 4838 return c 4839 } 4840 4841 // Header returns a http.Header that can be modified by the caller to add 4842 // headers to the request. 4843 func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Header() http.Header { 4844 if c.header_ == nil { 4845 c.header_ = make(http.Header) 4846 } 4847 return c.header_ 4848 } 4849 4850 func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) { 4851 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4852 var body io.Reader = nil 4853 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reschedulemaintenancerequest) 4854 if err != nil { 4855 return nil, err 4856 } 4857 c.urlParams_.Set("alt", alt) 4858 c.urlParams_.Set("prettyPrint", "false") 4859 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:rescheduleMaintenance") 4860 urls += "?" + c.urlParams_.Encode() 4861 req, err := http.NewRequest("POST", urls, body) 4862 if err != nil { 4863 return nil, err 4864 } 4865 req.Header = reqHeaders 4866 googleapi.Expand(req.URL, map[string]string{ 4867 "name": c.name, 4868 }) 4869 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4870 } 4871 4872 // Do executes the "redis.projects.locations.instances.rescheduleMaintenance" call. 4873 // Any non-2xx status code is an error. Response headers are in either 4874 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4875 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4876 // whether the returned error was because http.StatusNotModified was returned. 4877 func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4878 gensupport.SetOptions(c.urlParams_, opts...) 4879 res, err := c.doRequest("json") 4880 if res != nil && res.StatusCode == http.StatusNotModified { 4881 if res.Body != nil { 4882 res.Body.Close() 4883 } 4884 return nil, gensupport.WrapError(&googleapi.Error{ 4885 Code: res.StatusCode, 4886 Header: res.Header, 4887 }) 4888 } 4889 if err != nil { 4890 return nil, err 4891 } 4892 defer googleapi.CloseBody(res) 4893 if err := googleapi.CheckResponse(res); err != nil { 4894 return nil, gensupport.WrapError(err) 4895 } 4896 ret := &Operation{ 4897 ServerResponse: googleapi.ServerResponse{ 4898 Header: res.Header, 4899 HTTPStatusCode: res.StatusCode, 4900 }, 4901 } 4902 target := &ret 4903 if err := gensupport.DecodeResponse(target, res); err != nil { 4904 return nil, err 4905 } 4906 return ret, nil 4907 } 4908 4909 type ProjectsLocationsInstancesUpgradeCall struct { 4910 s *Service 4911 name string 4912 upgradeinstancerequest *UpgradeInstanceRequest 4913 urlParams_ gensupport.URLParams 4914 ctx_ context.Context 4915 header_ http.Header 4916 } 4917 4918 // Upgrade: Upgrades Redis instance to the newer Redis version specified in the 4919 // request. 4920 // 4921 // - name: Redis instance resource name using the form: 4922 // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` 4923 // where `location_id` refers to a GCP region. 4924 func (r *ProjectsLocationsInstancesService) Upgrade(name string, upgradeinstancerequest *UpgradeInstanceRequest) *ProjectsLocationsInstancesUpgradeCall { 4925 c := &ProjectsLocationsInstancesUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4926 c.name = name 4927 c.upgradeinstancerequest = upgradeinstancerequest 4928 return c 4929 } 4930 4931 // Fields allows partial responses to be retrieved. See 4932 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4933 // details. 4934 func (c *ProjectsLocationsInstancesUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesUpgradeCall { 4935 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4936 return c 4937 } 4938 4939 // Context sets the context to be used in this call's Do method. 4940 func (c *ProjectsLocationsInstancesUpgradeCall) Context(ctx context.Context) *ProjectsLocationsInstancesUpgradeCall { 4941 c.ctx_ = ctx 4942 return c 4943 } 4944 4945 // Header returns a http.Header that can be modified by the caller to add 4946 // headers to the request. 4947 func (c *ProjectsLocationsInstancesUpgradeCall) Header() http.Header { 4948 if c.header_ == nil { 4949 c.header_ = make(http.Header) 4950 } 4951 return c.header_ 4952 } 4953 4954 func (c *ProjectsLocationsInstancesUpgradeCall) doRequest(alt string) (*http.Response, error) { 4955 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4956 var body io.Reader = nil 4957 body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeinstancerequest) 4958 if err != nil { 4959 return nil, err 4960 } 4961 c.urlParams_.Set("alt", alt) 4962 c.urlParams_.Set("prettyPrint", "false") 4963 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:upgrade") 4964 urls += "?" + c.urlParams_.Encode() 4965 req, err := http.NewRequest("POST", urls, body) 4966 if err != nil { 4967 return nil, err 4968 } 4969 req.Header = reqHeaders 4970 googleapi.Expand(req.URL, map[string]string{ 4971 "name": c.name, 4972 }) 4973 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4974 } 4975 4976 // Do executes the "redis.projects.locations.instances.upgrade" call. 4977 // Any non-2xx status code is an error. Response headers are in either 4978 // *Operation.ServerResponse.Header or (if a response was returned at all) in 4979 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4980 // whether the returned error was because http.StatusNotModified was returned. 4981 func (c *ProjectsLocationsInstancesUpgradeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4982 gensupport.SetOptions(c.urlParams_, opts...) 4983 res, err := c.doRequest("json") 4984 if res != nil && res.StatusCode == http.StatusNotModified { 4985 if res.Body != nil { 4986 res.Body.Close() 4987 } 4988 return nil, gensupport.WrapError(&googleapi.Error{ 4989 Code: res.StatusCode, 4990 Header: res.Header, 4991 }) 4992 } 4993 if err != nil { 4994 return nil, err 4995 } 4996 defer googleapi.CloseBody(res) 4997 if err := googleapi.CheckResponse(res); err != nil { 4998 return nil, gensupport.WrapError(err) 4999 } 5000 ret := &Operation{ 5001 ServerResponse: googleapi.ServerResponse{ 5002 Header: res.Header, 5003 HTTPStatusCode: res.StatusCode, 5004 }, 5005 } 5006 target := &ret 5007 if err := gensupport.DecodeResponse(target, res); err != nil { 5008 return nil, err 5009 } 5010 return ret, nil 5011 } 5012 5013 type ProjectsLocationsOperationsCancelCall struct { 5014 s *Service 5015 name string 5016 urlParams_ gensupport.URLParams 5017 ctx_ context.Context 5018 header_ http.Header 5019 } 5020 5021 // Cancel: Starts asynchronous cancellation on a long-running operation. The 5022 // server makes a best effort to cancel the operation, but success is not 5023 // guaranteed. If the server doesn't support this method, it returns 5024 // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or 5025 // other methods to check whether the cancellation succeeded or whether the 5026 // operation completed despite cancellation. On successful cancellation, the 5027 // operation is not deleted; instead, it becomes an operation with an 5028 // Operation.error value with a google.rpc.Status.code of 1, corresponding to 5029 // `Code.CANCELLED`. 5030 // 5031 // - name: The name of the operation resource to be cancelled. 5032 func (r *ProjectsLocationsOperationsService) Cancel(name string) *ProjectsLocationsOperationsCancelCall { 5033 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5034 c.name = name 5035 return c 5036 } 5037 5038 // Fields allows partial responses to be retrieved. See 5039 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5040 // details. 5041 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { 5042 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5043 return c 5044 } 5045 5046 // Context sets the context to be used in this call's Do method. 5047 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { 5048 c.ctx_ = ctx 5049 return c 5050 } 5051 5052 // Header returns a http.Header that can be modified by the caller to add 5053 // headers to the request. 5054 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { 5055 if c.header_ == nil { 5056 c.header_ = make(http.Header) 5057 } 5058 return c.header_ 5059 } 5060 5061 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 5062 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5063 var body io.Reader = nil 5064 c.urlParams_.Set("alt", alt) 5065 c.urlParams_.Set("prettyPrint", "false") 5066 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") 5067 urls += "?" + c.urlParams_.Encode() 5068 req, err := http.NewRequest("POST", urls, body) 5069 if err != nil { 5070 return nil, err 5071 } 5072 req.Header = reqHeaders 5073 googleapi.Expand(req.URL, map[string]string{ 5074 "name": c.name, 5075 }) 5076 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5077 } 5078 5079 // Do executes the "redis.projects.locations.operations.cancel" call. 5080 // Any non-2xx status code is an error. Response headers are in either 5081 // *Empty.ServerResponse.Header or (if a response was returned at all) in 5082 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5083 // whether the returned error was because http.StatusNotModified was returned. 5084 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 5085 gensupport.SetOptions(c.urlParams_, opts...) 5086 res, err := c.doRequest("json") 5087 if res != nil && res.StatusCode == http.StatusNotModified { 5088 if res.Body != nil { 5089 res.Body.Close() 5090 } 5091 return nil, gensupport.WrapError(&googleapi.Error{ 5092 Code: res.StatusCode, 5093 Header: res.Header, 5094 }) 5095 } 5096 if err != nil { 5097 return nil, err 5098 } 5099 defer googleapi.CloseBody(res) 5100 if err := googleapi.CheckResponse(res); err != nil { 5101 return nil, gensupport.WrapError(err) 5102 } 5103 ret := &Empty{ 5104 ServerResponse: googleapi.ServerResponse{ 5105 Header: res.Header, 5106 HTTPStatusCode: res.StatusCode, 5107 }, 5108 } 5109 target := &ret 5110 if err := gensupport.DecodeResponse(target, res); err != nil { 5111 return nil, err 5112 } 5113 return ret, nil 5114 } 5115 5116 type ProjectsLocationsOperationsDeleteCall struct { 5117 s *Service 5118 name string 5119 urlParams_ gensupport.URLParams 5120 ctx_ context.Context 5121 header_ http.Header 5122 } 5123 5124 // Delete: Deletes a long-running operation. This method indicates that the 5125 // client is no longer interested in the operation result. It does not cancel 5126 // the operation. If the server doesn't support this method, it returns 5127 // `google.rpc.Code.UNIMPLEMENTED`. 5128 // 5129 // - name: The name of the operation resource to be deleted. 5130 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall { 5131 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5132 c.name = name 5133 return c 5134 } 5135 5136 // Fields allows partial responses to be retrieved. See 5137 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5138 // details. 5139 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall { 5140 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5141 return c 5142 } 5143 5144 // Context sets the context to be used in this call's Do method. 5145 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall { 5146 c.ctx_ = ctx 5147 return c 5148 } 5149 5150 // Header returns a http.Header that can be modified by the caller to add 5151 // headers to the request. 5152 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { 5153 if c.header_ == nil { 5154 c.header_ = make(http.Header) 5155 } 5156 return c.header_ 5157 } 5158 5159 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 5160 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5161 var body io.Reader = nil 5162 c.urlParams_.Set("alt", alt) 5163 c.urlParams_.Set("prettyPrint", "false") 5164 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5165 urls += "?" + c.urlParams_.Encode() 5166 req, err := http.NewRequest("DELETE", urls, body) 5167 if err != nil { 5168 return nil, err 5169 } 5170 req.Header = reqHeaders 5171 googleapi.Expand(req.URL, map[string]string{ 5172 "name": c.name, 5173 }) 5174 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5175 } 5176 5177 // Do executes the "redis.projects.locations.operations.delete" call. 5178 // Any non-2xx status code is an error. Response headers are in either 5179 // *Empty.ServerResponse.Header or (if a response was returned at all) in 5180 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5181 // whether the returned error was because http.StatusNotModified was returned. 5182 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 5183 gensupport.SetOptions(c.urlParams_, opts...) 5184 res, err := c.doRequest("json") 5185 if res != nil && res.StatusCode == http.StatusNotModified { 5186 if res.Body != nil { 5187 res.Body.Close() 5188 } 5189 return nil, gensupport.WrapError(&googleapi.Error{ 5190 Code: res.StatusCode, 5191 Header: res.Header, 5192 }) 5193 } 5194 if err != nil { 5195 return nil, err 5196 } 5197 defer googleapi.CloseBody(res) 5198 if err := googleapi.CheckResponse(res); err != nil { 5199 return nil, gensupport.WrapError(err) 5200 } 5201 ret := &Empty{ 5202 ServerResponse: googleapi.ServerResponse{ 5203 Header: res.Header, 5204 HTTPStatusCode: res.StatusCode, 5205 }, 5206 } 5207 target := &ret 5208 if err := gensupport.DecodeResponse(target, res); err != nil { 5209 return nil, err 5210 } 5211 return ret, nil 5212 } 5213 5214 type ProjectsLocationsOperationsGetCall struct { 5215 s *Service 5216 name string 5217 urlParams_ gensupport.URLParams 5218 ifNoneMatch_ string 5219 ctx_ context.Context 5220 header_ http.Header 5221 } 5222 5223 // Get: Gets the latest state of a long-running operation. Clients can use this 5224 // method to poll the operation result at intervals as recommended by the API 5225 // service. 5226 // 5227 // - name: The name of the operation resource. 5228 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 5229 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5230 c.name = name 5231 return c 5232 } 5233 5234 // Fields allows partial responses to be retrieved. See 5235 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5236 // details. 5237 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 5238 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5239 return c 5240 } 5241 5242 // IfNoneMatch sets an optional parameter which makes the operation fail if the 5243 // object's ETag matches the given value. This is useful for getting updates 5244 // only after the object has changed since the last request. 5245 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 5246 c.ifNoneMatch_ = entityTag 5247 return c 5248 } 5249 5250 // Context sets the context to be used in this call's Do method. 5251 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 5252 c.ctx_ = ctx 5253 return c 5254 } 5255 5256 // Header returns a http.Header that can be modified by the caller to add 5257 // headers to the request. 5258 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 5259 if c.header_ == nil { 5260 c.header_ = make(http.Header) 5261 } 5262 return c.header_ 5263 } 5264 5265 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 5266 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5267 if c.ifNoneMatch_ != "" { 5268 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5269 } 5270 var body io.Reader = nil 5271 c.urlParams_.Set("alt", alt) 5272 c.urlParams_.Set("prettyPrint", "false") 5273 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5274 urls += "?" + c.urlParams_.Encode() 5275 req, err := http.NewRequest("GET", urls, body) 5276 if err != nil { 5277 return nil, err 5278 } 5279 req.Header = reqHeaders 5280 googleapi.Expand(req.URL, map[string]string{ 5281 "name": c.name, 5282 }) 5283 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5284 } 5285 5286 // Do executes the "redis.projects.locations.operations.get" call. 5287 // Any non-2xx status code is an error. Response headers are in either 5288 // *Operation.ServerResponse.Header or (if a response was returned at all) in 5289 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5290 // whether the returned error was because http.StatusNotModified was returned. 5291 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5292 gensupport.SetOptions(c.urlParams_, opts...) 5293 res, err := c.doRequest("json") 5294 if res != nil && res.StatusCode == http.StatusNotModified { 5295 if res.Body != nil { 5296 res.Body.Close() 5297 } 5298 return nil, gensupport.WrapError(&googleapi.Error{ 5299 Code: res.StatusCode, 5300 Header: res.Header, 5301 }) 5302 } 5303 if err != nil { 5304 return nil, err 5305 } 5306 defer googleapi.CloseBody(res) 5307 if err := googleapi.CheckResponse(res); err != nil { 5308 return nil, gensupport.WrapError(err) 5309 } 5310 ret := &Operation{ 5311 ServerResponse: googleapi.ServerResponse{ 5312 Header: res.Header, 5313 HTTPStatusCode: res.StatusCode, 5314 }, 5315 } 5316 target := &ret 5317 if err := gensupport.DecodeResponse(target, res); err != nil { 5318 return nil, err 5319 } 5320 return ret, nil 5321 } 5322 5323 type ProjectsLocationsOperationsListCall struct { 5324 s *Service 5325 name string 5326 urlParams_ gensupport.URLParams 5327 ifNoneMatch_ string 5328 ctx_ context.Context 5329 header_ http.Header 5330 } 5331 5332 // List: Lists operations that match the specified filter in the request. If 5333 // the server doesn't support this method, it returns `UNIMPLEMENTED`. 5334 // 5335 // - name: The name of the operation's parent resource. 5336 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { 5337 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5338 c.name = name 5339 return c 5340 } 5341 5342 // Filter sets the optional parameter "filter": The standard list filter. 5343 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { 5344 c.urlParams_.Set("filter", filter) 5345 return c 5346 } 5347 5348 // PageSize sets the optional parameter "pageSize": The standard list page 5349 // size. 5350 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { 5351 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5352 return c 5353 } 5354 5355 // PageToken sets the optional parameter "pageToken": The standard list page 5356 // token. 5357 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { 5358 c.urlParams_.Set("pageToken", pageToken) 5359 return c 5360 } 5361 5362 // Fields allows partial responses to be retrieved. See 5363 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5364 // details. 5365 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { 5366 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5367 return c 5368 } 5369 5370 // IfNoneMatch sets an optional parameter which makes the operation fail if the 5371 // object's ETag matches the given value. This is useful for getting updates 5372 // only after the object has changed since the last request. 5373 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { 5374 c.ifNoneMatch_ = entityTag 5375 return c 5376 } 5377 5378 // Context sets the context to be used in this call's Do method. 5379 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { 5380 c.ctx_ = ctx 5381 return c 5382 } 5383 5384 // Header returns a http.Header that can be modified by the caller to add 5385 // headers to the request. 5386 func (c *ProjectsLocationsOperationsListCall) Header() http.Header { 5387 if c.header_ == nil { 5388 c.header_ = make(http.Header) 5389 } 5390 return c.header_ 5391 } 5392 5393 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { 5394 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5395 if c.ifNoneMatch_ != "" { 5396 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5397 } 5398 var body io.Reader = nil 5399 c.urlParams_.Set("alt", alt) 5400 c.urlParams_.Set("prettyPrint", "false") 5401 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") 5402 urls += "?" + c.urlParams_.Encode() 5403 req, err := http.NewRequest("GET", urls, body) 5404 if err != nil { 5405 return nil, err 5406 } 5407 req.Header = reqHeaders 5408 googleapi.Expand(req.URL, map[string]string{ 5409 "name": c.name, 5410 }) 5411 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5412 } 5413 5414 // Do executes the "redis.projects.locations.operations.list" call. 5415 // Any non-2xx status code is an error. Response headers are in either 5416 // *ListOperationsResponse.ServerResponse.Header or (if a response was returned 5417 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5418 // check whether the returned error was because http.StatusNotModified was 5419 // returned. 5420 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 5421 gensupport.SetOptions(c.urlParams_, opts...) 5422 res, err := c.doRequest("json") 5423 if res != nil && res.StatusCode == http.StatusNotModified { 5424 if res.Body != nil { 5425 res.Body.Close() 5426 } 5427 return nil, gensupport.WrapError(&googleapi.Error{ 5428 Code: res.StatusCode, 5429 Header: res.Header, 5430 }) 5431 } 5432 if err != nil { 5433 return nil, err 5434 } 5435 defer googleapi.CloseBody(res) 5436 if err := googleapi.CheckResponse(res); err != nil { 5437 return nil, gensupport.WrapError(err) 5438 } 5439 ret := &ListOperationsResponse{ 5440 ServerResponse: googleapi.ServerResponse{ 5441 Header: res.Header, 5442 HTTPStatusCode: res.StatusCode, 5443 }, 5444 } 5445 target := &ret 5446 if err := gensupport.DecodeResponse(target, res); err != nil { 5447 return nil, err 5448 } 5449 return ret, nil 5450 } 5451 5452 // Pages invokes f for each page of results. 5453 // A non-nil error returned from f will halt the iteration. 5454 // The provided context supersedes any context provided to the Context method. 5455 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 5456 c.ctx_ = ctx 5457 defer c.PageToken(c.urlParams_.Get("pageToken")) 5458 for { 5459 x, err := c.Do() 5460 if err != nil { 5461 return err 5462 } 5463 if err := f(x); err != nil { 5464 return err 5465 } 5466 if x.NextPageToken == "" { 5467 return nil 5468 } 5469 c.PageToken(x.NextPageToken) 5470 } 5471 } 5472