diff --git a/packages/google-cloud-redis/protos/google/cloud/redis/v1/cloud_redis.proto b/packages/google-cloud-redis/protos/google/cloud/redis/v1/cloud_redis.proto index c95f6aa2069..f0ba2f43fbf 100644 --- a/packages/google-cloud-redis/protos/google/cloud/redis/v1/cloud_redis.proto +++ b/packages/google-cloud-redis/protos/google/cloud/redis/v1/cloud_redis.proto @@ -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. @@ -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/v1;redis"; option java_multiple_files = true; @@ -72,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: "/v1/{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 @@ -191,6 +204,20 @@ service CloudRedis { metadata_type: "google.cloud.redis.v1.OperationMetadata" }; } + + // Reschedule maintenance for a given instance in a given project and + // location. + rpc RescheduleMaintenance(RescheduleMaintenanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{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.v1.Instance" + metadata_type: "google.cloud.redis.v1.OperationMetadata" + }; + } } // Node specific properties. @@ -202,7 +229,7 @@ message NodeInfo { string zone = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// A Google Cloud Redis instance. +// A Memorystore for Redis instance. message Instance { option (google.api.resource) = { type: "redis.googleapis.com/Instance" @@ -267,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 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 @@ -278,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; } @@ -333,6 +372,13 @@ message Instance { // the default block size is /28. string reserved_ip_range = 9 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Additional IP range for node placement. Required when enabling read + // replicas on an existing instance. For DIRECT_PEERING mode value must be a + // CIDR range of size /28, or "auto". For PRIVATE_SERVICE_ACCESS mode value + // must be the name of an allocated address range associated with the private + // service access connection, or "auto". + string secondary_ip_range = 30 [(google.api.field_behavior) = OPTIONAL]; + // Output only. Hostname or IP address of the exposed Redis endpoint used by // clients to connect to the service. string host = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -400,9 +446,37 @@ message 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 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. + + // 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. @@ -418,10 +492,95 @@ 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. + // Optional. Read replicas mode for the instance. Defaults to READ_REPLICAS_DISABLED. ReadReplicasMode read_replicas_mode = 35 [(google.api.field_behavior) = OPTIONAL]; } +// Request for [RescheduleMaintenance][google.cloud.redis.v1.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]; +} + +// 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.v1.CloudRedis.ListInstances]. message ListInstancesRequest { // Required. The resource name of the instance location using the form: @@ -484,6 +643,25 @@ message GetInstanceRequest { ]; } +// Request for [GetInstanceAuthString][google.cloud.redis.v1.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" + } + ]; +} + +// Instance AUTH string details. +message InstanceAuthString { + // AUTH string set on the instance. + string auth_string = 1; +} + // Request for [CreateInstance][google.cloud.redis.v1.CloudRedis.CreateInstance]. message CreateInstanceRequest { // Required. The resource name of the instance location using the form: @@ -684,3 +862,25 @@ message LocationMetadata { 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 466b8429511..b680329783b 100644 --- a/packages/google-cloud-redis/protos/protos.d.ts +++ b/packages/google-cloud-redis/protos/protos.d.ts @@ -74,6 +74,20 @@ export namespace google { */ public getInstance(request: google.cloud.redis.v1.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.v1.IGetInstanceAuthStringRequest, callback: google.cloud.redis.v1.CloudRedis.GetInstanceAuthStringCallback): void; + + /** + * Calls GetInstanceAuthString. + * @param request GetInstanceAuthStringRequest message or plain object + * @returns Promise + */ + public getInstanceAuthString(request: google.cloud.redis.v1.IGetInstanceAuthStringRequest): Promise; + /** * Calls CreateInstance. * @param request CreateInstanceRequest message or plain object @@ -171,6 +185,20 @@ export namespace google { * @returns Promise */ public deleteInstance(request: google.cloud.redis.v1.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.v1.IRescheduleMaintenanceRequest, callback: google.cloud.redis.v1.CloudRedis.RescheduleMaintenanceCallback): void; + + /** + * Calls RescheduleMaintenance. + * @param request RescheduleMaintenanceRequest message or plain object + * @returns Promise + */ + public rescheduleMaintenance(request: google.cloud.redis.v1.IRescheduleMaintenanceRequest): Promise; } namespace CloudRedis { @@ -189,6 +217,13 @@ export namespace google { */ type GetInstanceCallback = (error: (Error|null), response?: google.cloud.redis.v1.Instance) => void; + /** + * Callback as used by {@link google.cloud.redis.v1.CloudRedis#getInstanceAuthString}. + * @param error Error, if any + * @param [response] InstanceAuthString + */ + type GetInstanceAuthStringCallback = (error: (Error|null), response?: google.cloud.redis.v1.InstanceAuthString) => void; + /** * Callback as used by {@link google.cloud.redis.v1.CloudRedis#createInstance}. * @param error Error, if any @@ -237,6 +272,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.v1.CloudRedis#rescheduleMaintenance}. + * @param error Error, if any + * @param [response] Operation + */ + type RescheduleMaintenanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of a NodeInfo. */ @@ -359,6 +401,9 @@ export namespace google { /** Instance reservedIpRange */ reservedIpRange?: (string|null); + /** Instance secondaryIpRange */ + secondaryIpRange?: (string|null); + /** Instance host */ host?: (string|null); @@ -395,6 +440,21 @@ export namespace google { /** Instance connectMode */ connectMode?: (google.cloud.redis.v1.Instance.ConnectMode|keyof typeof google.cloud.redis.v1.Instance.ConnectMode|null); + /** Instance authEnabled */ + authEnabled?: (boolean|null); + + /** Instance serverCaCerts */ + serverCaCerts?: (google.cloud.redis.v1.ITlsCertificate[]|null); + + /** Instance transitEncryptionMode */ + transitEncryptionMode?: (google.cloud.redis.v1.Instance.TransitEncryptionMode|keyof typeof google.cloud.redis.v1.Instance.TransitEncryptionMode|null); + + /** Instance maintenancePolicy */ + maintenancePolicy?: (google.cloud.redis.v1.IMaintenancePolicy|null); + + /** Instance maintenanceSchedule */ + maintenanceSchedule?: (google.cloud.redis.v1.IMaintenanceSchedule|null); + /** Instance replicaCount */ replicaCount?: (number|null); @@ -441,6 +501,9 @@ export namespace google { /** Instance reservedIpRange. */ public reservedIpRange: string; + /** Instance secondaryIpRange. */ + public secondaryIpRange: string; + /** Instance host. */ public host: string; @@ -477,6 +540,21 @@ export namespace google { /** Instance connectMode. */ public connectMode: (google.cloud.redis.v1.Instance.ConnectMode|keyof typeof google.cloud.redis.v1.Instance.ConnectMode); + /** Instance authEnabled. */ + public authEnabled: boolean; + + /** Instance serverCaCerts. */ + public serverCaCerts: google.cloud.redis.v1.ITlsCertificate[]; + + /** Instance transitEncryptionMode. */ + public transitEncryptionMode: (google.cloud.redis.v1.Instance.TransitEncryptionMode|keyof typeof google.cloud.redis.v1.Instance.TransitEncryptionMode); + + /** Instance maintenancePolicy. */ + public maintenancePolicy?: (google.cloud.redis.v1.IMaintenancePolicy|null); + + /** Instance maintenanceSchedule. */ + public maintenanceSchedule?: (google.cloud.redis.v1.IMaintenanceSchedule|null); + /** Instance replicaCount. */ public replicaCount: number; @@ -592,6 +670,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, @@ -600,295 +685,906 @@ export namespace google { } } - /** Properties of a ListInstancesRequest. */ - interface IListInstancesRequest { + /** Properties of a RescheduleMaintenanceRequest. */ + interface IRescheduleMaintenanceRequest { - /** ListInstancesRequest parent */ - parent?: (string|null); + /** RescheduleMaintenanceRequest name */ + name?: (string|null); - /** ListInstancesRequest pageSize */ - pageSize?: (number|null); + /** RescheduleMaintenanceRequest rescheduleType */ + rescheduleType?: (google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType|keyof typeof google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType|null); - /** ListInstancesRequest pageToken */ - pageToken?: (string|null); + /** RescheduleMaintenanceRequest scheduleTime */ + scheduleTime?: (google.protobuf.ITimestamp|null); } - /** Represents a ListInstancesRequest. */ - class ListInstancesRequest implements IListInstancesRequest { + /** Represents a RescheduleMaintenanceRequest. */ + class RescheduleMaintenanceRequest implements IRescheduleMaintenanceRequest { /** - * Constructs a new ListInstancesRequest. + * Constructs a new RescheduleMaintenanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.redis.v1.IListInstancesRequest); + constructor(properties?: google.cloud.redis.v1.IRescheduleMaintenanceRequest); - /** ListInstancesRequest parent. */ - public parent: string; + /** RescheduleMaintenanceRequest name. */ + public name: string; - /** ListInstancesRequest pageSize. */ - public pageSize: number; + /** RescheduleMaintenanceRequest rescheduleType. */ + public rescheduleType: (google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType|keyof typeof google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType); - /** ListInstancesRequest pageToken. */ - public pageToken: string; + /** RescheduleMaintenanceRequest scheduleTime. */ + public scheduleTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new ListInstancesRequest instance using the specified properties. + * Creates a new RescheduleMaintenanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListInstancesRequest instance + * @returns RescheduleMaintenanceRequest instance */ - public static create(properties?: google.cloud.redis.v1.IListInstancesRequest): google.cloud.redis.v1.ListInstancesRequest; + public static create(properties?: google.cloud.redis.v1.IRescheduleMaintenanceRequest): google.cloud.redis.v1.RescheduleMaintenanceRequest; /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.redis.v1.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode + * Encodes the specified RescheduleMaintenanceRequest message. Does not implicitly {@link google.cloud.redis.v1.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.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.redis.v1.IRescheduleMaintenanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode + * Encodes the specified RescheduleMaintenanceRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1.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.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.redis.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IWeeklyMaintenanceWindow[]|null); + } + + /** Represents a MaintenancePolicy. */ + class MaintenancePolicy implements IMaintenancePolicy { + + /** + * Constructs a new MaintenancePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.redis.v1.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.v1.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.v1.IMaintenancePolicy): google.cloud.redis.v1.MaintenancePolicy; + + /** + * Encodes the specified MaintenancePolicy message. Does not implicitly {@link google.cloud.redis.v1.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.v1.IMaintenancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenancePolicy message, length delimited. Does not implicitly {@link google.cloud.redis.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IWeeklyMaintenanceWindow): google.cloud.redis.v1.WeeklyMaintenanceWindow; + + /** + * Encodes the specified WeeklyMaintenanceWindow message. Does not implicitly {@link google.cloud.redis.v1.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.v1.IWeeklyMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeeklyMaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.redis.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IMaintenanceSchedule): google.cloud.redis.v1.MaintenanceSchedule; + + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.redis.v1.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.v1.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.redis.v1.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.v1.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.v1.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.v1.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.v1.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.v1.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 { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.redis.v1.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.redis.v1.IListInstancesRequest): google.cloud.redis.v1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.redis.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.redis.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.redis.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @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.v1.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @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.v1.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest 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 ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.redis.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.cloud.redis.v1.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.redis.v1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.redis.v1.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.cloud.redis.v1.IListInstancesResponse): google.cloud.redis.v1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.redis.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.redis.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.redis.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.redis.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @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.v1.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @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.v1.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse 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 ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.redis.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.redis.v1.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.redis.v1.IGetInstanceRequest): google.cloud.redis.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.redis.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.redis.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.redis.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. + * Decodes a GetInstanceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListInstancesRequest + * @returns GetInstanceRequest * @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.v1.ListInstancesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.redis.v1.GetInstanceRequest; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListInstancesRequest + * @returns GetInstanceRequest * @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.v1.ListInstancesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.redis.v1.GetInstanceRequest; /** - * Verifies a ListInstancesRequest message. + * Verifies a GetInstanceRequest 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 ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListInstancesRequest + * @returns GetInstanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1.ListInstancesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1.GetInstanceRequest; /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. - * @param message ListInstancesRequest + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.redis.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.redis.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListInstancesRequest to JSON. + * Converts this GetInstanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListInstancesResponse. */ - interface IListInstancesResponse { - - /** ListInstancesResponse instances */ - instances?: (google.cloud.redis.v1.IInstance[]|null); - - /** ListInstancesResponse nextPageToken */ - nextPageToken?: (string|null); + /** Properties of a GetInstanceAuthStringRequest. */ + interface IGetInstanceAuthStringRequest { - /** ListInstancesResponse unreachable */ - unreachable?: (string[]|null); + /** GetInstanceAuthStringRequest name */ + name?: (string|null); } - /** Represents a ListInstancesResponse. */ - class ListInstancesResponse implements IListInstancesResponse { + /** Represents a GetInstanceAuthStringRequest. */ + class GetInstanceAuthStringRequest implements IGetInstanceAuthStringRequest { /** - * Constructs a new ListInstancesResponse. + * Constructs a new GetInstanceAuthStringRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.redis.v1.IListInstancesResponse); - - /** ListInstancesResponse instances. */ - public instances: google.cloud.redis.v1.IInstance[]; + constructor(properties?: google.cloud.redis.v1.IGetInstanceAuthStringRequest); - /** ListInstancesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListInstancesResponse unreachable. */ - public unreachable: string[]; + /** GetInstanceAuthStringRequest name. */ + public name: string; /** - * Creates a new ListInstancesResponse instance using the specified properties. + * Creates a new GetInstanceAuthStringRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListInstancesResponse instance + * @returns GetInstanceAuthStringRequest instance */ - public static create(properties?: google.cloud.redis.v1.IListInstancesResponse): google.cloud.redis.v1.ListInstancesResponse; + public static create(properties?: google.cloud.redis.v1.IGetInstanceAuthStringRequest): google.cloud.redis.v1.GetInstanceAuthStringRequest; /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.redis.v1.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode + * Encodes the specified GetInstanceAuthStringRequest message. Does not implicitly {@link google.cloud.redis.v1.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.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.redis.v1.IGetInstanceAuthStringRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.redis.v1.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode + * Encodes the specified GetInstanceAuthStringRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1.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.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.redis.v1.IGetInstanceAuthStringRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. + * 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 ListInstancesResponse + * @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.v1.ListInstancesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.redis.v1.GetInstanceAuthStringRequest; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a GetInstanceAuthStringRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListInstancesResponse + * @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.v1.ListInstancesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.redis.v1.GetInstanceAuthStringRequest; /** - * Verifies a ListInstancesResponse message. + * 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 ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetInstanceAuthStringRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListInstancesResponse + * @returns GetInstanceAuthStringRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1.ListInstancesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1.GetInstanceAuthStringRequest; /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. - * @param message ListInstancesResponse + * 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.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.redis.v1.GetInstanceAuthStringRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListInstancesResponse to JSON. + * Converts this GetInstanceAuthStringRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetInstanceRequest. */ - interface IGetInstanceRequest { + /** Properties of an InstanceAuthString. */ + interface IInstanceAuthString { - /** GetInstanceRequest name */ - name?: (string|null); + /** InstanceAuthString authString */ + authString?: (string|null); } - /** Represents a GetInstanceRequest. */ - class GetInstanceRequest implements IGetInstanceRequest { + /** Represents an InstanceAuthString. */ + class InstanceAuthString implements IInstanceAuthString { /** - * Constructs a new GetInstanceRequest. + * Constructs a new InstanceAuthString. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.redis.v1.IGetInstanceRequest); + constructor(properties?: google.cloud.redis.v1.IInstanceAuthString); - /** GetInstanceRequest name. */ - public name: string; + /** InstanceAuthString authString. */ + public authString: string; /** - * Creates a new GetInstanceRequest instance using the specified properties. + * Creates a new InstanceAuthString instance using the specified properties. * @param [properties] Properties to set - * @returns GetInstanceRequest instance + * @returns InstanceAuthString instance */ - public static create(properties?: google.cloud.redis.v1.IGetInstanceRequest): google.cloud.redis.v1.GetInstanceRequest; + public static create(properties?: google.cloud.redis.v1.IInstanceAuthString): google.cloud.redis.v1.InstanceAuthString; /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.redis.v1.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode + * Encodes the specified InstanceAuthString message. Does not implicitly {@link google.cloud.redis.v1.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.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.redis.v1.IInstanceAuthString, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode + * Encodes the specified InstanceAuthString message, length delimited. Does not implicitly {@link google.cloud.redis.v1.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.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.redis.v1.IInstanceAuthString, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. + * 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 GetInstanceRequest + * @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.v1.GetInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.redis.v1.InstanceAuthString; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes an InstanceAuthString message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetInstanceRequest + * @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.v1.GetInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.redis.v1.InstanceAuthString; /** - * Verifies a GetInstanceRequest message. + * 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 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. * @param object Plain object - * @returns GetInstanceRequest + * @returns InstanceAuthString */ - public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1.GetInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.redis.v1.InstanceAuthString; /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @param message GetInstanceRequest + * 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.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.redis.v1.InstanceAuthString, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetInstanceRequest to JSON. + * Converts this InstanceAuthString to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -2241,6 +2937,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.v1.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.v1.ITlsCertificate): google.cloud.redis.v1.TlsCertificate; + + /** + * Encodes the specified TlsCertificate message. Does not implicitly {@link google.cloud.redis.v1.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.v1.ITlsCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TlsCertificate message, length delimited. Does not implicitly {@link google.cloud.redis.v1.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.v1.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.v1.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.v1.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.v1.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.v1.TlsCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TlsCertificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Namespace v1beta1. */ diff --git a/packages/google-cloud-redis/protos/protos.js b/packages/google-cloud-redis/protos/protos.js index 11dee10890b..d4ff8e3da1c 100644 --- a/packages/google-cloud-redis/protos/protos.js +++ b/packages/google-cloud-redis/protos/protos.js @@ -164,6 +164,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.redis.v1.CloudRedis#getInstanceAuthString}. + * @memberof google.cloud.redis.v1.CloudRedis + * @typedef GetInstanceAuthStringCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.redis.v1.InstanceAuthString} [response] InstanceAuthString + */ + + /** + * Calls GetInstanceAuthString. + * @function getInstanceAuthString + * @memberof google.cloud.redis.v1.CloudRedis + * @instance + * @param {google.cloud.redis.v1.IGetInstanceAuthStringRequest} request GetInstanceAuthStringRequest message or plain object + * @param {google.cloud.redis.v1.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.v1.GetInstanceAuthStringRequest, $root.google.cloud.redis.v1.InstanceAuthString, request, callback); + }, "name", { value: "GetInstanceAuthString" }); + + /** + * Calls GetInstanceAuthString. + * @function getInstanceAuthString + * @memberof google.cloud.redis.v1.CloudRedis + * @instance + * @param {google.cloud.redis.v1.IGetInstanceAuthStringRequest} request GetInstanceAuthStringRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.redis.v1.CloudRedis#createInstance}. * @memberof google.cloud.redis.v1.CloudRedis @@ -395,6 +428,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.redis.v1.CloudRedis#rescheduleMaintenance}. + * @memberof google.cloud.redis.v1.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.v1.CloudRedis + * @instance + * @param {google.cloud.redis.v1.IRescheduleMaintenanceRequest} request RescheduleMaintenanceRequest message or plain object + * @param {google.cloud.redis.v1.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.v1.RescheduleMaintenanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RescheduleMaintenance" }); + + /** + * Calls RescheduleMaintenance. + * @function rescheduleMaintenance + * @memberof google.cloud.redis.v1.CloudRedis + * @instance + * @param {google.cloud.redis.v1.IRescheduleMaintenanceRequest} request RescheduleMaintenanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return CloudRedis; })(); @@ -621,6 +687,7 @@ * @property {string|null} [alternativeLocationId] Instance alternativeLocationId * @property {string|null} [redisVersion] Instance redisVersion * @property {string|null} [reservedIpRange] Instance reservedIpRange + * @property {string|null} [secondaryIpRange] Instance secondaryIpRange * @property {string|null} [host] Instance host * @property {number|null} [port] Instance port * @property {string|null} [currentLocationId] Instance currentLocationId @@ -633,6 +700,11 @@ * @property {string|null} [authorizedNetwork] Instance authorizedNetwork * @property {string|null} [persistenceIamIdentity] Instance persistenceIamIdentity * @property {google.cloud.redis.v1.Instance.ConnectMode|null} [connectMode] Instance connectMode + * @property {boolean|null} [authEnabled] Instance authEnabled + * @property {Array.|null} [serverCaCerts] Instance serverCaCerts + * @property {google.cloud.redis.v1.Instance.TransitEncryptionMode|null} [transitEncryptionMode] Instance transitEncryptionMode + * @property {google.cloud.redis.v1.IMaintenancePolicy|null} [maintenancePolicy] Instance maintenancePolicy + * @property {google.cloud.redis.v1.IMaintenanceSchedule|null} [maintenanceSchedule] Instance maintenanceSchedule * @property {number|null} [replicaCount] Instance replicaCount * @property {Array.|null} [nodes] Instance nodes * @property {string|null} [readEndpoint] Instance readEndpoint @@ -651,6 +723,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) @@ -714,6 +787,14 @@ */ Instance.prototype.reservedIpRange = ""; + /** + * Instance secondaryIpRange. + * @member {string} secondaryIpRange + * @memberof google.cloud.redis.v1.Instance + * @instance + */ + Instance.prototype.secondaryIpRange = ""; + /** * Instance host. * @member {string} host @@ -810,6 +891,46 @@ */ Instance.prototype.connectMode = 0; + /** + * Instance authEnabled. + * @member {boolean} authEnabled + * @memberof google.cloud.redis.v1.Instance + * @instance + */ + Instance.prototype.authEnabled = false; + + /** + * Instance serverCaCerts. + * @member {Array.} serverCaCerts + * @memberof google.cloud.redis.v1.Instance + * @instance + */ + Instance.prototype.serverCaCerts = $util.emptyArray; + + /** + * Instance transitEncryptionMode. + * @member {google.cloud.redis.v1.Instance.TransitEncryptionMode} transitEncryptionMode + * @memberof google.cloud.redis.v1.Instance + * @instance + */ + Instance.prototype.transitEncryptionMode = 0; + + /** + * Instance maintenancePolicy. + * @member {google.cloud.redis.v1.IMaintenancePolicy|null|undefined} maintenancePolicy + * @memberof google.cloud.redis.v1.Instance + * @instance + */ + Instance.prototype.maintenancePolicy = null; + + /** + * Instance maintenanceSchedule. + * @member {google.cloud.redis.v1.IMaintenanceSchedule|null|undefined} maintenanceSchedule + * @memberof google.cloud.redis.v1.Instance + * @instance + */ + Instance.prototype.maintenanceSchedule = null; + /** * Instance replicaCount. * @member {number} replicaCount @@ -914,6 +1035,19 @@ 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.v1.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.v1.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.v1.MaintenanceSchedule.encode(message.maintenanceSchedule, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.secondaryIpRange != null && Object.hasOwnProperty.call(message, "secondaryIpRange")) + writer.uint32(/* id 30, wireType 2 =*/242).string(message.secondaryIpRange); 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) @@ -999,6 +1133,9 @@ case 9: message.reservedIpRange = reader.string(); break; + case 30: + message.secondaryIpRange = reader.string(); + break; case 10: message.host = reader.string(); break; @@ -1054,6 +1191,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.v1.TlsCertificate.decode(reader, reader.uint32())); + break; + case 26: + message.transitEncryptionMode = reader.int32(); + break; + case 27: + message.maintenancePolicy = $root.google.cloud.redis.v1.MaintenancePolicy.decode(reader, reader.uint32()); + break; + case 28: + message.maintenanceSchedule = $root.google.cloud.redis.v1.MaintenanceSchedule.decode(reader, reader.uint32()); + break; case 31: message.replicaCount = reader.int32(); break; @@ -1132,6 +1286,9 @@ if (message.reservedIpRange != null && message.hasOwnProperty("reservedIpRange")) if (!$util.isString(message.reservedIpRange)) return "reservedIpRange: string expected"; + if (message.secondaryIpRange != null && message.hasOwnProperty("secondaryIpRange")) + if (!$util.isString(message.secondaryIpRange)) + return "secondaryIpRange: string expected"; if (message.host != null && message.hasOwnProperty("host")) if (!$util.isString(message.host)) return "host: string expected"; @@ -1199,6 +1356,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.v1.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.v1.MaintenancePolicy.verify(message.maintenancePolicy); + if (error) + return "maintenancePolicy." + error; + } + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) { + var error = $root.google.cloud.redis.v1.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"; @@ -1260,6 +1448,8 @@ message.redisVersion = String(object.redisVersion); if (object.reservedIpRange != null) message.reservedIpRange = String(object.reservedIpRange); + if (object.secondaryIpRange != null) + message.secondaryIpRange = String(object.secondaryIpRange); if (object.host != null) message.host = String(object.host); if (object.port != null) @@ -1352,6 +1542,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.v1.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.v1.Instance.serverCaCerts: object expected"); + message.serverCaCerts[i] = $root.google.cloud.redis.v1.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.v1.Instance.maintenancePolicy: object expected"); + message.maintenancePolicy = $root.google.cloud.redis.v1.MaintenancePolicy.fromObject(object.maintenancePolicy); + } + if (object.maintenanceSchedule != null) { + if (typeof object.maintenanceSchedule !== "object") + throw TypeError(".google.cloud.redis.v1.Instance.maintenanceSchedule: object expected"); + message.maintenanceSchedule = $root.google.cloud.redis.v1.MaintenanceSchedule.fromObject(object.maintenanceSchedule); + } if (object.replicaCount != null) message.replicaCount = object.replicaCount | 0; if (object.nodes) { @@ -1398,8 +1624,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 = {}; @@ -1422,6 +1650,11 @@ 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.secondaryIpRange = ""; object.replicaCount = 0; object.readEndpoint = ""; object.readEndpointPort = 0; @@ -1472,6 +1705,21 @@ object.persistenceIamIdentity = message.persistenceIamIdentity; if (message.connectMode != null && message.hasOwnProperty("connectMode")) object.connectMode = options.enums === String ? $root.google.cloud.redis.v1.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.v1.TlsCertificate.toObject(message.serverCaCerts[j], options); + } + if (message.transitEncryptionMode != null && message.hasOwnProperty("transitEncryptionMode")) + object.transitEncryptionMode = options.enums === String ? $root.google.cloud.redis.v1.Instance.TransitEncryptionMode[message.transitEncryptionMode] : message.transitEncryptionMode; + if (message.maintenancePolicy != null && message.hasOwnProperty("maintenancePolicy")) + object.maintenancePolicy = $root.google.cloud.redis.v1.MaintenancePolicy.toObject(message.maintenancePolicy, options); + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) + object.maintenanceSchedule = $root.google.cloud.redis.v1.MaintenanceSchedule.toObject(message.maintenanceSchedule, options); + if (message.secondaryIpRange != null && message.hasOwnProperty("secondaryIpRange")) + object.secondaryIpRange = message.secondaryIpRange; if (message.replicaCount != null && message.hasOwnProperty("replicaCount")) object.replicaCount = message.replicaCount; if (message.nodes && message.nodes.length) { @@ -1559,6 +1807,22 @@ return values; })(); + /** + * TransitEncryptionMode enum. + * @name google.cloud.redis.v1.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.v1.Instance.ReadReplicasMode @@ -1578,26 +1842,26 @@ return Instance; })(); - v1.ListInstancesRequest = (function() { + v1.RescheduleMaintenanceRequest = (function() { /** - * Properties of a ListInstancesRequest. + * Properties of a RescheduleMaintenanceRequest. * @memberof google.cloud.redis.v1 - * @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.v1.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.v1 - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest + * @classdesc Represents a RescheduleMaintenanceRequest. + * @implements IRescheduleMaintenanceRequest * @constructor - * @param {google.cloud.redis.v1.IListInstancesRequest=} [properties] Properties to set + * @param {google.cloud.redis.v1.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) @@ -1605,101 +1869,101 @@ } /** - * ListInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.redis.v1.ListInstancesRequest + * RescheduleMaintenanceRequest name. + * @member {string} name + * @memberof google.cloud.redis.v1.RescheduleMaintenanceRequest * @instance */ - ListInstancesRequest.prototype.parent = ""; + RescheduleMaintenanceRequest.prototype.name = ""; /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.redis.v1.ListInstancesRequest + * RescheduleMaintenanceRequest rescheduleType. + * @member {google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType} rescheduleType + * @memberof google.cloud.redis.v1.RescheduleMaintenanceRequest * @instance */ - ListInstancesRequest.prototype.pageSize = 0; + RescheduleMaintenanceRequest.prototype.rescheduleType = 0; /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.redis.v1.ListInstancesRequest + * RescheduleMaintenanceRequest scheduleTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime + * @memberof google.cloud.redis.v1.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.v1.ListInstancesRequest + * @memberof google.cloud.redis.v1.RescheduleMaintenanceRequest * @static - * @param {google.cloud.redis.v1.IListInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.redis.v1.ListInstancesRequest} ListInstancesRequest instance + * @param {google.cloud.redis.v1.IRescheduleMaintenanceRequest=} [properties] Properties to set + * @returns {google.cloud.redis.v1.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.v1.ListInstancesRequest.verify|verify} messages. + * Encodes the specified RescheduleMaintenanceRequest message. Does not implicitly {@link google.cloud.redis.v1.RescheduleMaintenanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.redis.v1.ListInstancesRequest + * @memberof google.cloud.redis.v1.RescheduleMaintenanceRequest * @static - * @param {google.cloud.redis.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {google.cloud.redis.v1.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.v1.ListInstancesRequest.verify|verify} messages. + * Encodes the specified RescheduleMaintenanceRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1.RescheduleMaintenanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.redis.v1.ListInstancesRequest + * @memberof google.cloud.redis.v1.RescheduleMaintenanceRequest * @static - * @param {google.cloud.redis.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {google.cloud.redis.v1.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.v1.ListInstancesRequest + * @memberof google.cloud.redis.v1.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.v1.ListInstancesRequest} ListInstancesRequest + * @returns {google.cloud.redis.v1.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.v1.ListInstancesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1.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); @@ -1710,128 +1974,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.v1.ListInstancesRequest + * @memberof google.cloud.redis.v1.RescheduleMaintenanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.redis.v1.ListInstancesRequest} ListInstancesRequest + * @returns {google.cloud.redis.v1.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.v1.ListInstancesRequest + * @memberof google.cloud.redis.v1.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.v1.ListInstancesRequest + * @memberof google.cloud.redis.v1.RescheduleMaintenanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.redis.v1.ListInstancesRequest} ListInstancesRequest + * @returns {google.cloud.redis.v1.RescheduleMaintenanceRequest} RescheduleMaintenanceRequest */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.redis.v1.ListInstancesRequest) + RescheduleMaintenanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1.RescheduleMaintenanceRequest) return object; - var message = new $root.google.cloud.redis.v1.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.v1.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.v1.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.v1.ListInstancesRequest + * @memberof google.cloud.redis.v1.RescheduleMaintenanceRequest * @static - * @param {google.cloud.redis.v1.ListInstancesRequest} message ListInstancesRequest + * @param {google.cloud.redis.v1.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.v1.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.v1.ListInstancesRequest + * @memberof google.cloud.redis.v1.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.v1.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; })(); - v1.ListInstancesResponse = (function() { + v1.MaintenancePolicy = (function() { /** - * Properties of a ListInstancesResponse. + * Properties of a MaintenancePolicy. * @memberof google.cloud.redis.v1 - * @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.v1 - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse + * @classdesc Represents a MaintenancePolicy. + * @implements IMaintenancePolicy * @constructor - * @param {google.cloud.redis.v1.IListInstancesResponse=} [properties] Properties to set + * @param {google.cloud.redis.v1.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) @@ -1839,107 +2149,1600 @@ } /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.redis.v1.ListInstancesResponse + * MaintenancePolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.redis.v1.MaintenancePolicy * @instance */ - ListInstancesResponse.prototype.instances = $util.emptyArray; + MaintenancePolicy.prototype.createTime = null; /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.redis.v1.ListInstancesResponse + * MaintenancePolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.redis.v1.MaintenancePolicy * @instance */ - ListInstancesResponse.prototype.nextPageToken = ""; + MaintenancePolicy.prototype.updateTime = null; + + /** + * MaintenancePolicy description. + * @member {string} description + * @memberof google.cloud.redis.v1.MaintenancePolicy + * @instance + */ + MaintenancePolicy.prototype.description = ""; + + /** + * MaintenancePolicy weeklyMaintenanceWindow. + * @member {Array.} weeklyMaintenanceWindow + * @memberof google.cloud.redis.v1.MaintenancePolicy + * @instance + */ + MaintenancePolicy.prototype.weeklyMaintenanceWindow = $util.emptyArray; + + /** + * Creates a new MaintenancePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1.MaintenancePolicy + * @static + * @param {google.cloud.redis.v1.IMaintenancePolicy=} [properties] Properties to set + * @returns {google.cloud.redis.v1.MaintenancePolicy} MaintenancePolicy instance + */ + MaintenancePolicy.create = function create(properties) { + return new MaintenancePolicy(properties); + }; + + /** + * Encodes the specified MaintenancePolicy message. Does not implicitly {@link google.cloud.redis.v1.MaintenancePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1.MaintenancePolicy + * @static + * @param {google.cloud.redis.v1.IMaintenancePolicy} message MaintenancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenancePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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.v1.WeeklyMaintenanceWindow.encode(message.weeklyMaintenanceWindow[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MaintenancePolicy message, length delimited. Does not implicitly {@link google.cloud.redis.v1.MaintenancePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1.MaintenancePolicy + * @static + * @param {google.cloud.redis.v1.IMaintenancePolicy} message MaintenancePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaintenancePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaintenancePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.redis.v1.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.v1.MaintenancePolicy} MaintenancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.v1.MaintenancePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.description = reader.string(); + break; + case 4: + if (!(message.weeklyMaintenanceWindow && message.weeklyMaintenanceWindow.length)) + message.weeklyMaintenanceWindow = []; + message.weeklyMaintenanceWindow.push($root.google.cloud.redis.v1.WeeklyMaintenanceWindow.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MaintenancePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.redis.v1.MaintenancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1.MaintenancePolicy} MaintenancePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaintenancePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaintenancePolicy message. + * @function verify + * @memberof google.cloud.redis.v1.MaintenancePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaintenancePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.v1.WeeklyMaintenanceWindow.verify(message.weeklyMaintenanceWindow[i]); + if (error) + return "weeklyMaintenanceWindow." + error; + } + } + return null; + }; + + /** + * Creates a MaintenancePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.redis.v1.MaintenancePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1.MaintenancePolicy} MaintenancePolicy + */ + MaintenancePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1.MaintenancePolicy) + return object; + var message = new $root.google.cloud.redis.v1.MaintenancePolicy(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.redis.v1.MaintenancePolicy.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.redis.v1.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.v1.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.v1.MaintenancePolicy.weeklyMaintenanceWindow: object expected"); + message.weeklyMaintenanceWindow[i] = $root.google.cloud.redis.v1.WeeklyMaintenanceWindow.fromObject(object.weeklyMaintenanceWindow[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MaintenancePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.redis.v1.MaintenancePolicy + * @static + * @param {google.cloud.redis.v1.MaintenancePolicy} message MaintenancePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaintenancePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.weeklyMaintenanceWindow = []; + if (options.defaults) { + object.createTime = null; + object.updateTime = null; + object.description = ""; + } + 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.v1.WeeklyMaintenanceWindow.toObject(message.weeklyMaintenanceWindow[j], options); + } + return object; + }; + + /** + * Converts this MaintenancePolicy to JSON. + * @function toJSON + * @memberof google.cloud.redis.v1.MaintenancePolicy + * @instance + * @returns {Object.} JSON object + */ + MaintenancePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MaintenancePolicy; + })(); + + v1.WeeklyMaintenanceWindow = (function() { + + /** + * Properties of a WeeklyMaintenanceWindow. + * @memberof google.cloud.redis.v1 + * @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.v1 + * @classdesc Represents a WeeklyMaintenanceWindow. + * @implements IWeeklyMaintenanceWindow + * @constructor + * @param {google.cloud.redis.v1.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.v1.WeeklyMaintenanceWindow + * @instance + */ + WeeklyMaintenanceWindow.prototype.day = 0; + + /** + * WeeklyMaintenanceWindow startTime. + * @member {google.type.ITimeOfDay|null|undefined} startTime + * @memberof google.cloud.redis.v1.WeeklyMaintenanceWindow + * @instance + */ + WeeklyMaintenanceWindow.prototype.startTime = null; + + /** + * WeeklyMaintenanceWindow duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.redis.v1.WeeklyMaintenanceWindow + * @instance + */ + WeeklyMaintenanceWindow.prototype.duration = null; + + /** + * Creates a new WeeklyMaintenanceWindow instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1.WeeklyMaintenanceWindow + * @static + * @param {google.cloud.redis.v1.IWeeklyMaintenanceWindow=} [properties] Properties to set + * @returns {google.cloud.redis.v1.WeeklyMaintenanceWindow} WeeklyMaintenanceWindow instance + */ + WeeklyMaintenanceWindow.create = function create(properties) { + return new WeeklyMaintenanceWindow(properties); + }; + + /** + * Encodes the specified WeeklyMaintenanceWindow message. Does not implicitly {@link google.cloud.redis.v1.WeeklyMaintenanceWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1.WeeklyMaintenanceWindow + * @static + * @param {google.cloud.redis.v1.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.v1.WeeklyMaintenanceWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1.WeeklyMaintenanceWindow + * @static + * @param {google.cloud.redis.v1.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.v1.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.v1.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.v1.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.v1.WeeklyMaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1.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.v1.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.v1.WeeklyMaintenanceWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1.WeeklyMaintenanceWindow} WeeklyMaintenanceWindow + */ + WeeklyMaintenanceWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1.WeeklyMaintenanceWindow) + return object; + var message = new $root.google.cloud.redis.v1.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.v1.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.v1.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.v1.WeeklyMaintenanceWindow + * @static + * @param {google.cloud.redis.v1.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.v1.WeeklyMaintenanceWindow + * @instance + * @returns {Object.} JSON object + */ + WeeklyMaintenanceWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WeeklyMaintenanceWindow; + })(); + + v1.MaintenanceSchedule = (function() { + + /** + * Properties of a MaintenanceSchedule. + * @memberof google.cloud.redis.v1 + * @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.v1 + * @classdesc Represents a MaintenanceSchedule. + * @implements IMaintenanceSchedule + * @constructor + * @param {google.cloud.redis.v1.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.v1.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.startTime = null; + + /** + * MaintenanceSchedule endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.redis.v1.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.endTime = null; + + /** + * MaintenanceSchedule canReschedule. + * @member {boolean} canReschedule + * @memberof google.cloud.redis.v1.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.canReschedule = false; + + /** + * MaintenanceSchedule scheduleDeadlineTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduleDeadlineTime + * @memberof google.cloud.redis.v1.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.scheduleDeadlineTime = null; + + /** + * Creates a new MaintenanceSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1.MaintenanceSchedule + * @static + * @param {google.cloud.redis.v1.IMaintenanceSchedule=} [properties] Properties to set + * @returns {google.cloud.redis.v1.MaintenanceSchedule} MaintenanceSchedule instance + */ + MaintenanceSchedule.create = function create(properties) { + return new MaintenanceSchedule(properties); + }; + + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.redis.v1.MaintenanceSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1.MaintenanceSchedule + * @static + * @param {google.cloud.redis.v1.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.v1.MaintenanceSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1.MaintenanceSchedule + * @static + * @param {google.cloud.redis.v1.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.v1.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.v1.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.v1.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.v1.MaintenanceSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1.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.v1.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.v1.MaintenanceSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1.MaintenanceSchedule} MaintenanceSchedule + */ + MaintenanceSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1.MaintenanceSchedule) + return object; + var message = new $root.google.cloud.redis.v1.MaintenanceSchedule(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.redis.v1.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.v1.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.v1.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.v1.MaintenanceSchedule + * @static + * @param {google.cloud.redis.v1.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.v1.MaintenanceSchedule + * @instance + * @returns {Object.} JSON object + */ + MaintenanceSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MaintenanceSchedule; + })(); + + v1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.redis.v1 + * @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.v1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.redis.v1.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.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.redis.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.redis.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1.ListInstancesRequest + * @static + * @param {google.cloud.redis.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.redis.v1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.redis.v1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1.ListInstancesRequest + * @static + * @param {google.cloud.redis.v1.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.v1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1.ListInstancesRequest + * @static + * @param {google.cloud.redis.v1.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.v1.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.v1.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.v1.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.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1.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.v1.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.v1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1.ListInstancesRequest) + return object; + var message = new $root.google.cloud.redis.v1.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.v1.ListInstancesRequest + * @static + * @param {google.cloud.redis.v1.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.v1.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesRequest; + })(); + + v1.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.redis.v1 + * @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.v1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.redis.v1.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.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.redis.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.redis.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1.ListInstancesResponse + * @static + * @param {google.cloud.redis.v1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.redis.v1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.redis.v1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1.ListInstancesResponse + * @static + * @param {google.cloud.redis.v1.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.v1.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.v1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1.ListInstancesResponse + * @static + * @param {google.cloud.redis.v1.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.v1.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.v1.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.v1.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.v1.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.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1.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.v1.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.v1.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.v1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1.ListInstancesResponse) + return object; + var message = new $root.google.cloud.redis.v1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.redis.v1.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.v1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.redis.v1.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.v1.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.v1.ListInstancesResponse + * @static + * @param {google.cloud.redis.v1.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.v1.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.v1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesResponse; + })(); + + v1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.redis.v1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.redis.v1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.redis.v1.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.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1.GetInstanceRequest + * @static + * @param {google.cloud.redis.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.redis.v1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.redis.v1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1.GetInstanceRequest + * @static + * @param {google.cloud.redis.v1.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.v1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1.GetInstanceRequest + * @static + * @param {google.cloud.redis.v1.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.v1.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.v1.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.v1.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.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1.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.v1.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.v1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.redis.v1.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.v1.GetInstanceRequest + * @static + * @param {google.cloud.redis.v1.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.v1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInstanceRequest; + })(); + + v1.GetInstanceAuthStringRequest = (function() { + + /** + * Properties of a GetInstanceAuthStringRequest. + * @memberof google.cloud.redis.v1 + * @interface IGetInstanceAuthStringRequest + * @property {string|null} [name] GetInstanceAuthStringRequest name + */ + + /** + * Constructs a new GetInstanceAuthStringRequest. + * @memberof google.cloud.redis.v1 + * @classdesc Represents a GetInstanceAuthStringRequest. + * @implements IGetInstanceAuthStringRequest + * @constructor + * @param {google.cloud.redis.v1.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]]; + } /** - * ListInstancesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.redis.v1.ListInstancesResponse + * GetInstanceAuthStringRequest name. + * @member {string} name + * @memberof google.cloud.redis.v1.GetInstanceAuthStringRequest * @instance */ - ListInstancesResponse.prototype.unreachable = $util.emptyArray; + GetInstanceAuthStringRequest.prototype.name = ""; /** - * Creates a new ListInstancesResponse instance using the specified properties. + * Creates a new GetInstanceAuthStringRequest instance using the specified properties. * @function create - * @memberof google.cloud.redis.v1.ListInstancesResponse + * @memberof google.cloud.redis.v1.GetInstanceAuthStringRequest * @static - * @param {google.cloud.redis.v1.IListInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.redis.v1.ListInstancesResponse} ListInstancesResponse instance + * @param {google.cloud.redis.v1.IGetInstanceAuthStringRequest=} [properties] Properties to set + * @returns {google.cloud.redis.v1.GetInstanceAuthStringRequest} GetInstanceAuthStringRequest instance */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); + GetInstanceAuthStringRequest.create = function create(properties) { + return new GetInstanceAuthStringRequest(properties); }; /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.redis.v1.ListInstancesResponse.verify|verify} messages. + * Encodes the specified GetInstanceAuthStringRequest message. Does not implicitly {@link google.cloud.redis.v1.GetInstanceAuthStringRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.redis.v1.ListInstancesResponse + * @memberof google.cloud.redis.v1.GetInstanceAuthStringRequest * @static - * @param {google.cloud.redis.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {google.cloud.redis.v1.IGetInstanceAuthStringRequest} message GetInstanceAuthStringRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesResponse.encode = function encode(message, writer) { + GetInstanceAuthStringRequest.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.v1.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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.redis.v1.ListInstancesResponse.verify|verify} messages. + * Encodes the specified GetInstanceAuthStringRequest message, length delimited. Does not implicitly {@link google.cloud.redis.v1.GetInstanceAuthStringRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.redis.v1.ListInstancesResponse + * @memberof google.cloud.redis.v1.GetInstanceAuthStringRequest * @static - * @param {google.cloud.redis.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {google.cloud.redis.v1.IGetInstanceAuthStringRequest} message GetInstanceAuthStringRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetInstanceAuthStringRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. + * Decodes a GetInstanceAuthStringRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.redis.v1.ListInstancesResponse + * @memberof google.cloud.redis.v1.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.v1.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.redis.v1.GetInstanceAuthStringRequest} GetInstanceAuthStringRequest * @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) { + 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.v1.ListInstancesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1.GetInstanceAuthStringRequest(); 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.v1.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()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -1950,154 +3753,107 @@ }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a GetInstanceAuthStringRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.redis.v1.ListInstancesResponse + * @memberof google.cloud.redis.v1.GetInstanceAuthStringRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.redis.v1.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.redis.v1.GetInstanceAuthStringRequest} GetInstanceAuthStringRequest * @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) { + GetInstanceAuthStringRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListInstancesResponse message. + * Verifies a GetInstanceAuthStringRequest message. * @function verify - * @memberof google.cloud.redis.v1.ListInstancesResponse + * @memberof google.cloud.redis.v1.GetInstanceAuthStringRequest * @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) { + GetInstanceAuthStringRequest.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.v1.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"; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetInstanceAuthStringRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.redis.v1.ListInstancesResponse + * @memberof google.cloud.redis.v1.GetInstanceAuthStringRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.redis.v1.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.redis.v1.GetInstanceAuthStringRequest} GetInstanceAuthStringRequest */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.redis.v1.ListInstancesResponse) + GetInstanceAuthStringRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1.GetInstanceAuthStringRequest) return object; - var message = new $root.google.cloud.redis.v1.ListInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.redis.v1.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.v1.ListInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.redis.v1.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.v1.ListInstancesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } + var message = new $root.google.cloud.redis.v1.GetInstanceAuthStringRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetInstanceAuthStringRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.redis.v1.ListInstancesResponse + * @memberof google.cloud.redis.v1.GetInstanceAuthStringRequest * @static - * @param {google.cloud.redis.v1.ListInstancesResponse} message ListInstancesResponse + * @param {google.cloud.redis.v1.GetInstanceAuthStringRequest} message GetInstanceAuthStringRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesResponse.toObject = function toObject(message, options) { + GetInstanceAuthStringRequest.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.v1.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]; - } + 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.v1.ListInstancesResponse + * @memberof google.cloud.redis.v1.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; })(); - v1.GetInstanceRequest = (function() { + v1.InstanceAuthString = (function() { /** - * Properties of a GetInstanceRequest. + * Properties of an InstanceAuthString. * @memberof google.cloud.redis.v1 - * @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.v1 - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest + * @classdesc Represents an InstanceAuthString. + * @implements IInstanceAuthString * @constructor - * @param {google.cloud.redis.v1.IGetInstanceRequest=} [properties] Properties to set + * @param {google.cloud.redis.v1.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) @@ -2105,75 +3861,75 @@ } /** - * GetInstanceRequest name. - * @member {string} name - * @memberof google.cloud.redis.v1.GetInstanceRequest + * InstanceAuthString authString. + * @member {string} authString + * @memberof google.cloud.redis.v1.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.v1.GetInstanceRequest + * @memberof google.cloud.redis.v1.InstanceAuthString * @static - * @param {google.cloud.redis.v1.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.redis.v1.GetInstanceRequest} GetInstanceRequest instance + * @param {google.cloud.redis.v1.IInstanceAuthString=} [properties] Properties to set + * @returns {google.cloud.redis.v1.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.v1.GetInstanceRequest.verify|verify} messages. + * Encodes the specified InstanceAuthString message. Does not implicitly {@link google.cloud.redis.v1.InstanceAuthString.verify|verify} messages. * @function encode - * @memberof google.cloud.redis.v1.GetInstanceRequest + * @memberof google.cloud.redis.v1.InstanceAuthString * @static - * @param {google.cloud.redis.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {google.cloud.redis.v1.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.v1.GetInstanceRequest.verify|verify} messages. + * Encodes the specified InstanceAuthString message, length delimited. Does not implicitly {@link google.cloud.redis.v1.InstanceAuthString.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.redis.v1.GetInstanceRequest + * @memberof google.cloud.redis.v1.InstanceAuthString * @static - * @param {google.cloud.redis.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {google.cloud.redis.v1.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.v1.GetInstanceRequest + * @memberof google.cloud.redis.v1.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.v1.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.redis.v1.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.v1.GetInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.redis.v1.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); @@ -2184,87 +3940,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.v1.GetInstanceRequest + * @memberof google.cloud.redis.v1.InstanceAuthString * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.redis.v1.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.redis.v1.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.v1.GetInstanceRequest + * @memberof google.cloud.redis.v1.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.v1.GetInstanceRequest + * @memberof google.cloud.redis.v1.InstanceAuthString * @static * @param {Object.} object Plain object - * @returns {google.cloud.redis.v1.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.redis.v1.InstanceAuthString} InstanceAuthString */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.redis.v1.GetInstanceRequest) + InstanceAuthString.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1.InstanceAuthString) return object; - var message = new $root.google.cloud.redis.v1.GetInstanceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.redis.v1.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.v1.GetInstanceRequest + * @memberof google.cloud.redis.v1.InstanceAuthString * @static - * @param {google.cloud.redis.v1.GetInstanceRequest} message GetInstanceRequest + * @param {google.cloud.redis.v1.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.v1.GetInstanceRequest + * @memberof google.cloud.redis.v1.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; })(); v1.CreateInstanceRequest = (function() { @@ -5310,6 +7066,292 @@ return ZoneMetadata; })(); + v1.TlsCertificate = (function() { + + /** + * Properties of a TlsCertificate. + * @memberof google.cloud.redis.v1 + * @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.v1 + * @classdesc Represents a TlsCertificate. + * @implements ITlsCertificate + * @constructor + * @param {google.cloud.redis.v1.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.v1.TlsCertificate + * @instance + */ + TlsCertificate.prototype.serialNumber = ""; + + /** + * TlsCertificate cert. + * @member {string} cert + * @memberof google.cloud.redis.v1.TlsCertificate + * @instance + */ + TlsCertificate.prototype.cert = ""; + + /** + * TlsCertificate createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.redis.v1.TlsCertificate + * @instance + */ + TlsCertificate.prototype.createTime = null; + + /** + * TlsCertificate expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.redis.v1.TlsCertificate + * @instance + */ + TlsCertificate.prototype.expireTime = null; + + /** + * TlsCertificate sha1Fingerprint. + * @member {string} sha1Fingerprint + * @memberof google.cloud.redis.v1.TlsCertificate + * @instance + */ + TlsCertificate.prototype.sha1Fingerprint = ""; + + /** + * Creates a new TlsCertificate instance using the specified properties. + * @function create + * @memberof google.cloud.redis.v1.TlsCertificate + * @static + * @param {google.cloud.redis.v1.ITlsCertificate=} [properties] Properties to set + * @returns {google.cloud.redis.v1.TlsCertificate} TlsCertificate instance + */ + TlsCertificate.create = function create(properties) { + return new TlsCertificate(properties); + }; + + /** + * Encodes the specified TlsCertificate message. Does not implicitly {@link google.cloud.redis.v1.TlsCertificate.verify|verify} messages. + * @function encode + * @memberof google.cloud.redis.v1.TlsCertificate + * @static + * @param {google.cloud.redis.v1.ITlsCertificate} message TlsCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} 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 TlsCertificate message, length delimited. Does not implicitly {@link google.cloud.redis.v1.TlsCertificate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.redis.v1.TlsCertificate + * @static + * @param {google.cloud.redis.v1.ITlsCertificate} message TlsCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TlsCertificate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TlsCertificate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.redis.v1.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.v1.TlsCertificate} TlsCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.v1.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; + } + } + return message; + }; + + /** + * Decodes a TlsCertificate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.redis.v1.TlsCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.redis.v1.TlsCertificate} TlsCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TlsCertificate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TlsCertificate message. + * @function verify + * @memberof google.cloud.redis.v1.TlsCertificate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + 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 TlsCertificate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.redis.v1.TlsCertificate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.redis.v1.TlsCertificate} TlsCertificate + */ + TlsCertificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.redis.v1.TlsCertificate) + return object; + var message = new $root.google.cloud.redis.v1.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.v1.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.v1.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 TlsCertificate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.redis.v1.TlsCertificate + * @static + * @param {google.cloud.redis.v1.TlsCertificate} message TlsCertificate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + 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 TlsCertificate to JSON. + * @function toJSON + * @memberof google.cloud.redis.v1.TlsCertificate + * @instance + * @returns {Object.} JSON object + */ + TlsCertificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TlsCertificate; + })(); + return v1; })(); diff --git a/packages/google-cloud-redis/protos/protos.json b/packages/google-cloud-redis/protos/protos.json index dd9fc146998..2c9205f2341 100644 --- a/packages/google-cloud-redis/protos/protos.json +++ b/packages/google-cloud-redis/protos/protos.json @@ -56,6 +56,24 @@ } ] }, + "GetInstanceAuthString": { + "requestType": "GetInstanceAuthStringRequest", + "responseType": "InstanceAuthString", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/instances/*}/authString", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/instances/*}/authString" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, "CreateInstance": { "requestType": "CreateInstanceRequest", "responseType": "google.longrunning.Operation", @@ -249,6 +267,34 @@ } } ] + }, + "RescheduleMaintenance": { + "requestType": "RescheduleMaintenanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{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.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.redis.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/instances/*}:rescheduleMaintenance", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name, reschedule_type, schedule_time" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.redis.v1.Instance", + "metadata_type": "google.cloud.redis.v1.OperationMetadata" + } + } + ] } } }, @@ -320,6 +366,13 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "secondaryIpRange": { + "type": "string", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "host": { "type": "string", "id": 10, @@ -405,6 +458,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, @@ -470,6 +559,13 @@ "PRIVATE_SERVICE_ACCESS": 2 } }, + "TransitEncryptionMode": { + "values": { + "TRANSIT_ENCRYPTION_MODE_UNSPECIFIED": 0, + "SERVER_AUTHENTICATION": 1, + "DISABLED": 2 + } + }, "ReadReplicasMode": { "values": { "READ_REPLICAS_MODE_UNSPECIFIED": 0, @@ -479,6 +575,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": { @@ -529,6 +751,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": { @@ -766,6 +1008,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 + } + } } } }, diff --git a/packages/google-cloud-redis/samples/generated/v1/cloud_redis.get_instance_auth_string.js b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.get_instance_auth_string.js new file mode 100644 index 00000000000..105d3248014 --- /dev/null +++ b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.get_instance_auth_string.js @@ -0,0 +1,60 @@ +// 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. +// You may obtain a copy of the License at +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START redis_v1_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').v1; + + // 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_v1_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/v1/cloud_redis.reschedule_maintenance.js b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.reschedule_maintenance.js new file mode 100644 index 00000000000..35959f21358 --- /dev/null +++ b/packages/google-cloud-redis/samples/generated/v1/cloud_redis.reschedule_maintenance.js @@ -0,0 +1,72 @@ +// 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. +// You may obtain a copy of the License at +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, rescheduleType) { + // [START redis_v1_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').v1; + + // 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_v1_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/v1/snippet_metadata.google.cloud.redis.v1.json b/packages/google-cloud-redis/samples/generated/v1/snippet_metadata.google.cloud.redis.v1.json index 633259e7576..07ae5080ece 100644 --- a/packages/google-cloud-redis/samples/generated/v1/snippet_metadata.google.cloud.redis.v1.json +++ b/packages/google-cloud-redis/samples/generated/v1/snippet_metadata.google.cloud.redis.v1.json @@ -99,6 +99,46 @@ } } }, + { + "regionTag": "redis_v1_generated_CloudRedis_GetInstanceAuthString_async", + "title": "CloudRedis getInstanceAuthString Sample", + "origin": "API_DEFINITION", + "description": " Gets the AUTH string for a Redis instance. If AUTH is not enabled for the instance the response will be empty. This information is not included in the details returned to GetInstance.", + "canonical": true, + "file": "cloud_redis.get_instance_auth_string.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstanceAuthString", + "fullName": "google.cloud.redis.v1.CloudRedis.GetInstanceAuthString", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.redis.v1.InstanceAuthString", + "client": { + "shortName": "CloudRedisClient", + "fullName": "google.cloud.redis.v1.CloudRedisClient" + }, + "method": { + "shortName": "GetInstanceAuthString", + "fullName": "google.cloud.redis.v1.CloudRedis.GetInstanceAuthString", + "service": { + "shortName": "CloudRedis", + "fullName": "google.cloud.redis.v1.CloudRedis" + } + } + } + }, { "regionTag": "redis_v1_generated_CloudRedis_CreateInstance_async", "title": "CloudRedis createInstance Sample", @@ -406,6 +446,54 @@ } } } + }, + { + "regionTag": "redis_v1_generated_CloudRedis_RescheduleMaintenance_async", + "title": "CloudRedis rescheduleMaintenance Sample", + "origin": "API_DEFINITION", + "description": " Reschedule maintenance for a given instance in a given project and location.", + "canonical": true, + "file": "cloud_redis.reschedule_maintenance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RescheduleMaintenance", + "fullName": "google.cloud.redis.v1.CloudRedis.RescheduleMaintenance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "reschedule_type", + "type": ".google.cloud.redis.v1.RescheduleMaintenanceRequest.RescheduleType" + }, + { + "name": "schedule_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudRedisClient", + "fullName": "google.cloud.redis.v1.CloudRedisClient" + }, + "method": { + "shortName": "RescheduleMaintenance", + "fullName": "google.cloud.redis.v1.CloudRedis.RescheduleMaintenance", + "service": { + "shortName": "CloudRedis", + "fullName": "google.cloud.redis.v1.CloudRedis" + } + } + } } ] } 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 673713b0465..17e4747c052 100644 --- a/packages/google-cloud-redis/src/v1/cloud_redis_client.ts +++ b/packages/google-cloud-redis/src/v1/cloud_redis_client.ts @@ -253,6 +253,12 @@ export class CloudRedisClient { const deleteInstanceMetadata = protoFilesRoot.lookup( '.google.cloud.redis.v1.OperationMetadata' ) as gax.protobuf.Type; + const rescheduleMaintenanceResponse = protoFilesRoot.lookup( + '.google.cloud.redis.v1.Instance' + ) as gax.protobuf.Type; + const rescheduleMaintenanceMetadata = protoFilesRoot.lookup( + '.google.cloud.redis.v1.OperationMetadata' + ) 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( @@ -521,6 +536,101 @@ 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.v1.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/v1/cloud_redis.get_instance_auth_string.js + * region_tag:redis_v1_generated_CloudRedis_GetInstanceAuthString_async + */ + getInstanceAuthString( + request?: protos.google.cloud.redis.v1.IGetInstanceAuthStringRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.redis.v1.IInstanceAuthString, + protos.google.cloud.redis.v1.IGetInstanceAuthStringRequest | undefined, + {} | undefined + ] + >; + getInstanceAuthString( + request: protos.google.cloud.redis.v1.IGetInstanceAuthStringRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.redis.v1.IInstanceAuthString, + | protos.google.cloud.redis.v1.IGetInstanceAuthStringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstanceAuthString( + request: protos.google.cloud.redis.v1.IGetInstanceAuthStringRequest, + callback: Callback< + protos.google.cloud.redis.v1.IInstanceAuthString, + | protos.google.cloud.redis.v1.IGetInstanceAuthStringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstanceAuthString( + request?: protos.google.cloud.redis.v1.IGetInstanceAuthStringRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.redis.v1.IInstanceAuthString, + | protos.google.cloud.redis.v1.IGetInstanceAuthStringRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.redis.v1.IInstanceAuthString, + | protos.google.cloud.redis.v1.IGetInstanceAuthStringRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.redis.v1.IInstanceAuthString, + protos.google.cloud.redis.v1.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. @@ -1554,6 +1664,152 @@ export class CloudRedisClient { protos.google.cloud.redis.v1.OperationMetadata >; } + /** + * 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.v1.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/v1/cloud_redis.reschedule_maintenance.js + * region_tag:redis_v1_generated_CloudRedis_RescheduleMaintenance_async + */ + rescheduleMaintenance( + request?: protos.google.cloud.redis.v1.IRescheduleMaintenanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.redis.v1.IInstance, + protos.google.cloud.redis.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + rescheduleMaintenance( + request: protos.google.cloud.redis.v1.IRescheduleMaintenanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.redis.v1.IInstance, + protos.google.cloud.redis.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rescheduleMaintenance( + request: protos.google.cloud.redis.v1.IRescheduleMaintenanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.redis.v1.IInstance, + protos.google.cloud.redis.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rescheduleMaintenance( + request?: protos.google.cloud.redis.v1.IRescheduleMaintenanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.redis.v1.IInstance, + protos.google.cloud.redis.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.redis.v1.IInstance, + protos.google.cloud.redis.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.redis.v1.IInstance, + protos.google.cloud.redis.v1.IOperationMetadata + >, + 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/v1/cloud_redis.reschedule_maintenance.js + * region_tag:redis_v1_generated_CloudRedis_RescheduleMaintenance_async + */ + async checkRescheduleMaintenanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.redis.v1.Instance, + protos.google.cloud.redis.v1.OperationMetadata + > + > { + 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.v1.Instance, + protos.google.cloud.redis.v1.OperationMetadata + >; + } /** * Lists all Redis instances owned by a project in either the specified * location (region) or all locations. diff --git a/packages/google-cloud-redis/src/v1/cloud_redis_client_config.json b/packages/google-cloud-redis/src/v1/cloud_redis_client_config.json index 9fd604eb46f..72ac0d962a3 100644 --- a/packages/google-cloud-redis/src/v1/cloud_redis_client_config.json +++ b/packages/google-cloud-redis/src/v1/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,11 @@ "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "RescheduleMaintenance": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-redis/src/v1/gapic_metadata.json b/packages/google-cloud-redis/src/v1/gapic_metadata.json index 1d824e0d512..4390968e4b6 100644 --- a/packages/google-cloud-redis/src/v1/gapic_metadata.json +++ b/packages/google-cloud-redis/src/v1/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/test/gapic_cloud_redis_v1.ts b/packages/google-cloud-redis/test/gapic_cloud_redis_v1.ts index 3a24c7b2912..981d5dbf289 100644 --- a/packages/google-cloud-redis/test/gapic_cloud_redis_v1.ts +++ b/packages/google-cloud-redis/test/gapic_cloud_redis_v1.ts @@ -360,13 +360,145 @@ describe('v1.CloudRedisClient', () => { new protos.google.cloud.redis.v1.GetInstanceRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getInstance(request), expectedError); }); }); + describe('getInstanceAuthString', () => { + it('invokes getInstanceAuthString without error', async () => { + const client = new cloudredisModule.v1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1.GetInstanceAuthStringRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.redis.v1.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.v1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1.GetInstanceAuthStringRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.redis.v1.InstanceAuthString() + ); + client.innerApiCalls.getInstanceAuthString = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstanceAuthString( + request, + ( + err?: Error | null, + result?: protos.google.cloud.redis.v1.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.v1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1.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) + ); + }); + + it('invokes getInstanceAuthString with closed client', async () => { + const client = new cloudredisModule.v1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1.GetInstanceAuthStringRequest() + ); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getInstanceAuthString(request), + expectedError + ); + }); + }); + describe('createInstance', () => { it('invokes createInstance without error', async () => { const client = new cloudredisModule.v1.CloudRedisClient({ @@ -1729,6 +1861,203 @@ describe('v1.CloudRedisClient', () => { }); }); + describe('rescheduleMaintenance', () => { + it('invokes rescheduleMaintenance without error', async () => { + const client = new cloudredisModule.v1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1.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.v1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1.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.v1.IInstance, + protos.google.cloud.redis.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.redis.v1.IInstance, + protos.google.cloud.redis.v1.IOperationMetadata + >; + 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.v1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1.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.v1.CloudRedisClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.redis.v1.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.v1.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.v1.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.v1.CloudRedisClient({ 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 d971f660a77..05295106868 100644 --- a/packages/google-cloud-redis/test/gapic_cloud_redis_v1beta1.ts +++ b/packages/google-cloud-redis/test/gapic_cloud_redis_v1beta1.ts @@ -360,7 +360,6 @@ describe('v1beta1.CloudRedisClient', () => { new protos.google.cloud.redis.v1beta1.GetInstanceRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getInstance(request), expectedError); @@ -491,7 +490,6 @@ describe('v1beta1.CloudRedisClient', () => { new protos.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(