From 282d93bf0987d0a26eff6d944eedf0cec7be2b3c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 26 Jan 2022 19:58:36 +0000 Subject: [PATCH] chore: update v2.12.0 gapic-generator-typescript (#542) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 424244721 Source-Link: https://github.com/googleapis/googleapis/commit/4b6b01f507ebc3df95fdf8e1d76b0ae0ae33e52c Source-Link: https://github.com/googleapis/googleapis-gen/commit/8ac83fba606d008c7e8a42e7d55b6596ec4be35f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGFjODNmYmE2MDZkMDA4YzdlOGE0MmU3ZDU1YjY1OTZlYzRiZTM1ZiJ9 --- packages/google-cloud-redis/.jsdoc.js | 4 +- .../google-cloud-redis/linkinator.config.json | 10 +- .../cloud/redis/v1beta1/cloud_redis.proto | 297 +- .../google-cloud-redis/protos/protos.d.ts | 928 +++++ packages/google-cloud-redis/protos/protos.js | 2984 +++++++++++++++-- .../google-cloud-redis/protos/protos.json | 309 ++ .../v1/cloud_redis.create_instance.js | 1 + .../v1/cloud_redis.delete_instance.js | 1 + .../v1/cloud_redis.export_instance.js | 1 + .../v1/cloud_redis.failover_instance.js | 1 + .../generated/v1/cloud_redis.get_instance.js | 1 + .../v1/cloud_redis.import_instance.js | 1 + .../v1/cloud_redis.list_instances.js | 5 +- .../v1/cloud_redis.update_instance.js | 1 + .../v1/cloud_redis.upgrade_instance.js | 1 + .../v1beta1/cloud_redis.create_instance.js | 1 + .../v1beta1/cloud_redis.delete_instance.js | 1 + .../v1beta1/cloud_redis.export_instance.js | 1 + .../v1beta1/cloud_redis.failover_instance.js | 1 + .../v1beta1/cloud_redis.get_instance.js | 1 + .../cloud_redis.get_instance_auth_string.js | 55 + .../v1beta1/cloud_redis.import_instance.js | 1 + .../v1beta1/cloud_redis.list_instances.js | 8 +- .../cloud_redis.reschedule_maintenance.js | 67 + .../v1beta1/cloud_redis.update_instance.js | 1 + .../v1beta1/cloud_redis.upgrade_instance.js | 1 + .../src/v1/cloud_redis_client.ts | 2 +- packages/google-cloud-redis/src/v1/index.ts | 2 +- .../src/v1beta1/cloud_redis_client.ts | 273 +- .../v1beta1/cloud_redis_client_config.json | 9 + .../src/v1beta1/gapic_metadata.json | 20 + .../google-cloud-redis/src/v1beta1/index.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../google-cloud-redis/system-test/install.ts | 2 +- .../test/gapic_cloud_redis_v1.ts | 2 +- .../test/gapic_cloud_redis_v1beta1.ts | 314 +- 37 files changed, 4890 insertions(+), 423 deletions(-) create mode 100644 packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.get_instance_auth_string.js create mode 100644 packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.reschedule_maintenance.js diff --git a/packages/google-cloud-redis/.jsdoc.js b/packages/google-cloud-redis/.jsdoc.js index 124d6ab7dcc..24897a56fd2 100644 --- a/packages/google-cloud-redis/.jsdoc.js +++ b/packages/google-cloud-redis/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2021 Google LLC', + copyright: 'Copyright 2022 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/redis', diff --git a/packages/google-cloud-redis/linkinator.config.json b/packages/google-cloud-redis/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-redis/linkinator.config.json +++ b/packages/google-cloud-redis/linkinator.config.json @@ -3,8 +3,14 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io" + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" ], "silent": true, - "concurrency": 5 + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 } diff --git a/packages/google-cloud-redis/protos/google/cloud/redis/v1beta1/cloud_redis.proto b/packages/google-cloud-redis/protos/google/cloud/redis/v1beta1/cloud_redis.proto index 4ffb29085e9..ee1719d7b94 100644 --- a/packages/google-cloud-redis/protos/google/cloud/redis/v1beta1/cloud_redis.proto +++ b/packages/google-cloud-redis/protos/google/cloud/redis/v1beta1/cloud_redis.proto @@ -21,8 +21,11 @@ import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/redis/v1beta1;redis"; option java_multiple_files = true; @@ -46,8 +49,7 @@ option java_package = "com.google.cloud.redis.v1beta1"; // * `projects/redpepper-1290/locations/us-central1/instances/my-redis` service CloudRedis { option (google.api.default_host) = "redis.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Lists all Redis instances owned by a project in either the specified // location (region) or all locations. @@ -73,6 +75,16 @@ service CloudRedis { option (google.api.method_signature) = "name"; } + // 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. + rpc GetInstanceAuthString(GetInstanceAuthStringRequest) returns (InstanceAuthString) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/instances/*}/authString" + }; + option (google.api.method_signature) = "name"; + } + // Creates a Redis instance based on the specified tier and memory size. // // By default, the instance is accessible from the project's @@ -85,8 +97,7 @@ service CloudRedis { // // The returned operation is automatically deleted after a few hours, so there // is no need to call DeleteOperation. - rpc CreateInstance(CreateInstanceRequest) - returns (google.longrunning.Operation) { + rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/locations/*}/instances" body: "instance" @@ -103,8 +114,7 @@ service CloudRedis { // 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. - rpc UpdateInstance(UpdateInstanceRequest) - returns (google.longrunning.Operation) { + rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta1/{instance.name=projects/*/locations/*/instances/*}" body: "instance" @@ -118,8 +128,7 @@ service CloudRedis { // Upgrades Redis instance to the newer Redis version specified in the // request. - rpc UpgradeInstance(UpgradeInstanceRequest) - returns (google.longrunning.Operation) { + rpc UpgradeInstance(UpgradeInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade" body: "*" @@ -139,8 +148,7 @@ service CloudRedis { // // The returned operation is automatically deleted after a few hours, so // there is no need to call DeleteOperation. - rpc ImportInstance(ImportInstanceRequest) - returns (google.longrunning.Operation) { + rpc ImportInstance(ImportInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:import" body: "*" @@ -158,8 +166,7 @@ service CloudRedis { // // The returned operation is automatically deleted after a few hours, so // there is no need to call DeleteOperation. - rpc ExportInstance(ExportInstanceRequest) - returns (google.longrunning.Operation) { + rpc ExportInstance(ExportInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:export" body: "*" @@ -173,8 +180,7 @@ service CloudRedis { // Initiates a failover of the primary node to current replica node for a // specific STANDARD tier Cloud Memorystore for Redis instance. - rpc FailoverInstance(FailoverInstanceRequest) - returns (google.longrunning.Operation) { + rpc FailoverInstance(FailoverInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:failover" body: "*" @@ -188,8 +194,7 @@ service CloudRedis { // Deletes a specific Redis instance. Instance stops serving and data is // deleted. - rpc DeleteInstance(DeleteInstanceRequest) - returns (google.longrunning.Operation) { + rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta1/{name=projects/*/locations/*/instances/*}" }; @@ -199,6 +204,20 @@ service CloudRedis { metadata_type: "google.protobuf.Any" }; } + + // Reschedule maintenance for a given instance in a given project and + // location. + rpc RescheduleMaintenance(RescheduleMaintenanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance" + body: "*" + }; + option (google.api.method_signature) = "name, reschedule_type, schedule_time"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.redis.v1beta1.Instance" + metadata_type: "google.protobuf.Any" + }; + } } // Node specific properties. @@ -275,10 +294,22 @@ message Instance { PRIVATE_SERVICE_ACCESS = 2; } + // Available TLS modes. + enum TransitEncryptionMode { + // Not set. + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + + // Client to Server traffic encryption enabled with server authentication. + SERVER_AUTHENTICATION = 1; + + // TLS is disabled for the instance. + DISABLED = 2; + } + // Read replicas mode. enum ReadReplicasMode { - // If not set, Memorystore for Redis backend will pick the mode based on - // other fields in the request. + // If not set, Memorystore Redis backend will default to + // READ_REPLICAS_DISABLED. READ_REPLICAS_MODE_UNSPECIFIED = 0; // If disabled, read endpoint will not be provided and the instance cannot @@ -286,7 +317,7 @@ message Instance { READ_REPLICAS_DISABLED = 1; // If enabled, read endpoint will be provided and the instance can scale - // up and down the number of replicas. + // up and down the number of replicas. Not valid for basic tier. READ_REPLICAS_ENABLED = 2; } @@ -297,10 +328,8 @@ message Instance { // 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][google.cloud.redis.v1beta1.Instance.location_id] and - // [alternative_location_id][google.cloud.redis.v1beta1.Instance.alternative_location_id] - // fields for more details. + // should be provisioned in. Refer to [location_id][google.cloud.redis.v1beta1.Instance.location_id] and + // [alternative_location_id][google.cloud.redis.v1beta1.Instance.alternative_location_id] fields for more details. string name = 1 [(google.api.field_behavior) = REQUIRED]; // An arbitrary and optional user-provided name for the instance. @@ -356,8 +385,7 @@ message Instance { string current_location_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time the instance was created. - google.protobuf.Timestamp create_time = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The current state of this instance. State state = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -386,8 +414,7 @@ message Instance { // // * stream-node-max-bytes // * stream-node-max-entries - map redis_configs = 16 - [(google.api.field_behavior) = OPTIONAL]; + map redis_configs = 16 [(google.api.field_behavior) = OPTIONAL]; // Required. The service tier of the instance. Tier tier = 17 [(google.api.field_behavior) = REQUIRED]; @@ -406,16 +433,37 @@ message Instance { // "serviceAccount:". The value may change over time // for a given instance so should be checked before each import/export // operation. - string persistence_iam_identity = 21 - [(google.api.field_behavior) = OUTPUT_ONLY]; + string persistence_iam_identity = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; // Optional. The network connect mode of the Redis instance. // If not provided, the connect mode defaults to DIRECT_PEERING. ConnectMode connect_mode = 22 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The number of replica nodes. Valid range for standard tier - // is [1-5] and defaults to 1. Valid value for basic tier is 0 and defaults - // to 0. + // Optional. Indicates whether OSS Redis AUTH is enabled for the instance. If set to + // "true" AUTH is enabled on the instance. Default value is "false" meaning + // AUTH is disabled. + bool auth_enabled = 23 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. List of server CA certificates for the instance. + repeated TlsCertificate server_ca_certs = 25 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The TLS mode of the Redis instance. + // If not provided, TLS is disabled for the instance. + TransitEncryptionMode transit_encryption_mode = 26 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maintenance policy for the instance. If not provided, + // maintenance events can be performed at any time. + MaintenancePolicy maintenance_policy = 27 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Date and time of upcoming maintenance events which have been + // scheduled. + MaintenanceSchedule maintenance_schedule = 28 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The number of replica nodes. The valid range for the Standard Tier with + // read replicas enabled is [1-5] and defaults to 2. If read replicas are not + // enabled for a Standard Tier instance, the only valid value is 1 and the + // default is 1. The valid value for basic tier is 0 and the default is also + // 0. int32 replica_count = 31 [(google.api.field_behavior) = OPTIONAL]; // Output only. Info per node. @@ -431,13 +479,97 @@ message Instance { // endpoint. Standard tier only. Write requests should target 'port'. int32 read_endpoint_port = 34 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. Read replica mode. - ReadReplicasMode read_replicas_mode = 35 - [(google.api.field_behavior) = OPTIONAL]; + // Optional. Read replica mode. Can only be specified when trying to create the + // instance. + ReadReplicasMode read_replicas_mode = 35 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for [RescheduleMaintenance][google.cloud.redis.v1beta1.CloudRedis.RescheduleMaintenance]. +message RescheduleMaintenanceRequest { + // Reschedule options. + enum RescheduleType { + // Not set. + RESCHEDULE_TYPE_UNSPECIFIED = 0; + + // If the user wants to schedule the maintenance to happen now. + IMMEDIATE = 1; + + // If the user wants to use the existing maintenance policy to find the + // next available window. + NEXT_AVAILABLE_WINDOW = 2; + + // If the user wants to reschedule the maintenance to a specific time. + SPECIFIC_TIME = 3; + } + + // 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. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "redis.googleapis.com/Instance" + } + ]; + + // Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + RescheduleType reschedule_type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Timestamp when the maintenance shall be rescheduled to if + // reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + // example `2012-11-15T16:19:00.094Z`. + google.protobuf.Timestamp schedule_time = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Request for -// [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances]. +// Maintenance policy for an instance. +message MaintenancePolicy { + // Output only. The time when the policy was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the policy was last updated. + google.protobuf.Timestamp update_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Description of what this policy is for. Create/Update methods + // return INVALID_ARGUMENT if the length is greater than 512. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maintenance window that is applied to resources covered by this + // policy. Minimum 1. For the current version, the maximum number of + // weekly_window is expected to be one. + repeated WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Time window in which disruptive maintenance updates occur. Non-disruptive +// updates can occur inside or outside this window. +message WeeklyMaintenanceWindow { + // Required. The day of week that maintenance updates occur. + google.type.DayOfWeek day = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Start time of the window in UTC time. + google.type.TimeOfDay start_time = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Duration of the maintenance window. The current window is fixed at 1 hour. + google.protobuf.Duration duration = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Upcoming maintenance schedule. If no maintenance is scheduled, fields are not +// populated. +message MaintenanceSchedule { + // Output only. The start time of any upcoming scheduled maintenance for this instance. + google.protobuf.Timestamp start_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The end time of any upcoming scheduled maintenance for this instance. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // If the scheduled maintenance can be rescheduled, default is true. + bool can_reschedule = 3 [deprecated = true]; + + // Output only. The deadline that the maintenance schedule start time can not go beyond, + // including reschedule. + google.protobuf.Timestamp schedule_deadline_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances]. message ListInstancesRequest { // Required. The resource name of the instance location using the form: // `projects/{project_id}/locations/{location_id}` @@ -459,13 +591,11 @@ message ListInstancesRequest { int32 page_size = 2; // The `next_page_token` value returned from a previous - // [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances] - // request, if any. + // [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances] request, if any. string page_token = 3; } -// Response for -// [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances]. +// Response for [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances]. message ListInstancesResponse { // A list of Redis instances in the project in the specified location, // or across all locations. @@ -495,12 +625,32 @@ message GetInstanceRequest { // where `location_id` refers to a GCP region. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "redis.googleapis.com/Instance" } + (google.api.resource_reference) = { + type: "redis.googleapis.com/Instance" + } + ]; +} + +// Request for [GetInstanceAuthString][google.cloud.redis.v1beta1.CloudRedis.GetInstanceAuthString]. +message GetInstanceAuthStringRequest { + // 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. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "redis.googleapis.com/Instance" + } ]; } -// Request for -// [CreateInstance][google.cloud.redis.v1beta1.CloudRedis.CreateInstance]. +// Instance AUTH string details. +message InstanceAuthString { + // AUTH string set on the instance. + string auth_string = 1; +} + +// Request for [CreateInstance][google.cloud.redis.v1beta1.CloudRedis.CreateInstance]. message CreateInstanceRequest { // Required. The resource name of the instance location using the form: // `projects/{project_id}/locations/{location_id}` @@ -526,8 +676,7 @@ message CreateInstanceRequest { Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; } -// Request for -// [UpdateInstance][google.cloud.redis.v1beta1.CloudRedis.UpdateInstance]. +// Request for [UpdateInstance][google.cloud.redis.v1beta1.CloudRedis.UpdateInstance]. message UpdateInstanceRequest { // 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 @@ -538,38 +687,39 @@ message UpdateInstanceRequest { // * `memorySizeGb` // * `redisConfig` // * `replica_count` - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; // Required. Update description. // Only fields specified in update_mask are updated. Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; } -// Request for -// [UpgradeInstance][google.cloud.redis.v1beta1.CloudRedis.UpgradeInstance]. +// Request for [UpgradeInstance][google.cloud.redis.v1beta1.CloudRedis.UpgradeInstance]. message UpgradeInstanceRequest { // 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. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "redis.googleapis.com/Instance" } + (google.api.resource_reference) = { + type: "redis.googleapis.com/Instance" + } ]; // Required. Specifies the target version of Redis software to upgrade to. string redis_version = 2 [(google.api.field_behavior) = REQUIRED]; } -// Request for -// [DeleteInstance][google.cloud.redis.v1beta1.CloudRedis.DeleteInstance]. +// Request for [DeleteInstance][google.cloud.redis.v1beta1.CloudRedis.DeleteInstance]. message DeleteInstanceRequest { // 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. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "redis.googleapis.com/Instance" } + (google.api.resource_reference) = { + type: "redis.googleapis.com/Instance" + } ]; } @@ -626,8 +776,7 @@ message ExportInstanceRequest { OutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; } -// Request for -// [Failover][google.cloud.redis.v1beta1.CloudRedis.FailoverInstance]. +// Request for [Failover][google.cloud.redis.v1beta1.CloudRedis.FailoverInstance]. message FailoverInstanceRequest { // Specifies different modes of operation in relation to the data retention. enum DataProtectionMode { @@ -650,13 +799,14 @@ message FailoverInstanceRequest { // where `location_id` refers to a GCP region. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "redis.googleapis.com/Instance" } + (google.api.resource_reference) = { + type: "redis.googleapis.com/Instance" + } ]; // Optional. Available data protection modes that the user can choose. If it's // unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - DataProtectionMode data_protection_mode = 2 - [(google.api.field_behavior) = OPTIONAL]; + DataProtectionMode data_protection_mode = 2 [(google.api.field_behavior) = OPTIONAL]; } // This location metadata represents additional configuration options for a @@ -668,10 +818,33 @@ message LocationMetadata { // by the lowercase ID of each zone, as defined by GCE. These keys can be // specified in `location_id` or `alternative_location_id` fields when // creating a Redis instance. - map available_zones = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; + map available_zones = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Defines specific information for a particular zone. Currently empty and // reserved for future use only. -message ZoneMetadata {} +message ZoneMetadata { + +} + +// TlsCertificate Resource +message TlsCertificate { + // Serial number, as extracted from the certificate. + string serial_number = 1; + + // PEM representation. + string cert = 2; + + // Output only. The time when the certificate was created in [RFC + // 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2020-05-18T00:00:00.094Z`. + google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the certificate expires in [RFC + // 3339](https://tools.ietf.org/html/rfc3339) format, for example + // `2020-05-18T00:00:00.094Z`. + google.protobuf.Timestamp expire_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Sha1 Fingerprint of the certificate. + string sha1_fingerprint = 5; +} diff --git a/packages/google-cloud-redis/protos/protos.d.ts b/packages/google-cloud-redis/protos/protos.d.ts index abd735c448b..943f0eae7e1 100644 --- a/packages/google-cloud-redis/protos/protos.d.ts +++ b/packages/google-cloud-redis/protos/protos.d.ts @@ -2294,6 +2294,20 @@ export namespace google { */ public getInstance(request: google.cloud.redis.v1beta1.IGetInstanceRequest): Promise; + /** + * Calls GetInstanceAuthString. + * @param request GetInstanceAuthStringRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceAuthString + */ + public getInstanceAuthString(request: google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest, callback: google.cloud.redis.v1beta1.CloudRedis.GetInstanceAuthStringCallback): void; + + /** + * Calls GetInstanceAuthString. + * @param request GetInstanceAuthStringRequest message or plain object + * @returns Promise + */ + public getInstanceAuthString(request: google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest): Promise; + /** * Calls CreateInstance. * @param request CreateInstanceRequest message or plain object @@ -2391,6 +2405,20 @@ export namespace google { * @returns Promise */ public deleteInstance(request: google.cloud.redis.v1beta1.IDeleteInstanceRequest): Promise; + + /** + * Calls RescheduleMaintenance. + * @param request RescheduleMaintenanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public rescheduleMaintenance(request: google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest, callback: google.cloud.redis.v1beta1.CloudRedis.RescheduleMaintenanceCallback): void; + + /** + * Calls RescheduleMaintenance. + * @param request RescheduleMaintenanceRequest message or plain object + * @returns Promise + */ + public rescheduleMaintenance(request: google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest): Promise; } namespace CloudRedis { @@ -2409,6 +2437,13 @@ export namespace google { */ type GetInstanceCallback = (error: (Error|null), response?: google.cloud.redis.v1beta1.Instance) => void; + /** + * Callback as used by {@link google.cloud.redis.v1beta1.CloudRedis#getInstanceAuthString}. + * @param error Error, if any + * @param [response] InstanceAuthString + */ + type GetInstanceAuthStringCallback = (error: (Error|null), response?: google.cloud.redis.v1beta1.InstanceAuthString) => void; + /** * Callback as used by {@link google.cloud.redis.v1beta1.CloudRedis#createInstance}. * @param error Error, if any @@ -2457,6 +2492,13 @@ export namespace google { * @param [response] Operation */ type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.redis.v1beta1.CloudRedis#rescheduleMaintenance}. + * @param error Error, if any + * @param [response] Operation + */ + type RescheduleMaintenanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of a NodeInfo. */ @@ -2615,6 +2657,21 @@ export namespace google { /** Instance connectMode */ connectMode?: (google.cloud.redis.v1beta1.Instance.ConnectMode|keyof typeof google.cloud.redis.v1beta1.Instance.ConnectMode|null); + /** Instance authEnabled */ + authEnabled?: (boolean|null); + + /** Instance serverCaCerts */ + serverCaCerts?: (google.cloud.redis.v1beta1.ITlsCertificate[]|null); + + /** Instance transitEncryptionMode */ + transitEncryptionMode?: (google.cloud.redis.v1beta1.Instance.TransitEncryptionMode|keyof typeof google.cloud.redis.v1beta1.Instance.TransitEncryptionMode|null); + + /** Instance maintenancePolicy */ + maintenancePolicy?: (google.cloud.redis.v1beta1.IMaintenancePolicy|null); + + /** Instance maintenanceSchedule */ + maintenanceSchedule?: (google.cloud.redis.v1beta1.IMaintenanceSchedule|null); + /** Instance replicaCount */ replicaCount?: (number|null); @@ -2697,6 +2754,21 @@ export namespace google { /** Instance connectMode. */ public connectMode: (google.cloud.redis.v1beta1.Instance.ConnectMode|keyof typeof google.cloud.redis.v1beta1.Instance.ConnectMode); + /** Instance authEnabled. */ + public authEnabled: boolean; + + /** Instance serverCaCerts. */ + public serverCaCerts: google.cloud.redis.v1beta1.ITlsCertificate[]; + + /** Instance transitEncryptionMode. */ + public transitEncryptionMode: (google.cloud.redis.v1beta1.Instance.TransitEncryptionMode|keyof typeof google.cloud.redis.v1beta1.Instance.TransitEncryptionMode); + + /** Instance maintenancePolicy. */ + public maintenancePolicy?: (google.cloud.redis.v1beta1.IMaintenancePolicy|null); + + /** Instance maintenanceSchedule. */ + public maintenanceSchedule?: (google.cloud.redis.v1beta1.IMaintenanceSchedule|null); + /** Instance replicaCount. */ public replicaCount: number; @@ -2812,6 +2884,13 @@ export namespace google { PRIVATE_SERVICE_ACCESS = 2 } + /** TransitEncryptionMode enum. */ + enum TransitEncryptionMode { + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0, + SERVER_AUTHENTICATION = 1, + DISABLED = 2 + } + /** ReadReplicasMode enum. */ enum ReadReplicasMode { READ_REPLICAS_MODE_UNSPECIFIED = 0, @@ -2820,6 +2899,437 @@ export namespace google { } } + /** Properties of a RescheduleMaintenanceRequest. */ + interface IRescheduleMaintenanceRequest { + + /** RescheduleMaintenanceRequest name */ + name?: (string|null); + + /** RescheduleMaintenanceRequest rescheduleType */ + rescheduleType?: (google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.RescheduleType|keyof typeof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.RescheduleType|null); + + /** RescheduleMaintenanceRequest scheduleTime */ + scheduleTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a RescheduleMaintenanceRequest. */ + class RescheduleMaintenanceRequest implements IRescheduleMaintenanceRequest { + + /** + * Constructs a new RescheduleMaintenanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest); + + /** RescheduleMaintenanceRequest name. */ + public name: string; + + /** RescheduleMaintenanceRequest rescheduleType. */ + public rescheduleType: (google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.RescheduleType|keyof typeof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.RescheduleType); + + /** RescheduleMaintenanceRequest scheduleTime. */ + public scheduleTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new RescheduleMaintenanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RescheduleMaintenanceRequest instance + */ + public static create(properties?: google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest): google.cloud.redis.v1beta1.RescheduleMaintenanceRequest; + + /** + * Encodes the specified RescheduleMaintenanceRequest message. Does not implicitly {@link google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.verify|verify} messages. + * @param message RescheduleMaintenanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RescheduleMaintenanceRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.verify|verify} messages. + * @param message RescheduleMaintenanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RescheduleMaintenanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RescheduleMaintenanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.redis.v1beta1.RescheduleMaintenanceRequest; + + /** + * Decodes a RescheduleMaintenanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RescheduleMaintenanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.redis.v1beta1.RescheduleMaintenanceRequest; + + /** + * Verifies a RescheduleMaintenanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RescheduleMaintenanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RescheduleMaintenanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1beta1.RescheduleMaintenanceRequest; + + /** + * Creates a plain object from a RescheduleMaintenanceRequest message. Also converts values to other types if specified. + * @param message RescheduleMaintenanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.redis.v1beta1.RescheduleMaintenanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RescheduleMaintenanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RescheduleMaintenanceRequest { + + /** RescheduleType enum. */ + enum RescheduleType { + RESCHEDULE_TYPE_UNSPECIFIED = 0, + IMMEDIATE = 1, + NEXT_AVAILABLE_WINDOW = 2, + SPECIFIC_TIME = 3 + } + } + + /** Properties of a MaintenancePolicy. */ + interface IMaintenancePolicy { + + /** MaintenancePolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** MaintenancePolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** MaintenancePolicy description */ + description?: (string|null); + + /** MaintenancePolicy weeklyMaintenanceWindow */ + weeklyMaintenanceWindow?: (google.cloud.redis.v1beta1.IWeeklyMaintenanceWindow[]|null); + } + + /** Represents a MaintenancePolicy. */ + class MaintenancePolicy implements IMaintenancePolicy { + + /** + * Constructs a new MaintenancePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.redis.v1beta1.IMaintenancePolicy); + + /** MaintenancePolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** MaintenancePolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** MaintenancePolicy description. */ + public description: string; + + /** MaintenancePolicy weeklyMaintenanceWindow. */ + public weeklyMaintenanceWindow: google.cloud.redis.v1beta1.IWeeklyMaintenanceWindow[]; + + /** + * Creates a new MaintenancePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenancePolicy instance + */ + public static create(properties?: google.cloud.redis.v1beta1.IMaintenancePolicy): google.cloud.redis.v1beta1.MaintenancePolicy; + + /** + * Encodes the specified MaintenancePolicy message. Does not implicitly {@link google.cloud.redis.v1beta1.MaintenancePolicy.verify|verify} messages. + * @param message MaintenancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.redis.v1beta1.IMaintenancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenancePolicy message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.MaintenancePolicy.verify|verify} messages. + * @param message MaintenancePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.redis.v1beta1.IMaintenancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenancePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.redis.v1beta1.MaintenancePolicy; + + /** + * Decodes a MaintenancePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.redis.v1beta1.MaintenancePolicy; + + /** + * Verifies a MaintenancePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenancePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenancePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1beta1.MaintenancePolicy; + + /** + * Creates a plain object from a MaintenancePolicy message. Also converts values to other types if specified. + * @param message MaintenancePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.redis.v1beta1.MaintenancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenancePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WeeklyMaintenanceWindow. */ + interface IWeeklyMaintenanceWindow { + + /** WeeklyMaintenanceWindow day */ + day?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); + + /** WeeklyMaintenanceWindow startTime */ + startTime?: (google.type.ITimeOfDay|null); + + /** WeeklyMaintenanceWindow duration */ + duration?: (google.protobuf.IDuration|null); + } + + /** Represents a WeeklyMaintenanceWindow. */ + class WeeklyMaintenanceWindow implements IWeeklyMaintenanceWindow { + + /** + * Constructs a new WeeklyMaintenanceWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.redis.v1beta1.IWeeklyMaintenanceWindow); + + /** WeeklyMaintenanceWindow day. */ + public day: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); + + /** WeeklyMaintenanceWindow startTime. */ + public startTime?: (google.type.ITimeOfDay|null); + + /** WeeklyMaintenanceWindow duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** + * Creates a new WeeklyMaintenanceWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns WeeklyMaintenanceWindow instance + */ + public static create(properties?: google.cloud.redis.v1beta1.IWeeklyMaintenanceWindow): google.cloud.redis.v1beta1.WeeklyMaintenanceWindow; + + /** + * Encodes the specified WeeklyMaintenanceWindow message. Does not implicitly {@link google.cloud.redis.v1beta1.WeeklyMaintenanceWindow.verify|verify} messages. + * @param message WeeklyMaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.redis.v1beta1.IWeeklyMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeeklyMaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.WeeklyMaintenanceWindow.verify|verify} messages. + * @param message WeeklyMaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.redis.v1beta1.IWeeklyMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WeeklyMaintenanceWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeeklyMaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.redis.v1beta1.WeeklyMaintenanceWindow; + + /** + * Decodes a WeeklyMaintenanceWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeeklyMaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.redis.v1beta1.WeeklyMaintenanceWindow; + + /** + * Verifies a WeeklyMaintenanceWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WeeklyMaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeeklyMaintenanceWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1beta1.WeeklyMaintenanceWindow; + + /** + * Creates a plain object from a WeeklyMaintenanceWindow message. Also converts values to other types if specified. + * @param message WeeklyMaintenanceWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.redis.v1beta1.WeeklyMaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeeklyMaintenanceWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MaintenanceSchedule. */ + interface IMaintenanceSchedule { + + /** MaintenanceSchedule startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceSchedule endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceSchedule canReschedule */ + canReschedule?: (boolean|null); + + /** MaintenanceSchedule scheduleDeadlineTime */ + scheduleDeadlineTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a MaintenanceSchedule. */ + class MaintenanceSchedule implements IMaintenanceSchedule { + + /** + * Constructs a new MaintenanceSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.redis.v1beta1.IMaintenanceSchedule); + + /** MaintenanceSchedule startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceSchedule endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceSchedule canReschedule. */ + public canReschedule: boolean; + + /** MaintenanceSchedule scheduleDeadlineTime. */ + public scheduleDeadlineTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new MaintenanceSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenanceSchedule instance + */ + public static create(properties?: google.cloud.redis.v1beta1.IMaintenanceSchedule): google.cloud.redis.v1beta1.MaintenanceSchedule; + + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.redis.v1beta1.MaintenanceSchedule.verify|verify} messages. + * @param message MaintenanceSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.redis.v1beta1.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.MaintenanceSchedule.verify|verify} messages. + * @param message MaintenanceSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.redis.v1beta1.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.redis.v1beta1.MaintenanceSchedule; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.redis.v1beta1.MaintenanceSchedule; + + /** + * Verifies a MaintenanceSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaintenanceSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1beta1.MaintenanceSchedule; + + /** + * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. + * @param message MaintenanceSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.redis.v1beta1.MaintenanceSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenanceSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a ListInstancesRequest. */ interface IListInstancesRequest { @@ -3114,6 +3624,186 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a GetInstanceAuthStringRequest. */ + interface IGetInstanceAuthStringRequest { + + /** GetInstanceAuthStringRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceAuthStringRequest. */ + class GetInstanceAuthStringRequest implements IGetInstanceAuthStringRequest { + + /** + * Constructs a new GetInstanceAuthStringRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest); + + /** GetInstanceAuthStringRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceAuthStringRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceAuthStringRequest instance + */ + public static create(properties?: google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest): google.cloud.redis.v1beta1.GetInstanceAuthStringRequest; + + /** + * Encodes the specified GetInstanceAuthStringRequest message. Does not implicitly {@link google.cloud.redis.v1beta1.GetInstanceAuthStringRequest.verify|verify} messages. + * @param message GetInstanceAuthStringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceAuthStringRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.GetInstanceAuthStringRequest.verify|verify} messages. + * @param message GetInstanceAuthStringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceAuthStringRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceAuthStringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.redis.v1beta1.GetInstanceAuthStringRequest; + + /** + * Decodes a GetInstanceAuthStringRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceAuthStringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.redis.v1beta1.GetInstanceAuthStringRequest; + + /** + * Verifies a GetInstanceAuthStringRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceAuthStringRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceAuthStringRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1beta1.GetInstanceAuthStringRequest; + + /** + * Creates a plain object from a GetInstanceAuthStringRequest message. Also converts values to other types if specified. + * @param message GetInstanceAuthStringRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.redis.v1beta1.GetInstanceAuthStringRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceAuthStringRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceAuthString. */ + interface IInstanceAuthString { + + /** InstanceAuthString authString */ + authString?: (string|null); + } + + /** Represents an InstanceAuthString. */ + class InstanceAuthString implements IInstanceAuthString { + + /** + * Constructs a new InstanceAuthString. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.redis.v1beta1.IInstanceAuthString); + + /** InstanceAuthString authString. */ + public authString: string; + + /** + * Creates a new InstanceAuthString instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceAuthString instance + */ + public static create(properties?: google.cloud.redis.v1beta1.IInstanceAuthString): google.cloud.redis.v1beta1.InstanceAuthString; + + /** + * Encodes the specified InstanceAuthString message. Does not implicitly {@link google.cloud.redis.v1beta1.InstanceAuthString.verify|verify} messages. + * @param message InstanceAuthString message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.redis.v1beta1.IInstanceAuthString, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceAuthString message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.InstanceAuthString.verify|verify} messages. + * @param message InstanceAuthString message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.redis.v1beta1.IInstanceAuthString, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceAuthString message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceAuthString + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.redis.v1beta1.InstanceAuthString; + + /** + * Decodes an InstanceAuthString message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceAuthString + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.redis.v1beta1.InstanceAuthString; + + /** + * Verifies an InstanceAuthString message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceAuthString message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceAuthString + */ + public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1beta1.InstanceAuthString; + + /** + * Creates a plain object from an InstanceAuthString message. Also converts values to other types if specified. + * @param message InstanceAuthString + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.redis.v1beta1.InstanceAuthString, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceAuthString to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a CreateInstanceRequest. */ interface ICreateInstanceRequest { @@ -4335,6 +5025,120 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of a TlsCertificate. */ + interface ITlsCertificate { + + /** TlsCertificate serialNumber */ + serialNumber?: (string|null); + + /** TlsCertificate cert */ + cert?: (string|null); + + /** TlsCertificate createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TlsCertificate expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** TlsCertificate sha1Fingerprint */ + sha1Fingerprint?: (string|null); + } + + /** Represents a TlsCertificate. */ + class TlsCertificate implements ITlsCertificate { + + /** + * Constructs a new TlsCertificate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.redis.v1beta1.ITlsCertificate); + + /** TlsCertificate serialNumber. */ + public serialNumber: string; + + /** TlsCertificate cert. */ + public cert: string; + + /** TlsCertificate createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TlsCertificate expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** TlsCertificate sha1Fingerprint. */ + public sha1Fingerprint: string; + + /** + * Creates a new TlsCertificate instance using the specified properties. + * @param [properties] Properties to set + * @returns TlsCertificate instance + */ + public static create(properties?: google.cloud.redis.v1beta1.ITlsCertificate): google.cloud.redis.v1beta1.TlsCertificate; + + /** + * Encodes the specified TlsCertificate message. Does not implicitly {@link google.cloud.redis.v1beta1.TlsCertificate.verify|verify} messages. + * @param message TlsCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.redis.v1beta1.ITlsCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TlsCertificate message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.TlsCertificate.verify|verify} messages. + * @param message TlsCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.redis.v1beta1.ITlsCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TlsCertificate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TlsCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.redis.v1beta1.TlsCertificate; + + /** + * Decodes a TlsCertificate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TlsCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.redis.v1beta1.TlsCertificate; + + /** + * Verifies a TlsCertificate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TlsCertificate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TlsCertificate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1beta1.TlsCertificate; + + /** + * Creates a plain object from a TlsCertificate message. Also converts values to other types if specified. + * @param message TlsCertificate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.redis.v1beta1.TlsCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TlsCertificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } } } @@ -9548,4 +10352,128 @@ export namespace google { public toJSON(): { [k: string]: any }; } } + + /** Namespace type. */ + namespace type { + + /** DayOfWeek enum. */ + enum DayOfWeek { + DAY_OF_WEEK_UNSPECIFIED = 0, + MONDAY = 1, + TUESDAY = 2, + WEDNESDAY = 3, + THURSDAY = 4, + FRIDAY = 5, + SATURDAY = 6, + SUNDAY = 7 + } + + /** Properties of a TimeOfDay. */ + interface ITimeOfDay { + + /** TimeOfDay hours */ + hours?: (number|null); + + /** TimeOfDay minutes */ + minutes?: (number|null); + + /** TimeOfDay seconds */ + seconds?: (number|null); + + /** TimeOfDay nanos */ + nanos?: (number|null); + } + + /** Represents a TimeOfDay. */ + class TimeOfDay implements ITimeOfDay { + + /** + * Constructs a new TimeOfDay. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ITimeOfDay); + + /** TimeOfDay hours. */ + public hours: number; + + /** TimeOfDay minutes. */ + public minutes: number; + + /** TimeOfDay seconds. */ + public seconds: number; + + /** TimeOfDay nanos. */ + public nanos: number; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeOfDay instance + */ + public static create(properties?: google.type.ITimeOfDay): google.type.TimeOfDay; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.TimeOfDay; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.TimeOfDay; + + /** + * Verifies a TimeOfDay message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeOfDay + */ + public static fromObject(object: { [k: string]: any }): google.type.TimeOfDay; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @param message TimeOfDay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.TimeOfDay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeOfDay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } } diff --git a/packages/google-cloud-redis/protos/protos.js b/packages/google-cloud-redis/protos/protos.js index dafc8a132da..2ef6afbcbe3 100644 --- a/packages/google-cloud-redis/protos/protos.js +++ b/packages/google-cloud-redis/protos/protos.js @@ -5420,6 +5420,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.redis.v1beta1.CloudRedis#getInstanceAuthString}. + * @memberof google.cloud.redis.v1beta1.CloudRedis + * @typedef GetInstanceAuthStringCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.redis.v1beta1.InstanceAuthString} [response] InstanceAuthString + */ + + /** + * Calls GetInstanceAuthString. + * @function getInstanceAuthString + * @memberof google.cloud.redis.v1beta1.CloudRedis + * @instance + * @param {google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest} request GetInstanceAuthStringRequest message or plain object + * @param {google.cloud.redis.v1beta1.CloudRedis.GetInstanceAuthStringCallback} callback Node-style callback called with the error, if any, and InstanceAuthString + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudRedis.prototype.getInstanceAuthString = function getInstanceAuthString(request, callback) { + return this.rpcCall(getInstanceAuthString, $root.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest, $root.google.cloud.redis.v1beta1.InstanceAuthString, request, callback); + }, "name", { value: "GetInstanceAuthString" }); + + /** + * Calls GetInstanceAuthString. + * @function getInstanceAuthString + * @memberof google.cloud.redis.v1beta1.CloudRedis + * @instance + * @param {google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest} request GetInstanceAuthStringRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.redis.v1beta1.CloudRedis#createInstance}. * @memberof google.cloud.redis.v1beta1.CloudRedis @@ -5651,6 +5684,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.redis.v1beta1.CloudRedis#rescheduleMaintenance}. + * @memberof google.cloud.redis.v1beta1.CloudRedis + * @typedef RescheduleMaintenanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RescheduleMaintenance. + * @function rescheduleMaintenance + * @memberof google.cloud.redis.v1beta1.CloudRedis + * @instance + * @param {google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest} request RescheduleMaintenanceRequest message or plain object + * @param {google.cloud.redis.v1beta1.CloudRedis.RescheduleMaintenanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudRedis.prototype.rescheduleMaintenance = function rescheduleMaintenance(request, callback) { + return this.rpcCall(rescheduleMaintenance, $root.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RescheduleMaintenance" }); + + /** + * Calls RescheduleMaintenance. + * @function rescheduleMaintenance + * @memberof google.cloud.redis.v1beta1.CloudRedis + * @instance + * @param {google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest} request RescheduleMaintenanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return CloudRedis; })(); @@ -5889,6 +5955,11 @@ * @property {string|null} [authorizedNetwork] Instance authorizedNetwork * @property {string|null} [persistenceIamIdentity] Instance persistenceIamIdentity * @property {google.cloud.redis.v1beta1.Instance.ConnectMode|null} [connectMode] Instance connectMode + * @property {boolean|null} [authEnabled] Instance authEnabled + * @property {Array.|null} [serverCaCerts] Instance serverCaCerts + * @property {google.cloud.redis.v1beta1.Instance.TransitEncryptionMode|null} [transitEncryptionMode] Instance transitEncryptionMode + * @property {google.cloud.redis.v1beta1.IMaintenancePolicy|null} [maintenancePolicy] Instance maintenancePolicy + * @property {google.cloud.redis.v1beta1.IMaintenanceSchedule|null} [maintenanceSchedule] Instance maintenanceSchedule * @property {number|null} [replicaCount] Instance replicaCount * @property {Array.|null} [nodes] Instance nodes * @property {string|null} [readEndpoint] Instance readEndpoint @@ -5907,6 +5978,7 @@ function Instance(properties) { this.labels = {}; this.redisConfigs = {}; + this.serverCaCerts = []; this.nodes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -6066,6 +6138,46 @@ */ Instance.prototype.connectMode = 0; + /** + * Instance authEnabled. + * @member {boolean} authEnabled + * @memberof google.cloud.redis.v1beta1.Instance + * @instance + */ + Instance.prototype.authEnabled = false; + + /** + * Instance serverCaCerts. + * @member {Array.} serverCaCerts + * @memberof google.cloud.redis.v1beta1.Instance + * @instance + */ + Instance.prototype.serverCaCerts = $util.emptyArray; + + /** + * Instance transitEncryptionMode. + * @member {google.cloud.redis.v1beta1.Instance.TransitEncryptionMode} transitEncryptionMode + * @memberof google.cloud.redis.v1beta1.Instance + * @instance + */ + Instance.prototype.transitEncryptionMode = 0; + + /** + * Instance maintenancePolicy. + * @member {google.cloud.redis.v1beta1.IMaintenancePolicy|null|undefined} maintenancePolicy + * @memberof google.cloud.redis.v1beta1.Instance + * @instance + */ + Instance.prototype.maintenancePolicy = null; + + /** + * Instance maintenanceSchedule. + * @member {google.cloud.redis.v1beta1.IMaintenanceSchedule|null|undefined} maintenanceSchedule + * @memberof google.cloud.redis.v1beta1.Instance + * @instance + */ + Instance.prototype.maintenanceSchedule = null; + /** * Instance replicaCount. * @member {number} replicaCount @@ -6170,6 +6282,17 @@ writer.uint32(/* id 21, wireType 2 =*/170).string(message.persistenceIamIdentity); if (message.connectMode != null && Object.hasOwnProperty.call(message, "connectMode")) writer.uint32(/* id 22, wireType 0 =*/176).int32(message.connectMode); + if (message.authEnabled != null && Object.hasOwnProperty.call(message, "authEnabled")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.authEnabled); + if (message.serverCaCerts != null && message.serverCaCerts.length) + for (var i = 0; i < message.serverCaCerts.length; ++i) + $root.google.cloud.redis.v1beta1.TlsCertificate.encode(message.serverCaCerts[i], writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.transitEncryptionMode != null && Object.hasOwnProperty.call(message, "transitEncryptionMode")) + writer.uint32(/* id 26, wireType 0 =*/208).int32(message.transitEncryptionMode); + if (message.maintenancePolicy != null && Object.hasOwnProperty.call(message, "maintenancePolicy")) + $root.google.cloud.redis.v1beta1.MaintenancePolicy.encode(message.maintenancePolicy, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.maintenanceSchedule != null && Object.hasOwnProperty.call(message, "maintenanceSchedule")) + $root.google.cloud.redis.v1beta1.MaintenanceSchedule.encode(message.maintenanceSchedule, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); if (message.replicaCount != null && Object.hasOwnProperty.call(message, "replicaCount")) writer.uint32(/* id 31, wireType 0 =*/248).int32(message.replicaCount); if (message.nodes != null && message.nodes.length) @@ -6310,6 +6433,23 @@ case 22: message.connectMode = reader.int32(); break; + case 23: + message.authEnabled = reader.bool(); + break; + case 25: + if (!(message.serverCaCerts && message.serverCaCerts.length)) + message.serverCaCerts = []; + message.serverCaCerts.push($root.google.cloud.redis.v1beta1.TlsCertificate.decode(reader, reader.uint32())); + break; + case 26: + message.transitEncryptionMode = reader.int32(); + break; + case 27: + message.maintenancePolicy = $root.google.cloud.redis.v1beta1.MaintenancePolicy.decode(reader, reader.uint32()); + break; + case 28: + message.maintenanceSchedule = $root.google.cloud.redis.v1beta1.MaintenanceSchedule.decode(reader, reader.uint32()); + break; case 31: message.replicaCount = reader.int32(); break; @@ -6455,6 +6595,37 @@ case 2: break; } + if (message.authEnabled != null && message.hasOwnProperty("authEnabled")) + if (typeof message.authEnabled !== "boolean") + return "authEnabled: boolean expected"; + if (message.serverCaCerts != null && message.hasOwnProperty("serverCaCerts")) { + if (!Array.isArray(message.serverCaCerts)) + return "serverCaCerts: array expected"; + for (var i = 0; i < message.serverCaCerts.length; ++i) { + var error = $root.google.cloud.redis.v1beta1.TlsCertificate.verify(message.serverCaCerts[i]); + if (error) + return "serverCaCerts." + error; + } + } + if (message.transitEncryptionMode != null && message.hasOwnProperty("transitEncryptionMode")) + switch (message.transitEncryptionMode) { + default: + return "transitEncryptionMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.maintenancePolicy != null && message.hasOwnProperty("maintenancePolicy")) { + var error = $root.google.cloud.redis.v1beta1.MaintenancePolicy.verify(message.maintenancePolicy); + if (error) + return "maintenancePolicy." + error; + } + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) { + var error = $root.google.cloud.redis.v1beta1.MaintenanceSchedule.verify(message.maintenanceSchedule); + if (error) + return "maintenanceSchedule." + error; + } if (message.replicaCount != null && message.hasOwnProperty("replicaCount")) if (!$util.isInteger(message.replicaCount)) return "replicaCount: integer expected"; @@ -6608,6 +6779,42 @@ message.connectMode = 2; break; } + if (object.authEnabled != null) + message.authEnabled = Boolean(object.authEnabled); + if (object.serverCaCerts) { + if (!Array.isArray(object.serverCaCerts)) + throw TypeError(".google.cloud.redis.v1beta1.Instance.serverCaCerts: array expected"); + message.serverCaCerts = []; + for (var i = 0; i < object.serverCaCerts.length; ++i) { + if (typeof object.serverCaCerts[i] !== "object") + throw TypeError(".google.cloud.redis.v1beta1.Instance.serverCaCerts: object expected"); + message.serverCaCerts[i] = $root.google.cloud.redis.v1beta1.TlsCertificate.fromObject(object.serverCaCerts[i]); + } + } + switch (object.transitEncryptionMode) { + case "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED": + case 0: + message.transitEncryptionMode = 0; + break; + case "SERVER_AUTHENTICATION": + case 1: + message.transitEncryptionMode = 1; + break; + case "DISABLED": + case 2: + message.transitEncryptionMode = 2; + break; + } + if (object.maintenancePolicy != null) { + if (typeof object.maintenancePolicy !== "object") + throw TypeError(".google.cloud.redis.v1beta1.Instance.maintenancePolicy: object expected"); + message.maintenancePolicy = $root.google.cloud.redis.v1beta1.MaintenancePolicy.fromObject(object.maintenancePolicy); + } + if (object.maintenanceSchedule != null) { + if (typeof object.maintenanceSchedule !== "object") + throw TypeError(".google.cloud.redis.v1beta1.Instance.maintenanceSchedule: object expected"); + message.maintenanceSchedule = $root.google.cloud.redis.v1beta1.MaintenanceSchedule.fromObject(object.maintenanceSchedule); + } if (object.replicaCount != null) message.replicaCount = object.replicaCount | 0; if (object.nodes) { @@ -6654,8 +6861,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { + object.serverCaCerts = []; object.nodes = []; + } if (options.objects || options.defaults) { object.labels = {}; object.redisConfigs = {}; @@ -6678,6 +6887,10 @@ object.authorizedNetwork = ""; object.persistenceIamIdentity = ""; object.connectMode = options.enums === String ? "CONNECT_MODE_UNSPECIFIED" : 0; + object.authEnabled = false; + object.transitEncryptionMode = options.enums === String ? "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED" : 0; + object.maintenancePolicy = null; + object.maintenanceSchedule = null; object.replicaCount = 0; object.readEndpoint = ""; object.readEndpointPort = 0; @@ -6728,6 +6941,19 @@ object.persistenceIamIdentity = message.persistenceIamIdentity; if (message.connectMode != null && message.hasOwnProperty("connectMode")) object.connectMode = options.enums === String ? $root.google.cloud.redis.v1beta1.Instance.ConnectMode[message.connectMode] : message.connectMode; + if (message.authEnabled != null && message.hasOwnProperty("authEnabled")) + object.authEnabled = message.authEnabled; + if (message.serverCaCerts && message.serverCaCerts.length) { + object.serverCaCerts = []; + for (var j = 0; j < message.serverCaCerts.length; ++j) + object.serverCaCerts[j] = $root.google.cloud.redis.v1beta1.TlsCertificate.toObject(message.serverCaCerts[j], options); + } + if (message.transitEncryptionMode != null && message.hasOwnProperty("transitEncryptionMode")) + object.transitEncryptionMode = options.enums === String ? $root.google.cloud.redis.v1beta1.Instance.TransitEncryptionMode[message.transitEncryptionMode] : message.transitEncryptionMode; + if (message.maintenancePolicy != null && message.hasOwnProperty("maintenancePolicy")) + object.maintenancePolicy = $root.google.cloud.redis.v1beta1.MaintenancePolicy.toObject(message.maintenancePolicy, options); + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) + object.maintenanceSchedule = $root.google.cloud.redis.v1beta1.MaintenanceSchedule.toObject(message.maintenanceSchedule, options); if (message.replicaCount != null && message.hasOwnProperty("replicaCount")) object.replicaCount = message.replicaCount; if (message.nodes && message.nodes.length) { @@ -6815,6 +7041,22 @@ return values; })(); + /** + * TransitEncryptionMode enum. + * @name google.cloud.redis.v1beta1.Instance.TransitEncryptionMode + * @enum {number} + * @property {number} TRANSIT_ENCRYPTION_MODE_UNSPECIFIED=0 TRANSIT_ENCRYPTION_MODE_UNSPECIFIED value + * @property {number} SERVER_AUTHENTICATION=1 SERVER_AUTHENTICATION value + * @property {number} DISABLED=2 DISABLED value + */ + Instance.TransitEncryptionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SERVER_AUTHENTICATION"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + return values; + })(); + /** * ReadReplicasMode enum. * @name google.cloud.redis.v1beta1.Instance.ReadReplicasMode @@ -6834,26 +7076,26 @@ return Instance; })(); - v1beta1.ListInstancesRequest = (function() { + v1beta1.RescheduleMaintenanceRequest = (function() { /** - * Properties of a ListInstancesRequest. + * Properties of a RescheduleMaintenanceRequest. * @memberof google.cloud.redis.v1beta1 - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {number|null} [pageSize] ListInstancesRequest pageSize - * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @interface IRescheduleMaintenanceRequest + * @property {string|null} [name] RescheduleMaintenanceRequest name + * @property {google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.RescheduleType|null} [rescheduleType] RescheduleMaintenanceRequest rescheduleType + * @property {google.protobuf.ITimestamp|null} [scheduleTime] RescheduleMaintenanceRequest scheduleTime */ /** - * Constructs a new ListInstancesRequest. + * Constructs a new RescheduleMaintenanceRequest. * @memberof google.cloud.redis.v1beta1 - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest + * @classdesc Represents a RescheduleMaintenanceRequest. + * @implements IRescheduleMaintenanceRequest * @constructor - * @param {google.cloud.redis.v1beta1.IListInstancesRequest=} [properties] Properties to set + * @param {google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest=} [properties] Properties to set */ - function ListInstancesRequest(properties) { + function RescheduleMaintenanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6861,101 +7103,101 @@ } /** - * ListInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * RescheduleMaintenanceRequest name. + * @member {string} name + * @memberof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest * @instance */ - ListInstancesRequest.prototype.parent = ""; + RescheduleMaintenanceRequest.prototype.name = ""; /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * RescheduleMaintenanceRequest rescheduleType. + * @member {google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.RescheduleType} rescheduleType + * @memberof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest * @instance */ - ListInstancesRequest.prototype.pageSize = 0; + RescheduleMaintenanceRequest.prototype.rescheduleType = 0; /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * RescheduleMaintenanceRequest scheduleTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime + * @memberof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest * @instance */ - ListInstancesRequest.prototype.pageToken = ""; + RescheduleMaintenanceRequest.prototype.scheduleTime = null; /** - * Creates a new ListInstancesRequest instance using the specified properties. + * Creates a new RescheduleMaintenanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @memberof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest * @static - * @param {google.cloud.redis.v1beta1.IListInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.redis.v1beta1.ListInstancesRequest} ListInstancesRequest instance + * @param {google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest=} [properties] Properties to set + * @returns {google.cloud.redis.v1beta1.RescheduleMaintenanceRequest} RescheduleMaintenanceRequest instance */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); + RescheduleMaintenanceRequest.create = function create(properties) { + return new RescheduleMaintenanceRequest(properties); }; /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.redis.v1beta1.ListInstancesRequest.verify|verify} messages. + * Encodes the specified RescheduleMaintenanceRequest message. Does not implicitly {@link google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @memberof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest * @static - * @param {google.cloud.redis.v1beta1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest} message RescheduleMaintenanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesRequest.encode = function encode(message, writer) { + RescheduleMaintenanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.rescheduleType != null && Object.hasOwnProperty.call(message, "rescheduleType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rescheduleType); + if (message.scheduleTime != null && Object.hasOwnProperty.call(message, "scheduleTime")) + $root.google.protobuf.Timestamp.encode(message.scheduleTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.ListInstancesRequest.verify|verify} messages. + * Encodes the specified RescheduleMaintenanceRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @memberof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest * @static - * @param {google.cloud.redis.v1beta1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest} message RescheduleMaintenanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + RescheduleMaintenanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. + * Decodes a RescheduleMaintenanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @memberof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.redis.v1beta1.ListInstancesRequest} ListInstancesRequest + * @returns {google.cloud.redis.v1beta1.RescheduleMaintenanceRequest} RescheduleMaintenanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListInstancesRequest.decode = function decode(reader, length) { + RescheduleMaintenanceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.ListInstancesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.pageSize = reader.int32(); + message.rescheduleType = reader.int32(); break; case 3: - message.pageToken = reader.string(); + message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6966,128 +7208,174 @@ }; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes a RescheduleMaintenanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @memberof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.redis.v1beta1.ListInstancesRequest} ListInstancesRequest + * @returns {google.cloud.redis.v1beta1.RescheduleMaintenanceRequest} RescheduleMaintenanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + RescheduleMaintenanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListInstancesRequest message. + * Verifies a RescheduleMaintenanceRequest message. * @function verify - * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @memberof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListInstancesRequest.verify = function verify(message) { + RescheduleMaintenanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.rescheduleType != null && message.hasOwnProperty("rescheduleType")) + switch (message.rescheduleType) { + default: + return "rescheduleType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduleTime); + if (error) + return "scheduleTime." + error; + } return null; }; /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RescheduleMaintenanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @memberof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.redis.v1beta1.ListInstancesRequest} ListInstancesRequest + * @returns {google.cloud.redis.v1beta1.RescheduleMaintenanceRequest} RescheduleMaintenanceRequest */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.redis.v1beta1.ListInstancesRequest) + RescheduleMaintenanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest) return object; - var message = new $root.google.cloud.redis.v1beta1.ListInstancesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.rescheduleType) { + case "RESCHEDULE_TYPE_UNSPECIFIED": + case 0: + message.rescheduleType = 0; + break; + case "IMMEDIATE": + case 1: + message.rescheduleType = 1; + break; + case "NEXT_AVAILABLE_WINDOW": + case 2: + message.rescheduleType = 2; + break; + case "SPECIFIC_TIME": + case 3: + message.rescheduleType = 3; + break; + } + if (object.scheduleTime != null) { + if (typeof object.scheduleTime !== "object") + throw TypeError(".google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.scheduleTime: object expected"); + message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); + } return message; }; /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * Creates a plain object from a RescheduleMaintenanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @memberof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest * @static - * @param {google.cloud.redis.v1beta1.ListInstancesRequest} message ListInstancesRequest + * @param {google.cloud.redis.v1beta1.RescheduleMaintenanceRequest} message RescheduleMaintenanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesRequest.toObject = function toObject(message, options) { + RescheduleMaintenanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + object.name = ""; + object.rescheduleType = options.enums === String ? "RESCHEDULE_TYPE_UNSPECIFIED" : 0; + object.scheduleTime = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.rescheduleType != null && message.hasOwnProperty("rescheduleType")) + object.rescheduleType = options.enums === String ? $root.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.RescheduleType[message.rescheduleType] : message.rescheduleType; + if (message.scheduleTime != null && message.hasOwnProperty("scheduleTime")) + object.scheduleTime = $root.google.protobuf.Timestamp.toObject(message.scheduleTime, options); return object; }; /** - * Converts this ListInstancesRequest to JSON. + * Converts this RescheduleMaintenanceRequest to JSON. * @function toJSON - * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @memberof google.cloud.redis.v1beta1.RescheduleMaintenanceRequest * @instance * @returns {Object.} JSON object */ - ListInstancesRequest.prototype.toJSON = function toJSON() { + RescheduleMaintenanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListInstancesRequest; + /** + * RescheduleType enum. + * @name google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.RescheduleType + * @enum {number} + * @property {number} RESCHEDULE_TYPE_UNSPECIFIED=0 RESCHEDULE_TYPE_UNSPECIFIED value + * @property {number} IMMEDIATE=1 IMMEDIATE value + * @property {number} NEXT_AVAILABLE_WINDOW=2 NEXT_AVAILABLE_WINDOW value + * @property {number} SPECIFIC_TIME=3 SPECIFIC_TIME value + */ + RescheduleMaintenanceRequest.RescheduleType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESCHEDULE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMMEDIATE"] = 1; + values[valuesById[2] = "NEXT_AVAILABLE_WINDOW"] = 2; + values[valuesById[3] = "SPECIFIC_TIME"] = 3; + return values; + })(); + + return RescheduleMaintenanceRequest; })(); - v1beta1.ListInstancesResponse = (function() { + v1beta1.MaintenancePolicy = (function() { /** - * Properties of a ListInstancesResponse. + * Properties of a MaintenancePolicy. * @memberof google.cloud.redis.v1beta1 - * @interface IListInstancesResponse - * @property {Array.|null} [instances] ListInstancesResponse instances - * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken - * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + * @interface IMaintenancePolicy + * @property {google.protobuf.ITimestamp|null} [createTime] MaintenancePolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] MaintenancePolicy updateTime + * @property {string|null} [description] MaintenancePolicy description + * @property {Array.|null} [weeklyMaintenanceWindow] MaintenancePolicy weeklyMaintenanceWindow */ /** - * Constructs a new ListInstancesResponse. + * Constructs a new MaintenancePolicy. * @memberof google.cloud.redis.v1beta1 - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse + * @classdesc Represents a MaintenancePolicy. + * @implements IMaintenancePolicy * @constructor - * @param {google.cloud.redis.v1beta1.IListInstancesResponse=} [properties] Properties to set + * @param {google.cloud.redis.v1beta1.IMaintenancePolicy=} [properties] Properties to set */ - function ListInstancesResponse(properties) { - this.instances = []; - this.unreachable = []; + function MaintenancePolicy(properties) { + this.weeklyMaintenanceWindow = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7095,107 +7383,117 @@ } /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * MaintenancePolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.redis.v1beta1.MaintenancePolicy * @instance */ - ListInstancesResponse.prototype.instances = $util.emptyArray; + MaintenancePolicy.prototype.createTime = null; /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * MaintenancePolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.redis.v1beta1.MaintenancePolicy * @instance */ - ListInstancesResponse.prototype.nextPageToken = ""; + MaintenancePolicy.prototype.updateTime = null; /** - * ListInstancesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * MaintenancePolicy description. + * @member {string} description + * @memberof google.cloud.redis.v1beta1.MaintenancePolicy * @instance */ - ListInstancesResponse.prototype.unreachable = $util.emptyArray; + MaintenancePolicy.prototype.description = ""; /** - * Creates a new ListInstancesResponse instance using the specified properties. + * MaintenancePolicy weeklyMaintenanceWindow. + * @member {Array.} weeklyMaintenanceWindow + * @memberof google.cloud.redis.v1beta1.MaintenancePolicy + * @instance + */ + MaintenancePolicy.prototype.weeklyMaintenanceWindow = $util.emptyArray; + + /** + * Creates a new MaintenancePolicy instance using the specified properties. * @function create - * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @memberof google.cloud.redis.v1beta1.MaintenancePolicy * @static - * @param {google.cloud.redis.v1beta1.IListInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.redis.v1beta1.ListInstancesResponse} ListInstancesResponse instance + * @param {google.cloud.redis.v1beta1.IMaintenancePolicy=} [properties] Properties to set + * @returns {google.cloud.redis.v1beta1.MaintenancePolicy} MaintenancePolicy instance */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); + MaintenancePolicy.create = function create(properties) { + return new MaintenancePolicy(properties); }; /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.redis.v1beta1.ListInstancesResponse.verify|verify} messages. + * Encodes the specified MaintenancePolicy message. Does not implicitly {@link google.cloud.redis.v1beta1.MaintenancePolicy.verify|verify} messages. * @function encode - * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @memberof google.cloud.redis.v1beta1.MaintenancePolicy * @static - * @param {google.cloud.redis.v1beta1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {google.cloud.redis.v1beta1.IMaintenancePolicy} message MaintenancePolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesResponse.encode = function encode(message, writer) { + MaintenancePolicy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.redis.v1beta1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.weeklyMaintenanceWindow != null && message.weeklyMaintenanceWindow.length) + for (var i = 0; i < message.weeklyMaintenanceWindow.length; ++i) + $root.google.cloud.redis.v1beta1.WeeklyMaintenanceWindow.encode(message.weeklyMaintenanceWindow[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.ListInstancesResponse.verify|verify} messages. + * Encodes the specified MaintenancePolicy message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.MaintenancePolicy.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @memberof google.cloud.redis.v1beta1.MaintenancePolicy * @static - * @param {google.cloud.redis.v1beta1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {google.cloud.redis.v1beta1.IMaintenancePolicy} message MaintenancePolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + MaintenancePolicy.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. + * Decodes a MaintenancePolicy message from the specified reader or buffer. * @function decode - * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @memberof google.cloud.redis.v1beta1.MaintenancePolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.redis.v1beta1.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.redis.v1beta1.MaintenancePolicy} MaintenancePolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListInstancesResponse.decode = function decode(reader, length) { + MaintenancePolicy.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.ListInstancesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.MaintenancePolicy(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.redis.v1beta1.Instance.decode(reader, reader.uint32())); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 2: - message.nextPageToken = reader.string(); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 3: - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.description = reader.string(); + break; + case 4: + if (!(message.weeklyMaintenanceWindow && message.weeklyMaintenanceWindow.length)) + message.weeklyMaintenanceWindow = []; + message.weeklyMaintenanceWindow.push($root.google.cloud.redis.v1beta1.WeeklyMaintenanceWindow.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -7206,154 +7504,1590 @@ }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a MaintenancePolicy message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @memberof google.cloud.redis.v1beta1.MaintenancePolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.redis.v1beta1.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.redis.v1beta1.MaintenancePolicy} MaintenancePolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + MaintenancePolicy.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListInstancesResponse message. + * Verifies a MaintenancePolicy message. * @function verify - * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @memberof google.cloud.redis.v1beta1.MaintenancePolicy * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListInstancesResponse.verify = function verify(message) { + MaintenancePolicy.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.redis.v1beta1.Instance.verify(message.instances[i]); + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.weeklyMaintenanceWindow != null && message.hasOwnProperty("weeklyMaintenanceWindow")) { + if (!Array.isArray(message.weeklyMaintenanceWindow)) + return "weeklyMaintenanceWindow: array expected"; + for (var i = 0; i < message.weeklyMaintenanceWindow.length; ++i) { + var error = $root.google.cloud.redis.v1beta1.WeeklyMaintenanceWindow.verify(message.weeklyMaintenanceWindow[i]); if (error) - return "instances." + error; + return "weeklyMaintenanceWindow." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } return null; }; /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a MaintenancePolicy message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @memberof google.cloud.redis.v1beta1.MaintenancePolicy * @static * @param {Object.} object Plain object - * @returns {google.cloud.redis.v1beta1.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.redis.v1beta1.MaintenancePolicy} MaintenancePolicy */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.redis.v1beta1.ListInstancesResponse) + MaintenancePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1beta1.MaintenancePolicy) return object; - var message = new $root.google.cloud.redis.v1beta1.ListInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.redis.v1beta1.ListInstancesResponse.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.redis.v1beta1.ListInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.redis.v1beta1.Instance.fromObject(object.instances[i]); - } + var message = new $root.google.cloud.redis.v1beta1.MaintenancePolicy(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.redis.v1beta1.MaintenancePolicy.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.redis.v1beta1.ListInstancesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.redis.v1beta1.MaintenancePolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.description != null) + message.description = String(object.description); + if (object.weeklyMaintenanceWindow) { + if (!Array.isArray(object.weeklyMaintenanceWindow)) + throw TypeError(".google.cloud.redis.v1beta1.MaintenancePolicy.weeklyMaintenanceWindow: array expected"); + message.weeklyMaintenanceWindow = []; + for (var i = 0; i < object.weeklyMaintenanceWindow.length; ++i) { + if (typeof object.weeklyMaintenanceWindow[i] !== "object") + throw TypeError(".google.cloud.redis.v1beta1.MaintenancePolicy.weeklyMaintenanceWindow: object expected"); + message.weeklyMaintenanceWindow[i] = $root.google.cloud.redis.v1beta1.WeeklyMaintenanceWindow.fromObject(object.weeklyMaintenanceWindow[i]); + } } return message; }; /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * Creates a plain object from a MaintenancePolicy message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @memberof google.cloud.redis.v1beta1.MaintenancePolicy * @static - * @param {google.cloud.redis.v1beta1.ListInstancesResponse} message ListInstancesResponse + * @param {google.cloud.redis.v1beta1.MaintenancePolicy} message MaintenancePolicy * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesResponse.toObject = function toObject(message, options) { + MaintenancePolicy.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.instances = []; - object.unreachable = []; + if (options.arrays || options.defaults) + object.weeklyMaintenanceWindow = []; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + object.description = ""; } - if (options.defaults) - object.nextPageToken = ""; - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.redis.v1beta1.Instance.toObject(message.instances[j], options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.weeklyMaintenanceWindow && message.weeklyMaintenanceWindow.length) { + object.weeklyMaintenanceWindow = []; + for (var j = 0; j < message.weeklyMaintenanceWindow.length; ++j) + object.weeklyMaintenanceWindow[j] = $root.google.cloud.redis.v1beta1.WeeklyMaintenanceWindow.toObject(message.weeklyMaintenanceWindow[j], options); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; + return object; + }; + + /** + * Converts this MaintenancePolicy to JSON. + * @function toJSON + * @memberof google.cloud.redis.v1beta1.MaintenancePolicy + * @instance + * @returns {Object.} JSON object + */ + MaintenancePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MaintenancePolicy; + })(); + + v1beta1.WeeklyMaintenanceWindow = (function() { + + /** + * Properties of a WeeklyMaintenanceWindow. + * @memberof google.cloud.redis.v1beta1 + * @interface IWeeklyMaintenanceWindow + * @property {google.type.DayOfWeek|null} [day] WeeklyMaintenanceWindow day + * @property {google.type.ITimeOfDay|null} [startTime] WeeklyMaintenanceWindow startTime + * @property {google.protobuf.IDuration|null} [duration] WeeklyMaintenanceWindow duration + */ + + /** + * Constructs a new WeeklyMaintenanceWindow. + * @memberof google.cloud.redis.v1beta1 + * @classdesc Represents a WeeklyMaintenanceWindow. + * @implements IWeeklyMaintenanceWindow + * @constructor + * @param {google.cloud.redis.v1beta1.IWeeklyMaintenanceWindow=} [properties] Properties to set + */ + function WeeklyMaintenanceWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WeeklyMaintenanceWindow day. + * @member {google.type.DayOfWeek} day + * @memberof google.cloud.redis.v1beta1.WeeklyMaintenanceWindow + * @instance + */ + WeeklyMaintenanceWindow.prototype.day = 0; + + /** + * WeeklyMaintenanceWindow startTime. + * @member {google.type.ITimeOfDay|null|undefined} startTime + * @memberof google.cloud.redis.v1beta1.WeeklyMaintenanceWindow + * @instance + */ + WeeklyMaintenanceWindow.prototype.startTime = null; + + /** + * WeeklyMaintenanceWindow duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.redis.v1beta1.WeeklyMaintenanceWindow + * @instance + */ + WeeklyMaintenanceWindow.prototype.duration = null; + + /** + * Creates a new WeeklyMaintenanceWindow instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1beta1.WeeklyMaintenanceWindow + * @static + * @param {google.cloud.redis.v1beta1.IWeeklyMaintenanceWindow=} [properties] Properties to set + * @returns {google.cloud.redis.v1beta1.WeeklyMaintenanceWindow} WeeklyMaintenanceWindow instance + */ + WeeklyMaintenanceWindow.create = function create(properties) { + return new WeeklyMaintenanceWindow(properties); + }; + + /** + * Encodes the specified WeeklyMaintenanceWindow message. Does not implicitly {@link google.cloud.redis.v1beta1.WeeklyMaintenanceWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1beta1.WeeklyMaintenanceWindow + * @static + * @param {google.cloud.redis.v1beta1.IWeeklyMaintenanceWindow} message WeeklyMaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklyMaintenanceWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.day); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.type.TimeOfDay.encode(message.startTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WeeklyMaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.WeeklyMaintenanceWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1beta1.WeeklyMaintenanceWindow + * @static + * @param {google.cloud.redis.v1beta1.IWeeklyMaintenanceWindow} message WeeklyMaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeeklyMaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeeklyMaintenanceWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.redis.v1beta1.WeeklyMaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.redis.v1beta1.WeeklyMaintenanceWindow} WeeklyMaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklyMaintenanceWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.WeeklyMaintenanceWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.day = reader.int32(); + break; + case 2: + message.startTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); + break; + case 3: + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; + + /** + * Decodes a WeeklyMaintenanceWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.redis.v1beta1.WeeklyMaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1beta1.WeeklyMaintenanceWindow} WeeklyMaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeeklyMaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeeklyMaintenanceWindow message. + * @function verify + * @memberof google.cloud.redis.v1beta1.WeeklyMaintenanceWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeeklyMaintenanceWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.day != null && message.hasOwnProperty("day")) + switch (message.day) { + default: + return "day: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.type.TimeOfDay.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + return null; + }; + + /** + * Creates a WeeklyMaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.redis.v1beta1.WeeklyMaintenanceWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1beta1.WeeklyMaintenanceWindow} WeeklyMaintenanceWindow + */ + WeeklyMaintenanceWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1beta1.WeeklyMaintenanceWindow) + return object; + var message = new $root.google.cloud.redis.v1beta1.WeeklyMaintenanceWindow(); + switch (object.day) { + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.day = 0; + break; + case "MONDAY": + case 1: + message.day = 1; + break; + case "TUESDAY": + case 2: + message.day = 2; + break; + case "WEDNESDAY": + case 3: + message.day = 3; + break; + case "THURSDAY": + case 4: + message.day = 4; + break; + case "FRIDAY": + case 5: + message.day = 5; + break; + case "SATURDAY": + case 6: + message.day = 6; + break; + case "SUNDAY": + case 7: + message.day = 7; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.redis.v1beta1.WeeklyMaintenanceWindow.startTime: object expected"); + message.startTime = $root.google.type.TimeOfDay.fromObject(object.startTime); + } + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.cloud.redis.v1beta1.WeeklyMaintenanceWindow.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; + + /** + * Creates a plain object from a WeeklyMaintenanceWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.redis.v1beta1.WeeklyMaintenanceWindow + * @static + * @param {google.cloud.redis.v1beta1.WeeklyMaintenanceWindow} message WeeklyMaintenanceWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeeklyMaintenanceWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.day = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; + object.startTime = null; + object.duration = null; + } + if (message.day != null && message.hasOwnProperty("day")) + object.day = options.enums === String ? $root.google.type.DayOfWeek[message.day] : message.day; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.type.TimeOfDay.toObject(message.startTime, options); + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + return object; + }; + + /** + * Converts this WeeklyMaintenanceWindow to JSON. + * @function toJSON + * @memberof google.cloud.redis.v1beta1.WeeklyMaintenanceWindow + * @instance + * @returns {Object.} JSON object + */ + WeeklyMaintenanceWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WeeklyMaintenanceWindow; + })(); + + v1beta1.MaintenanceSchedule = (function() { + + /** + * Properties of a MaintenanceSchedule. + * @memberof google.cloud.redis.v1beta1 + * @interface IMaintenanceSchedule + * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceSchedule startTime + * @property {google.protobuf.ITimestamp|null} [endTime] MaintenanceSchedule endTime + * @property {boolean|null} [canReschedule] MaintenanceSchedule canReschedule + * @property {google.protobuf.ITimestamp|null} [scheduleDeadlineTime] MaintenanceSchedule scheduleDeadlineTime + */ + + /** + * Constructs a new MaintenanceSchedule. + * @memberof google.cloud.redis.v1beta1 + * @classdesc Represents a MaintenanceSchedule. + * @implements IMaintenanceSchedule + * @constructor + * @param {google.cloud.redis.v1beta1.IMaintenanceSchedule=} [properties] Properties to set + */ + function MaintenanceSchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaintenanceSchedule startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.redis.v1beta1.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.startTime = null; + + /** + * MaintenanceSchedule endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.redis.v1beta1.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.endTime = null; + + /** + * MaintenanceSchedule canReschedule. + * @member {boolean} canReschedule + * @memberof google.cloud.redis.v1beta1.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.canReschedule = false; + + /** + * MaintenanceSchedule scheduleDeadlineTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduleDeadlineTime + * @memberof google.cloud.redis.v1beta1.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.scheduleDeadlineTime = null; + + /** + * Creates a new MaintenanceSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1beta1.MaintenanceSchedule + * @static + * @param {google.cloud.redis.v1beta1.IMaintenanceSchedule=} [properties] Properties to set + * @returns {google.cloud.redis.v1beta1.MaintenanceSchedule} MaintenanceSchedule instance + */ + MaintenanceSchedule.create = function create(properties) { + return new MaintenanceSchedule(properties); + }; + + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.redis.v1beta1.MaintenanceSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1beta1.MaintenanceSchedule + * @static + * @param {google.cloud.redis.v1beta1.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.canReschedule != null && Object.hasOwnProperty.call(message, "canReschedule")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.canReschedule); + if (message.scheduleDeadlineTime != null && Object.hasOwnProperty.call(message, "scheduleDeadlineTime")) + $root.google.protobuf.Timestamp.encode(message.scheduleDeadlineTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.MaintenanceSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1beta1.MaintenanceSchedule + * @static + * @param {google.cloud.redis.v1beta1.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenanceSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.redis.v1beta1.MaintenanceSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.redis.v1beta1.MaintenanceSchedule} MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceSchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.MaintenanceSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.canReschedule = reader.bool(); + break; + case 5: + message.scheduleDeadlineTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.redis.v1beta1.MaintenanceSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1beta1.MaintenanceSchedule} MaintenanceSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenanceSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenanceSchedule message. + * @function verify + * @memberof google.cloud.redis.v1beta1.MaintenanceSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenanceSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.canReschedule != null && message.hasOwnProperty("canReschedule")) + if (typeof message.canReschedule !== "boolean") + return "canReschedule: boolean expected"; + if (message.scheduleDeadlineTime != null && message.hasOwnProperty("scheduleDeadlineTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduleDeadlineTime); + if (error) + return "scheduleDeadlineTime." + error; + } + return null; + }; + + /** + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.redis.v1beta1.MaintenanceSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1beta1.MaintenanceSchedule} MaintenanceSchedule + */ + MaintenanceSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1beta1.MaintenanceSchedule) + return object; + var message = new $root.google.cloud.redis.v1beta1.MaintenanceSchedule(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.redis.v1beta1.MaintenanceSchedule.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.redis.v1beta1.MaintenanceSchedule.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.canReschedule != null) + message.canReschedule = Boolean(object.canReschedule); + if (object.scheduleDeadlineTime != null) { + if (typeof object.scheduleDeadlineTime !== "object") + throw TypeError(".google.cloud.redis.v1beta1.MaintenanceSchedule.scheduleDeadlineTime: object expected"); + message.scheduleDeadlineTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleDeadlineTime); + } + return message; + }; + + /** + * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.redis.v1beta1.MaintenanceSchedule + * @static + * @param {google.cloud.redis.v1beta1.MaintenanceSchedule} message MaintenanceSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenanceSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.canReschedule = false; + object.scheduleDeadlineTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.canReschedule != null && message.hasOwnProperty("canReschedule")) + object.canReschedule = message.canReschedule; + if (message.scheduleDeadlineTime != null && message.hasOwnProperty("scheduleDeadlineTime")) + object.scheduleDeadlineTime = $root.google.protobuf.Timestamp.toObject(message.scheduleDeadlineTime, options); + return object; + }; + + /** + * Converts this MaintenanceSchedule to JSON. + * @function toJSON + * @memberof google.cloud.redis.v1beta1.MaintenanceSchedule + * @instance + * @returns {Object.} JSON object + */ + MaintenanceSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MaintenanceSchedule; + })(); + + v1beta1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.redis.v1beta1 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.redis.v1beta1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.redis.v1beta1.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @static + * @param {google.cloud.redis.v1beta1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.redis.v1beta1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.redis.v1beta1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @static + * @param {google.cloud.redis.v1beta1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @static + * @param {google.cloud.redis.v1beta1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.redis.v1beta1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1beta1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1beta1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1beta1.ListInstancesRequest) + return object; + var message = new $root.google.cloud.redis.v1beta1.ListInstancesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @static + * @param {google.cloud.redis.v1beta1.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.redis.v1beta1.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesRequest; + })(); + + v1beta1.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.redis.v1beta1 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.redis.v1beta1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.redis.v1beta1.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @static + * @param {google.cloud.redis.v1beta1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.redis.v1beta1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.redis.v1beta1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @static + * @param {google.cloud.redis.v1beta1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.redis.v1beta1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @static + * @param {google.cloud.redis.v1beta1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.redis.v1beta1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.redis.v1beta1.Instance.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + case 3: + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1beta1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.redis.v1beta1.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1beta1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1beta1.ListInstancesResponse) + return object; + var message = new $root.google.cloud.redis.v1beta1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.redis.v1beta1.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.redis.v1beta1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.redis.v1beta1.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.redis.v1beta1.ListInstancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @static + * @param {google.cloud.redis.v1beta1.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.redis.v1beta1.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesResponse; + })(); + + v1beta1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.redis.v1beta1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.redis.v1beta1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.redis.v1beta1.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @static + * @param {google.cloud.redis.v1beta1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.redis.v1beta1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.redis.v1beta1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @static + * @param {google.cloud.redis.v1beta1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @static + * @param {google.cloud.redis.v1beta1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.redis.v1beta1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1beta1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1beta1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1beta1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.redis.v1beta1.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @static + * @param {google.cloud.redis.v1beta1.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInstanceRequest; + })(); + + v1beta1.GetInstanceAuthStringRequest = (function() { + + /** + * Properties of a GetInstanceAuthStringRequest. + * @memberof google.cloud.redis.v1beta1 + * @interface IGetInstanceAuthStringRequest + * @property {string|null} [name] GetInstanceAuthStringRequest name + */ + + /** + * Constructs a new GetInstanceAuthStringRequest. + * @memberof google.cloud.redis.v1beta1 + * @classdesc Represents a GetInstanceAuthStringRequest. + * @implements IGetInstanceAuthStringRequest + * @constructor + * @param {google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest=} [properties] Properties to set + */ + function GetInstanceAuthStringRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceAuthStringRequest name. + * @member {string} name + * @memberof google.cloud.redis.v1beta1.GetInstanceAuthStringRequest + * @instance + */ + GetInstanceAuthStringRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceAuthStringRequest instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1beta1.GetInstanceAuthStringRequest + * @static + * @param {google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest=} [properties] Properties to set + * @returns {google.cloud.redis.v1beta1.GetInstanceAuthStringRequest} GetInstanceAuthStringRequest instance + */ + GetInstanceAuthStringRequest.create = function create(properties) { + return new GetInstanceAuthStringRequest(properties); + }; + + /** + * Encodes the specified GetInstanceAuthStringRequest message. Does not implicitly {@link google.cloud.redis.v1beta1.GetInstanceAuthStringRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1beta1.GetInstanceAuthStringRequest + * @static + * @param {google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest} message GetInstanceAuthStringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceAuthStringRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstanceAuthStringRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.GetInstanceAuthStringRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1beta1.GetInstanceAuthStringRequest + * @static + * @param {google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest} message GetInstanceAuthStringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceAuthStringRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceAuthStringRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.redis.v1beta1.GetInstanceAuthStringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.redis.v1beta1.GetInstanceAuthStringRequest} GetInstanceAuthStringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceAuthStringRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceAuthStringRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.redis.v1beta1.GetInstanceAuthStringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1beta1.GetInstanceAuthStringRequest} GetInstanceAuthStringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceAuthStringRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceAuthStringRequest message. + * @function verify + * @memberof google.cloud.redis.v1beta1.GetInstanceAuthStringRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceAuthStringRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInstanceAuthStringRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.redis.v1beta1.GetInstanceAuthStringRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1beta1.GetInstanceAuthStringRequest} GetInstanceAuthStringRequest + */ + GetInstanceAuthStringRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest) + return object; + var message = new $root.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceAuthStringRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.redis.v1beta1.GetInstanceAuthStringRequest + * @static + * @param {google.cloud.redis.v1beta1.GetInstanceAuthStringRequest} message GetInstanceAuthStringRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceAuthStringRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListInstancesResponse to JSON. + * Converts this GetInstanceAuthStringRequest to JSON. * @function toJSON - * @memberof google.cloud.redis.v1beta1.ListInstancesResponse + * @memberof google.cloud.redis.v1beta1.GetInstanceAuthStringRequest * @instance * @returns {Object.} JSON object */ - ListInstancesResponse.prototype.toJSON = function toJSON() { + GetInstanceAuthStringRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListInstancesResponse; + return GetInstanceAuthStringRequest; })(); - v1beta1.GetInstanceRequest = (function() { + v1beta1.InstanceAuthString = (function() { /** - * Properties of a GetInstanceRequest. + * Properties of an InstanceAuthString. * @memberof google.cloud.redis.v1beta1 - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name + * @interface IInstanceAuthString + * @property {string|null} [authString] InstanceAuthString authString */ /** - * Constructs a new GetInstanceRequest. + * Constructs a new InstanceAuthString. * @memberof google.cloud.redis.v1beta1 - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest + * @classdesc Represents an InstanceAuthString. + * @implements IInstanceAuthString * @constructor - * @param {google.cloud.redis.v1beta1.IGetInstanceRequest=} [properties] Properties to set + * @param {google.cloud.redis.v1beta1.IInstanceAuthString=} [properties] Properties to set */ - function GetInstanceRequest(properties) { + function InstanceAuthString(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7361,75 +9095,75 @@ } /** - * GetInstanceRequest name. - * @member {string} name - * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * InstanceAuthString authString. + * @member {string} authString + * @memberof google.cloud.redis.v1beta1.InstanceAuthString * @instance */ - GetInstanceRequest.prototype.name = ""; + InstanceAuthString.prototype.authString = ""; /** - * Creates a new GetInstanceRequest instance using the specified properties. + * Creates a new InstanceAuthString instance using the specified properties. * @function create - * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @memberof google.cloud.redis.v1beta1.InstanceAuthString * @static - * @param {google.cloud.redis.v1beta1.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.redis.v1beta1.GetInstanceRequest} GetInstanceRequest instance + * @param {google.cloud.redis.v1beta1.IInstanceAuthString=} [properties] Properties to set + * @returns {google.cloud.redis.v1beta1.InstanceAuthString} InstanceAuthString instance */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); + InstanceAuthString.create = function create(properties) { + return new InstanceAuthString(properties); }; /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.redis.v1beta1.GetInstanceRequest.verify|verify} messages. + * Encodes the specified InstanceAuthString message. Does not implicitly {@link google.cloud.redis.v1beta1.InstanceAuthString.verify|verify} messages. * @function encode - * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @memberof google.cloud.redis.v1beta1.InstanceAuthString * @static - * @param {google.cloud.redis.v1beta1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {google.cloud.redis.v1beta1.IInstanceAuthString} message InstanceAuthString message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetInstanceRequest.encode = function encode(message, writer) { + InstanceAuthString.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.authString != null && Object.hasOwnProperty.call(message, "authString")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.authString); return writer; }; /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.GetInstanceRequest.verify|verify} messages. + * Encodes the specified InstanceAuthString message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.InstanceAuthString.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @memberof google.cloud.redis.v1beta1.InstanceAuthString * @static - * @param {google.cloud.redis.v1beta1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {google.cloud.redis.v1beta1.IInstanceAuthString} message InstanceAuthString message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + InstanceAuthString.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. + * Decodes an InstanceAuthString message from the specified reader or buffer. * @function decode - * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @memberof google.cloud.redis.v1beta1.InstanceAuthString * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.redis.v1beta1.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.redis.v1beta1.InstanceAuthString} InstanceAuthString * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetInstanceRequest.decode = function decode(reader, length) { + InstanceAuthString.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.GetInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.InstanceAuthString(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.authString = reader.string(); break; default: reader.skipType(tag & 7); @@ -7440,87 +9174,87 @@ }; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes an InstanceAuthString message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @memberof google.cloud.redis.v1beta1.InstanceAuthString * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.redis.v1beta1.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.redis.v1beta1.InstanceAuthString} InstanceAuthString * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + InstanceAuthString.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetInstanceRequest message. + * Verifies an InstanceAuthString message. * @function verify - * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @memberof google.cloud.redis.v1beta1.InstanceAuthString * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetInstanceRequest.verify = function verify(message) { + InstanceAuthString.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.authString != null && message.hasOwnProperty("authString")) + if (!$util.isString(message.authString)) + return "authString: string expected"; return null; }; /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates an InstanceAuthString message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @memberof google.cloud.redis.v1beta1.InstanceAuthString * @static * @param {Object.} object Plain object - * @returns {google.cloud.redis.v1beta1.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.redis.v1beta1.InstanceAuthString} InstanceAuthString */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.redis.v1beta1.GetInstanceRequest) + InstanceAuthString.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1beta1.InstanceAuthString) return object; - var message = new $root.google.cloud.redis.v1beta1.GetInstanceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.redis.v1beta1.InstanceAuthString(); + if (object.authString != null) + message.authString = String(object.authString); return message; }; /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from an InstanceAuthString message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @memberof google.cloud.redis.v1beta1.InstanceAuthString * @static - * @param {google.cloud.redis.v1beta1.GetInstanceRequest} message GetInstanceRequest + * @param {google.cloud.redis.v1beta1.InstanceAuthString} message InstanceAuthString * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetInstanceRequest.toObject = function toObject(message, options) { + InstanceAuthString.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.authString = ""; + if (message.authString != null && message.hasOwnProperty("authString")) + object.authString = message.authString; return object; }; /** - * Converts this GetInstanceRequest to JSON. + * Converts this InstanceAuthString to JSON. * @function toJSON - * @memberof google.cloud.redis.v1beta1.GetInstanceRequest + * @memberof google.cloud.redis.v1beta1.InstanceAuthString * @instance * @returns {Object.} JSON object */ - GetInstanceRequest.prototype.toJSON = function toJSON() { + InstanceAuthString.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetInstanceRequest; + return InstanceAuthString; })(); v1beta1.CreateInstanceRequest = (function() { @@ -10092,71 +11826,301 @@ * @constructor * @param {google.cloud.redis.v1beta1.IZoneMetadata=} [properties] Properties to set */ - function ZoneMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + function ZoneMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ZoneMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @static + * @param {google.cloud.redis.v1beta1.IZoneMetadata=} [properties] Properties to set + * @returns {google.cloud.redis.v1beta1.ZoneMetadata} ZoneMetadata instance + */ + ZoneMetadata.create = function create(properties) { + return new ZoneMetadata(properties); + }; + + /** + * Encodes the specified ZoneMetadata message. Does not implicitly {@link google.cloud.redis.v1beta1.ZoneMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @static + * @param {google.cloud.redis.v1beta1.IZoneMetadata} message ZoneMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ZoneMetadata message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.ZoneMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @static + * @param {google.cloud.redis.v1beta1.IZoneMetadata} message ZoneMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.redis.v1beta1.ZoneMetadata} ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.ZoneMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1beta1.ZoneMetadata} ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZoneMetadata message. + * @function verify + * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZoneMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ZoneMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1beta1.ZoneMetadata} ZoneMetadata + */ + ZoneMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1beta1.ZoneMetadata) + return object; + return new $root.google.cloud.redis.v1beta1.ZoneMetadata(); + }; + + /** + * Creates a plain object from a ZoneMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @static + * @param {google.cloud.redis.v1beta1.ZoneMetadata} message ZoneMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZoneMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ZoneMetadata to JSON. + * @function toJSON + * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @instance + * @returns {Object.} JSON object + */ + ZoneMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ZoneMetadata; + })(); + + v1beta1.TlsCertificate = (function() { + + /** + * Properties of a TlsCertificate. + * @memberof google.cloud.redis.v1beta1 + * @interface ITlsCertificate + * @property {string|null} [serialNumber] TlsCertificate serialNumber + * @property {string|null} [cert] TlsCertificate cert + * @property {google.protobuf.ITimestamp|null} [createTime] TlsCertificate createTime + * @property {google.protobuf.ITimestamp|null} [expireTime] TlsCertificate expireTime + * @property {string|null} [sha1Fingerprint] TlsCertificate sha1Fingerprint + */ + + /** + * Constructs a new TlsCertificate. + * @memberof google.cloud.redis.v1beta1 + * @classdesc Represents a TlsCertificate. + * @implements ITlsCertificate + * @constructor + * @param {google.cloud.redis.v1beta1.ITlsCertificate=} [properties] Properties to set + */ + function TlsCertificate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TlsCertificate serialNumber. + * @member {string} serialNumber + * @memberof google.cloud.redis.v1beta1.TlsCertificate + * @instance + */ + TlsCertificate.prototype.serialNumber = ""; + + /** + * TlsCertificate cert. + * @member {string} cert + * @memberof google.cloud.redis.v1beta1.TlsCertificate + * @instance + */ + TlsCertificate.prototype.cert = ""; + + /** + * TlsCertificate createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.redis.v1beta1.TlsCertificate + * @instance + */ + TlsCertificate.prototype.createTime = null; + + /** + * TlsCertificate expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.redis.v1beta1.TlsCertificate + * @instance + */ + TlsCertificate.prototype.expireTime = null; /** - * Creates a new ZoneMetadata instance using the specified properties. + * TlsCertificate sha1Fingerprint. + * @member {string} sha1Fingerprint + * @memberof google.cloud.redis.v1beta1.TlsCertificate + * @instance + */ + TlsCertificate.prototype.sha1Fingerprint = ""; + + /** + * Creates a new TlsCertificate instance using the specified properties. * @function create - * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @memberof google.cloud.redis.v1beta1.TlsCertificate * @static - * @param {google.cloud.redis.v1beta1.IZoneMetadata=} [properties] Properties to set - * @returns {google.cloud.redis.v1beta1.ZoneMetadata} ZoneMetadata instance + * @param {google.cloud.redis.v1beta1.ITlsCertificate=} [properties] Properties to set + * @returns {google.cloud.redis.v1beta1.TlsCertificate} TlsCertificate instance */ - ZoneMetadata.create = function create(properties) { - return new ZoneMetadata(properties); + TlsCertificate.create = function create(properties) { + return new TlsCertificate(properties); }; /** - * Encodes the specified ZoneMetadata message. Does not implicitly {@link google.cloud.redis.v1beta1.ZoneMetadata.verify|verify} messages. + * Encodes the specified TlsCertificate message. Does not implicitly {@link google.cloud.redis.v1beta1.TlsCertificate.verify|verify} messages. * @function encode - * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @memberof google.cloud.redis.v1beta1.TlsCertificate * @static - * @param {google.cloud.redis.v1beta1.IZoneMetadata} message ZoneMetadata message or plain object to encode + * @param {google.cloud.redis.v1beta1.ITlsCertificate} message TlsCertificate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ZoneMetadata.encode = function encode(message, writer) { + TlsCertificate.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.serialNumber != null && Object.hasOwnProperty.call(message, "serialNumber")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serialNumber); + if (message.cert != null && Object.hasOwnProperty.call(message, "cert")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cert); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sha1Fingerprint != null && Object.hasOwnProperty.call(message, "sha1Fingerprint")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.sha1Fingerprint); return writer; }; /** - * Encodes the specified ZoneMetadata message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.ZoneMetadata.verify|verify} messages. + * Encodes the specified TlsCertificate message, length delimited. Does not implicitly {@link google.cloud.redis.v1beta1.TlsCertificate.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @memberof google.cloud.redis.v1beta1.TlsCertificate * @static - * @param {google.cloud.redis.v1beta1.IZoneMetadata} message ZoneMetadata message or plain object to encode + * @param {google.cloud.redis.v1beta1.ITlsCertificate} message TlsCertificate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ZoneMetadata.encodeDelimited = function encodeDelimited(message, writer) { + TlsCertificate.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ZoneMetadata message from the specified reader or buffer. + * Decodes a TlsCertificate message from the specified reader or buffer. * @function decode - * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @memberof google.cloud.redis.v1beta1.TlsCertificate * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.redis.v1beta1.ZoneMetadata} ZoneMetadata + * @returns {google.cloud.redis.v1beta1.TlsCertificate} TlsCertificate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ZoneMetadata.decode = function decode(reader, length) { + TlsCertificate.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.ZoneMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1beta1.TlsCertificate(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.serialNumber = reader.string(); + break; + case 2: + message.cert = reader.string(); + break; + case 3: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.sha1Fingerprint = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -10166,74 +12130,130 @@ }; /** - * Decodes a ZoneMetadata message from the specified reader or buffer, length delimited. + * Decodes a TlsCertificate message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @memberof google.cloud.redis.v1beta1.TlsCertificate * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.redis.v1beta1.ZoneMetadata} ZoneMetadata + * @returns {google.cloud.redis.v1beta1.TlsCertificate} TlsCertificate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ZoneMetadata.decodeDelimited = function decodeDelimited(reader) { + TlsCertificate.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ZoneMetadata message. + * Verifies a TlsCertificate message. * @function verify - * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @memberof google.cloud.redis.v1beta1.TlsCertificate * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ZoneMetadata.verify = function verify(message) { + TlsCertificate.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.serialNumber != null && message.hasOwnProperty("serialNumber")) + if (!$util.isString(message.serialNumber)) + return "serialNumber: string expected"; + if (message.cert != null && message.hasOwnProperty("cert")) + if (!$util.isString(message.cert)) + return "cert: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + if (!$util.isString(message.sha1Fingerprint)) + return "sha1Fingerprint: string expected"; return null; }; /** - * Creates a ZoneMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a TlsCertificate message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @memberof google.cloud.redis.v1beta1.TlsCertificate * @static * @param {Object.} object Plain object - * @returns {google.cloud.redis.v1beta1.ZoneMetadata} ZoneMetadata + * @returns {google.cloud.redis.v1beta1.TlsCertificate} TlsCertificate */ - ZoneMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.redis.v1beta1.ZoneMetadata) + TlsCertificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1beta1.TlsCertificate) return object; - return new $root.google.cloud.redis.v1beta1.ZoneMetadata(); + var message = new $root.google.cloud.redis.v1beta1.TlsCertificate(); + if (object.serialNumber != null) + message.serialNumber = String(object.serialNumber); + if (object.cert != null) + message.cert = String(object.cert); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.redis.v1beta1.TlsCertificate.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.redis.v1beta1.TlsCertificate.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.sha1Fingerprint != null) + message.sha1Fingerprint = String(object.sha1Fingerprint); + return message; }; /** - * Creates a plain object from a ZoneMetadata message. Also converts values to other types if specified. + * Creates a plain object from a TlsCertificate message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @memberof google.cloud.redis.v1beta1.TlsCertificate * @static - * @param {google.cloud.redis.v1beta1.ZoneMetadata} message ZoneMetadata + * @param {google.cloud.redis.v1beta1.TlsCertificate} message TlsCertificate * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ZoneMetadata.toObject = function toObject() { - return {}; + TlsCertificate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.serialNumber = ""; + object.cert = ""; + object.createTime = null; + object.expireTime = null; + object.sha1Fingerprint = ""; + } + if (message.serialNumber != null && message.hasOwnProperty("serialNumber")) + object.serialNumber = message.serialNumber; + if (message.cert != null && message.hasOwnProperty("cert")) + object.cert = message.cert; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.sha1Fingerprint != null && message.hasOwnProperty("sha1Fingerprint")) + object.sha1Fingerprint = message.sha1Fingerprint; + return object; }; /** - * Converts this ZoneMetadata to JSON. + * Converts this TlsCertificate to JSON. * @function toJSON - * @memberof google.cloud.redis.v1beta1.ZoneMetadata + * @memberof google.cloud.redis.v1beta1.TlsCertificate * @instance * @returns {Object.} JSON object */ - ZoneMetadata.prototype.toJSON = function toJSON() { + TlsCertificate.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ZoneMetadata; + return TlsCertificate; })(); return v1beta1; @@ -23843,6 +25863,298 @@ return rpc; })(); + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + /** + * DayOfWeek enum. + * @name google.type.DayOfWeek + * @enum {number} + * @property {number} DAY_OF_WEEK_UNSPECIFIED=0 DAY_OF_WEEK_UNSPECIFIED value + * @property {number} MONDAY=1 MONDAY value + * @property {number} TUESDAY=2 TUESDAY value + * @property {number} WEDNESDAY=3 WEDNESDAY value + * @property {number} THURSDAY=4 THURSDAY value + * @property {number} FRIDAY=5 FRIDAY value + * @property {number} SATURDAY=6 SATURDAY value + * @property {number} SUNDAY=7 SUNDAY value + */ + type.DayOfWeek = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONDAY"] = 1; + values[valuesById[2] = "TUESDAY"] = 2; + values[valuesById[3] = "WEDNESDAY"] = 3; + values[valuesById[4] = "THURSDAY"] = 4; + values[valuesById[5] = "FRIDAY"] = 5; + values[valuesById[6] = "SATURDAY"] = 6; + values[valuesById[7] = "SUNDAY"] = 7; + return values; + })(); + + type.TimeOfDay = (function() { + + /** + * Properties of a TimeOfDay. + * @memberof google.type + * @interface ITimeOfDay + * @property {number|null} [hours] TimeOfDay hours + * @property {number|null} [minutes] TimeOfDay minutes + * @property {number|null} [seconds] TimeOfDay seconds + * @property {number|null} [nanos] TimeOfDay nanos + */ + + /** + * Constructs a new TimeOfDay. + * @memberof google.type + * @classdesc Represents a TimeOfDay. + * @implements ITimeOfDay + * @constructor + * @param {google.type.ITimeOfDay=} [properties] Properties to set + */ + function TimeOfDay(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeOfDay hours. + * @member {number} hours + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.hours = 0; + + /** + * TimeOfDay minutes. + * @member {number} minutes + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.minutes = 0; + + /** + * TimeOfDay seconds. + * @member {number} seconds + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.seconds = 0; + + /** + * TimeOfDay nanos. + * @member {number} nanos + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.nanos = 0; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @function create + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay=} [properties] Properties to set + * @returns {google.type.TimeOfDay} TimeOfDay instance + */ + TimeOfDay.create = function create(properties) { + return new TimeOfDay(properties); + }; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encode + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hours); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minutes); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @function decode + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.TimeOfDay(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hours = reader.int32(); + break; + case 2: + message.minutes = reader.int32(); + break; + case 3: + message.seconds = reader.int32(); + break; + case 4: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeOfDay message. + * @function verify + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeOfDay.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hours != null && message.hasOwnProperty("hours")) + if (!$util.isInteger(message.hours)) + return "hours: integer expected"; + if (message.minutes != null && message.hasOwnProperty("minutes")) + if (!$util.isInteger(message.minutes)) + return "minutes: integer expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} object Plain object + * @returns {google.type.TimeOfDay} TimeOfDay + */ + TimeOfDay.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.TimeOfDay) + return object; + var message = new $root.google.type.TimeOfDay(); + if (object.hours != null) + message.hours = object.hours | 0; + if (object.minutes != null) + message.minutes = object.minutes | 0; + if (object.seconds != null) + message.seconds = object.seconds | 0; + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.TimeOfDay} message TimeOfDay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeOfDay.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hours = 0; + object.minutes = 0; + object.seconds = 0; + object.nanos = 0; + } + if (message.hours != null && message.hasOwnProperty("hours")) + object.hours = message.hours; + if (message.minutes != null && message.hasOwnProperty("minutes")) + object.minutes = message.minutes; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this TimeOfDay to JSON. + * @function toJSON + * @memberof google.type.TimeOfDay + * @instance + * @returns {Object.} JSON object + */ + TimeOfDay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TimeOfDay; + })(); + + return type; + })(); + return google; })(); diff --git a/packages/google-cloud-redis/protos/protos.json b/packages/google-cloud-redis/protos/protos.json index 2adf9328ac5..bab5c670977 100644 --- a/packages/google-cloud-redis/protos/protos.json +++ b/packages/google-cloud-redis/protos/protos.json @@ -819,6 +819,24 @@ } ] }, + "GetInstanceAuthString": { + "requestType": "GetInstanceAuthStringRequest", + "responseType": "InstanceAuthString", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/instances/*}/authString", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/instances/*}/authString" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, "CreateInstance": { "requestType": "CreateInstanceRequest", "responseType": "google.longrunning.Operation", @@ -1012,6 +1030,34 @@ } } ] + }, + "RescheduleMaintenance": { + "requestType": "RescheduleMaintenanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name, reschedule_type, schedule_time", + "(google.longrunning.operation_info).response_type": "google.cloud.redis.v1beta1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Any" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name, reschedule_type, schedule_time" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.redis.v1beta1.Instance", + "metadata_type": "google.protobuf.Any" + } + } + ] } } }, @@ -1168,6 +1214,42 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "authEnabled": { + "type": "bool", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serverCaCerts": { + "rule": "repeated", + "type": "TlsCertificate", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "transitEncryptionMode": { + "type": "TransitEncryptionMode", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maintenancePolicy": { + "type": "MaintenancePolicy", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maintenanceSchedule": { + "type": "MaintenanceSchedule", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "replicaCount": { "type": "int32", "id": 31, @@ -1233,6 +1315,13 @@ "PRIVATE_SERVICE_ACCESS": 2 } }, + "TransitEncryptionMode": { + "values": { + "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED": 0, + "SERVER_AUTHENTICATION": 1, + "DISABLED": 2 + } + }, "ReadReplicasMode": { "values": { "READ_REPLICAS_MODE_UNSPECIFIED": 0, @@ -1242,6 +1331,132 @@ } } }, + "RescheduleMaintenanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "redis.googleapis.com/Instance" + } + }, + "rescheduleType": { + "type": "RescheduleType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scheduleTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RescheduleType": { + "values": { + "RESCHEDULE_TYPE_UNSPECIFIED": 0, + "IMMEDIATE": 1, + "NEXT_AVAILABLE_WINDOW": 2, + "SPECIFIC_TIME": 3 + } + } + } + }, + "MaintenancePolicy": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "weeklyMaintenanceWindow": { + "rule": "repeated", + "type": "WeeklyMaintenanceWindow", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "WeeklyMaintenanceWindow": { + "fields": { + "day": { + "type": "google.type.DayOfWeek", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startTime": { + "type": "google.type.TimeOfDay", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "duration": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MaintenanceSchedule": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "canReschedule": { + "type": "bool", + "id": 3, + "options": { + "deprecated": true + } + }, + "scheduleDeadlineTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "ListInstancesRequest": { "fields": { "parent": { @@ -1292,6 +1507,26 @@ } } }, + "GetInstanceAuthStringRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "redis.googleapis.com/Instance" + } + } + } + }, + "InstanceAuthString": { + "fields": { + "authString": { + "type": "string", + "id": 1 + } + } + }, "CreateInstanceRequest": { "fields": { "parent": { @@ -1497,6 +1732,36 @@ }, "ZoneMetadata": { "fields": {} + }, + "TlsCertificate": { + "fields": { + "serialNumber": { + "type": "string", + "id": 1 + }, + "cert": { + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sha1Fingerprint": { + "type": "string", + "id": 5 + } + } } } } @@ -2915,6 +3180,50 @@ } } } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/timeofday;timeofday", + "java_multiple_files": true, + "java_outer_classname": "TimeOfDayProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP", + "cc_enable_arenas": true + }, + "nested": { + "DayOfWeek": { + "values": { + "DAY_OF_WEEK_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7 + } + }, + "TimeOfDay": { + "fields": { + "hours": { + "type": "int32", + "id": 1 + }, + "minutes": { + "type": "int32", + "id": 2 + }, + "seconds": { + "type": "int32", + "id": 3 + }, + "nanos": { + "type": "int32", + "id": 4 + } + } + } + } } } } diff --git a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.create_instance.js b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.create_instance.js index 205a3f9447b..b48d4303e44 100644 --- a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.create_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.create_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, instanceId, instance) { diff --git a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.delete_instance.js b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.delete_instance.js index 26d96c1a05b..d1d629a2bbd 100644 --- a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.delete_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.delete_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.export_instance.js b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.export_instance.js index 6b025ff2b62..2c3db9a7a8d 100644 --- a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.export_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.export_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, outputConfig) { diff --git a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.failover_instance.js b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.failover_instance.js index f457aa618e1..6111f320a09 100644 --- a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.failover_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.failover_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.get_instance.js b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.get_instance.js index 20a31861cc7..7c62c080b0e 100644 --- a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.get_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.get_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.import_instance.js b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.import_instance.js index 9938e443242..5baf725d916 100644 --- a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.import_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.import_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, inputConfig) { diff --git a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.list_instances.js b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.list_instances.js index 5ae4138536b..baa8a4e460f 100644 --- a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.list_instances.js +++ b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.list_instances.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -30,7 +31,7 @@ function main(parent) { * 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` google.cloud.redis.v1.ListInstancesResponse.next_page_token + * `next_page_token` google.cloud.redis.v1.ListInstancesResponse.next_page_token * to determine if there are more instances left to be queried. */ // const pageSize = 1234 @@ -55,7 +56,7 @@ function main(parent) { // Run request const iterable = await redisClient.listInstancesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.update_instance.js b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.update_instance.js index 49dadb3a0eb..c9ce6eff07d 100644 --- a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.update_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.update_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(updateMask, instance) { diff --git a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.upgrade_instance.js b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.upgrade_instance.js index 66304ae5222..2177fe48c24 100644 --- a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.upgrade_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.upgrade_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, redisVersion) { diff --git a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.create_instance.js b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.create_instance.js index 6b8ef5b2265..702bfb02208 100644 --- a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.create_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.create_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, instanceId, instance) { diff --git a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.delete_instance.js b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.delete_instance.js index 28c68a41359..95506f36985 100644 --- a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.delete_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.delete_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.export_instance.js b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.export_instance.js index be49d424923..7d9c535c273 100644 --- a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.export_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.export_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, outputConfig) { diff --git a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.failover_instance.js b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.failover_instance.js index 5fd6f93352d..fd5c6f0681a 100644 --- a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.failover_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.failover_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.get_instance.js b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.get_instance.js index 3b9a0728047..86624c8abbe 100644 --- a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.get_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.get_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.get_instance_auth_string.js b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.get_instance_auth_string.js new file mode 100644 index 00000000000..ad6d5d37e7e --- /dev/null +++ b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.get_instance_auth_string.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(name) { + // [START redis_v1beta1_generated_CloudRedis_GetInstanceAuthString_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const name = 'abc123' + + // Imports the Redis library + const {CloudRedisClient} = require('@google-cloud/redis').v1beta1; + + // Instantiates a client + const redisClient = new CloudRedisClient(); + + async function callGetInstanceAuthString() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await redisClient.getInstanceAuthString(request); + console.log(response); + } + + callGetInstanceAuthString(); + // [END redis_v1beta1_generated_CloudRedis_GetInstanceAuthString_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.import_instance.js b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.import_instance.js index a3cc5709a27..02cedbc11fc 100644 --- a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.import_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.import_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, inputConfig) { diff --git a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.list_instances.js b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.list_instances.js index 897f6397843..c20122dd5b2 100644 --- a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.list_instances.js +++ b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.list_instances.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -30,14 +31,13 @@ function main(parent) { * 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` google.cloud.redis.v1beta1.ListInstancesResponse.next_page_token + * `next_page_token` google.cloud.redis.v1beta1.ListInstancesResponse.next_page_token * to determine if there are more instances left to be queried. */ // const pageSize = 1234 /** * The `next_page_token` value returned from a previous - * ListInstances google.cloud.redis.v1beta1.CloudRedis.ListInstances - * request, if any. + * ListInstances google.cloud.redis.v1beta1.CloudRedis.ListInstances request, if any. */ // const pageToken = 'abc123' @@ -56,7 +56,7 @@ function main(parent) { // Run request const iterable = await redisClient.listInstancesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.reschedule_maintenance.js b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.reschedule_maintenance.js new file mode 100644 index 00000000000..0376b54cc11 --- /dev/null +++ b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.reschedule_maintenance.js @@ -0,0 +1,67 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(name, rescheduleType) { + // [START redis_v1beta1_generated_CloudRedis_RescheduleMaintenance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * 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. + */ + // const name = 'abc123' + /** + * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + */ + // const rescheduleType = {} + /** + * Optional. Timestamp when the maintenance shall be rescheduled to if + * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + * example `2012-11-15T16:19:00.094Z`. + */ + // const scheduleTime = {} + + // Imports the Redis library + const {CloudRedisClient} = require('@google-cloud/redis').v1beta1; + + // Instantiates a client + const redisClient = new CloudRedisClient(); + + async function callRescheduleMaintenance() { + // Construct request + const request = { + name, + rescheduleType, + }; + + // Run request + const [operation] = await redisClient.rescheduleMaintenance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRescheduleMaintenance(); + // [END redis_v1beta1_generated_CloudRedis_RescheduleMaintenance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.update_instance.js b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.update_instance.js index 9dcd9bce9f5..3a2291f5f96 100644 --- a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.update_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.update_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(updateMask, instance) { diff --git a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.upgrade_instance.js b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.upgrade_instance.js index 4efe9a5b550..162614cc497 100644 --- a/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.upgrade_instance.js +++ b/packages/google-cloud-redis/samples/generated/v1beta1/cloud_redis.upgrade_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, redisVersion) { diff --git a/packages/google-cloud-redis/src/v1/cloud_redis_client.ts b/packages/google-cloud-redis/src/v1/cloud_redis_client.ts index cb4a6232b2b..62318282d2b 100644 --- a/packages/google-cloud-redis/src/v1/cloud_redis_client.ts +++ b/packages/google-cloud-redis/src/v1/cloud_redis_client.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-redis/src/v1/index.ts b/packages/google-cloud-redis/src/v1/index.ts index 1400fac9a6e..b07180428a1 100644 --- a/packages/google-cloud-redis/src/v1/index.ts +++ b/packages/google-cloud-redis/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-redis/src/v1beta1/cloud_redis_client.ts b/packages/google-cloud-redis/src/v1beta1/cloud_redis_client.ts index ace005c205e..4338e5be815 100644 --- a/packages/google-cloud-redis/src/v1beta1/cloud_redis_client.ts +++ b/packages/google-cloud-redis/src/v1beta1/cloud_redis_client.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -253,6 +253,12 @@ export class CloudRedisClient { const deleteInstanceMetadata = protoFilesRoot.lookup( '.google.protobuf.Any' ) as gax.protobuf.Type; + const rescheduleMaintenanceResponse = protoFilesRoot.lookup( + '.google.cloud.redis.v1beta1.Instance' + ) as gax.protobuf.Type; + const rescheduleMaintenanceMetadata = protoFilesRoot.lookup( + '.google.protobuf.Any' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createInstance: new this._gaxModule.LongrunningDescriptor( @@ -290,6 +296,13 @@ export class CloudRedisClient { deleteInstanceResponse.decode.bind(deleteInstanceResponse), deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) ), + rescheduleMaintenance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + rescheduleMaintenanceResponse.decode.bind( + rescheduleMaintenanceResponse + ), + rescheduleMaintenanceMetadata.decode.bind(rescheduleMaintenanceMetadata) + ), }; // Put together the default options sent with requests. @@ -344,6 +357,7 @@ export class CloudRedisClient { const cloudRedisStubMethods = [ 'listInstances', 'getInstance', + 'getInstanceAuthString', 'createInstance', 'updateInstance', 'upgradeInstance', @@ -351,6 +365,7 @@ export class CloudRedisClient { 'exportInstance', 'failoverInstance', 'deleteInstance', + 'rescheduleMaintenance', ]; for (const methodName of cloudRedisStubMethods) { const callPromise = this.cloudRedisStub.then( @@ -523,6 +538,107 @@ export class CloudRedisClient { this.initialize(); return this.innerApiCalls.getInstance(request, options, callback); } + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [InstanceAuthString]{@link google.cloud.redis.v1beta1.InstanceAuthString}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_redis.get_instance_auth_string.js + * region_tag:redis_v1beta1_generated_CloudRedis_GetInstanceAuthString_async + */ + getInstanceAuthString( + request?: protos.google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.redis.v1beta1.IInstanceAuthString, + ( + | protos.google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest + | undefined + ), + {} | undefined + ] + >; + getInstanceAuthString( + request: protos.google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.redis.v1beta1.IInstanceAuthString, + | protos.google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstanceAuthString( + request: protos.google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest, + callback: Callback< + protos.google.cloud.redis.v1beta1.IInstanceAuthString, + | protos.google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstanceAuthString( + request?: protos.google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.redis.v1beta1.IInstanceAuthString, + | protos.google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.redis.v1beta1.IInstanceAuthString, + | protos.google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.redis.v1beta1.IInstanceAuthString, + ( + | protos.google.cloud.redis.v1beta1.IGetInstanceAuthStringRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getInstanceAuthString(request, options, callback); + } /** * Creates a Redis instance based on the specified tier and memory size. @@ -1538,6 +1654,152 @@ export class CloudRedisClient { protos.google.protobuf.Any >; } + /** + * Reschedule maintenance for a given instance in a given project and + * location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * 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. + * @param {google.cloud.redis.v1beta1.RescheduleMaintenanceRequest.RescheduleType} request.rescheduleType + * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + * @param {google.protobuf.Timestamp} [request.scheduleTime] + * Optional. Timestamp when the maintenance shall be rescheduled to if + * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + * example `2012-11-15T16:19:00.094Z`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_redis.reschedule_maintenance.js + * region_tag:redis_v1beta1_generated_CloudRedis_RescheduleMaintenance_async + */ + rescheduleMaintenance( + request?: protos.google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.redis.v1beta1.IInstance, + protos.google.protobuf.IAny + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + rescheduleMaintenance( + request: protos.google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.redis.v1beta1.IInstance, + protos.google.protobuf.IAny + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rescheduleMaintenance( + request: protos.google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.redis.v1beta1.IInstance, + protos.google.protobuf.IAny + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rescheduleMaintenance( + request?: protos.google.cloud.redis.v1beta1.IRescheduleMaintenanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.redis.v1beta1.IInstance, + protos.google.protobuf.IAny + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.redis.v1beta1.IInstance, + protos.google.protobuf.IAny + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.redis.v1beta1.IInstance, + protos.google.protobuf.IAny + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.rescheduleMaintenance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `rescheduleMaintenance()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_redis.reschedule_maintenance.js + * region_tag:redis_v1beta1_generated_CloudRedis_RescheduleMaintenance_async + */ + async checkRescheduleMaintenanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.redis.v1beta1.Instance, + protos.google.protobuf.Any + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.rescheduleMaintenance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.redis.v1beta1.Instance, + protos.google.protobuf.Any + >; + } /** * Lists all Redis instances owned by a project in either the specified * location (region) or all locations. @@ -1565,8 +1827,7 @@ export class CloudRedisClient { * to determine if there are more instances left to be queried. * @param {string} request.pageToken * The `next_page_token` value returned from a previous - * {@link google.cloud.redis.v1beta1.CloudRedis.ListInstances|ListInstances} - * request, if any. + * {@link google.cloud.redis.v1beta1.CloudRedis.ListInstances|ListInstances} request, if any. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1673,8 +1934,7 @@ export class CloudRedisClient { * to determine if there are more instances left to be queried. * @param {string} request.pageToken * The `next_page_token` value returned from a previous - * {@link google.cloud.redis.v1beta1.CloudRedis.ListInstances|ListInstances} - * request, if any. + * {@link google.cloud.redis.v1beta1.CloudRedis.ListInstances|ListInstances} request, if any. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1729,8 +1989,7 @@ export class CloudRedisClient { * to determine if there are more instances left to be queried. * @param {string} request.pageToken * The `next_page_token` value returned from a previous - * {@link google.cloud.redis.v1beta1.CloudRedis.ListInstances|ListInstances} - * request, if any. + * {@link google.cloud.redis.v1beta1.CloudRedis.ListInstances|ListInstances} request, if any. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} diff --git a/packages/google-cloud-redis/src/v1beta1/cloud_redis_client_config.json b/packages/google-cloud-redis/src/v1beta1/cloud_redis_client_config.json index 52d2e5dc0e1..fc33fa45d6f 100644 --- a/packages/google-cloud-redis/src/v1beta1/cloud_redis_client_config.json +++ b/packages/google-cloud-redis/src/v1beta1/cloud_redis_client_config.json @@ -30,6 +30,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "GetInstanceAuthString": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "CreateInstance": { "timeout_millis": 600000, "retry_codes_name": "non_idempotent", @@ -64,6 +69,10 @@ "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "RescheduleMaintenance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-redis/src/v1beta1/gapic_metadata.json b/packages/google-cloud-redis/src/v1beta1/gapic_metadata.json index ebb333533a4..6ec65068a1d 100644 --- a/packages/google-cloud-redis/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-redis/src/v1beta1/gapic_metadata.json @@ -15,6 +15,11 @@ "getInstance" ] }, + "GetInstanceAuthString": { + "methods": [ + "getInstanceAuthString" + ] + }, "CreateInstance": { "methods": [ "createInstance" @@ -50,6 +55,11 @@ "deleteInstance" ] }, + "RescheduleMaintenance": { + "methods": [ + "rescheduleMaintenance" + ] + }, "ListInstances": { "methods": [ "listInstances", @@ -67,6 +77,11 @@ "getInstance" ] }, + "GetInstanceAuthString": { + "methods": [ + "getInstanceAuthString" + ] + }, "CreateInstance": { "methods": [ "createInstance" @@ -102,6 +117,11 @@ "deleteInstance" ] }, + "RescheduleMaintenance": { + "methods": [ + "rescheduleMaintenance" + ] + }, "ListInstances": { "methods": [ "listInstances", diff --git a/packages/google-cloud-redis/src/v1beta1/index.ts b/packages/google-cloud-redis/src/v1beta1/index.ts index 1400fac9a6e..b07180428a1 100644 --- a/packages/google-cloud-redis/src/v1beta1/index.ts +++ b/packages/google-cloud-redis/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-redis/system-test/fixtures/sample/src/index.js b/packages/google-cloud-redis/system-test/fixtures/sample/src/index.js index 070e2705f25..88d94c59767 100644 --- a/packages/google-cloud-redis/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-redis/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-redis/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-redis/system-test/fixtures/sample/src/index.ts index 70ee5a7267d..4c8c3984744 100644 --- a/packages/google-cloud-redis/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-redis/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-redis/system-test/install.ts b/packages/google-cloud-redis/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-redis/system-test/install.ts +++ b/packages/google-cloud-redis/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-redis/test/gapic_cloud_redis_v1.ts b/packages/google-cloud-redis/test/gapic_cloud_redis_v1.ts index 2cdfe4aeb19..bb37e995724 100644 --- a/packages/google-cloud-redis/test/gapic_cloud_redis_v1.ts +++ b/packages/google-cloud-redis/test/gapic_cloud_redis_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-redis/test/gapic_cloud_redis_v1beta1.ts b/packages/google-cloud-redis/test/gapic_cloud_redis_v1beta1.ts index 3b170229c4a..e49eb40efca 100644 --- a/packages/google-cloud-redis/test/gapic_cloud_redis_v1beta1.ts +++ b/packages/google-cloud-redis/test/gapic_cloud_redis_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -336,6 +336,121 @@ describe('v1beta1.CloudRedisClient', () => { }); }); + describe('getInstanceAuthString', () => { + it('invokes getInstanceAuthString without error', async () => { + const client = new cloudredisModule.v1beta1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.redis.v1beta1.InstanceAuthString() + ); + client.innerApiCalls.getInstanceAuthString = + stubSimpleCall(expectedResponse); + const [response] = await client.getInstanceAuthString(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getInstanceAuthString as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getInstanceAuthString without error using callback', async () => { + const client = new cloudredisModule.v1beta1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.redis.v1beta1.InstanceAuthString() + ); + client.innerApiCalls.getInstanceAuthString = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstanceAuthString( + request, + ( + err?: Error | null, + result?: protos.google.cloud.redis.v1beta1.IInstanceAuthString | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getInstanceAuthString as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getInstanceAuthString with error', async () => { + const client = new cloudredisModule.v1beta1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstanceAuthString = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getInstanceAuthString(request), + expectedError + ); + assert( + (client.innerApiCalls.getInstanceAuthString as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('createInstance', () => { it('invokes createInstance without error', async () => { const client = new cloudredisModule.v1beta1.CloudRedisClient({ @@ -1698,6 +1813,203 @@ describe('v1beta1.CloudRedisClient', () => { }); }); + describe('rescheduleMaintenance', () => { + it('invokes rescheduleMaintenance without error', async () => { + const client = new cloudredisModule.v1beta1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.rescheduleMaintenance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.rescheduleMaintenance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.rescheduleMaintenance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes rescheduleMaintenance without error using callback', async () => { + const client = new cloudredisModule.v1beta1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.rescheduleMaintenance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rescheduleMaintenance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.redis.v1beta1.IInstance, + protos.google.protobuf.IAny + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.redis.v1beta1.IInstance, + protos.google.protobuf.IAny + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.rescheduleMaintenance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes rescheduleMaintenance with call error', async () => { + const client = new cloudredisModule.v1beta1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.rescheduleMaintenance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.rescheduleMaintenance(request), + expectedError + ); + assert( + (client.innerApiCalls.rescheduleMaintenance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes rescheduleMaintenance with LRO error', async () => { + const client = new cloudredisModule.v1beta1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.rescheduleMaintenance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.rescheduleMaintenance(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.rescheduleMaintenance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkRescheduleMaintenanceProgress without error', async () => { + const client = new cloudredisModule.v1beta1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRescheduleMaintenanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRescheduleMaintenanceProgress with error', async () => { + const client = new cloudredisModule.v1beta1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRescheduleMaintenanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listInstances', () => { it('invokes listInstances without error', async () => { const client = new cloudredisModule.v1beta1.CloudRedisClient({