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