1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package 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// Creating a client 14// 15// Usage example: 16// 17// import "google.golang.org/api/redis/v1beta1" 18// ... 19// ctx := context.Background() 20// redisService, err := redis.NewService(ctx) 21// 22// In this example, Google Application Default Credentials are used for authentication. 23// 24// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 25// 26// Other authentication options 27// 28// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 29// 30// redisService, err := redis.NewService(ctx, option.WithAPIKey("AIza...")) 31// 32// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 33// 34// config := &oauth2.Config{...} 35// // ... 36// token, err := config.Exchange(ctx, ...) 37// redisService, err := redis.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 38// 39// See https://godoc.org/google.golang.org/api/option/ for details on options. 40package redis // import "google.golang.org/api/redis/v1beta1" 41 42import ( 43 "bytes" 44 "context" 45 "encoding/json" 46 "errors" 47 "fmt" 48 "io" 49 "net/http" 50 "net/url" 51 "strconv" 52 "strings" 53 54 googleapi "google.golang.org/api/googleapi" 55 gensupport "google.golang.org/api/internal/gensupport" 56 option "google.golang.org/api/option" 57 internaloption "google.golang.org/api/option/internaloption" 58 htransport "google.golang.org/api/transport/http" 59) 60 61// Always reference these packages, just in case the auto-generated code 62// below doesn't. 63var _ = bytes.NewBuffer 64var _ = strconv.Itoa 65var _ = fmt.Sprintf 66var _ = json.NewDecoder 67var _ = io.Copy 68var _ = url.Parse 69var _ = gensupport.MarshalJSON 70var _ = googleapi.Version 71var _ = errors.New 72var _ = strings.Replace 73var _ = context.Canceled 74var _ = internaloption.WithDefaultEndpoint 75 76const apiId = "redis:v1beta1" 77const apiName = "redis" 78const apiVersion = "v1beta1" 79const basePath = "https://redis.googleapis.com/" 80const mtlsBasePath = "https://redis.mtls.googleapis.com/" 81 82// OAuth2 scopes used by this API. 83const ( 84 // See, edit, configure, and delete your Google Cloud Platform data 85 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 86) 87 88// NewService creates a new Service. 89func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 90 scopesOption := option.WithScopes( 91 "https://www.googleapis.com/auth/cloud-platform", 92 ) 93 // NOTE: prepend, so we don't override user-specified scopes. 94 opts = append([]option.ClientOption{scopesOption}, opts...) 95 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 96 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 97 client, endpoint, err := htransport.NewClient(ctx, opts...) 98 if err != nil { 99 return nil, err 100 } 101 s, err := New(client) 102 if err != nil { 103 return nil, err 104 } 105 if endpoint != "" { 106 s.BasePath = endpoint 107 } 108 return s, nil 109} 110 111// New creates a new Service. It uses the provided http.Client for requests. 112// 113// Deprecated: please use NewService instead. 114// To provide a custom HTTP client, use option.WithHTTPClient. 115// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 116func New(client *http.Client) (*Service, error) { 117 if client == nil { 118 return nil, errors.New("client is nil") 119 } 120 s := &Service{client: client, BasePath: basePath} 121 s.Projects = NewProjectsService(s) 122 return s, nil 123} 124 125type Service struct { 126 client *http.Client 127 BasePath string // API endpoint base URL 128 UserAgent string // optional additional User-Agent fragment 129 130 Projects *ProjectsService 131} 132 133func (s *Service) userAgent() string { 134 if s.UserAgent == "" { 135 return googleapi.UserAgent 136 } 137 return googleapi.UserAgent + " " + s.UserAgent 138} 139 140func NewProjectsService(s *Service) *ProjectsService { 141 rs := &ProjectsService{s: s} 142 rs.Locations = NewProjectsLocationsService(s) 143 return rs 144} 145 146type ProjectsService struct { 147 s *Service 148 149 Locations *ProjectsLocationsService 150} 151 152func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 153 rs := &ProjectsLocationsService{s: s} 154 rs.Instances = NewProjectsLocationsInstancesService(s) 155 rs.Operations = NewProjectsLocationsOperationsService(s) 156 return rs 157} 158 159type ProjectsLocationsService struct { 160 s *Service 161 162 Instances *ProjectsLocationsInstancesService 163 164 Operations *ProjectsLocationsOperationsService 165} 166 167func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService { 168 rs := &ProjectsLocationsInstancesService{s: s} 169 return rs 170} 171 172type ProjectsLocationsInstancesService struct { 173 s *Service 174} 175 176func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 177 rs := &ProjectsLocationsOperationsService{s: s} 178 return rs 179} 180 181type ProjectsLocationsOperationsService struct { 182 s *Service 183} 184 185// Empty: A generic empty message that you can re-use to avoid defining 186// duplicated empty messages in your APIs. A typical example is to use 187// it as the request or the response type of an API method. For 188// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 189// (google.protobuf.Empty); } The JSON representation for `Empty` is 190// empty JSON object `{}`. 191type Empty struct { 192 // ServerResponse contains the HTTP response code and headers from the 193 // server. 194 googleapi.ServerResponse `json:"-"` 195} 196 197// ExportInstanceRequest: Request for Export. 198type ExportInstanceRequest struct { 199 // OutputConfig: Required. Specify data to be exported. 200 OutputConfig *OutputConfig `json:"outputConfig,omitempty"` 201 202 // ForceSendFields is a list of field names (e.g. "OutputConfig") to 203 // unconditionally include in API requests. By default, fields with 204 // empty or default values are omitted from API requests. However, any 205 // non-pointer, non-interface field appearing in ForceSendFields will be 206 // sent to the server regardless of whether the field is empty or not. 207 // This may be used to include empty fields in Patch requests. 208 ForceSendFields []string `json:"-"` 209 210 // NullFields is a list of field names (e.g. "OutputConfig") to include 211 // in API requests with the JSON null value. By default, fields with 212 // empty values are omitted from API requests. However, any field with 213 // an empty value appearing in NullFields will be sent to the server as 214 // null. It is an error if a field in this list has a non-empty value. 215 // This may be used to include null fields in Patch requests. 216 NullFields []string `json:"-"` 217} 218 219func (s *ExportInstanceRequest) MarshalJSON() ([]byte, error) { 220 type NoMethod ExportInstanceRequest 221 raw := NoMethod(*s) 222 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 223} 224 225// FailoverInstanceRequest: Request for Failover. 226type FailoverInstanceRequest struct { 227 // DataProtectionMode: Optional. Available data protection modes that 228 // the user can choose. If it's unspecified, data protection mode will 229 // be LIMITED_DATA_LOSS by default. 230 // 231 // Possible values: 232 // "DATA_PROTECTION_MODE_UNSPECIFIED" - Defaults to LIMITED_DATA_LOSS 233 // if a data protection mode is not specified. 234 // "LIMITED_DATA_LOSS" - Instance failover will be protected with data 235 // loss control. More specifically, the failover will only be performed 236 // if the current replication offset diff between primary and replica is 237 // under a certain threshold. 238 // "FORCE_DATA_LOSS" - Instance failover will be performed without 239 // data loss control. 240 DataProtectionMode string `json:"dataProtectionMode,omitempty"` 241 242 // ForceSendFields is a list of field names (e.g. "DataProtectionMode") 243 // to unconditionally include in API requests. By default, fields with 244 // empty or default values are omitted from API requests. However, any 245 // non-pointer, non-interface field appearing in ForceSendFields will be 246 // sent to the server regardless of whether the field is empty or not. 247 // This may be used to include empty fields in Patch requests. 248 ForceSendFields []string `json:"-"` 249 250 // NullFields is a list of field names (e.g. "DataProtectionMode") to 251 // include in API requests with the JSON null value. By default, fields 252 // with empty values are omitted from API requests. However, any field 253 // with an empty value appearing in NullFields will be sent to the 254 // server as null. It is an error if a field in this list has a 255 // non-empty value. This may be used to include null fields in Patch 256 // requests. 257 NullFields []string `json:"-"` 258} 259 260func (s *FailoverInstanceRequest) MarshalJSON() ([]byte, error) { 261 type NoMethod FailoverInstanceRequest 262 raw := NoMethod(*s) 263 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 264} 265 266// GcsDestination: The Cloud Storage location for the output content 267type GcsDestination struct { 268 // Uri: Required. Data destination URI (e.g. 269 // 'gs://my_bucket/my_object'). Existing files will be overwritten. 270 Uri string `json:"uri,omitempty"` 271 272 // ForceSendFields is a list of field names (e.g. "Uri") to 273 // unconditionally include in API requests. By default, fields with 274 // empty or default values are omitted from API requests. However, any 275 // non-pointer, non-interface field appearing in ForceSendFields will be 276 // sent to the server regardless of whether the field is empty or not. 277 // This may be used to include empty fields in Patch requests. 278 ForceSendFields []string `json:"-"` 279 280 // NullFields is a list of field names (e.g. "Uri") to include in API 281 // requests with the JSON null value. By default, fields with empty 282 // values are omitted from API requests. However, any field with an 283 // empty value appearing in NullFields will be sent to the server as 284 // null. It is an error if a field in this list has a non-empty value. 285 // This may be used to include null fields in Patch requests. 286 NullFields []string `json:"-"` 287} 288 289func (s *GcsDestination) MarshalJSON() ([]byte, error) { 290 type NoMethod GcsDestination 291 raw := NoMethod(*s) 292 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 293} 294 295// GcsSource: The Cloud Storage location for the input content 296type GcsSource struct { 297 // Uri: Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). 298 Uri string `json:"uri,omitempty"` 299 300 // ForceSendFields is a list of field names (e.g. "Uri") to 301 // unconditionally include in API requests. By default, fields with 302 // empty or default values are omitted from API requests. However, any 303 // non-pointer, non-interface field appearing in ForceSendFields will be 304 // sent to the server regardless of whether the field is empty or not. 305 // This may be used to include empty fields in Patch requests. 306 ForceSendFields []string `json:"-"` 307 308 // NullFields is a list of field names (e.g. "Uri") to include in API 309 // requests with the JSON null value. By default, fields with empty 310 // values are omitted from API requests. However, any field with an 311 // empty value appearing in NullFields will be sent to the server as 312 // null. It is an error if a field in this list has a non-empty value. 313 // This may be used to include null fields in Patch requests. 314 NullFields []string `json:"-"` 315} 316 317func (s *GcsSource) MarshalJSON() ([]byte, error) { 318 type NoMethod GcsSource 319 raw := NoMethod(*s) 320 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 321} 322 323// GoogleCloudCommonOperationMetadata: Represents the metadata of the 324// long-running operation. 325type GoogleCloudCommonOperationMetadata struct { 326 // ApiVersion: Output only. API version used to start the operation. 327 ApiVersion string `json:"apiVersion,omitempty"` 328 329 // CancelRequested: Output only. Identifies whether the user has 330 // requested cancellation of the operation. Operations that have 331 // successfully been cancelled have Operation.error value with a 332 // google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. 333 CancelRequested bool `json:"cancelRequested,omitempty"` 334 335 // CreateTime: Output only. The time the operation was created. 336 CreateTime string `json:"createTime,omitempty"` 337 338 // EndTime: Output only. The time the operation finished running. 339 EndTime string `json:"endTime,omitempty"` 340 341 // StatusDetail: Output only. Human-readable status of the operation, if 342 // any. 343 StatusDetail string `json:"statusDetail,omitempty"` 344 345 // Target: Output only. Server-defined resource path for the target of 346 // the operation. 347 Target string `json:"target,omitempty"` 348 349 // Verb: Output only. Name of the verb executed by the operation. 350 Verb string `json:"verb,omitempty"` 351 352 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 353 // unconditionally include in API requests. By default, fields with 354 // empty or default values are omitted from API requests. However, any 355 // non-pointer, non-interface field appearing in ForceSendFields will be 356 // sent to the server regardless of whether the field is empty or not. 357 // This may be used to include empty fields in Patch requests. 358 ForceSendFields []string `json:"-"` 359 360 // NullFields is a list of field names (e.g. "ApiVersion") to include in 361 // API requests with the JSON null value. By default, fields with empty 362 // values are omitted from API requests. However, any field with an 363 // empty value appearing in NullFields will be sent to the server as 364 // null. It is an error if a field in this list has a non-empty value. 365 // This may be used to include null fields in Patch requests. 366 NullFields []string `json:"-"` 367} 368 369func (s *GoogleCloudCommonOperationMetadata) MarshalJSON() ([]byte, error) { 370 type NoMethod GoogleCloudCommonOperationMetadata 371 raw := NoMethod(*s) 372 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 373} 374 375// GoogleCloudRedisV1beta1LocationMetadata: This location metadata 376// represents additional configuration options for a given location 377// where a Redis instance may be created. All fields are output only. It 378// is returned as content of the 379// `google.cloud.location.Location.metadata` field. 380type GoogleCloudRedisV1beta1LocationMetadata struct { 381 // AvailableZones: Output only. The set of available zones in the 382 // location. The map is keyed by the lowercase ID of each zone, as 383 // defined by GCE. These keys can be specified in `location_id` or 384 // `alternative_location_id` fields when creating a Redis instance. 385 AvailableZones map[string]GoogleCloudRedisV1beta1ZoneMetadata `json:"availableZones,omitempty"` 386 387 // ForceSendFields is a list of field names (e.g. "AvailableZones") to 388 // unconditionally include in API requests. By default, fields with 389 // empty or default values are omitted from API requests. However, any 390 // non-pointer, non-interface field appearing in ForceSendFields will be 391 // sent to the server regardless of whether the field is empty or not. 392 // This may be used to include empty fields in Patch requests. 393 ForceSendFields []string `json:"-"` 394 395 // NullFields is a list of field names (e.g. "AvailableZones") to 396 // include in API requests with the JSON null value. By default, fields 397 // with empty values are omitted from API requests. However, any field 398 // with an empty value appearing in NullFields will be sent to the 399 // server as null. It is an error if a field in this list has a 400 // non-empty value. This may be used to include null fields in Patch 401 // requests. 402 NullFields []string `json:"-"` 403} 404 405func (s *GoogleCloudRedisV1beta1LocationMetadata) MarshalJSON() ([]byte, error) { 406 type NoMethod GoogleCloudRedisV1beta1LocationMetadata 407 raw := NoMethod(*s) 408 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 409} 410 411// GoogleCloudRedisV1beta1ZoneMetadata: Defines specific information for 412// a particular zone. Currently empty and reserved for future use only. 413type GoogleCloudRedisV1beta1ZoneMetadata struct { 414} 415 416// ImportInstanceRequest: Request for Import. 417type ImportInstanceRequest struct { 418 // InputConfig: Required. Specify data to be imported. 419 InputConfig *InputConfig `json:"inputConfig,omitempty"` 420 421 // ForceSendFields is a list of field names (e.g. "InputConfig") to 422 // unconditionally include in API requests. By default, fields with 423 // empty or default values are omitted from API requests. However, any 424 // non-pointer, non-interface field appearing in ForceSendFields will be 425 // sent to the server regardless of whether the field is empty or not. 426 // This may be used to include empty fields in Patch requests. 427 ForceSendFields []string `json:"-"` 428 429 // NullFields is a list of field names (e.g. "InputConfig") to include 430 // in API requests with the JSON null value. By default, fields with 431 // empty values are omitted from API requests. However, any field with 432 // an empty value appearing in NullFields will be sent to the server as 433 // null. It is an error if a field in this list has a non-empty value. 434 // This may be used to include null fields in Patch requests. 435 NullFields []string `json:"-"` 436} 437 438func (s *ImportInstanceRequest) MarshalJSON() ([]byte, error) { 439 type NoMethod ImportInstanceRequest 440 raw := NoMethod(*s) 441 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 442} 443 444// InputConfig: The input content 445type InputConfig struct { 446 // GcsSource: Google Cloud Storage location where input content is 447 // located. 448 GcsSource *GcsSource `json:"gcsSource,omitempty"` 449 450 // ForceSendFields is a list of field names (e.g. "GcsSource") to 451 // unconditionally include in API requests. By default, fields with 452 // empty or default values are omitted from API requests. However, any 453 // non-pointer, non-interface field appearing in ForceSendFields will be 454 // sent to the server regardless of whether the field is empty or not. 455 // This may be used to include empty fields in Patch requests. 456 ForceSendFields []string `json:"-"` 457 458 // NullFields is a list of field names (e.g. "GcsSource") to include in 459 // API requests with the JSON null value. By default, fields with empty 460 // values are omitted from API requests. However, any field with an 461 // empty value appearing in NullFields will be sent to the server as 462 // null. It is an error if a field in this list has a non-empty value. 463 // This may be used to include null fields in Patch requests. 464 NullFields []string `json:"-"` 465} 466 467func (s *InputConfig) MarshalJSON() ([]byte, error) { 468 type NoMethod InputConfig 469 raw := NoMethod(*s) 470 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 471} 472 473// Instance: A Google Cloud Redis instance. next id = 30 474type Instance struct { 475 // AlternativeLocationId: Optional. Only applicable to STANDARD_HA tier 476 // which protects the instance against zonal failures by provisioning it 477 // across two zones. If provided, it must be a different zone from the 478 // one provided in location_id. 479 AlternativeLocationId string `json:"alternativeLocationId,omitempty"` 480 481 // AuthEnabled: Optional. Indicates whether OSS Redis AUTH is enabled 482 // for the instance. If set to "true" AUTH is enabled on the instance. 483 // Default value is "false" meaning AUTH is disabled. 484 AuthEnabled bool `json:"authEnabled,omitempty"` 485 486 // AuthorizedNetwork: Optional. The full name of the Google Compute 487 // Engine network (https://cloud.google.com/vpc/docs/vpc) to which the 488 // instance is connected. If left unspecified, the `default` network 489 // will be used. 490 AuthorizedNetwork string `json:"authorizedNetwork,omitempty"` 491 492 // ConnectMode: Optional. The network connect mode of the Redis 493 // instance. If not provided, the connect mode defaults to 494 // DIRECT_PEERING. 495 // 496 // Possible values: 497 // "CONNECT_MODE_UNSPECIFIED" - Not set. 498 // "DIRECT_PEERING" - Connect via direct peering to the Memorystore 499 // for Redis hosted service. 500 // "PRIVATE_SERVICE_ACCESS" - Connect your Memorystore for Redis 501 // instance using Private Services Access. Private services access 502 // provides an IP address range for multiple Google Cloud services, 503 // including Memorystore. 504 ConnectMode string `json:"connectMode,omitempty"` 505 506 // CreateTime: Output only. The time the instance was created. 507 CreateTime string `json:"createTime,omitempty"` 508 509 // CurrentLocationId: Output only. The current zone where the Redis 510 // endpoint is placed. For Basic Tier instances, this will always be the 511 // same as the location_id provided by the user at creation time. For 512 // Standard Tier instances, this can be either location_id or 513 // alternative_location_id and can change after a failover event. 514 CurrentLocationId string `json:"currentLocationId,omitempty"` 515 516 // DisplayName: An arbitrary and optional user-provided name for the 517 // instance. 518 DisplayName string `json:"displayName,omitempty"` 519 520 // Host: Output only. Hostname or IP address of the exposed Redis 521 // endpoint used by clients to connect to the service. 522 Host string `json:"host,omitempty"` 523 524 // Labels: Resource labels to represent user provided metadata 525 Labels map[string]string `json:"labels,omitempty"` 526 527 // LocationId: Optional. The zone where the instance will be 528 // provisioned. If not provided, the service will choose a zone for the 529 // instance. For STANDARD_HA tier, instances will be created across two 530 // zones for protection against zonal failures. If 531 // alternative_location_id is also provided, it must be different from 532 // location_id. 533 LocationId string `json:"locationId,omitempty"` 534 535 // MaintenancePolicy: Optional. The maintenance policy for the instance. 536 // If not provided, maintenance events can be performed at any time. 537 MaintenancePolicy *MaintenancePolicy `json:"maintenancePolicy,omitempty"` 538 539 // MaintenanceSchedule: Output only. Date and time of upcoming 540 // maintenance events which have been scheduled. 541 MaintenanceSchedule *MaintenanceSchedule `json:"maintenanceSchedule,omitempty"` 542 543 // MemorySizeGb: Required. Redis memory size in GiB. 544 MemorySizeGb int64 `json:"memorySizeGb,omitempty"` 545 546 // Name: Required. Unique name of the resource in this scope including 547 // project and location using the form: 548 // `projects/{project_id}/locations/{location_id}/instances/{instance_id} 549 // ` Note: Redis instances are managed and addressed at regional level 550 // so location_id here refers to a GCP region; however, users may choose 551 // which specific zone (or collection of zones for cross-zone instances) 552 // an instance should be provisioned in. Refer to location_id and 553 // alternative_location_id fields for more details. 554 Name string `json:"name,omitempty"` 555 556 // PersistenceIamIdentity: Output only. Cloud IAM identity used by 557 // import / export operations to transfer data to/from Cloud Storage. 558 // Format is "serviceAccount:". The value may change over time for a 559 // given instance so should be checked before each import/export 560 // operation. 561 PersistenceIamIdentity string `json:"persistenceIamIdentity,omitempty"` 562 563 // Port: Output only. The port number of the exposed Redis endpoint. 564 Port int64 `json:"port,omitempty"` 565 566 // RedisConfigs: Optional. Redis configuration parameters, according to 567 // http://redis.io/topics/config. Currently, the only supported 568 // parameters are: Redis version 3.2 and newer: * maxmemory-policy * 569 // notify-keyspace-events Redis version 4.0 and newer: * activedefrag * 570 // lfu-decay-time * lfu-log-factor * maxmemory-gb Redis version 5.0 and 571 // newer: * stream-node-max-bytes * stream-node-max-entries 572 RedisConfigs map[string]string `json:"redisConfigs,omitempty"` 573 574 // RedisVersion: Optional. The version of Redis software. If not 575 // provided, latest supported version will be used. Currently, the 576 // supported values are: * `REDIS_3_2` for Redis 3.2 compatibility * 577 // `REDIS_4_0` for Redis 4.0 compatibility (default) * `REDIS_5_0` for 578 // Redis 5.0 compatibility * `REDIS_6_X` for Redis 6.x compatibility 579 RedisVersion string `json:"redisVersion,omitempty"` 580 581 // ReservedIpRange: Optional. For DIRECT_PEERING mode, the CIDR range of 582 // internal addresses that are reserved for this instance. Range must be 583 // unique and non-overlapping with existing subnets in an authorized 584 // network. For PRIVATE_SERVICE_ACCESS mode, the name of one allocated 585 // IP address ranges associated with this private service access 586 // connection. If not provided, the service will choose an unused /29 587 // block, for example, 10.0.0.0/29 or 192.168.0.0/29. 588 ReservedIpRange string `json:"reservedIpRange,omitempty"` 589 590 // ServerCaCerts: Output only. List of server CA certificates for the 591 // instance. 592 ServerCaCerts []*TlsCertificate `json:"serverCaCerts,omitempty"` 593 594 // State: Output only. The current state of this instance. 595 // 596 // Possible values: 597 // "STATE_UNSPECIFIED" - Not set. 598 // "CREATING" - Redis instance is being created. 599 // "READY" - Redis instance has been created and is fully usable. 600 // "UPDATING" - Redis instance configuration is being updated. Certain 601 // kinds of updates may cause the instance to become unusable while the 602 // update is in progress. 603 // "DELETING" - Redis instance is being deleted. 604 // "REPAIRING" - Redis instance is being repaired and may be unusable. 605 // "MAINTENANCE" - Maintenance is being performed on this Redis 606 // instance. 607 // "IMPORTING" - Redis instance is importing data (availability may be 608 // affected). 609 // "FAILING_OVER" - Redis instance is failing over (availability may 610 // be affected). 611 State string `json:"state,omitempty"` 612 613 // StatusMessage: Output only. Additional information about the current 614 // status of this instance, if available. 615 StatusMessage string `json:"statusMessage,omitempty"` 616 617 // Tier: Required. The service tier of the instance. 618 // 619 // Possible values: 620 // "TIER_UNSPECIFIED" - Not set. 621 // "BASIC" - BASIC tier: standalone instance 622 // "STANDARD_HA" - STANDARD_HA tier: highly available primary/replica 623 // instances 624 Tier string `json:"tier,omitempty"` 625 626 // TransitEncryptionMode: Optional. The TLS mode of the Redis instance. 627 // If not provided, TLS is disabled for the instance. 628 // 629 // Possible values: 630 // "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED" - Not set. 631 // "SERVER_AUTHENTICATION" - Client to Server traffic encryption 632 // enabled with server authentication. 633 // "DISABLED" - TLS is disabled for the instance. 634 TransitEncryptionMode string `json:"transitEncryptionMode,omitempty"` 635 636 // ServerResponse contains the HTTP response code and headers from the 637 // server. 638 googleapi.ServerResponse `json:"-"` 639 640 // ForceSendFields is a list of field names (e.g. 641 // "AlternativeLocationId") to unconditionally include in API requests. 642 // By default, fields with empty or default values are omitted from API 643 // requests. However, any non-pointer, non-interface field appearing in 644 // ForceSendFields will be sent to the server regardless of whether the 645 // field is empty or not. This may be used to include empty fields in 646 // Patch requests. 647 ForceSendFields []string `json:"-"` 648 649 // NullFields is a list of field names (e.g. "AlternativeLocationId") to 650 // include in API requests with the JSON null value. By default, fields 651 // with empty values are omitted from API requests. However, any field 652 // with an empty value appearing in NullFields will be sent to the 653 // server as null. It is an error if a field in this list has a 654 // non-empty value. This may be used to include null fields in Patch 655 // requests. 656 NullFields []string `json:"-"` 657} 658 659func (s *Instance) MarshalJSON() ([]byte, error) { 660 type NoMethod Instance 661 raw := NoMethod(*s) 662 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 663} 664 665// InstanceAuthString: Instance AUTH string details. 666type InstanceAuthString struct { 667 // AuthString: AUTH string set on the instance. 668 AuthString string `json:"authString,omitempty"` 669 670 // ServerResponse contains the HTTP response code and headers from the 671 // server. 672 googleapi.ServerResponse `json:"-"` 673 674 // ForceSendFields is a list of field names (e.g. "AuthString") to 675 // unconditionally include in API requests. By default, fields with 676 // empty or default values are omitted from API requests. However, any 677 // non-pointer, non-interface field appearing in ForceSendFields will be 678 // sent to the server regardless of whether the field is empty or not. 679 // This may be used to include empty fields in Patch requests. 680 ForceSendFields []string `json:"-"` 681 682 // NullFields is a list of field names (e.g. "AuthString") to include in 683 // API requests with the JSON null value. By default, fields with empty 684 // values are omitted from API requests. However, any field with an 685 // empty value appearing in NullFields will be sent to the server as 686 // null. It is an error if a field in this list has a non-empty value. 687 // This may be used to include null fields in Patch requests. 688 NullFields []string `json:"-"` 689} 690 691func (s *InstanceAuthString) MarshalJSON() ([]byte, error) { 692 type NoMethod InstanceAuthString 693 raw := NoMethod(*s) 694 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 695} 696 697// ListInstancesResponse: Response for ListInstances. 698type ListInstancesResponse struct { 699 // Instances: A list of Redis instances in the project in the specified 700 // location, or across all locations. If the `location_id` in the parent 701 // field of the request is "-", all regions available to the project are 702 // queried, and the results aggregated. If in such an aggregated query a 703 // location is unavailable, a placeholder Redis entry is included in the 704 // response with the `name` field set to a value of the form 705 // `projects/{project_id}/locations/{location_id}/instances/`- and the 706 // `status` field set to ERROR and `status_message` field set to 707 // "location not available for ListInstances". 708 Instances []*Instance `json:"instances,omitempty"` 709 710 // NextPageToken: Token to retrieve the next page of results, or empty 711 // if there are no more results in the list. 712 NextPageToken string `json:"nextPageToken,omitempty"` 713 714 // Unreachable: Locations that could not be reached. 715 Unreachable []string `json:"unreachable,omitempty"` 716 717 // ServerResponse contains the HTTP response code and headers from the 718 // server. 719 googleapi.ServerResponse `json:"-"` 720 721 // ForceSendFields is a list of field names (e.g. "Instances") to 722 // unconditionally include in API requests. By default, fields with 723 // empty or default values are omitted from API requests. However, any 724 // non-pointer, non-interface field appearing in ForceSendFields will be 725 // sent to the server regardless of whether the field is empty or not. 726 // This may be used to include empty fields in Patch requests. 727 ForceSendFields []string `json:"-"` 728 729 // NullFields is a list of field names (e.g. "Instances") to include in 730 // API requests with the JSON null value. By default, fields with empty 731 // values are omitted from API requests. However, any field with an 732 // empty value appearing in NullFields will be sent to the server as 733 // null. It is an error if a field in this list has a non-empty value. 734 // This may be used to include null fields in Patch requests. 735 NullFields []string `json:"-"` 736} 737 738func (s *ListInstancesResponse) MarshalJSON() ([]byte, error) { 739 type NoMethod ListInstancesResponse 740 raw := NoMethod(*s) 741 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 742} 743 744// ListLocationsResponse: The response message for 745// Locations.ListLocations. 746type ListLocationsResponse struct { 747 // Locations: A list of locations that matches the specified filter in 748 // the request. 749 Locations []*Location `json:"locations,omitempty"` 750 751 // NextPageToken: The standard List next-page token. 752 NextPageToken string `json:"nextPageToken,omitempty"` 753 754 // ServerResponse contains the HTTP response code and headers from the 755 // server. 756 googleapi.ServerResponse `json:"-"` 757 758 // ForceSendFields is a list of field names (e.g. "Locations") to 759 // unconditionally include in API requests. By default, fields with 760 // empty or default values are omitted from API requests. However, any 761 // non-pointer, non-interface field appearing in ForceSendFields will be 762 // sent to the server regardless of whether the field is empty or not. 763 // This may be used to include empty fields in Patch requests. 764 ForceSendFields []string `json:"-"` 765 766 // NullFields is a list of field names (e.g. "Locations") to include in 767 // API requests with the JSON null value. By default, fields with empty 768 // values are omitted from API requests. However, any field with an 769 // empty value appearing in NullFields will be sent to the server as 770 // null. It is an error if a field in this list has a non-empty value. 771 // This may be used to include null fields in Patch requests. 772 NullFields []string `json:"-"` 773} 774 775func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) { 776 type NoMethod ListLocationsResponse 777 raw := NoMethod(*s) 778 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 779} 780 781// ListOperationsResponse: The response message for 782// Operations.ListOperations. 783type ListOperationsResponse struct { 784 // NextPageToken: The standard List next-page token. 785 NextPageToken string `json:"nextPageToken,omitempty"` 786 787 // Operations: A list of operations that matches the specified filter in 788 // the request. 789 Operations []*Operation `json:"operations,omitempty"` 790 791 // ServerResponse contains the HTTP response code and headers from the 792 // server. 793 googleapi.ServerResponse `json:"-"` 794 795 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 796 // unconditionally include in API requests. By default, fields with 797 // empty or default values are omitted from API requests. However, any 798 // non-pointer, non-interface field appearing in ForceSendFields will be 799 // sent to the server regardless of whether the field is empty or not. 800 // This may be used to include empty fields in Patch requests. 801 ForceSendFields []string `json:"-"` 802 803 // NullFields is a list of field names (e.g. "NextPageToken") to include 804 // in API requests with the JSON null value. By default, fields with 805 // empty values are omitted from API requests. However, any field with 806 // an empty value appearing in NullFields will be sent to the server as 807 // null. It is an error if a field in this list has a non-empty value. 808 // This may be used to include null fields in Patch requests. 809 NullFields []string `json:"-"` 810} 811 812func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 813 type NoMethod ListOperationsResponse 814 raw := NoMethod(*s) 815 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 816} 817 818// Location: A resource that represents Google Cloud Platform location. 819type Location struct { 820 // DisplayName: The friendly name for this location, typically a nearby 821 // city name. For example, "Tokyo". 822 DisplayName string `json:"displayName,omitempty"` 823 824 // Labels: Cross-service attributes for the location. For example 825 // {"cloud.googleapis.com/region": "us-east1"} 826 Labels map[string]string `json:"labels,omitempty"` 827 828 // LocationId: Resource ID for the region. For example: "us-east1". 829 LocationId string `json:"locationId,omitempty"` 830 831 // Metadata: Output only. The set of available zones in the location. 832 // The map is keyed by the lowercase ID of each zone, as defined by 833 // Compute Engine. These keys can be specified in `location_id` or 834 // `alternative_location_id` fields when creating a Redis instance. 835 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 836 837 // Name: Full resource name for the region. For example: 838 // "projects/example-project/locations/us-east1". 839 Name string `json:"name,omitempty"` 840 841 // ServerResponse contains the HTTP response code and headers from the 842 // server. 843 googleapi.ServerResponse `json:"-"` 844 845 // ForceSendFields is a list of field names (e.g. "DisplayName") to 846 // unconditionally include in API requests. By default, fields with 847 // empty or default values are omitted from API requests. However, any 848 // non-pointer, non-interface field appearing in ForceSendFields will be 849 // sent to the server regardless of whether the field is empty or not. 850 // This may be used to include empty fields in Patch requests. 851 ForceSendFields []string `json:"-"` 852 853 // NullFields is a list of field names (e.g. "DisplayName") to include 854 // in API requests with the JSON null value. By default, fields with 855 // empty values are omitted from API requests. However, any field with 856 // an empty value appearing in NullFields will be sent to the server as 857 // null. It is an error if a field in this list has a non-empty value. 858 // This may be used to include null fields in Patch requests. 859 NullFields []string `json:"-"` 860} 861 862func (s *Location) MarshalJSON() ([]byte, error) { 863 type NoMethod Location 864 raw := NoMethod(*s) 865 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 866} 867 868// MaintenancePolicy: Maintenance policy for an instance. 869type MaintenancePolicy struct { 870 // CreateTime: Output only. The time when the policy was created. 871 CreateTime string `json:"createTime,omitempty"` 872 873 // Description: Optional. Description of what this policy is for. 874 // Create/Update methods return INVALID_ARGUMENT if the length is 875 // greater than 512. 876 Description string `json:"description,omitempty"` 877 878 // UpdateTime: Output only. The time when the policy was last updated. 879 UpdateTime string `json:"updateTime,omitempty"` 880 881 // WeeklyMaintenanceWindow: Optional. Maintenance window that is applied 882 // to resources covered by this policy. Minimum 1. For the current 883 // version, the maximum number of weekly_window is expected to be one. 884 WeeklyMaintenanceWindow []*WeeklyMaintenanceWindow `json:"weeklyMaintenanceWindow,omitempty"` 885 886 // ForceSendFields is a list of field names (e.g. "CreateTime") to 887 // unconditionally include in API requests. By default, fields with 888 // empty or default values are omitted from API requests. However, any 889 // non-pointer, non-interface field appearing in ForceSendFields will be 890 // sent to the server regardless of whether the field is empty or not. 891 // This may be used to include empty fields in Patch requests. 892 ForceSendFields []string `json:"-"` 893 894 // NullFields is a list of field names (e.g. "CreateTime") to include in 895 // API requests with the JSON null value. By default, fields with empty 896 // values are omitted from API requests. However, any field with an 897 // empty value appearing in NullFields will be sent to the server as 898 // null. It is an error if a field in this list has a non-empty value. 899 // This may be used to include null fields in Patch requests. 900 NullFields []string `json:"-"` 901} 902 903func (s *MaintenancePolicy) MarshalJSON() ([]byte, error) { 904 type NoMethod MaintenancePolicy 905 raw := NoMethod(*s) 906 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 907} 908 909// MaintenanceSchedule: Upcoming maintenance schedule. If no maintenance 910// is scheduled, fields are not populated. 911type MaintenanceSchedule struct { 912 // CanReschedule: If the scheduled maintenance can be rescheduled, 913 // default is true. 914 CanReschedule bool `json:"canReschedule,omitempty"` 915 916 // EndTime: Output only. The end time of any upcoming scheduled 917 // maintenance for this instance. 918 EndTime string `json:"endTime,omitempty"` 919 920 // ScheduleDeadlineTime: Output only. The time deadline any schedule 921 // start time cannot go beyond, including reschedule. 922 ScheduleDeadlineTime string `json:"scheduleDeadlineTime,omitempty"` 923 924 // StartTime: Output only. The start time of any upcoming scheduled 925 // maintenance for this instance. 926 StartTime string `json:"startTime,omitempty"` 927 928 // ForceSendFields is a list of field names (e.g. "CanReschedule") to 929 // unconditionally include in API requests. By default, fields with 930 // empty or default values are omitted from API requests. However, any 931 // non-pointer, non-interface field appearing in ForceSendFields will be 932 // sent to the server regardless of whether the field is empty or not. 933 // This may be used to include empty fields in Patch requests. 934 ForceSendFields []string `json:"-"` 935 936 // NullFields is a list of field names (e.g. "CanReschedule") to include 937 // in API requests with the JSON null value. By default, fields with 938 // empty values are omitted from API requests. However, any field with 939 // an empty value appearing in NullFields will be sent to the server as 940 // null. It is an error if a field in this list has a non-empty value. 941 // This may be used to include null fields in Patch requests. 942 NullFields []string `json:"-"` 943} 944 945func (s *MaintenanceSchedule) MarshalJSON() ([]byte, error) { 946 type NoMethod MaintenanceSchedule 947 raw := NoMethod(*s) 948 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 949} 950 951// Operation: This resource represents a long-running operation that is 952// the result of a network API call. 953type Operation struct { 954 // Done: If the value is `false`, it means the operation is still in 955 // progress. If `true`, the operation is completed, and either `error` 956 // or `response` is available. 957 Done bool `json:"done,omitempty"` 958 959 // Error: The error result of the operation in case of failure or 960 // cancellation. 961 Error *Status `json:"error,omitempty"` 962 963 // Metadata: { `createTime`: The time the operation was created. 964 // `endTime`: The time the operation finished running. `target`: 965 // Server-defined resource path for the target of the operation. `verb`: 966 // Name of the verb executed by the operation. `statusDetail`: 967 // Human-readable status of the operation, if any. `cancelRequested`: 968 // Identifies whether the user has requested cancellation of the 969 // operation. Operations that have successfully been cancelled have 970 // Operation.error value with a google.rpc.Status.code of 1, 971 // corresponding to `Code.CANCELLED`. `apiVersion`: API version used to 972 // start the operation. } 973 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 974 975 // Name: The server-assigned name, which is only unique within the same 976 // service that originally returns it. If you use the default HTTP 977 // mapping, the `name` should be a resource name ending with 978 // `operations/{unique_id}`. 979 Name string `json:"name,omitempty"` 980 981 // Response: The normal response of the operation in case of success. If 982 // the original method returns no data on success, such as `Delete`, the 983 // response is `google.protobuf.Empty`. If the original method is 984 // standard `Get`/`Create`/`Update`, the response should be the 985 // resource. For other methods, the response should have the type 986 // `XxxResponse`, where `Xxx` is the original method name. For example, 987 // if the original method name is `TakeSnapshot()`, the inferred 988 // response type is `TakeSnapshotResponse`. 989 Response googleapi.RawMessage `json:"response,omitempty"` 990 991 // ServerResponse contains the HTTP response code and headers from the 992 // server. 993 googleapi.ServerResponse `json:"-"` 994 995 // ForceSendFields is a list of field names (e.g. "Done") to 996 // unconditionally include in API requests. By default, fields with 997 // empty or default values are omitted from API requests. However, any 998 // non-pointer, non-interface field appearing in ForceSendFields will be 999 // sent to the server regardless of whether the field is empty or not. 1000 // This may be used to include empty fields in Patch requests. 1001 ForceSendFields []string `json:"-"` 1002 1003 // NullFields is a list of field names (e.g. "Done") to include in API 1004 // requests with the JSON null value. By default, fields with empty 1005 // values are omitted from API requests. However, any field with an 1006 // empty value appearing in NullFields will be sent to the server as 1007 // null. It is an error if a field in this list has a non-empty value. 1008 // This may be used to include null fields in Patch requests. 1009 NullFields []string `json:"-"` 1010} 1011 1012func (s *Operation) MarshalJSON() ([]byte, error) { 1013 type NoMethod Operation 1014 raw := NoMethod(*s) 1015 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1016} 1017 1018// OutputConfig: The output content 1019type OutputConfig struct { 1020 // GcsDestination: Google Cloud Storage destination for output content. 1021 GcsDestination *GcsDestination `json:"gcsDestination,omitempty"` 1022 1023 // ForceSendFields is a list of field names (e.g. "GcsDestination") to 1024 // unconditionally include in API requests. By default, fields with 1025 // empty or default values are omitted from API requests. However, any 1026 // non-pointer, non-interface field appearing in ForceSendFields will be 1027 // sent to the server regardless of whether the field is empty or not. 1028 // This may be used to include empty fields in Patch requests. 1029 ForceSendFields []string `json:"-"` 1030 1031 // NullFields is a list of field names (e.g. "GcsDestination") to 1032 // include in API requests with the JSON null value. By default, fields 1033 // with empty values are omitted from API requests. However, any field 1034 // with an empty value appearing in NullFields will be sent to the 1035 // server as null. It is an error if a field in this list has a 1036 // non-empty value. This may be used to include null fields in Patch 1037 // requests. 1038 NullFields []string `json:"-"` 1039} 1040 1041func (s *OutputConfig) MarshalJSON() ([]byte, error) { 1042 type NoMethod OutputConfig 1043 raw := NoMethod(*s) 1044 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1045} 1046 1047// RescheduleMaintenanceRequest: Request for RescheduleMaintenance. 1048type RescheduleMaintenanceRequest struct { 1049 // RescheduleType: Required. If reschedule type is SPECIFIC_TIME, must 1050 // set up schedule_time as well. 1051 // 1052 // Possible values: 1053 // "RESCHEDULE_TYPE_UNSPECIFIED" - Not set. 1054 // "IMMEDIATE" - If the user wants to schedule the maintenance to 1055 // happen now. 1056 // "NEXT_AVAILABLE_WINDOW" - If the user wants to use the existing 1057 // maintenance policy to find the next available window. 1058 // "SPECIFIC_TIME" - If the user wants to reschedule the maintenance 1059 // to a specific time. 1060 RescheduleType string `json:"rescheduleType,omitempty"` 1061 1062 // ScheduleTime: Optional. Timestamp when the maintenance shall be 1063 // rescheduled to if reschedule_type=SPECIFIC_TIME, in RFC 3339 format, 1064 // for example `2012-11-15T16:19:00.094Z`. 1065 ScheduleTime string `json:"scheduleTime,omitempty"` 1066 1067 // ForceSendFields is a list of field names (e.g. "RescheduleType") to 1068 // unconditionally include in API requests. By default, fields with 1069 // empty or default values are omitted from API requests. However, any 1070 // non-pointer, non-interface field appearing in ForceSendFields will be 1071 // sent to the server regardless of whether the field is empty or not. 1072 // This may be used to include empty fields in Patch requests. 1073 ForceSendFields []string `json:"-"` 1074 1075 // NullFields is a list of field names (e.g. "RescheduleType") to 1076 // include in API requests with the JSON null value. By default, fields 1077 // with empty values are omitted from API requests. However, any field 1078 // with an empty value appearing in NullFields will be sent to the 1079 // server as null. It is an error if a field in this list has a 1080 // non-empty value. This may be used to include null fields in Patch 1081 // requests. 1082 NullFields []string `json:"-"` 1083} 1084 1085func (s *RescheduleMaintenanceRequest) MarshalJSON() ([]byte, error) { 1086 type NoMethod RescheduleMaintenanceRequest 1087 raw := NoMethod(*s) 1088 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1089} 1090 1091// Status: The `Status` type defines a logical error model that is 1092// suitable for different programming environments, including REST APIs 1093// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 1094// `Status` message contains three pieces of data: error code, error 1095// message, and error details. You can find out more about this error 1096// model and how to work with it in the API Design Guide 1097// (https://cloud.google.com/apis/design/errors). 1098type Status struct { 1099 // Code: The status code, which should be an enum value of 1100 // google.rpc.Code. 1101 Code int64 `json:"code,omitempty"` 1102 1103 // Details: A list of messages that carry the error details. There is a 1104 // common set of message types for APIs to use. 1105 Details []googleapi.RawMessage `json:"details,omitempty"` 1106 1107 // Message: A developer-facing error message, which should be in 1108 // English. Any user-facing error message should be localized and sent 1109 // in the google.rpc.Status.details field, or localized by the client. 1110 Message string `json:"message,omitempty"` 1111 1112 // ForceSendFields is a list of field names (e.g. "Code") to 1113 // unconditionally include in API requests. By default, fields with 1114 // empty or default values are omitted from API requests. However, any 1115 // non-pointer, non-interface field appearing in ForceSendFields will be 1116 // sent to the server regardless of whether the field is empty or not. 1117 // This may be used to include empty fields in Patch requests. 1118 ForceSendFields []string `json:"-"` 1119 1120 // NullFields is a list of field names (e.g. "Code") to include in API 1121 // requests with the JSON null value. By default, fields with empty 1122 // values are omitted from API requests. However, any field with an 1123 // empty value appearing in NullFields will be sent to the server as 1124 // null. It is an error if a field in this list has a non-empty value. 1125 // This may be used to include null fields in Patch requests. 1126 NullFields []string `json:"-"` 1127} 1128 1129func (s *Status) MarshalJSON() ([]byte, error) { 1130 type NoMethod Status 1131 raw := NoMethod(*s) 1132 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1133} 1134 1135// TimeOfDay: Represents a time of day. The date and time zone are 1136// either not significant or are specified elsewhere. An API may choose 1137// to allow leap seconds. Related types are google.type.Date and 1138// `google.protobuf.Timestamp`. 1139type TimeOfDay struct { 1140 // Hours: Hours of day in 24 hour format. Should be from 0 to 23. An API 1141 // may choose to allow the value "24:00:00" for scenarios like business 1142 // closing time. 1143 Hours int64 `json:"hours,omitempty"` 1144 1145 // Minutes: Minutes of hour of day. Must be from 0 to 59. 1146 Minutes int64 `json:"minutes,omitempty"` 1147 1148 // Nanos: Fractions of seconds in nanoseconds. Must be from 0 to 1149 // 999,999,999. 1150 Nanos int64 `json:"nanos,omitempty"` 1151 1152 // Seconds: Seconds of minutes of the time. Must normally be from 0 to 1153 // 59. An API may allow the value 60 if it allows leap-seconds. 1154 Seconds int64 `json:"seconds,omitempty"` 1155 1156 // ForceSendFields is a list of field names (e.g. "Hours") to 1157 // unconditionally include in API requests. By default, fields with 1158 // empty or default values are omitted from API requests. However, any 1159 // non-pointer, non-interface field appearing in ForceSendFields will be 1160 // sent to the server regardless of whether the field is empty or not. 1161 // This may be used to include empty fields in Patch requests. 1162 ForceSendFields []string `json:"-"` 1163 1164 // NullFields is a list of field names (e.g. "Hours") to include in API 1165 // requests with the JSON null value. By default, fields with empty 1166 // values are omitted from API requests. However, any field with an 1167 // empty value appearing in NullFields will be sent to the server as 1168 // null. It is an error if a field in this list has a non-empty value. 1169 // This may be used to include null fields in Patch requests. 1170 NullFields []string `json:"-"` 1171} 1172 1173func (s *TimeOfDay) MarshalJSON() ([]byte, error) { 1174 type NoMethod TimeOfDay 1175 raw := NoMethod(*s) 1176 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1177} 1178 1179// TlsCertificate: TlsCertificate Resource 1180type TlsCertificate struct { 1181 // Cert: PEM representation. 1182 Cert string `json:"cert,omitempty"` 1183 1184 // CreateTime: Output only. The time when the certificate was created in 1185 // RFC 3339 (https://tools.ietf.org/html/rfc3339) format, for example 1186 // `2020-05-18T00:00:00.094Z`. 1187 CreateTime string `json:"createTime,omitempty"` 1188 1189 // ExpireTime: Output only. The time when the certificate expires in RFC 1190 // 3339 (https://tools.ietf.org/html/rfc3339) format, for example 1191 // `2020-05-18T00:00:00.094Z`. 1192 ExpireTime string `json:"expireTime,omitempty"` 1193 1194 // SerialNumber: Serial number, as extracted from the certificate. 1195 SerialNumber string `json:"serialNumber,omitempty"` 1196 1197 // Sha1Fingerprint: Sha1 Fingerprint of the certificate. 1198 Sha1Fingerprint string `json:"sha1Fingerprint,omitempty"` 1199 1200 // ForceSendFields is a list of field names (e.g. "Cert") to 1201 // unconditionally include in API requests. By default, fields with 1202 // empty or default values are omitted from API requests. However, any 1203 // non-pointer, non-interface field appearing in ForceSendFields will be 1204 // sent to the server regardless of whether the field is empty or not. 1205 // This may be used to include empty fields in Patch requests. 1206 ForceSendFields []string `json:"-"` 1207 1208 // NullFields is a list of field names (e.g. "Cert") to include in API 1209 // requests with the JSON null value. By default, fields with empty 1210 // values are omitted from API requests. However, any field with an 1211 // empty value appearing in NullFields will be sent to the server as 1212 // null. It is an error if a field in this list has a non-empty value. 1213 // This may be used to include null fields in Patch requests. 1214 NullFields []string `json:"-"` 1215} 1216 1217func (s *TlsCertificate) MarshalJSON() ([]byte, error) { 1218 type NoMethod TlsCertificate 1219 raw := NoMethod(*s) 1220 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1221} 1222 1223// UpgradeInstanceRequest: Request for UpgradeInstance. 1224type UpgradeInstanceRequest struct { 1225 // RedisVersion: Required. Specifies the target version of Redis 1226 // software to upgrade to. 1227 RedisVersion string `json:"redisVersion,omitempty"` 1228 1229 // ForceSendFields is a list of field names (e.g. "RedisVersion") to 1230 // unconditionally include in API requests. By default, fields with 1231 // empty or default values are omitted from API requests. However, any 1232 // non-pointer, non-interface field appearing in ForceSendFields will be 1233 // sent to the server regardless of whether the field is empty or not. 1234 // This may be used to include empty fields in Patch requests. 1235 ForceSendFields []string `json:"-"` 1236 1237 // NullFields is a list of field names (e.g. "RedisVersion") to include 1238 // in API requests with the JSON null value. By default, fields with 1239 // empty values are omitted from API requests. However, any field with 1240 // an empty value appearing in NullFields will be sent to the server as 1241 // null. It is an error if a field in this list has a non-empty value. 1242 // This may be used to include null fields in Patch requests. 1243 NullFields []string `json:"-"` 1244} 1245 1246func (s *UpgradeInstanceRequest) MarshalJSON() ([]byte, error) { 1247 type NoMethod UpgradeInstanceRequest 1248 raw := NoMethod(*s) 1249 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1250} 1251 1252// WeeklyMaintenanceWindow: Time window in which disruptive maintenance 1253// updates occur. Non-disruptive updates can occur inside or outside 1254// this window. 1255type WeeklyMaintenanceWindow struct { 1256 // Day: Required. The day of week that maintenance updates occur. 1257 // 1258 // Possible values: 1259 // "DAY_OF_WEEK_UNSPECIFIED" - The day of the week is unspecified. 1260 // "MONDAY" - Monday 1261 // "TUESDAY" - Tuesday 1262 // "WEDNESDAY" - Wednesday 1263 // "THURSDAY" - Thursday 1264 // "FRIDAY" - Friday 1265 // "SATURDAY" - Saturday 1266 // "SUNDAY" - Sunday 1267 Day string `json:"day,omitempty"` 1268 1269 // Duration: Output only. Duration of the maintenance window. The 1270 // current window is fixed at 1 hour. 1271 Duration string `json:"duration,omitempty"` 1272 1273 // StartTime: Required. Start time of the window in UTC time. 1274 StartTime *TimeOfDay `json:"startTime,omitempty"` 1275 1276 // ForceSendFields is a list of field names (e.g. "Day") to 1277 // unconditionally include in API requests. By default, fields with 1278 // empty or default values are omitted from API requests. However, any 1279 // non-pointer, non-interface field appearing in ForceSendFields will be 1280 // sent to the server regardless of whether the field is empty or not. 1281 // This may be used to include empty fields in Patch requests. 1282 ForceSendFields []string `json:"-"` 1283 1284 // NullFields is a list of field names (e.g. "Day") to include in API 1285 // requests with the JSON null value. By default, fields with empty 1286 // values are omitted from API requests. However, any field with an 1287 // empty value appearing in NullFields will be sent to the server as 1288 // null. It is an error if a field in this list has a non-empty value. 1289 // This may be used to include null fields in Patch requests. 1290 NullFields []string `json:"-"` 1291} 1292 1293func (s *WeeklyMaintenanceWindow) MarshalJSON() ([]byte, error) { 1294 type NoMethod WeeklyMaintenanceWindow 1295 raw := NoMethod(*s) 1296 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1297} 1298 1299// method id "redis.projects.locations.get": 1300 1301type ProjectsLocationsGetCall struct { 1302 s *Service 1303 name string 1304 urlParams_ gensupport.URLParams 1305 ifNoneMatch_ string 1306 ctx_ context.Context 1307 header_ http.Header 1308} 1309 1310// Get: Gets information about a location. 1311// 1312// - name: Resource name for the location. 1313func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall { 1314 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1315 c.name = name 1316 return c 1317} 1318 1319// Fields allows partial responses to be retrieved. See 1320// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1321// for more information. 1322func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall { 1323 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1324 return c 1325} 1326 1327// IfNoneMatch sets the optional parameter which makes the operation 1328// fail if the object's ETag matches the given value. This is useful for 1329// getting updates only after the object has changed since the last 1330// request. Use googleapi.IsNotModified to check whether the response 1331// error from Do is the result of In-None-Match. 1332func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall { 1333 c.ifNoneMatch_ = entityTag 1334 return c 1335} 1336 1337// Context sets the context to be used in this call's Do method. Any 1338// pending HTTP request will be aborted if the provided context is 1339// canceled. 1340func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall { 1341 c.ctx_ = ctx 1342 return c 1343} 1344 1345// Header returns an http.Header that can be modified by the caller to 1346// add HTTP headers to the request. 1347func (c *ProjectsLocationsGetCall) Header() http.Header { 1348 if c.header_ == nil { 1349 c.header_ = make(http.Header) 1350 } 1351 return c.header_ 1352} 1353 1354func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) { 1355 reqHeaders := make(http.Header) 1356 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 1357 for k, v := range c.header_ { 1358 reqHeaders[k] = v 1359 } 1360 reqHeaders.Set("User-Agent", c.s.userAgent()) 1361 if c.ifNoneMatch_ != "" { 1362 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1363 } 1364 var body io.Reader = nil 1365 c.urlParams_.Set("alt", alt) 1366 c.urlParams_.Set("prettyPrint", "false") 1367 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 1368 urls += "?" + c.urlParams_.Encode() 1369 req, err := http.NewRequest("GET", urls, body) 1370 if err != nil { 1371 return nil, err 1372 } 1373 req.Header = reqHeaders 1374 googleapi.Expand(req.URL, map[string]string{ 1375 "name": c.name, 1376 }) 1377 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1378} 1379 1380// Do executes the "redis.projects.locations.get" call. 1381// Exactly one of *Location or error will be non-nil. Any non-2xx status 1382// code is an error. Response headers are in either 1383// *Location.ServerResponse.Header or (if a response was returned at 1384// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1385// to check whether the returned error was because 1386// http.StatusNotModified was returned. 1387func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) { 1388 gensupport.SetOptions(c.urlParams_, opts...) 1389 res, err := c.doRequest("json") 1390 if res != nil && res.StatusCode == http.StatusNotModified { 1391 if res.Body != nil { 1392 res.Body.Close() 1393 } 1394 return nil, &googleapi.Error{ 1395 Code: res.StatusCode, 1396 Header: res.Header, 1397 } 1398 } 1399 if err != nil { 1400 return nil, err 1401 } 1402 defer googleapi.CloseBody(res) 1403 if err := googleapi.CheckResponse(res); err != nil { 1404 return nil, err 1405 } 1406 ret := &Location{ 1407 ServerResponse: googleapi.ServerResponse{ 1408 Header: res.Header, 1409 HTTPStatusCode: res.StatusCode, 1410 }, 1411 } 1412 target := &ret 1413 if err := gensupport.DecodeResponse(target, res); err != nil { 1414 return nil, err 1415 } 1416 return ret, nil 1417 // { 1418 // "description": "Gets information about a location.", 1419 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}", 1420 // "httpMethod": "GET", 1421 // "id": "redis.projects.locations.get", 1422 // "parameterOrder": [ 1423 // "name" 1424 // ], 1425 // "parameters": { 1426 // "name": { 1427 // "description": "Resource name for the location.", 1428 // "location": "path", 1429 // "pattern": "^projects/[^/]+/locations/[^/]+$", 1430 // "required": true, 1431 // "type": "string" 1432 // } 1433 // }, 1434 // "path": "v1beta1/{+name}", 1435 // "response": { 1436 // "$ref": "Location" 1437 // }, 1438 // "scopes": [ 1439 // "https://www.googleapis.com/auth/cloud-platform" 1440 // ] 1441 // } 1442 1443} 1444 1445// method id "redis.projects.locations.list": 1446 1447type ProjectsLocationsListCall struct { 1448 s *Service 1449 name string 1450 urlParams_ gensupport.URLParams 1451 ifNoneMatch_ string 1452 ctx_ context.Context 1453 header_ http.Header 1454} 1455 1456// List: Lists information about the supported locations for this 1457// service. 1458// 1459// - name: The resource that owns the locations collection, if 1460// applicable. 1461func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall { 1462 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1463 c.name = name 1464 return c 1465} 1466 1467// Filter sets the optional parameter "filter": A filter to narrow down 1468// results to a preferred subset. The filtering language accepts strings 1469// like "displayName=tokyo", and is documented in more detail in AIP-160 1470// (https://google.aip.dev/160). 1471func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall { 1472 c.urlParams_.Set("filter", filter) 1473 return c 1474} 1475 1476// PageSize sets the optional parameter "pageSize": The maximum number 1477// of results to return. If not set, the service selects a default. 1478func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall { 1479 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1480 return c 1481} 1482 1483// PageToken sets the optional parameter "pageToken": A page token 1484// received from the `next_page_token` field in the response. Send that 1485// page token to receive the subsequent page. 1486func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall { 1487 c.urlParams_.Set("pageToken", pageToken) 1488 return c 1489} 1490 1491// Fields allows partial responses to be retrieved. See 1492// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1493// for more information. 1494func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall { 1495 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1496 return c 1497} 1498 1499// IfNoneMatch sets the optional parameter which makes the operation 1500// fail if the object's ETag matches the given value. This is useful for 1501// getting updates only after the object has changed since the last 1502// request. Use googleapi.IsNotModified to check whether the response 1503// error from Do is the result of In-None-Match. 1504func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall { 1505 c.ifNoneMatch_ = entityTag 1506 return c 1507} 1508 1509// Context sets the context to be used in this call's Do method. Any 1510// pending HTTP request will be aborted if the provided context is 1511// canceled. 1512func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall { 1513 c.ctx_ = ctx 1514 return c 1515} 1516 1517// Header returns an http.Header that can be modified by the caller to 1518// add HTTP headers to the request. 1519func (c *ProjectsLocationsListCall) Header() http.Header { 1520 if c.header_ == nil { 1521 c.header_ = make(http.Header) 1522 } 1523 return c.header_ 1524} 1525 1526func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { 1527 reqHeaders := make(http.Header) 1528 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 1529 for k, v := range c.header_ { 1530 reqHeaders[k] = v 1531 } 1532 reqHeaders.Set("User-Agent", c.s.userAgent()) 1533 if c.ifNoneMatch_ != "" { 1534 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1535 } 1536 var body io.Reader = nil 1537 c.urlParams_.Set("alt", alt) 1538 c.urlParams_.Set("prettyPrint", "false") 1539 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations") 1540 urls += "?" + c.urlParams_.Encode() 1541 req, err := http.NewRequest("GET", urls, body) 1542 if err != nil { 1543 return nil, err 1544 } 1545 req.Header = reqHeaders 1546 googleapi.Expand(req.URL, map[string]string{ 1547 "name": c.name, 1548 }) 1549 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1550} 1551 1552// Do executes the "redis.projects.locations.list" call. 1553// Exactly one of *ListLocationsResponse or error will be non-nil. Any 1554// non-2xx status code is an error. Response headers are in either 1555// *ListLocationsResponse.ServerResponse.Header or (if a response was 1556// returned at all) in error.(*googleapi.Error).Header. Use 1557// googleapi.IsNotModified to check whether the returned error was 1558// because http.StatusNotModified was returned. 1559func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { 1560 gensupport.SetOptions(c.urlParams_, opts...) 1561 res, err := c.doRequest("json") 1562 if res != nil && res.StatusCode == http.StatusNotModified { 1563 if res.Body != nil { 1564 res.Body.Close() 1565 } 1566 return nil, &googleapi.Error{ 1567 Code: res.StatusCode, 1568 Header: res.Header, 1569 } 1570 } 1571 if err != nil { 1572 return nil, err 1573 } 1574 defer googleapi.CloseBody(res) 1575 if err := googleapi.CheckResponse(res); err != nil { 1576 return nil, err 1577 } 1578 ret := &ListLocationsResponse{ 1579 ServerResponse: googleapi.ServerResponse{ 1580 Header: res.Header, 1581 HTTPStatusCode: res.StatusCode, 1582 }, 1583 } 1584 target := &ret 1585 if err := gensupport.DecodeResponse(target, res); err != nil { 1586 return nil, err 1587 } 1588 return ret, nil 1589 // { 1590 // "description": "Lists information about the supported locations for this service.", 1591 // "flatPath": "v1beta1/projects/{projectsId}/locations", 1592 // "httpMethod": "GET", 1593 // "id": "redis.projects.locations.list", 1594 // "parameterOrder": [ 1595 // "name" 1596 // ], 1597 // "parameters": { 1598 // "filter": { 1599 // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in [AIP-160](https://google.aip.dev/160).", 1600 // "location": "query", 1601 // "type": "string" 1602 // }, 1603 // "name": { 1604 // "description": "The resource that owns the locations collection, if applicable.", 1605 // "location": "path", 1606 // "pattern": "^projects/[^/]+$", 1607 // "required": true, 1608 // "type": "string" 1609 // }, 1610 // "pageSize": { 1611 // "description": "The maximum number of results to return. If not set, the service selects a default.", 1612 // "format": "int32", 1613 // "location": "query", 1614 // "type": "integer" 1615 // }, 1616 // "pageToken": { 1617 // "description": "A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.", 1618 // "location": "query", 1619 // "type": "string" 1620 // } 1621 // }, 1622 // "path": "v1beta1/{+name}/locations", 1623 // "response": { 1624 // "$ref": "ListLocationsResponse" 1625 // }, 1626 // "scopes": [ 1627 // "https://www.googleapis.com/auth/cloud-platform" 1628 // ] 1629 // } 1630 1631} 1632 1633// Pages invokes f for each page of results. 1634// A non-nil error returned from f will halt the iteration. 1635// The provided context supersedes any context provided to the Context method. 1636func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { 1637 c.ctx_ = ctx 1638 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 1639 for { 1640 x, err := c.Do() 1641 if err != nil { 1642 return err 1643 } 1644 if err := f(x); err != nil { 1645 return err 1646 } 1647 if x.NextPageToken == "" { 1648 return nil 1649 } 1650 c.PageToken(x.NextPageToken) 1651 } 1652} 1653 1654// method id "redis.projects.locations.instances.create": 1655 1656type ProjectsLocationsInstancesCreateCall struct { 1657 s *Service 1658 parent string 1659 instance *Instance 1660 urlParams_ gensupport.URLParams 1661 ctx_ context.Context 1662 header_ http.Header 1663} 1664 1665// Create: Creates a Redis instance based on the specified tier and 1666// memory size. By default, the instance is accessible from the 1667// project's default network (https://cloud.google.com/vpc/docs/vpc). 1668// The creation is executed asynchronously and callers may check the 1669// returned operation to track its progress. Once the operation is 1670// completed the Redis instance will be fully functional. Completed 1671// longrunning.Operation will contain the new instance object in the 1672// response field. The returned operation is automatically deleted after 1673// a few hours, so there is no need to call DeleteOperation. 1674// 1675// - parent: The resource name of the instance location using the form: 1676// `projects/{project_id}/locations/{location_id}` where `location_id` 1677// refers to a GCP region. 1678func (r *ProjectsLocationsInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsInstancesCreateCall { 1679 c := &ProjectsLocationsInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1680 c.parent = parent 1681 c.instance = instance 1682 return c 1683} 1684 1685// InstanceId sets the optional parameter "instanceId": Required. The 1686// logical name of the Redis instance in the customer project with the 1687// following restrictions: * Must contain only lowercase letters, 1688// numbers, and hyphens. * Must start with a letter. * Must be between 1689// 1-40 characters. * Must end with a number or a letter. * Must be 1690// unique within the customer project / location 1691func (c *ProjectsLocationsInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsInstancesCreateCall { 1692 c.urlParams_.Set("instanceId", instanceId) 1693 return c 1694} 1695 1696// Fields allows partial responses to be retrieved. See 1697// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1698// for more information. 1699func (c *ProjectsLocationsInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCreateCall { 1700 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1701 return c 1702} 1703 1704// Context sets the context to be used in this call's Do method. Any 1705// pending HTTP request will be aborted if the provided context is 1706// canceled. 1707func (c *ProjectsLocationsInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesCreateCall { 1708 c.ctx_ = ctx 1709 return c 1710} 1711 1712// Header returns an http.Header that can be modified by the caller to 1713// add HTTP headers to the request. 1714func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header { 1715 if c.header_ == nil { 1716 c.header_ = make(http.Header) 1717 } 1718 return c.header_ 1719} 1720 1721func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) { 1722 reqHeaders := make(http.Header) 1723 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 1724 for k, v := range c.header_ { 1725 reqHeaders[k] = v 1726 } 1727 reqHeaders.Set("User-Agent", c.s.userAgent()) 1728 var body io.Reader = nil 1729 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) 1730 if err != nil { 1731 return nil, err 1732 } 1733 reqHeaders.Set("Content-Type", "application/json") 1734 c.urlParams_.Set("alt", alt) 1735 c.urlParams_.Set("prettyPrint", "false") 1736 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/instances") 1737 urls += "?" + c.urlParams_.Encode() 1738 req, err := http.NewRequest("POST", urls, body) 1739 if err != nil { 1740 return nil, err 1741 } 1742 req.Header = reqHeaders 1743 googleapi.Expand(req.URL, map[string]string{ 1744 "parent": c.parent, 1745 }) 1746 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1747} 1748 1749// Do executes the "redis.projects.locations.instances.create" call. 1750// Exactly one of *Operation or error will be non-nil. Any non-2xx 1751// status code is an error. Response headers are in either 1752// *Operation.ServerResponse.Header or (if a response was returned at 1753// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1754// to check whether the returned error was because 1755// http.StatusNotModified was returned. 1756func (c *ProjectsLocationsInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 1757 gensupport.SetOptions(c.urlParams_, opts...) 1758 res, err := c.doRequest("json") 1759 if res != nil && res.StatusCode == http.StatusNotModified { 1760 if res.Body != nil { 1761 res.Body.Close() 1762 } 1763 return nil, &googleapi.Error{ 1764 Code: res.StatusCode, 1765 Header: res.Header, 1766 } 1767 } 1768 if err != nil { 1769 return nil, err 1770 } 1771 defer googleapi.CloseBody(res) 1772 if err := googleapi.CheckResponse(res); err != nil { 1773 return nil, err 1774 } 1775 ret := &Operation{ 1776 ServerResponse: googleapi.ServerResponse{ 1777 Header: res.Header, 1778 HTTPStatusCode: res.StatusCode, 1779 }, 1780 } 1781 target := &ret 1782 if err := gensupport.DecodeResponse(target, res); err != nil { 1783 return nil, err 1784 } 1785 return ret, nil 1786 // { 1787 // "description": "Creates a Redis instance based on the specified tier and memory size. By default, the instance is accessible from the project's [default network](https://cloud.google.com/vpc/docs/vpc). The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis instance will be fully functional. Completed longrunning.Operation will contain the new instance object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.", 1788 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances", 1789 // "httpMethod": "POST", 1790 // "id": "redis.projects.locations.instances.create", 1791 // "parameterOrder": [ 1792 // "parent" 1793 // ], 1794 // "parameters": { 1795 // "instanceId": { 1796 // "description": "Required. The logical name of the Redis instance in the customer project with the following restrictions: * Must contain only lowercase letters, numbers, and hyphens. * Must start with a letter. * Must be between 1-40 characters. * Must end with a number or a letter. * Must be unique within the customer project / location", 1797 // "location": "query", 1798 // "type": "string" 1799 // }, 1800 // "parent": { 1801 // "description": "Required. The resource name of the instance location using the form: `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region.", 1802 // "location": "path", 1803 // "pattern": "^projects/[^/]+/locations/[^/]+$", 1804 // "required": true, 1805 // "type": "string" 1806 // } 1807 // }, 1808 // "path": "v1beta1/{+parent}/instances", 1809 // "request": { 1810 // "$ref": "Instance" 1811 // }, 1812 // "response": { 1813 // "$ref": "Operation" 1814 // }, 1815 // "scopes": [ 1816 // "https://www.googleapis.com/auth/cloud-platform" 1817 // ] 1818 // } 1819 1820} 1821 1822// method id "redis.projects.locations.instances.delete": 1823 1824type ProjectsLocationsInstancesDeleteCall struct { 1825 s *Service 1826 name string 1827 urlParams_ gensupport.URLParams 1828 ctx_ context.Context 1829 header_ http.Header 1830} 1831 1832// Delete: Deletes a specific Redis instance. Instance stops serving and 1833// data is deleted. 1834// 1835// - name: Redis instance resource name using the form: 1836// `projects/{project_id}/locations/{location_id}/instances/{instance_i 1837// d}` where `location_id` refers to a GCP region. 1838func (r *ProjectsLocationsInstancesService) Delete(name string) *ProjectsLocationsInstancesDeleteCall { 1839 c := &ProjectsLocationsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1840 c.name = name 1841 return c 1842} 1843 1844// Fields allows partial responses to be retrieved. See 1845// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1846// for more information. 1847func (c *ProjectsLocationsInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDeleteCall { 1848 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1849 return c 1850} 1851 1852// Context sets the context to be used in this call's Do method. Any 1853// pending HTTP request will be aborted if the provided context is 1854// canceled. 1855func (c *ProjectsLocationsInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDeleteCall { 1856 c.ctx_ = ctx 1857 return c 1858} 1859 1860// Header returns an http.Header that can be modified by the caller to 1861// add HTTP headers to the request. 1862func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header { 1863 if c.header_ == nil { 1864 c.header_ = make(http.Header) 1865 } 1866 return c.header_ 1867} 1868 1869func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { 1870 reqHeaders := make(http.Header) 1871 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 1872 for k, v := range c.header_ { 1873 reqHeaders[k] = v 1874 } 1875 reqHeaders.Set("User-Agent", c.s.userAgent()) 1876 var body io.Reader = nil 1877 c.urlParams_.Set("alt", alt) 1878 c.urlParams_.Set("prettyPrint", "false") 1879 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 1880 urls += "?" + c.urlParams_.Encode() 1881 req, err := http.NewRequest("DELETE", urls, body) 1882 if err != nil { 1883 return nil, err 1884 } 1885 req.Header = reqHeaders 1886 googleapi.Expand(req.URL, map[string]string{ 1887 "name": c.name, 1888 }) 1889 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1890} 1891 1892// Do executes the "redis.projects.locations.instances.delete" call. 1893// Exactly one of *Operation or error will be non-nil. Any non-2xx 1894// status code is an error. Response headers are in either 1895// *Operation.ServerResponse.Header or (if a response was returned at 1896// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1897// to check whether the returned error was because 1898// http.StatusNotModified was returned. 1899func (c *ProjectsLocationsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 1900 gensupport.SetOptions(c.urlParams_, opts...) 1901 res, err := c.doRequest("json") 1902 if res != nil && res.StatusCode == http.StatusNotModified { 1903 if res.Body != nil { 1904 res.Body.Close() 1905 } 1906 return nil, &googleapi.Error{ 1907 Code: res.StatusCode, 1908 Header: res.Header, 1909 } 1910 } 1911 if err != nil { 1912 return nil, err 1913 } 1914 defer googleapi.CloseBody(res) 1915 if err := googleapi.CheckResponse(res); err != nil { 1916 return nil, err 1917 } 1918 ret := &Operation{ 1919 ServerResponse: googleapi.ServerResponse{ 1920 Header: res.Header, 1921 HTTPStatusCode: res.StatusCode, 1922 }, 1923 } 1924 target := &ret 1925 if err := gensupport.DecodeResponse(target, res); err != nil { 1926 return nil, err 1927 } 1928 return ret, nil 1929 // { 1930 // "description": "Deletes a specific Redis instance. Instance stops serving and data is deleted.", 1931 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}", 1932 // "httpMethod": "DELETE", 1933 // "id": "redis.projects.locations.instances.delete", 1934 // "parameterOrder": [ 1935 // "name" 1936 // ], 1937 // "parameters": { 1938 // "name": { 1939 // "description": "Required. Redis instance resource name using the form: `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` refers to a GCP region.", 1940 // "location": "path", 1941 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 1942 // "required": true, 1943 // "type": "string" 1944 // } 1945 // }, 1946 // "path": "v1beta1/{+name}", 1947 // "response": { 1948 // "$ref": "Operation" 1949 // }, 1950 // "scopes": [ 1951 // "https://www.googleapis.com/auth/cloud-platform" 1952 // ] 1953 // } 1954 1955} 1956 1957// method id "redis.projects.locations.instances.export": 1958 1959type ProjectsLocationsInstancesExportCall struct { 1960 s *Service 1961 name string 1962 exportinstancerequest *ExportInstanceRequest 1963 urlParams_ gensupport.URLParams 1964 ctx_ context.Context 1965 header_ http.Header 1966} 1967 1968// Export: Export Redis instance data into a Redis RDB format file in 1969// Cloud Storage. Redis will continue serving during this operation. The 1970// returned operation is automatically deleted after a few hours, so 1971// there is no need to call DeleteOperation. 1972// 1973// - name: Redis instance resource name using the form: 1974// `projects/{project_id}/locations/{location_id}/instances/{instance_i 1975// d}` where `location_id` refers to a GCP region. 1976func (r *ProjectsLocationsInstancesService) Export(name string, exportinstancerequest *ExportInstanceRequest) *ProjectsLocationsInstancesExportCall { 1977 c := &ProjectsLocationsInstancesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1978 c.name = name 1979 c.exportinstancerequest = exportinstancerequest 1980 return c 1981} 1982 1983// Fields allows partial responses to be retrieved. See 1984// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1985// for more information. 1986func (c *ProjectsLocationsInstancesExportCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesExportCall { 1987 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1988 return c 1989} 1990 1991// Context sets the context to be used in this call's Do method. Any 1992// pending HTTP request will be aborted if the provided context is 1993// canceled. 1994func (c *ProjectsLocationsInstancesExportCall) Context(ctx context.Context) *ProjectsLocationsInstancesExportCall { 1995 c.ctx_ = ctx 1996 return c 1997} 1998 1999// Header returns an http.Header that can be modified by the caller to 2000// add HTTP headers to the request. 2001func (c *ProjectsLocationsInstancesExportCall) Header() http.Header { 2002 if c.header_ == nil { 2003 c.header_ = make(http.Header) 2004 } 2005 return c.header_ 2006} 2007 2008func (c *ProjectsLocationsInstancesExportCall) doRequest(alt string) (*http.Response, error) { 2009 reqHeaders := make(http.Header) 2010 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 2011 for k, v := range c.header_ { 2012 reqHeaders[k] = v 2013 } 2014 reqHeaders.Set("User-Agent", c.s.userAgent()) 2015 var body io.Reader = nil 2016 body, err := googleapi.WithoutDataWrapper.JSONReader(c.exportinstancerequest) 2017 if err != nil { 2018 return nil, err 2019 } 2020 reqHeaders.Set("Content-Type", "application/json") 2021 c.urlParams_.Set("alt", alt) 2022 c.urlParams_.Set("prettyPrint", "false") 2023 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:export") 2024 urls += "?" + c.urlParams_.Encode() 2025 req, err := http.NewRequest("POST", urls, body) 2026 if err != nil { 2027 return nil, err 2028 } 2029 req.Header = reqHeaders 2030 googleapi.Expand(req.URL, map[string]string{ 2031 "name": c.name, 2032 }) 2033 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2034} 2035 2036// Do executes the "redis.projects.locations.instances.export" call. 2037// Exactly one of *Operation or error will be non-nil. Any non-2xx 2038// status code is an error. Response headers are in either 2039// *Operation.ServerResponse.Header or (if a response was returned at 2040// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2041// to check whether the returned error was because 2042// http.StatusNotModified was returned. 2043func (c *ProjectsLocationsInstancesExportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2044 gensupport.SetOptions(c.urlParams_, opts...) 2045 res, err := c.doRequest("json") 2046 if res != nil && res.StatusCode == http.StatusNotModified { 2047 if res.Body != nil { 2048 res.Body.Close() 2049 } 2050 return nil, &googleapi.Error{ 2051 Code: res.StatusCode, 2052 Header: res.Header, 2053 } 2054 } 2055 if err != nil { 2056 return nil, err 2057 } 2058 defer googleapi.CloseBody(res) 2059 if err := googleapi.CheckResponse(res); err != nil { 2060 return nil, err 2061 } 2062 ret := &Operation{ 2063 ServerResponse: googleapi.ServerResponse{ 2064 Header: res.Header, 2065 HTTPStatusCode: res.StatusCode, 2066 }, 2067 } 2068 target := &ret 2069 if err := gensupport.DecodeResponse(target, res); err != nil { 2070 return nil, err 2071 } 2072 return ret, nil 2073 // { 2074 // "description": "Export Redis instance data into a Redis RDB format file in Cloud Storage. Redis will continue serving during this operation. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.", 2075 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:export", 2076 // "httpMethod": "POST", 2077 // "id": "redis.projects.locations.instances.export", 2078 // "parameterOrder": [ 2079 // "name" 2080 // ], 2081 // "parameters": { 2082 // "name": { 2083 // "description": "Required. Redis instance resource name using the form: `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` refers to a GCP region.", 2084 // "location": "path", 2085 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 2086 // "required": true, 2087 // "type": "string" 2088 // } 2089 // }, 2090 // "path": "v1beta1/{+name}:export", 2091 // "request": { 2092 // "$ref": "ExportInstanceRequest" 2093 // }, 2094 // "response": { 2095 // "$ref": "Operation" 2096 // }, 2097 // "scopes": [ 2098 // "https://www.googleapis.com/auth/cloud-platform" 2099 // ] 2100 // } 2101 2102} 2103 2104// method id "redis.projects.locations.instances.failover": 2105 2106type ProjectsLocationsInstancesFailoverCall struct { 2107 s *Service 2108 name string 2109 failoverinstancerequest *FailoverInstanceRequest 2110 urlParams_ gensupport.URLParams 2111 ctx_ context.Context 2112 header_ http.Header 2113} 2114 2115// Failover: Initiates a failover of the primary node to current replica 2116// node for a specific STANDARD tier Cloud Memorystore for Redis 2117// instance. 2118// 2119// - name: Redis instance resource name using the form: 2120// `projects/{project_id}/locations/{location_id}/instances/{instance_i 2121// d}` where `location_id` refers to a GCP region. 2122func (r *ProjectsLocationsInstancesService) Failover(name string, failoverinstancerequest *FailoverInstanceRequest) *ProjectsLocationsInstancesFailoverCall { 2123 c := &ProjectsLocationsInstancesFailoverCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2124 c.name = name 2125 c.failoverinstancerequest = failoverinstancerequest 2126 return c 2127} 2128 2129// Fields allows partial responses to be retrieved. See 2130// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2131// for more information. 2132func (c *ProjectsLocationsInstancesFailoverCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesFailoverCall { 2133 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2134 return c 2135} 2136 2137// Context sets the context to be used in this call's Do method. Any 2138// pending HTTP request will be aborted if the provided context is 2139// canceled. 2140func (c *ProjectsLocationsInstancesFailoverCall) Context(ctx context.Context) *ProjectsLocationsInstancesFailoverCall { 2141 c.ctx_ = ctx 2142 return c 2143} 2144 2145// Header returns an http.Header that can be modified by the caller to 2146// add HTTP headers to the request. 2147func (c *ProjectsLocationsInstancesFailoverCall) Header() http.Header { 2148 if c.header_ == nil { 2149 c.header_ = make(http.Header) 2150 } 2151 return c.header_ 2152} 2153 2154func (c *ProjectsLocationsInstancesFailoverCall) doRequest(alt string) (*http.Response, error) { 2155 reqHeaders := make(http.Header) 2156 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 2157 for k, v := range c.header_ { 2158 reqHeaders[k] = v 2159 } 2160 reqHeaders.Set("User-Agent", c.s.userAgent()) 2161 var body io.Reader = nil 2162 body, err := googleapi.WithoutDataWrapper.JSONReader(c.failoverinstancerequest) 2163 if err != nil { 2164 return nil, err 2165 } 2166 reqHeaders.Set("Content-Type", "application/json") 2167 c.urlParams_.Set("alt", alt) 2168 c.urlParams_.Set("prettyPrint", "false") 2169 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:failover") 2170 urls += "?" + c.urlParams_.Encode() 2171 req, err := http.NewRequest("POST", urls, body) 2172 if err != nil { 2173 return nil, err 2174 } 2175 req.Header = reqHeaders 2176 googleapi.Expand(req.URL, map[string]string{ 2177 "name": c.name, 2178 }) 2179 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2180} 2181 2182// Do executes the "redis.projects.locations.instances.failover" call. 2183// Exactly one of *Operation or error will be non-nil. Any non-2xx 2184// status code is an error. Response headers are in either 2185// *Operation.ServerResponse.Header or (if a response was returned at 2186// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2187// to check whether the returned error was because 2188// http.StatusNotModified was returned. 2189func (c *ProjectsLocationsInstancesFailoverCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2190 gensupport.SetOptions(c.urlParams_, opts...) 2191 res, err := c.doRequest("json") 2192 if res != nil && res.StatusCode == http.StatusNotModified { 2193 if res.Body != nil { 2194 res.Body.Close() 2195 } 2196 return nil, &googleapi.Error{ 2197 Code: res.StatusCode, 2198 Header: res.Header, 2199 } 2200 } 2201 if err != nil { 2202 return nil, err 2203 } 2204 defer googleapi.CloseBody(res) 2205 if err := googleapi.CheckResponse(res); err != nil { 2206 return nil, err 2207 } 2208 ret := &Operation{ 2209 ServerResponse: googleapi.ServerResponse{ 2210 Header: res.Header, 2211 HTTPStatusCode: res.StatusCode, 2212 }, 2213 } 2214 target := &ret 2215 if err := gensupport.DecodeResponse(target, res); err != nil { 2216 return nil, err 2217 } 2218 return ret, nil 2219 // { 2220 // "description": "Initiates a failover of the primary node to current replica node for a specific STANDARD tier Cloud Memorystore for Redis instance.", 2221 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:failover", 2222 // "httpMethod": "POST", 2223 // "id": "redis.projects.locations.instances.failover", 2224 // "parameterOrder": [ 2225 // "name" 2226 // ], 2227 // "parameters": { 2228 // "name": { 2229 // "description": "Required. Redis instance resource name using the form: `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` refers to a GCP region.", 2230 // "location": "path", 2231 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 2232 // "required": true, 2233 // "type": "string" 2234 // } 2235 // }, 2236 // "path": "v1beta1/{+name}:failover", 2237 // "request": { 2238 // "$ref": "FailoverInstanceRequest" 2239 // }, 2240 // "response": { 2241 // "$ref": "Operation" 2242 // }, 2243 // "scopes": [ 2244 // "https://www.googleapis.com/auth/cloud-platform" 2245 // ] 2246 // } 2247 2248} 2249 2250// method id "redis.projects.locations.instances.get": 2251 2252type ProjectsLocationsInstancesGetCall struct { 2253 s *Service 2254 name string 2255 urlParams_ gensupport.URLParams 2256 ifNoneMatch_ string 2257 ctx_ context.Context 2258 header_ http.Header 2259} 2260 2261// Get: Gets the details of a specific Redis instance. 2262// 2263// - name: Redis instance resource name using the form: 2264// `projects/{project_id}/locations/{location_id}/instances/{instance_i 2265// d}` where `location_id` refers to a GCP region. 2266func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall { 2267 c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2268 c.name = name 2269 return c 2270} 2271 2272// Fields allows partial responses to be retrieved. See 2273// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2274// for more information. 2275func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall { 2276 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2277 return c 2278} 2279 2280// IfNoneMatch sets the optional parameter which makes the operation 2281// fail if the object's ETag matches the given value. This is useful for 2282// getting updates only after the object has changed since the last 2283// request. Use googleapi.IsNotModified to check whether the response 2284// error from Do is the result of In-None-Match. 2285func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall { 2286 c.ifNoneMatch_ = entityTag 2287 return c 2288} 2289 2290// Context sets the context to be used in this call's Do method. Any 2291// pending HTTP request will be aborted if the provided context is 2292// canceled. 2293func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall { 2294 c.ctx_ = ctx 2295 return c 2296} 2297 2298// Header returns an http.Header that can be modified by the caller to 2299// add HTTP headers to the request. 2300func (c *ProjectsLocationsInstancesGetCall) Header() http.Header { 2301 if c.header_ == nil { 2302 c.header_ = make(http.Header) 2303 } 2304 return c.header_ 2305} 2306 2307func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) { 2308 reqHeaders := make(http.Header) 2309 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 2310 for k, v := range c.header_ { 2311 reqHeaders[k] = v 2312 } 2313 reqHeaders.Set("User-Agent", c.s.userAgent()) 2314 if c.ifNoneMatch_ != "" { 2315 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2316 } 2317 var body io.Reader = nil 2318 c.urlParams_.Set("alt", alt) 2319 c.urlParams_.Set("prettyPrint", "false") 2320 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2321 urls += "?" + c.urlParams_.Encode() 2322 req, err := http.NewRequest("GET", urls, body) 2323 if err != nil { 2324 return nil, err 2325 } 2326 req.Header = reqHeaders 2327 googleapi.Expand(req.URL, map[string]string{ 2328 "name": c.name, 2329 }) 2330 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2331} 2332 2333// Do executes the "redis.projects.locations.instances.get" call. 2334// Exactly one of *Instance or error will be non-nil. Any non-2xx status 2335// code is an error. Response headers are in either 2336// *Instance.ServerResponse.Header or (if a response was returned at 2337// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2338// to check whether the returned error was because 2339// http.StatusNotModified was returned. 2340func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) { 2341 gensupport.SetOptions(c.urlParams_, opts...) 2342 res, err := c.doRequest("json") 2343 if res != nil && res.StatusCode == http.StatusNotModified { 2344 if res.Body != nil { 2345 res.Body.Close() 2346 } 2347 return nil, &googleapi.Error{ 2348 Code: res.StatusCode, 2349 Header: res.Header, 2350 } 2351 } 2352 if err != nil { 2353 return nil, err 2354 } 2355 defer googleapi.CloseBody(res) 2356 if err := googleapi.CheckResponse(res); err != nil { 2357 return nil, err 2358 } 2359 ret := &Instance{ 2360 ServerResponse: googleapi.ServerResponse{ 2361 Header: res.Header, 2362 HTTPStatusCode: res.StatusCode, 2363 }, 2364 } 2365 target := &ret 2366 if err := gensupport.DecodeResponse(target, res); err != nil { 2367 return nil, err 2368 } 2369 return ret, nil 2370 // { 2371 // "description": "Gets the details of a specific Redis instance.", 2372 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}", 2373 // "httpMethod": "GET", 2374 // "id": "redis.projects.locations.instances.get", 2375 // "parameterOrder": [ 2376 // "name" 2377 // ], 2378 // "parameters": { 2379 // "name": { 2380 // "description": "Required. Redis instance resource name using the form: `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` refers to a GCP region.", 2381 // "location": "path", 2382 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 2383 // "required": true, 2384 // "type": "string" 2385 // } 2386 // }, 2387 // "path": "v1beta1/{+name}", 2388 // "response": { 2389 // "$ref": "Instance" 2390 // }, 2391 // "scopes": [ 2392 // "https://www.googleapis.com/auth/cloud-platform" 2393 // ] 2394 // } 2395 2396} 2397 2398// method id "redis.projects.locations.instances.getAuthString": 2399 2400type ProjectsLocationsInstancesGetAuthStringCall struct { 2401 s *Service 2402 name string 2403 urlParams_ gensupport.URLParams 2404 ifNoneMatch_ string 2405 ctx_ context.Context 2406 header_ http.Header 2407} 2408 2409// GetAuthString: Gets the AUTH string for a Redis instance. If AUTH is 2410// not enabled for the instance the response will be empty. This 2411// information is not included in the details returned to GetInstance. 2412// 2413// - name: Redis instance resource name using the form: 2414// `projects/{project_id}/locations/{location_id}/instances/{instance_i 2415// d}` where `location_id` refers to a GCP region. 2416func (r *ProjectsLocationsInstancesService) GetAuthString(name string) *ProjectsLocationsInstancesGetAuthStringCall { 2417 c := &ProjectsLocationsInstancesGetAuthStringCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2418 c.name = name 2419 return c 2420} 2421 2422// Fields allows partial responses to be retrieved. See 2423// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2424// for more information. 2425func (c *ProjectsLocationsInstancesGetAuthStringCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetAuthStringCall { 2426 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2427 return c 2428} 2429 2430// IfNoneMatch sets the optional parameter which makes the operation 2431// fail if the object's ETag matches the given value. This is useful for 2432// getting updates only after the object has changed since the last 2433// request. Use googleapi.IsNotModified to check whether the response 2434// error from Do is the result of In-None-Match. 2435func (c *ProjectsLocationsInstancesGetAuthStringCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetAuthStringCall { 2436 c.ifNoneMatch_ = entityTag 2437 return c 2438} 2439 2440// Context sets the context to be used in this call's Do method. Any 2441// pending HTTP request will be aborted if the provided context is 2442// canceled. 2443func (c *ProjectsLocationsInstancesGetAuthStringCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetAuthStringCall { 2444 c.ctx_ = ctx 2445 return c 2446} 2447 2448// Header returns an http.Header that can be modified by the caller to 2449// add HTTP headers to the request. 2450func (c *ProjectsLocationsInstancesGetAuthStringCall) Header() http.Header { 2451 if c.header_ == nil { 2452 c.header_ = make(http.Header) 2453 } 2454 return c.header_ 2455} 2456 2457func (c *ProjectsLocationsInstancesGetAuthStringCall) doRequest(alt string) (*http.Response, error) { 2458 reqHeaders := make(http.Header) 2459 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 2460 for k, v := range c.header_ { 2461 reqHeaders[k] = v 2462 } 2463 reqHeaders.Set("User-Agent", c.s.userAgent()) 2464 if c.ifNoneMatch_ != "" { 2465 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2466 } 2467 var body io.Reader = nil 2468 c.urlParams_.Set("alt", alt) 2469 c.urlParams_.Set("prettyPrint", "false") 2470 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/authString") 2471 urls += "?" + c.urlParams_.Encode() 2472 req, err := http.NewRequest("GET", urls, body) 2473 if err != nil { 2474 return nil, err 2475 } 2476 req.Header = reqHeaders 2477 googleapi.Expand(req.URL, map[string]string{ 2478 "name": c.name, 2479 }) 2480 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2481} 2482 2483// Do executes the "redis.projects.locations.instances.getAuthString" call. 2484// Exactly one of *InstanceAuthString or error will be non-nil. Any 2485// non-2xx status code is an error. Response headers are in either 2486// *InstanceAuthString.ServerResponse.Header or (if a response was 2487// returned at all) in error.(*googleapi.Error).Header. Use 2488// googleapi.IsNotModified to check whether the returned error was 2489// because http.StatusNotModified was returned. 2490func (c *ProjectsLocationsInstancesGetAuthStringCall) Do(opts ...googleapi.CallOption) (*InstanceAuthString, error) { 2491 gensupport.SetOptions(c.urlParams_, opts...) 2492 res, err := c.doRequest("json") 2493 if res != nil && res.StatusCode == http.StatusNotModified { 2494 if res.Body != nil { 2495 res.Body.Close() 2496 } 2497 return nil, &googleapi.Error{ 2498 Code: res.StatusCode, 2499 Header: res.Header, 2500 } 2501 } 2502 if err != nil { 2503 return nil, err 2504 } 2505 defer googleapi.CloseBody(res) 2506 if err := googleapi.CheckResponse(res); err != nil { 2507 return nil, err 2508 } 2509 ret := &InstanceAuthString{ 2510 ServerResponse: googleapi.ServerResponse{ 2511 Header: res.Header, 2512 HTTPStatusCode: res.StatusCode, 2513 }, 2514 } 2515 target := &ret 2516 if err := gensupport.DecodeResponse(target, res); err != nil { 2517 return nil, err 2518 } 2519 return ret, nil 2520 // { 2521 // "description": "Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response will be empty. This information is not included in the details returned to GetInstance.", 2522 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}/authString", 2523 // "httpMethod": "GET", 2524 // "id": "redis.projects.locations.instances.getAuthString", 2525 // "parameterOrder": [ 2526 // "name" 2527 // ], 2528 // "parameters": { 2529 // "name": { 2530 // "description": "Required. Redis instance resource name using the form: `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` refers to a GCP region.", 2531 // "location": "path", 2532 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 2533 // "required": true, 2534 // "type": "string" 2535 // } 2536 // }, 2537 // "path": "v1beta1/{+name}/authString", 2538 // "response": { 2539 // "$ref": "InstanceAuthString" 2540 // }, 2541 // "scopes": [ 2542 // "https://www.googleapis.com/auth/cloud-platform" 2543 // ] 2544 // } 2545 2546} 2547 2548// method id "redis.projects.locations.instances.import": 2549 2550type ProjectsLocationsInstancesImportCall struct { 2551 s *Service 2552 name string 2553 importinstancerequest *ImportInstanceRequest 2554 urlParams_ gensupport.URLParams 2555 ctx_ context.Context 2556 header_ http.Header 2557} 2558 2559// Import: Import a Redis RDB snapshot file from Cloud Storage into a 2560// Redis instance. Redis may stop serving during this operation. 2561// Instance state will be IMPORTING for entire operation. When complete, 2562// the instance will contain only data from the imported file. The 2563// returned operation is automatically deleted after a few hours, so 2564// there is no need to call DeleteOperation. 2565// 2566// - name: Redis instance resource name using the form: 2567// `projects/{project_id}/locations/{location_id}/instances/{instance_i 2568// d}` where `location_id` refers to a GCP region. 2569func (r *ProjectsLocationsInstancesService) Import(name string, importinstancerequest *ImportInstanceRequest) *ProjectsLocationsInstancesImportCall { 2570 c := &ProjectsLocationsInstancesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2571 c.name = name 2572 c.importinstancerequest = importinstancerequest 2573 return c 2574} 2575 2576// Fields allows partial responses to be retrieved. See 2577// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2578// for more information. 2579func (c *ProjectsLocationsInstancesImportCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesImportCall { 2580 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2581 return c 2582} 2583 2584// Context sets the context to be used in this call's Do method. Any 2585// pending HTTP request will be aborted if the provided context is 2586// canceled. 2587func (c *ProjectsLocationsInstancesImportCall) Context(ctx context.Context) *ProjectsLocationsInstancesImportCall { 2588 c.ctx_ = ctx 2589 return c 2590} 2591 2592// Header returns an http.Header that can be modified by the caller to 2593// add HTTP headers to the request. 2594func (c *ProjectsLocationsInstancesImportCall) Header() http.Header { 2595 if c.header_ == nil { 2596 c.header_ = make(http.Header) 2597 } 2598 return c.header_ 2599} 2600 2601func (c *ProjectsLocationsInstancesImportCall) doRequest(alt string) (*http.Response, error) { 2602 reqHeaders := make(http.Header) 2603 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 2604 for k, v := range c.header_ { 2605 reqHeaders[k] = v 2606 } 2607 reqHeaders.Set("User-Agent", c.s.userAgent()) 2608 var body io.Reader = nil 2609 body, err := googleapi.WithoutDataWrapper.JSONReader(c.importinstancerequest) 2610 if err != nil { 2611 return nil, err 2612 } 2613 reqHeaders.Set("Content-Type", "application/json") 2614 c.urlParams_.Set("alt", alt) 2615 c.urlParams_.Set("prettyPrint", "false") 2616 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:import") 2617 urls += "?" + c.urlParams_.Encode() 2618 req, err := http.NewRequest("POST", urls, body) 2619 if err != nil { 2620 return nil, err 2621 } 2622 req.Header = reqHeaders 2623 googleapi.Expand(req.URL, map[string]string{ 2624 "name": c.name, 2625 }) 2626 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2627} 2628 2629// Do executes the "redis.projects.locations.instances.import" call. 2630// Exactly one of *Operation or error will be non-nil. Any non-2xx 2631// status code is an error. Response headers are in either 2632// *Operation.ServerResponse.Header or (if a response was returned at 2633// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2634// to check whether the returned error was because 2635// http.StatusNotModified was returned. 2636func (c *ProjectsLocationsInstancesImportCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2637 gensupport.SetOptions(c.urlParams_, opts...) 2638 res, err := c.doRequest("json") 2639 if res != nil && res.StatusCode == http.StatusNotModified { 2640 if res.Body != nil { 2641 res.Body.Close() 2642 } 2643 return nil, &googleapi.Error{ 2644 Code: res.StatusCode, 2645 Header: res.Header, 2646 } 2647 } 2648 if err != nil { 2649 return nil, err 2650 } 2651 defer googleapi.CloseBody(res) 2652 if err := googleapi.CheckResponse(res); err != nil { 2653 return nil, err 2654 } 2655 ret := &Operation{ 2656 ServerResponse: googleapi.ServerResponse{ 2657 Header: res.Header, 2658 HTTPStatusCode: res.StatusCode, 2659 }, 2660 } 2661 target := &ret 2662 if err := gensupport.DecodeResponse(target, res); err != nil { 2663 return nil, err 2664 } 2665 return ret, nil 2666 // { 2667 // "description": "Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. Redis may stop serving during this operation. Instance state will be IMPORTING for entire operation. When complete, the instance will contain only data from the imported file. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.", 2668 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:import", 2669 // "httpMethod": "POST", 2670 // "id": "redis.projects.locations.instances.import", 2671 // "parameterOrder": [ 2672 // "name" 2673 // ], 2674 // "parameters": { 2675 // "name": { 2676 // "description": "Required. Redis instance resource name using the form: `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` refers to a GCP region.", 2677 // "location": "path", 2678 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 2679 // "required": true, 2680 // "type": "string" 2681 // } 2682 // }, 2683 // "path": "v1beta1/{+name}:import", 2684 // "request": { 2685 // "$ref": "ImportInstanceRequest" 2686 // }, 2687 // "response": { 2688 // "$ref": "Operation" 2689 // }, 2690 // "scopes": [ 2691 // "https://www.googleapis.com/auth/cloud-platform" 2692 // ] 2693 // } 2694 2695} 2696 2697// method id "redis.projects.locations.instances.list": 2698 2699type ProjectsLocationsInstancesListCall struct { 2700 s *Service 2701 parent string 2702 urlParams_ gensupport.URLParams 2703 ifNoneMatch_ string 2704 ctx_ context.Context 2705 header_ http.Header 2706} 2707 2708// List: Lists all Redis instances owned by a project in either the 2709// specified location (region) or all locations. The location should 2710// have the following format: * 2711// `projects/{project_id}/locations/{location_id}` If `location_id` is 2712// specified as `-` (wildcard), then all regions available to the 2713// project are queried, and the results are aggregated. 2714// 2715// - parent: The resource name of the instance location using the form: 2716// `projects/{project_id}/locations/{location_id}` where `location_id` 2717// refers to a GCP region. 2718func (r *ProjectsLocationsInstancesService) List(parent string) *ProjectsLocationsInstancesListCall { 2719 c := &ProjectsLocationsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2720 c.parent = parent 2721 return c 2722} 2723 2724// PageSize sets the optional parameter "pageSize": The maximum number 2725// of items to return. If not specified, a default value of 1000 will be 2726// used by the service. Regardless of the page_size value, the response 2727// may include a partial list and a caller should only rely on 2728// response's `next_page_token` to determine if there are more instances 2729// left to be queried. 2730func (c *ProjectsLocationsInstancesListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesListCall { 2731 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2732 return c 2733} 2734 2735// PageToken sets the optional parameter "pageToken": The 2736// `next_page_token` value returned from a previous ListInstances 2737// request, if any. 2738func (c *ProjectsLocationsInstancesListCall) PageToken(pageToken string) *ProjectsLocationsInstancesListCall { 2739 c.urlParams_.Set("pageToken", pageToken) 2740 return c 2741} 2742 2743// Fields allows partial responses to be retrieved. See 2744// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2745// for more information. 2746func (c *ProjectsLocationsInstancesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesListCall { 2747 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2748 return c 2749} 2750 2751// IfNoneMatch sets the optional parameter which makes the operation 2752// fail if the object's ETag matches the given value. This is useful for 2753// getting updates only after the object has changed since the last 2754// request. Use googleapi.IsNotModified to check whether the response 2755// error from Do is the result of In-None-Match. 2756func (c *ProjectsLocationsInstancesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesListCall { 2757 c.ifNoneMatch_ = entityTag 2758 return c 2759} 2760 2761// Context sets the context to be used in this call's Do method. Any 2762// pending HTTP request will be aborted if the provided context is 2763// canceled. 2764func (c *ProjectsLocationsInstancesListCall) Context(ctx context.Context) *ProjectsLocationsInstancesListCall { 2765 c.ctx_ = ctx 2766 return c 2767} 2768 2769// Header returns an http.Header that can be modified by the caller to 2770// add HTTP headers to the request. 2771func (c *ProjectsLocationsInstancesListCall) Header() http.Header { 2772 if c.header_ == nil { 2773 c.header_ = make(http.Header) 2774 } 2775 return c.header_ 2776} 2777 2778func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Response, error) { 2779 reqHeaders := make(http.Header) 2780 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 2781 for k, v := range c.header_ { 2782 reqHeaders[k] = v 2783 } 2784 reqHeaders.Set("User-Agent", c.s.userAgent()) 2785 if c.ifNoneMatch_ != "" { 2786 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2787 } 2788 var body io.Reader = nil 2789 c.urlParams_.Set("alt", alt) 2790 c.urlParams_.Set("prettyPrint", "false") 2791 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/instances") 2792 urls += "?" + c.urlParams_.Encode() 2793 req, err := http.NewRequest("GET", urls, body) 2794 if err != nil { 2795 return nil, err 2796 } 2797 req.Header = reqHeaders 2798 googleapi.Expand(req.URL, map[string]string{ 2799 "parent": c.parent, 2800 }) 2801 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2802} 2803 2804// Do executes the "redis.projects.locations.instances.list" call. 2805// Exactly one of *ListInstancesResponse or error will be non-nil. Any 2806// non-2xx status code is an error. Response headers are in either 2807// *ListInstancesResponse.ServerResponse.Header or (if a response was 2808// returned at all) in error.(*googleapi.Error).Header. Use 2809// googleapi.IsNotModified to check whether the returned error was 2810// because http.StatusNotModified was returned. 2811func (c *ProjectsLocationsInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) { 2812 gensupport.SetOptions(c.urlParams_, opts...) 2813 res, err := c.doRequest("json") 2814 if res != nil && res.StatusCode == http.StatusNotModified { 2815 if res.Body != nil { 2816 res.Body.Close() 2817 } 2818 return nil, &googleapi.Error{ 2819 Code: res.StatusCode, 2820 Header: res.Header, 2821 } 2822 } 2823 if err != nil { 2824 return nil, err 2825 } 2826 defer googleapi.CloseBody(res) 2827 if err := googleapi.CheckResponse(res); err != nil { 2828 return nil, err 2829 } 2830 ret := &ListInstancesResponse{ 2831 ServerResponse: googleapi.ServerResponse{ 2832 Header: res.Header, 2833 HTTPStatusCode: res.StatusCode, 2834 }, 2835 } 2836 target := &ret 2837 if err := gensupport.DecodeResponse(target, res); err != nil { 2838 return nil, err 2839 } 2840 return ret, nil 2841 // { 2842 // "description": "Lists all Redis instances owned by a project in either the specified location (region) or all locations. The location should have the following format: * `projects/{project_id}/locations/{location_id}` If `location_id` is specified as `-` (wildcard), then all regions available to the project are queried, and the results are aggregated.", 2843 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances", 2844 // "httpMethod": "GET", 2845 // "id": "redis.projects.locations.instances.list", 2846 // "parameterOrder": [ 2847 // "parent" 2848 // ], 2849 // "parameters": { 2850 // "pageSize": { 2851 // "description": "The maximum number of items to return. If not specified, a default value of 1000 will be used by the service. Regardless of the page_size value, the response may include a partial list and a caller should only rely on response's `next_page_token` to determine if there are more instances left to be queried.", 2852 // "format": "int32", 2853 // "location": "query", 2854 // "type": "integer" 2855 // }, 2856 // "pageToken": { 2857 // "description": "The `next_page_token` value returned from a previous ListInstances request, if any.", 2858 // "location": "query", 2859 // "type": "string" 2860 // }, 2861 // "parent": { 2862 // "description": "Required. The resource name of the instance location using the form: `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region.", 2863 // "location": "path", 2864 // "pattern": "^projects/[^/]+/locations/[^/]+$", 2865 // "required": true, 2866 // "type": "string" 2867 // } 2868 // }, 2869 // "path": "v1beta1/{+parent}/instances", 2870 // "response": { 2871 // "$ref": "ListInstancesResponse" 2872 // }, 2873 // "scopes": [ 2874 // "https://www.googleapis.com/auth/cloud-platform" 2875 // ] 2876 // } 2877 2878} 2879 2880// Pages invokes f for each page of results. 2881// A non-nil error returned from f will halt the iteration. 2882// The provided context supersedes any context provided to the Context method. 2883func (c *ProjectsLocationsInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error { 2884 c.ctx_ = ctx 2885 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2886 for { 2887 x, err := c.Do() 2888 if err != nil { 2889 return err 2890 } 2891 if err := f(x); err != nil { 2892 return err 2893 } 2894 if x.NextPageToken == "" { 2895 return nil 2896 } 2897 c.PageToken(x.NextPageToken) 2898 } 2899} 2900 2901// method id "redis.projects.locations.instances.patch": 2902 2903type ProjectsLocationsInstancesPatchCall struct { 2904 s *Service 2905 name string 2906 instance *Instance 2907 urlParams_ gensupport.URLParams 2908 ctx_ context.Context 2909 header_ http.Header 2910} 2911 2912// Patch: Updates the metadata and configuration of a specific Redis 2913// instance. Completed longrunning.Operation will contain the new 2914// instance object in the response field. The returned operation is 2915// automatically deleted after a few hours, so there is no need to call 2916// DeleteOperation. 2917// 2918// - name: Unique name of the resource in this scope including project 2919// and location using the form: 2920// `projects/{project_id}/locations/{location_id}/instances/{instance_i 2921// d}` Note: Redis instances are managed and addressed at regional 2922// level so location_id here refers to a GCP region; however, users 2923// may choose which specific zone (or collection of zones for 2924// cross-zone instances) an instance should be provisioned in. Refer 2925// to location_id and alternative_location_id fields for more details. 2926func (r *ProjectsLocationsInstancesService) Patch(name string, instance *Instance) *ProjectsLocationsInstancesPatchCall { 2927 c := &ProjectsLocationsInstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2928 c.name = name 2929 c.instance = instance 2930 return c 2931} 2932 2933// UpdateMask sets the optional parameter "updateMask": Required. Mask 2934// of fields to update. At least one path must be supplied in this 2935// field. The elements of the repeated paths field may only include 2936// these fields from Instance: * `displayName` * `labels` * 2937// `memorySizeGb` * `redisConfig` 2938func (c *ProjectsLocationsInstancesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsInstancesPatchCall { 2939 c.urlParams_.Set("updateMask", updateMask) 2940 return c 2941} 2942 2943// Fields allows partial responses to be retrieved. See 2944// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2945// for more information. 2946func (c *ProjectsLocationsInstancesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesPatchCall { 2947 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2948 return c 2949} 2950 2951// Context sets the context to be used in this call's Do method. Any 2952// pending HTTP request will be aborted if the provided context is 2953// canceled. 2954func (c *ProjectsLocationsInstancesPatchCall) Context(ctx context.Context) *ProjectsLocationsInstancesPatchCall { 2955 c.ctx_ = ctx 2956 return c 2957} 2958 2959// Header returns an http.Header that can be modified by the caller to 2960// add HTTP headers to the request. 2961func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header { 2962 if c.header_ == nil { 2963 c.header_ = make(http.Header) 2964 } 2965 return c.header_ 2966} 2967 2968func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) { 2969 reqHeaders := make(http.Header) 2970 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 2971 for k, v := range c.header_ { 2972 reqHeaders[k] = v 2973 } 2974 reqHeaders.Set("User-Agent", c.s.userAgent()) 2975 var body io.Reader = nil 2976 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) 2977 if err != nil { 2978 return nil, err 2979 } 2980 reqHeaders.Set("Content-Type", "application/json") 2981 c.urlParams_.Set("alt", alt) 2982 c.urlParams_.Set("prettyPrint", "false") 2983 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2984 urls += "?" + c.urlParams_.Encode() 2985 req, err := http.NewRequest("PATCH", urls, body) 2986 if err != nil { 2987 return nil, err 2988 } 2989 req.Header = reqHeaders 2990 googleapi.Expand(req.URL, map[string]string{ 2991 "name": c.name, 2992 }) 2993 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2994} 2995 2996// Do executes the "redis.projects.locations.instances.patch" call. 2997// Exactly one of *Operation or error will be non-nil. Any non-2xx 2998// status code is an error. Response headers are in either 2999// *Operation.ServerResponse.Header or (if a response was returned at 3000// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3001// to check whether the returned error was because 3002// http.StatusNotModified was returned. 3003func (c *ProjectsLocationsInstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3004 gensupport.SetOptions(c.urlParams_, opts...) 3005 res, err := c.doRequest("json") 3006 if res != nil && res.StatusCode == http.StatusNotModified { 3007 if res.Body != nil { 3008 res.Body.Close() 3009 } 3010 return nil, &googleapi.Error{ 3011 Code: res.StatusCode, 3012 Header: res.Header, 3013 } 3014 } 3015 if err != nil { 3016 return nil, err 3017 } 3018 defer googleapi.CloseBody(res) 3019 if err := googleapi.CheckResponse(res); err != nil { 3020 return nil, err 3021 } 3022 ret := &Operation{ 3023 ServerResponse: googleapi.ServerResponse{ 3024 Header: res.Header, 3025 HTTPStatusCode: res.StatusCode, 3026 }, 3027 } 3028 target := &ret 3029 if err := gensupport.DecodeResponse(target, res); err != nil { 3030 return nil, err 3031 } 3032 return ret, nil 3033 // { 3034 // "description": "Updates the metadata and configuration of a specific Redis instance. Completed longrunning.Operation will contain the new instance object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.", 3035 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}", 3036 // "httpMethod": "PATCH", 3037 // "id": "redis.projects.locations.instances.patch", 3038 // "parameterOrder": [ 3039 // "name" 3040 // ], 3041 // "parameters": { 3042 // "name": { 3043 // "description": "Required. Unique name of the resource in this scope including project and location using the form: `projects/{project_id}/locations/{location_id}/instances/{instance_id}` Note: Redis instances are managed and addressed at regional level so location_id here refers to a GCP region; however, users may choose which specific zone (or collection of zones for cross-zone instances) an instance should be provisioned in. Refer to location_id and alternative_location_id fields for more details.", 3044 // "location": "path", 3045 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 3046 // "required": true, 3047 // "type": "string" 3048 // }, 3049 // "updateMask": { 3050 // "description": "Required. Mask of fields to update. At least one path must be supplied in this field. The elements of the repeated paths field may only include these fields from Instance: * `displayName` * `labels` * `memorySizeGb` * `redisConfig`", 3051 // "format": "google-fieldmask", 3052 // "location": "query", 3053 // "type": "string" 3054 // } 3055 // }, 3056 // "path": "v1beta1/{+name}", 3057 // "request": { 3058 // "$ref": "Instance" 3059 // }, 3060 // "response": { 3061 // "$ref": "Operation" 3062 // }, 3063 // "scopes": [ 3064 // "https://www.googleapis.com/auth/cloud-platform" 3065 // ] 3066 // } 3067 3068} 3069 3070// method id "redis.projects.locations.instances.rescheduleMaintenance": 3071 3072type ProjectsLocationsInstancesRescheduleMaintenanceCall struct { 3073 s *Service 3074 name string 3075 reschedulemaintenancerequest *RescheduleMaintenanceRequest 3076 urlParams_ gensupport.URLParams 3077 ctx_ context.Context 3078 header_ http.Header 3079} 3080 3081// RescheduleMaintenance: Reschedule maintenance for a given instance in 3082// a given project and location. 3083// 3084// - name: Redis instance resource name using the form: 3085// `projects/{project_id}/locations/{location_id}/instances/{instance_i 3086// d}` where `location_id` refers to a GCP region. 3087func (r *ProjectsLocationsInstancesService) RescheduleMaintenance(name string, reschedulemaintenancerequest *RescheduleMaintenanceRequest) *ProjectsLocationsInstancesRescheduleMaintenanceCall { 3088 c := &ProjectsLocationsInstancesRescheduleMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3089 c.name = name 3090 c.reschedulemaintenancerequest = reschedulemaintenancerequest 3091 return c 3092} 3093 3094// Fields allows partial responses to be retrieved. See 3095// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3096// for more information. 3097func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesRescheduleMaintenanceCall { 3098 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3099 return c 3100} 3101 3102// Context sets the context to be used in this call's Do method. Any 3103// pending HTTP request will be aborted if the provided context is 3104// canceled. 3105func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Context(ctx context.Context) *ProjectsLocationsInstancesRescheduleMaintenanceCall { 3106 c.ctx_ = ctx 3107 return c 3108} 3109 3110// Header returns an http.Header that can be modified by the caller to 3111// add HTTP headers to the request. 3112func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Header() http.Header { 3113 if c.header_ == nil { 3114 c.header_ = make(http.Header) 3115 } 3116 return c.header_ 3117} 3118 3119func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) doRequest(alt string) (*http.Response, error) { 3120 reqHeaders := make(http.Header) 3121 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3122 for k, v := range c.header_ { 3123 reqHeaders[k] = v 3124 } 3125 reqHeaders.Set("User-Agent", c.s.userAgent()) 3126 var body io.Reader = nil 3127 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reschedulemaintenancerequest) 3128 if err != nil { 3129 return nil, err 3130 } 3131 reqHeaders.Set("Content-Type", "application/json") 3132 c.urlParams_.Set("alt", alt) 3133 c.urlParams_.Set("prettyPrint", "false") 3134 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:rescheduleMaintenance") 3135 urls += "?" + c.urlParams_.Encode() 3136 req, err := http.NewRequest("POST", urls, body) 3137 if err != nil { 3138 return nil, err 3139 } 3140 req.Header = reqHeaders 3141 googleapi.Expand(req.URL, map[string]string{ 3142 "name": c.name, 3143 }) 3144 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3145} 3146 3147// Do executes the "redis.projects.locations.instances.rescheduleMaintenance" call. 3148// Exactly one of *Operation or error will be non-nil. Any non-2xx 3149// status code is an error. Response headers are in either 3150// *Operation.ServerResponse.Header or (if a response was returned at 3151// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3152// to check whether the returned error was because 3153// http.StatusNotModified was returned. 3154func (c *ProjectsLocationsInstancesRescheduleMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3155 gensupport.SetOptions(c.urlParams_, opts...) 3156 res, err := c.doRequest("json") 3157 if res != nil && res.StatusCode == http.StatusNotModified { 3158 if res.Body != nil { 3159 res.Body.Close() 3160 } 3161 return nil, &googleapi.Error{ 3162 Code: res.StatusCode, 3163 Header: res.Header, 3164 } 3165 } 3166 if err != nil { 3167 return nil, err 3168 } 3169 defer googleapi.CloseBody(res) 3170 if err := googleapi.CheckResponse(res); err != nil { 3171 return nil, err 3172 } 3173 ret := &Operation{ 3174 ServerResponse: googleapi.ServerResponse{ 3175 Header: res.Header, 3176 HTTPStatusCode: res.StatusCode, 3177 }, 3178 } 3179 target := &ret 3180 if err := gensupport.DecodeResponse(target, res); err != nil { 3181 return nil, err 3182 } 3183 return ret, nil 3184 // { 3185 // "description": "Reschedule maintenance for a given instance in a given project and location.", 3186 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:rescheduleMaintenance", 3187 // "httpMethod": "POST", 3188 // "id": "redis.projects.locations.instances.rescheduleMaintenance", 3189 // "parameterOrder": [ 3190 // "name" 3191 // ], 3192 // "parameters": { 3193 // "name": { 3194 // "description": "Required. Redis instance resource name using the form: `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` refers to a GCP region.", 3195 // "location": "path", 3196 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 3197 // "required": true, 3198 // "type": "string" 3199 // } 3200 // }, 3201 // "path": "v1beta1/{+name}:rescheduleMaintenance", 3202 // "request": { 3203 // "$ref": "RescheduleMaintenanceRequest" 3204 // }, 3205 // "response": { 3206 // "$ref": "Operation" 3207 // }, 3208 // "scopes": [ 3209 // "https://www.googleapis.com/auth/cloud-platform" 3210 // ] 3211 // } 3212 3213} 3214 3215// method id "redis.projects.locations.instances.upgrade": 3216 3217type ProjectsLocationsInstancesUpgradeCall struct { 3218 s *Service 3219 name string 3220 upgradeinstancerequest *UpgradeInstanceRequest 3221 urlParams_ gensupport.URLParams 3222 ctx_ context.Context 3223 header_ http.Header 3224} 3225 3226// Upgrade: Upgrades Redis instance to the newer Redis version specified 3227// in the request. 3228// 3229// - name: Redis instance resource name using the form: 3230// `projects/{project_id}/locations/{location_id}/instances/{instance_i 3231// d}` where `location_id` refers to a GCP region. 3232func (r *ProjectsLocationsInstancesService) Upgrade(name string, upgradeinstancerequest *UpgradeInstanceRequest) *ProjectsLocationsInstancesUpgradeCall { 3233 c := &ProjectsLocationsInstancesUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3234 c.name = name 3235 c.upgradeinstancerequest = upgradeinstancerequest 3236 return c 3237} 3238 3239// Fields allows partial responses to be retrieved. See 3240// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3241// for more information. 3242func (c *ProjectsLocationsInstancesUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesUpgradeCall { 3243 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3244 return c 3245} 3246 3247// Context sets the context to be used in this call's Do method. Any 3248// pending HTTP request will be aborted if the provided context is 3249// canceled. 3250func (c *ProjectsLocationsInstancesUpgradeCall) Context(ctx context.Context) *ProjectsLocationsInstancesUpgradeCall { 3251 c.ctx_ = ctx 3252 return c 3253} 3254 3255// Header returns an http.Header that can be modified by the caller to 3256// add HTTP headers to the request. 3257func (c *ProjectsLocationsInstancesUpgradeCall) Header() http.Header { 3258 if c.header_ == nil { 3259 c.header_ = make(http.Header) 3260 } 3261 return c.header_ 3262} 3263 3264func (c *ProjectsLocationsInstancesUpgradeCall) doRequest(alt string) (*http.Response, error) { 3265 reqHeaders := make(http.Header) 3266 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3267 for k, v := range c.header_ { 3268 reqHeaders[k] = v 3269 } 3270 reqHeaders.Set("User-Agent", c.s.userAgent()) 3271 var body io.Reader = nil 3272 body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeinstancerequest) 3273 if err != nil { 3274 return nil, err 3275 } 3276 reqHeaders.Set("Content-Type", "application/json") 3277 c.urlParams_.Set("alt", alt) 3278 c.urlParams_.Set("prettyPrint", "false") 3279 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:upgrade") 3280 urls += "?" + c.urlParams_.Encode() 3281 req, err := http.NewRequest("POST", urls, body) 3282 if err != nil { 3283 return nil, err 3284 } 3285 req.Header = reqHeaders 3286 googleapi.Expand(req.URL, map[string]string{ 3287 "name": c.name, 3288 }) 3289 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3290} 3291 3292// Do executes the "redis.projects.locations.instances.upgrade" call. 3293// Exactly one of *Operation or error will be non-nil. Any non-2xx 3294// status code is an error. Response headers are in either 3295// *Operation.ServerResponse.Header or (if a response was returned at 3296// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3297// to check whether the returned error was because 3298// http.StatusNotModified was returned. 3299func (c *ProjectsLocationsInstancesUpgradeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3300 gensupport.SetOptions(c.urlParams_, opts...) 3301 res, err := c.doRequest("json") 3302 if res != nil && res.StatusCode == http.StatusNotModified { 3303 if res.Body != nil { 3304 res.Body.Close() 3305 } 3306 return nil, &googleapi.Error{ 3307 Code: res.StatusCode, 3308 Header: res.Header, 3309 } 3310 } 3311 if err != nil { 3312 return nil, err 3313 } 3314 defer googleapi.CloseBody(res) 3315 if err := googleapi.CheckResponse(res); err != nil { 3316 return nil, err 3317 } 3318 ret := &Operation{ 3319 ServerResponse: googleapi.ServerResponse{ 3320 Header: res.Header, 3321 HTTPStatusCode: res.StatusCode, 3322 }, 3323 } 3324 target := &ret 3325 if err := gensupport.DecodeResponse(target, res); err != nil { 3326 return nil, err 3327 } 3328 return ret, nil 3329 // { 3330 // "description": "Upgrades Redis instance to the newer Redis version specified in the request.", 3331 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:upgrade", 3332 // "httpMethod": "POST", 3333 // "id": "redis.projects.locations.instances.upgrade", 3334 // "parameterOrder": [ 3335 // "name" 3336 // ], 3337 // "parameters": { 3338 // "name": { 3339 // "description": "Required. Redis instance resource name using the form: `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` refers to a GCP region.", 3340 // "location": "path", 3341 // "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$", 3342 // "required": true, 3343 // "type": "string" 3344 // } 3345 // }, 3346 // "path": "v1beta1/{+name}:upgrade", 3347 // "request": { 3348 // "$ref": "UpgradeInstanceRequest" 3349 // }, 3350 // "response": { 3351 // "$ref": "Operation" 3352 // }, 3353 // "scopes": [ 3354 // "https://www.googleapis.com/auth/cloud-platform" 3355 // ] 3356 // } 3357 3358} 3359 3360// method id "redis.projects.locations.operations.cancel": 3361 3362type ProjectsLocationsOperationsCancelCall struct { 3363 s *Service 3364 name string 3365 urlParams_ gensupport.URLParams 3366 ctx_ context.Context 3367 header_ http.Header 3368} 3369 3370// Cancel: Starts asynchronous cancellation on a long-running operation. 3371// The server makes a best effort to cancel the operation, but success 3372// is not guaranteed. If the server doesn't support this method, it 3373// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use 3374// Operations.GetOperation or other methods to check whether the 3375// cancellation succeeded or whether the operation completed despite 3376// cancellation. On successful cancellation, the operation is not 3377// deleted; instead, it becomes an operation with an Operation.error 3378// value with a google.rpc.Status.code of 1, corresponding to 3379// `Code.CANCELLED`. 3380// 3381// - name: The name of the operation resource to be cancelled. 3382func (r *ProjectsLocationsOperationsService) Cancel(name string) *ProjectsLocationsOperationsCancelCall { 3383 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3384 c.name = name 3385 return c 3386} 3387 3388// Fields allows partial responses to be retrieved. See 3389// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3390// for more information. 3391func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { 3392 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3393 return c 3394} 3395 3396// Context sets the context to be used in this call's Do method. Any 3397// pending HTTP request will be aborted if the provided context is 3398// canceled. 3399func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { 3400 c.ctx_ = ctx 3401 return c 3402} 3403 3404// Header returns an http.Header that can be modified by the caller to 3405// add HTTP headers to the request. 3406func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { 3407 if c.header_ == nil { 3408 c.header_ = make(http.Header) 3409 } 3410 return c.header_ 3411} 3412 3413func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 3414 reqHeaders := make(http.Header) 3415 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3416 for k, v := range c.header_ { 3417 reqHeaders[k] = v 3418 } 3419 reqHeaders.Set("User-Agent", c.s.userAgent()) 3420 var body io.Reader = nil 3421 c.urlParams_.Set("alt", alt) 3422 c.urlParams_.Set("prettyPrint", "false") 3423 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") 3424 urls += "?" + c.urlParams_.Encode() 3425 req, err := http.NewRequest("POST", urls, body) 3426 if err != nil { 3427 return nil, err 3428 } 3429 req.Header = reqHeaders 3430 googleapi.Expand(req.URL, map[string]string{ 3431 "name": c.name, 3432 }) 3433 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3434} 3435 3436// Do executes the "redis.projects.locations.operations.cancel" call. 3437// Exactly one of *Empty or error will be non-nil. Any non-2xx status 3438// code is an error. Response headers are in either 3439// *Empty.ServerResponse.Header or (if a response was returned at all) 3440// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3441// check whether the returned error was because http.StatusNotModified 3442// was returned. 3443func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3444 gensupport.SetOptions(c.urlParams_, opts...) 3445 res, err := c.doRequest("json") 3446 if res != nil && res.StatusCode == http.StatusNotModified { 3447 if res.Body != nil { 3448 res.Body.Close() 3449 } 3450 return nil, &googleapi.Error{ 3451 Code: res.StatusCode, 3452 Header: res.Header, 3453 } 3454 } 3455 if err != nil { 3456 return nil, err 3457 } 3458 defer googleapi.CloseBody(res) 3459 if err := googleapi.CheckResponse(res); err != nil { 3460 return nil, err 3461 } 3462 ret := &Empty{ 3463 ServerResponse: googleapi.ServerResponse{ 3464 Header: res.Header, 3465 HTTPStatusCode: res.StatusCode, 3466 }, 3467 } 3468 target := &ret 3469 if err := gensupport.DecodeResponse(target, res); err != nil { 3470 return nil, err 3471 } 3472 return ret, nil 3473 // { 3474 // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", 3475 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", 3476 // "httpMethod": "POST", 3477 // "id": "redis.projects.locations.operations.cancel", 3478 // "parameterOrder": [ 3479 // "name" 3480 // ], 3481 // "parameters": { 3482 // "name": { 3483 // "description": "The name of the operation resource to be cancelled.", 3484 // "location": "path", 3485 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 3486 // "required": true, 3487 // "type": "string" 3488 // } 3489 // }, 3490 // "path": "v1beta1/{+name}:cancel", 3491 // "response": { 3492 // "$ref": "Empty" 3493 // }, 3494 // "scopes": [ 3495 // "https://www.googleapis.com/auth/cloud-platform" 3496 // ] 3497 // } 3498 3499} 3500 3501// method id "redis.projects.locations.operations.delete": 3502 3503type ProjectsLocationsOperationsDeleteCall struct { 3504 s *Service 3505 name string 3506 urlParams_ gensupport.URLParams 3507 ctx_ context.Context 3508 header_ http.Header 3509} 3510 3511// Delete: Deletes a long-running operation. This method indicates that 3512// the client is no longer interested in the operation result. It does 3513// not cancel the operation. If the server doesn't support this method, 3514// it returns `google.rpc.Code.UNIMPLEMENTED`. 3515// 3516// - name: The name of the operation resource to be deleted. 3517func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall { 3518 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3519 c.name = name 3520 return c 3521} 3522 3523// Fields allows partial responses to be retrieved. See 3524// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3525// for more information. 3526func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall { 3527 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3528 return c 3529} 3530 3531// Context sets the context to be used in this call's Do method. Any 3532// pending HTTP request will be aborted if the provided context is 3533// canceled. 3534func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall { 3535 c.ctx_ = ctx 3536 return c 3537} 3538 3539// Header returns an http.Header that can be modified by the caller to 3540// add HTTP headers to the request. 3541func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header { 3542 if c.header_ == nil { 3543 c.header_ = make(http.Header) 3544 } 3545 return c.header_ 3546} 3547 3548func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 3549 reqHeaders := make(http.Header) 3550 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3551 for k, v := range c.header_ { 3552 reqHeaders[k] = v 3553 } 3554 reqHeaders.Set("User-Agent", c.s.userAgent()) 3555 var body io.Reader = nil 3556 c.urlParams_.Set("alt", alt) 3557 c.urlParams_.Set("prettyPrint", "false") 3558 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 3559 urls += "?" + c.urlParams_.Encode() 3560 req, err := http.NewRequest("DELETE", urls, body) 3561 if err != nil { 3562 return nil, err 3563 } 3564 req.Header = reqHeaders 3565 googleapi.Expand(req.URL, map[string]string{ 3566 "name": c.name, 3567 }) 3568 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3569} 3570 3571// Do executes the "redis.projects.locations.operations.delete" call. 3572// Exactly one of *Empty or error will be non-nil. Any non-2xx status 3573// code is an error. Response headers are in either 3574// *Empty.ServerResponse.Header or (if a response was returned at all) 3575// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3576// check whether the returned error was because http.StatusNotModified 3577// was returned. 3578func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3579 gensupport.SetOptions(c.urlParams_, opts...) 3580 res, err := c.doRequest("json") 3581 if res != nil && res.StatusCode == http.StatusNotModified { 3582 if res.Body != nil { 3583 res.Body.Close() 3584 } 3585 return nil, &googleapi.Error{ 3586 Code: res.StatusCode, 3587 Header: res.Header, 3588 } 3589 } 3590 if err != nil { 3591 return nil, err 3592 } 3593 defer googleapi.CloseBody(res) 3594 if err := googleapi.CheckResponse(res); err != nil { 3595 return nil, err 3596 } 3597 ret := &Empty{ 3598 ServerResponse: googleapi.ServerResponse{ 3599 Header: res.Header, 3600 HTTPStatusCode: res.StatusCode, 3601 }, 3602 } 3603 target := &ret 3604 if err := gensupport.DecodeResponse(target, res); err != nil { 3605 return nil, err 3606 } 3607 return ret, nil 3608 // { 3609 // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.", 3610 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 3611 // "httpMethod": "DELETE", 3612 // "id": "redis.projects.locations.operations.delete", 3613 // "parameterOrder": [ 3614 // "name" 3615 // ], 3616 // "parameters": { 3617 // "name": { 3618 // "description": "The name of the operation resource to be deleted.", 3619 // "location": "path", 3620 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 3621 // "required": true, 3622 // "type": "string" 3623 // } 3624 // }, 3625 // "path": "v1beta1/{+name}", 3626 // "response": { 3627 // "$ref": "Empty" 3628 // }, 3629 // "scopes": [ 3630 // "https://www.googleapis.com/auth/cloud-platform" 3631 // ] 3632 // } 3633 3634} 3635 3636// method id "redis.projects.locations.operations.get": 3637 3638type ProjectsLocationsOperationsGetCall struct { 3639 s *Service 3640 name string 3641 urlParams_ gensupport.URLParams 3642 ifNoneMatch_ string 3643 ctx_ context.Context 3644 header_ http.Header 3645} 3646 3647// Get: Gets the latest state of a long-running operation. Clients can 3648// use this method to poll the operation result at intervals as 3649// recommended by the API service. 3650// 3651// - name: The name of the operation resource. 3652func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 3653 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3654 c.name = name 3655 return c 3656} 3657 3658// Fields allows partial responses to be retrieved. See 3659// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3660// for more information. 3661func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 3662 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3663 return c 3664} 3665 3666// IfNoneMatch sets the optional parameter which makes the operation 3667// fail if the object's ETag matches the given value. This is useful for 3668// getting updates only after the object has changed since the last 3669// request. Use googleapi.IsNotModified to check whether the response 3670// error from Do is the result of In-None-Match. 3671func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 3672 c.ifNoneMatch_ = entityTag 3673 return c 3674} 3675 3676// Context sets the context to be used in this call's Do method. Any 3677// pending HTTP request will be aborted if the provided context is 3678// canceled. 3679func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 3680 c.ctx_ = ctx 3681 return c 3682} 3683 3684// Header returns an http.Header that can be modified by the caller to 3685// add HTTP headers to the request. 3686func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 3687 if c.header_ == nil { 3688 c.header_ = make(http.Header) 3689 } 3690 return c.header_ 3691} 3692 3693func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 3694 reqHeaders := make(http.Header) 3695 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3696 for k, v := range c.header_ { 3697 reqHeaders[k] = v 3698 } 3699 reqHeaders.Set("User-Agent", c.s.userAgent()) 3700 if c.ifNoneMatch_ != "" { 3701 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3702 } 3703 var body io.Reader = nil 3704 c.urlParams_.Set("alt", alt) 3705 c.urlParams_.Set("prettyPrint", "false") 3706 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 3707 urls += "?" + c.urlParams_.Encode() 3708 req, err := http.NewRequest("GET", urls, body) 3709 if err != nil { 3710 return nil, err 3711 } 3712 req.Header = reqHeaders 3713 googleapi.Expand(req.URL, map[string]string{ 3714 "name": c.name, 3715 }) 3716 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3717} 3718 3719// Do executes the "redis.projects.locations.operations.get" call. 3720// Exactly one of *Operation or error will be non-nil. Any non-2xx 3721// status code is an error. Response headers are in either 3722// *Operation.ServerResponse.Header or (if a response was returned at 3723// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3724// to check whether the returned error was because 3725// http.StatusNotModified was returned. 3726func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3727 gensupport.SetOptions(c.urlParams_, opts...) 3728 res, err := c.doRequest("json") 3729 if res != nil && res.StatusCode == http.StatusNotModified { 3730 if res.Body != nil { 3731 res.Body.Close() 3732 } 3733 return nil, &googleapi.Error{ 3734 Code: res.StatusCode, 3735 Header: res.Header, 3736 } 3737 } 3738 if err != nil { 3739 return nil, err 3740 } 3741 defer googleapi.CloseBody(res) 3742 if err := googleapi.CheckResponse(res); err != nil { 3743 return nil, err 3744 } 3745 ret := &Operation{ 3746 ServerResponse: googleapi.ServerResponse{ 3747 Header: res.Header, 3748 HTTPStatusCode: res.StatusCode, 3749 }, 3750 } 3751 target := &ret 3752 if err := gensupport.DecodeResponse(target, res); err != nil { 3753 return nil, err 3754 } 3755 return ret, nil 3756 // { 3757 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 3758 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 3759 // "httpMethod": "GET", 3760 // "id": "redis.projects.locations.operations.get", 3761 // "parameterOrder": [ 3762 // "name" 3763 // ], 3764 // "parameters": { 3765 // "name": { 3766 // "description": "The name of the operation resource.", 3767 // "location": "path", 3768 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 3769 // "required": true, 3770 // "type": "string" 3771 // } 3772 // }, 3773 // "path": "v1beta1/{+name}", 3774 // "response": { 3775 // "$ref": "Operation" 3776 // }, 3777 // "scopes": [ 3778 // "https://www.googleapis.com/auth/cloud-platform" 3779 // ] 3780 // } 3781 3782} 3783 3784// method id "redis.projects.locations.operations.list": 3785 3786type ProjectsLocationsOperationsListCall struct { 3787 s *Service 3788 name string 3789 urlParams_ gensupport.URLParams 3790 ifNoneMatch_ string 3791 ctx_ context.Context 3792 header_ http.Header 3793} 3794 3795// List: Lists operations that match the specified filter in the 3796// request. If the server doesn't support this method, it returns 3797// `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to 3798// override the binding to use different resource name schemes, such as 3799// `users/*/operations`. To override the binding, API services can add a 3800// binding such as "/v1/{name=users/*}/operations" to their service 3801// configuration. For backwards compatibility, the default name includes 3802// the operations collection id, however overriding users must ensure 3803// the name binding is the parent resource, without the operations 3804// collection id. 3805// 3806// - name: The name of the operation's parent resource. 3807func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall { 3808 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3809 c.name = name 3810 return c 3811} 3812 3813// Filter sets the optional parameter "filter": The standard list 3814// filter. 3815func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall { 3816 c.urlParams_.Set("filter", filter) 3817 return c 3818} 3819 3820// PageSize sets the optional parameter "pageSize": The standard list 3821// page size. 3822func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall { 3823 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3824 return c 3825} 3826 3827// PageToken sets the optional parameter "pageToken": The standard list 3828// page token. 3829func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall { 3830 c.urlParams_.Set("pageToken", pageToken) 3831 return c 3832} 3833 3834// Fields allows partial responses to be retrieved. See 3835// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3836// for more information. 3837func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall { 3838 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3839 return c 3840} 3841 3842// IfNoneMatch sets the optional parameter which makes the operation 3843// fail if the object's ETag matches the given value. This is useful for 3844// getting updates only after the object has changed since the last 3845// request. Use googleapi.IsNotModified to check whether the response 3846// error from Do is the result of In-None-Match. 3847func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall { 3848 c.ifNoneMatch_ = entityTag 3849 return c 3850} 3851 3852// Context sets the context to be used in this call's Do method. Any 3853// pending HTTP request will be aborted if the provided context is 3854// canceled. 3855func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall { 3856 c.ctx_ = ctx 3857 return c 3858} 3859 3860// Header returns an http.Header that can be modified by the caller to 3861// add HTTP headers to the request. 3862func (c *ProjectsLocationsOperationsListCall) Header() http.Header { 3863 if c.header_ == nil { 3864 c.header_ = make(http.Header) 3865 } 3866 return c.header_ 3867} 3868 3869func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { 3870 reqHeaders := make(http.Header) 3871 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3872 for k, v := range c.header_ { 3873 reqHeaders[k] = v 3874 } 3875 reqHeaders.Set("User-Agent", c.s.userAgent()) 3876 if c.ifNoneMatch_ != "" { 3877 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3878 } 3879 var body io.Reader = nil 3880 c.urlParams_.Set("alt", alt) 3881 c.urlParams_.Set("prettyPrint", "false") 3882 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/operations") 3883 urls += "?" + c.urlParams_.Encode() 3884 req, err := http.NewRequest("GET", urls, body) 3885 if err != nil { 3886 return nil, err 3887 } 3888 req.Header = reqHeaders 3889 googleapi.Expand(req.URL, map[string]string{ 3890 "name": c.name, 3891 }) 3892 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3893} 3894 3895// Do executes the "redis.projects.locations.operations.list" call. 3896// Exactly one of *ListOperationsResponse or error will be non-nil. Any 3897// non-2xx status code is an error. Response headers are in either 3898// *ListOperationsResponse.ServerResponse.Header or (if a response was 3899// returned at all) in error.(*googleapi.Error).Header. Use 3900// googleapi.IsNotModified to check whether the returned error was 3901// because http.StatusNotModified was returned. 3902func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 3903 gensupport.SetOptions(c.urlParams_, opts...) 3904 res, err := c.doRequest("json") 3905 if res != nil && res.StatusCode == http.StatusNotModified { 3906 if res.Body != nil { 3907 res.Body.Close() 3908 } 3909 return nil, &googleapi.Error{ 3910 Code: res.StatusCode, 3911 Header: res.Header, 3912 } 3913 } 3914 if err != nil { 3915 return nil, err 3916 } 3917 defer googleapi.CloseBody(res) 3918 if err := googleapi.CheckResponse(res); err != nil { 3919 return nil, err 3920 } 3921 ret := &ListOperationsResponse{ 3922 ServerResponse: googleapi.ServerResponse{ 3923 Header: res.Header, 3924 HTTPStatusCode: res.StatusCode, 3925 }, 3926 } 3927 target := &ret 3928 if err := gensupport.DecodeResponse(target, res); err != nil { 3929 return nil, err 3930 } 3931 return ret, nil 3932 // { 3933 // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", 3934 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations", 3935 // "httpMethod": "GET", 3936 // "id": "redis.projects.locations.operations.list", 3937 // "parameterOrder": [ 3938 // "name" 3939 // ], 3940 // "parameters": { 3941 // "filter": { 3942 // "description": "The standard list filter.", 3943 // "location": "query", 3944 // "type": "string" 3945 // }, 3946 // "name": { 3947 // "description": "The name of the operation's parent resource.", 3948 // "location": "path", 3949 // "pattern": "^projects/[^/]+/locations/[^/]+$", 3950 // "required": true, 3951 // "type": "string" 3952 // }, 3953 // "pageSize": { 3954 // "description": "The standard list page size.", 3955 // "format": "int32", 3956 // "location": "query", 3957 // "type": "integer" 3958 // }, 3959 // "pageToken": { 3960 // "description": "The standard list page token.", 3961 // "location": "query", 3962 // "type": "string" 3963 // } 3964 // }, 3965 // "path": "v1beta1/{+name}/operations", 3966 // "response": { 3967 // "$ref": "ListOperationsResponse" 3968 // }, 3969 // "scopes": [ 3970 // "https://www.googleapis.com/auth/cloud-platform" 3971 // ] 3972 // } 3973 3974} 3975 3976// Pages invokes f for each page of results. 3977// A non-nil error returned from f will halt the iteration. 3978// The provided context supersedes any context provided to the Context method. 3979func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 3980 c.ctx_ = ctx 3981 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3982 for { 3983 x, err := c.Do() 3984 if err != nil { 3985 return err 3986 } 3987 if err := f(x); err != nil { 3988 return err 3989 } 3990 if x.NextPageToken == "" { 3991 return nil 3992 } 3993 c.PageToken(x.NextPageToken) 3994 } 3995} 3996