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