diff --git a/packages/google-cloud-memcache/README.md b/packages/google-cloud-memcache/README.md index e559cf8f0aa..50be6ce83b0 100644 --- a/packages/google-cloud-memcache/README.md +++ b/packages/google-cloud-memcache/README.md @@ -129,6 +129,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Cloud_memcache.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.delete_instance.js,samples/README.md) | | Cloud_memcache.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.get_instance.js,samples/README.md) | | Cloud_memcache.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js,samples/README.md) | +| Cloud_memcache.reschedule_maintenance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.reschedule_maintenance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.reschedule_maintenance.js,samples/README.md) | | Cloud_memcache.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js,samples/README.md) | | Cloud_memcache.update_parameters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_parameters.js,samples/README.md) | | Cloud_memcache.apply_parameters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.apply_parameters.js,samples/README.md) | @@ -137,6 +138,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Cloud_memcache.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.delete_instance.js,samples/README.md) | | Cloud_memcache.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.get_instance.js,samples/README.md) | | Cloud_memcache.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.list_instances.js,samples/README.md) | +| Cloud_memcache.reschedule_maintenance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.reschedule_maintenance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.reschedule_maintenance.js,samples/README.md) | | Cloud_memcache.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js,samples/README.md) | | Cloud_memcache.update_parameters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_parameters.js,samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/quickstart.js,samples/README.md) | diff --git a/packages/google-cloud-memcache/protos/google/cloud/memcache/v1/cloud_memcache.proto b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1/cloud_memcache.proto index 308f0582009..f1cca123137 100644 --- a/packages/google-cloud-memcache/protos/google/cloud/memcache/v1/cloud_memcache.proto +++ b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1/cloud_memcache.proto @@ -1,4 +1,4 @@ -// Copyright 2020 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/memcache/v1;memcache"; option java_multiple_files = true; @@ -90,9 +93,10 @@ service CloudMemcache { }; } - // Updates the defined Memcached Parameters for an existing Instance. + // Updates the defined Memcached parameters for an existing instance. // This method only stages the parameters, it must be followed by - // ApplyParameters to apply the parameters to nodes of the Memcached Instance. + // `ApplyParameters` to apply the parameters to nodes of the Memcached + // instance. rpc UpdateParameters(UpdateParametersRequest) returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{name=projects/*/locations/*/instances/*}:updateParameters" @@ -117,7 +121,7 @@ service CloudMemcache { }; } - // ApplyParameters will restart the set of specified nodes in order to update + // `ApplyParameters` restarts the set of specified nodes in order to update // them to the current set of parameters for the Memcached Instance. rpc ApplyParameters(ApplyParametersRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -130,14 +134,50 @@ service CloudMemcache { metadata_type: "google.cloud.memcache.v1.OperationMetadata" }; } + + // Reschedules upcoming maintenance event. + rpc RescheduleMaintenance(RescheduleMaintenanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{instance=projects/*/locations/*/instances/*}:rescheduleMaintenance" + body: "*" + }; + option (google.api.method_signature) = "instance, reschedule_type, schedule_time"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1.Instance" + metadata_type: "google.cloud.memcache.v1.OperationMetadata" + }; + } } +// A Memorystore for Memcached instance message Instance { option (google.api.resource) = { type: "memcache.googleapis.com/Instance" pattern: "projects/{project}/locations/{location}/instances/{instance}" }; + // Different states of a Memcached instance. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // Memcached instance is being created. + CREATING = 1; + + // Memcached instance has been created and ready to be used. + READY = 2; + + // Memcached instance is updating configuration such as maintenance policy + // and schedule. + UPDATING = 3; + + // Memcached instance is being deleted. + DELETING = 4; + + // Memcached instance is going through maintenance, e.g. data plane rollout. + PERFORMING_MAINTENANCE = 5; + } + // Configuration for a Memcached Node. message NodeConfig { // Required. Number of cpus per Memcached node. @@ -203,35 +243,17 @@ message Instance { string message = 2; } - // Different states of a Memcached instance. - enum State { - // State not set. - STATE_UNSPECIFIED = 0; - - // Memcached instance is being created. - CREATING = 1; - - // Memcached instance has been created and ready to be used. - READY = 2; - - // Memcached instance is being deleted. - DELETING = 4; - - // Memcached instance is going through maintenance, e.g. data plane rollout. - PERFORMING_MAINTENANCE = 5; - } - // Required. Unique name of the resource in this scope including project and // location using the form: // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` // - // Note: Memcached instances are managed and addressed at regional level so - // location_id here refers to a GCP region; however, users may choose which - // zones Memcached nodes within an instances should be provisioned in. - // Refer to [zones] field for more details. + // Note: Memcached instances are managed and addressed at the regional level + // so `location_id` here refers to a Google Cloud region; however, users may + // choose which zones Memcached nodes should be provisioned in within an + // instance. Refer to [zones][google.cloud.memcache.v1.Instance.zones] field for more details. string name = 1 [(google.api.field_behavior) = REQUIRED]; - // User provided name for the instance only used for display + // User provided name for the instance, which is only used for display // purposes. Cannot be more than 80 characters. string display_name = 2; @@ -246,7 +268,7 @@ message Instance { // will be used. string authorized_network = 4; - // Zones where Memcached nodes should be provisioned in. + // Zones in which Memcached nodes should be provisioned. // Memcached nodes will be equally distributed across these zones. If not // provided, the service will by default create nodes in all zones in the // region for the instance. @@ -260,17 +282,17 @@ message Instance { // The major version of Memcached software. // If not provided, latest supported version will be used. Currently the - // latest supported major version is MEMCACHE_1_5. + // latest supported major version is `MEMCACHE_1_5`. // The minor version will be automatically determined by our system based on // the latest supported minor version. MemcacheVersion memcache_version = 9; - // Optional: User defined parameters to apply to the memcached process + // User defined parameters to apply to the memcached process // on each node. MemcacheParameters parameters = 11; // Output only. List of Memcached nodes. - // Refer to [Node] message for more details. + // Refer to [Node][google.cloud.memcache.v1.Instance.Node] message for more details. repeated Node memcache_nodes = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time the instance was created. @@ -288,11 +310,99 @@ message Instance { // The full version format will be "memcached-1.5.16". string memcache_full_version = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - // List of messages that describe current statuses of memcached instance. + // List of messages that describe the current state of the Memcached instance. repeated InstanceMessage instance_messages = 19; - // Output only. Endpoint for Discovery API + // Output only. Endpoint for the Discovery API. string discovery_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The maintenance policy for the instance. If not provided, + // the maintenance event will be performed based on Memorystore + // internal rollout schedule. + MaintenancePolicy maintenance_policy = 21; + + // Output only. Published maintenance schedule. + MaintenanceSchedule maintenance_schedule = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Maintenance policy per 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 updated. + google.protobuf.Timestamp update_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Description of what this policy is for. Create/Update methods + // return INVALID_ARGUMENT if the length is greater than 512. + string description = 3; + + // Required. Maintenance window that is applied to resources covered by this + // policy. Minimum 1. For the current version, the maximum number of + // weekly_maintenance_windows is expected to be one. + repeated WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Time window specified for weekly operations. +message WeeklyMaintenanceWindow { + // Required. Allows to define schedule that runs specified day of the week. + google.type.DayOfWeek day = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Start time of the window in UTC. + google.type.TimeOfDay start_time = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Duration of the time window. + google.protobuf.Duration duration = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Upcoming maintenance schedule. +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]; + + // Output only. The deadline that the maintenance schedule start time can not go beyond, + // including reschedule. + google.protobuf.Timestamp schedule_deadline_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for [RescheduleMaintenance][google.cloud.memcache.v1.CloudMemcache.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. Memcache instance resource name using the form: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region. + string instance = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.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]; + + // 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; } // Request for [ListInstances][google.cloud.memcache.v1.CloudMemcache.ListInstances]. @@ -310,18 +420,17 @@ message ListInstancesRequest { // The maximum number of items to return. // // If not specified, a default value of 1000 will be used by the service. - // Regardless of the page_size value, the response may include a partial list - // and a caller should only rely on response's - // [next_page_token][CloudMemcache.ListInstancesResponse.next_page_token] + // Regardless of the `page_size` value, the response may include a partial + // list and a caller should only rely on response's + // [`next_page_token`][google.cloud.memcache.v1.ListInstancesResponse.next_page_token] // to determine if there are more instances left to be queried. int32 page_size = 2; - // The next_page_token value returned from a previous List request, - // if any. + // The `next_page_token` value returned from a previous List request, if any. string page_token = 3; // List filter. For example, exclude all Memcached instances with name as - // my-instance by specifying "name != my-instance". + // my-instance by specifying `"name != my-instance"`. string filter = 4; // Sort results. Supported values are "name", "name desc" or "" (unsorted). @@ -377,9 +486,9 @@ message CreateInstanceRequest { // * Must start with a letter. // * Must be between 1-40 characters. // * Must end with a number or a letter. - // * Must be unique within the user project / location + // * Must be unique within the user project / location. // - // If any of the above are not met, will raise an invalid argument error. + // If any of the above are not met, the API raises an invalid argument error. string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. A Memcached Instance @@ -389,6 +498,7 @@ message CreateInstanceRequest { // Request for [UpdateInstance][google.cloud.memcache.v1.CloudMemcache.UpdateInstance]. message UpdateInstanceRequest { // Required. Mask of fields to update. + // // * `displayName` google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; @@ -421,12 +531,12 @@ message ApplyParametersRequest { } ]; - // Nodes to which we should apply the instance-level parameter group. + // Nodes to which the instance-level parameter group is applied. repeated string node_ids = 2; // Whether to apply instance-level parameter group to all nodes. If set to - // true, will explicitly restrict users from specifying any nodes, and apply - // parameter group updates to all nodes within the instance. + // true, users are restricted from specifying individual nodes, and + // `ApplyParameters` updates all nodes within the instance. bool apply_all = 3; } @@ -448,11 +558,20 @@ message UpdateParametersRequest { MemcacheParameters parameters = 3; } +// Memcached versions supported by our service. +enum MemcacheVersion { + MEMCACHE_VERSION_UNSPECIFIED = 0; + + // Memcached 1.5 version. + MEMCACHE_1_5 = 1; +} + message MemcacheParameters { // Output only. The unique ID associated with this set of parameters. Users // can use this id to determine if the parameters associated with the instance - // differ from the parameters associated with the nodes and any action needs - // to be taken to apply parameters on nodes. + // differ from the parameters associated with the nodes. A discrepancy between + // parameter ids can inform users that they may need to take action to apply + // parameters on nodes. string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // User defined set of parameters to use in the memcached process. @@ -486,10 +605,14 @@ message OperationMetadata { string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// Memcached versions supported by our service. -enum MemcacheVersion { - MEMCACHE_VERSION_UNSPECIFIED = 0; +// Metadata for the given [google.cloud.location.Location][google.cloud.location.Location]. +message LocationMetadata { + // Output only. The set of available zones in the location. The map is keyed + // by the lowercase ID of each zone, as defined by GCE. These keys can be + // specified in the `zones` field when creating a Memcached instance. + map available_zones = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message ZoneMetadata { - // Memcached 1.5 version. - MEMCACHE_1_5 = 1; } diff --git a/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto index 1a3ff64a7f8..4cb9040318b 100644 --- a/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.proto +++ b/packages/google-cloud-memcache/protos/google/cloud/memcache/v1beta2/cloud_memcache.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/memcache/v1beta2;memcache"; option java_multiple_files = true; @@ -144,6 +147,19 @@ service CloudMemcache { metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" }; } + + // Performs the apply phase of the RescheduleMaintenance verb. + rpc RescheduleMaintenance(RescheduleMaintenanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta2/{instance=projects/*/locations/*/instances/*}:rescheduleMaintenance" + body: "*" + }; + option (google.api.method_signature) = "instance, reschedule_type, schedule_time"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.memcache.v1beta2.Instance" + metadata_type: "google.cloud.memcache.v1beta2.OperationMetadata" + }; + } } // A Memorystore for Memcached instance @@ -153,6 +169,28 @@ message Instance { pattern: "projects/{project}/locations/{location}/instances/{instance}" }; + // Different states of a Memcached instance. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // Memcached instance is being created. + CREATING = 1; + + // Memcached instance has been created and ready to be used. + READY = 2; + + // Memcached instance is updating configuration such as maintenance policy + // and schedule. + UPDATING = 3; + + // Memcached instance is being deleted. + DELETING = 4; + + // Memcached instance is going through maintenance, e.g. data plane rollout. + PERFORMING_MAINTENANCE = 5; + } + // Configuration for a Memcached Node. message NodeConfig { // Required. Number of cpus per Memcached node. @@ -221,24 +259,6 @@ message Instance { string message = 2; } - // Different states of a Memcached instance. - enum State { - // State not set. - STATE_UNSPECIFIED = 0; - - // Memcached instance is being created. - CREATING = 1; - - // Memcached instance has been created and ready to be used. - READY = 2; - - // Memcached instance is being deleted. - DELETING = 4; - - // Memcached instance is going through maintenance, e.g. data plane rollout. - PERFORMING_MAINTENANCE = 5; - } - // Required. Unique name of the resource in this scope including project and // location using the form: // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` @@ -283,7 +303,7 @@ message Instance { // the latest supported minor version. MemcacheVersion memcache_version = 9; - // Optional: User defined parameters to apply to the memcached process + // User defined parameters to apply to the memcached process // on each node. MemcacheParameters parameters = 11; @@ -314,6 +334,57 @@ message Instance { // Output only. Returns true if there is an update waiting to be applied bool update_available = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The maintenance policy for the instance. If not provided, + // the maintenance event will be performed based on Memorystore + // internal rollout schedule. + MaintenancePolicy maintenance_policy = 22; + + // Output only. Published maintenance schedule. + MaintenanceSchedule maintenance_schedule = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Maintenance policy per 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 updated. + google.protobuf.Timestamp update_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Description of what this policy is for. Create/Update methods + // return INVALID_ARGUMENT if the length is greater than 512. + string description = 3; + + // Required. Maintenance window that is applied to resources covered by this + // policy. Minimum 1. For the current version, the maximum number of + // weekly_maintenance_windows is expected to be one. + repeated WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(google.api.field_behavior) = REQUIRED]; +} + +// Time window specified for weekly operations. +message WeeklyMaintenanceWindow { + // Required. Allows to define schedule that runs specified day of the week. + google.type.DayOfWeek day = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Start time of the window in UTC. + google.type.TimeOfDay start_time = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Duration of the time window. + google.protobuf.Duration duration = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Upcoming maintenance schedule. +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]; + + // Output only. The deadline that the maintenance schedule start time can not go beyond, + // including reschedule. + google.protobuf.Timestamp schedule_deadline_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request for [ListInstances][google.cloud.memcache.v1beta2.CloudMemcache.ListInstances]. @@ -409,6 +480,7 @@ message CreateInstanceRequest { // Request for [UpdateInstance][google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstance]. message UpdateInstanceRequest { // Required. Mask of fields to update. + // // * `displayName` google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; @@ -430,6 +502,43 @@ message DeleteInstanceRequest { ]; } +// Request for [RescheduleMaintenance][google.cloud.memcache.v1beta2.CloudMemcache.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. Memcache instance resource name using the form: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region. + string instance = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memcache.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]; + + // 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; +} + // Request for [ApplyParameters][google.cloud.memcache.v1beta2.CloudMemcache.ApplyParameters]. message ApplyParametersRequest { // Required. Resource name of the Memcached instance for which parameter group updates @@ -489,13 +598,20 @@ message ApplySoftwareUpdateRequest { bool apply_all = 3; } -// The unique ID associated with this set of parameters. Users -// can use this id to determine if the parameters associated with the instance -// differ from the parameters associated with the nodes. A discrepancy between -// parameter ids can inform users that they may need to take action to apply -// parameters on nodes. +// Memcached versions supported by our service. +enum MemcacheVersion { + MEMCACHE_VERSION_UNSPECIFIED = 0; + + // Memcached 1.5 version. + MEMCACHE_1_5 = 1; +} + message MemcacheParameters { - // Output only. + // Output only. The unique ID associated with this set of parameters. Users + // can use this id to determine if the parameters associated with the instance + // differ from the parameters associated with the nodes. A discrepancy between + // parameter ids can inform users that they may need to take action to apply + // parameters on nodes. string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // User defined set of parameters to use in the memcached process. @@ -529,14 +645,6 @@ message OperationMetadata { string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// Memcached versions supported by our service. -enum MemcacheVersion { - MEMCACHE_VERSION_UNSPECIFIED = 0; - - // Memcached 1.5 version. - MEMCACHE_1_5 = 1; -} - // Metadata for the given [google.cloud.location.Location][google.cloud.location.Location]. message LocationMetadata { // Output only. The set of available zones in the location. The map is keyed diff --git a/packages/google-cloud-memcache/protos/protos.d.ts b/packages/google-cloud-memcache/protos/protos.d.ts index ccbef8193c6..6350b26c1ff 100644 --- a/packages/google-cloud-memcache/protos/protos.d.ts +++ b/packages/google-cloud-memcache/protos/protos.d.ts @@ -143,6 +143,20 @@ export namespace google { * @returns Promise */ public applyParameters(request: google.cloud.memcache.v1.IApplyParametersRequest): 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.memcache.v1.IRescheduleMaintenanceRequest, callback: google.cloud.memcache.v1.CloudMemcache.RescheduleMaintenanceCallback): void; + + /** + * Calls RescheduleMaintenance. + * @param request RescheduleMaintenanceRequest message or plain object + * @returns Promise + */ + public rescheduleMaintenance(request: google.cloud.memcache.v1.IRescheduleMaintenanceRequest): Promise; } namespace CloudMemcache { @@ -195,6 +209,13 @@ export namespace google { * @param [response] Operation */ type ApplyParametersCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|rescheduleMaintenance}. + * @param error Error, if any + * @param [response] Operation + */ + type RescheduleMaintenanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of an Instance. */ @@ -247,6 +268,12 @@ export namespace google { /** Instance discoveryEndpoint */ discoveryEndpoint?: (string|null); + + /** Instance maintenancePolicy */ + maintenancePolicy?: (google.cloud.memcache.v1.IMaintenancePolicy|null); + + /** Instance maintenanceSchedule */ + maintenanceSchedule?: (google.cloud.memcache.v1.IMaintenanceSchedule|null); } /** Represents an Instance. */ @@ -306,6 +333,12 @@ export namespace google { /** Instance discoveryEndpoint. */ public discoveryEndpoint: string; + /** Instance maintenancePolicy. */ + public maintenancePolicy?: (google.cloud.memcache.v1.IMaintenancePolicy|null); + + /** Instance maintenanceSchedule. */ + public maintenanceSchedule?: (google.cloud.memcache.v1.IMaintenanceSchedule|null); + /** * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set @@ -386,6 +419,16 @@ export namespace google { namespace Instance { + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + UPDATING = 3, + DELETING = 4, + PERFORMING_MAINTENANCE = 5 + } + /** Properties of a NodeConfig. */ interface INodeConfig { @@ -739,477 +782,921 @@ export namespace google { ZONE_DISTRIBUTION_UNBALANCED = 1 } } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2, - DELETING = 4, - PERFORMING_MAINTENANCE = 5 - } } - /** Properties of a ListInstancesRequest. */ - interface IListInstancesRequest { - - /** ListInstancesRequest parent */ - parent?: (string|null); + /** Properties of a MaintenancePolicy. */ + interface IMaintenancePolicy { - /** ListInstancesRequest pageSize */ - pageSize?: (number|null); + /** MaintenancePolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** ListInstancesRequest pageToken */ - pageToken?: (string|null); + /** MaintenancePolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** ListInstancesRequest filter */ - filter?: (string|null); + /** MaintenancePolicy description */ + description?: (string|null); - /** ListInstancesRequest orderBy */ - orderBy?: (string|null); + /** MaintenancePolicy weeklyMaintenanceWindow */ + weeklyMaintenanceWindow?: (google.cloud.memcache.v1.IWeeklyMaintenanceWindow[]|null); } - /** Represents a ListInstancesRequest. */ - class ListInstancesRequest implements IListInstancesRequest { + /** Represents a MaintenancePolicy. */ + class MaintenancePolicy implements IMaintenancePolicy { /** - * Constructs a new ListInstancesRequest. + * Constructs a new MaintenancePolicy. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.memcache.v1.IListInstancesRequest); - - /** ListInstancesRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.memcache.v1.IMaintenancePolicy); - /** ListInstancesRequest pageSize. */ - public pageSize: number; + /** MaintenancePolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** ListInstancesRequest pageToken. */ - public pageToken: string; + /** MaintenancePolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** ListInstancesRequest filter. */ - public filter: string; + /** MaintenancePolicy description. */ + public description: string; - /** ListInstancesRequest orderBy. */ - public orderBy: string; + /** MaintenancePolicy weeklyMaintenanceWindow. */ + public weeklyMaintenanceWindow: google.cloud.memcache.v1.IWeeklyMaintenanceWindow[]; /** - * Creates a new ListInstancesRequest instance using the specified properties. + * Creates a new MaintenancePolicy instance using the specified properties. * @param [properties] Properties to set - * @returns ListInstancesRequest instance + * @returns MaintenancePolicy instance */ - public static create(properties?: google.cloud.memcache.v1.IListInstancesRequest): google.cloud.memcache.v1.ListInstancesRequest; + public static create(properties?: google.cloud.memcache.v1.IMaintenancePolicy): google.cloud.memcache.v1.MaintenancePolicy; /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode + * Encodes the specified MaintenancePolicy message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.memcache.v1.IMaintenancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesRequest.verify|verify} messages. - * @param message ListInstancesRequest message or plain object to encode + * Encodes the specified MaintenancePolicy message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.memcache.v1.IMaintenancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. + * 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 ListInstancesRequest + * @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.memcache.v1.ListInstancesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.MaintenancePolicy; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes a MaintenancePolicy message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListInstancesRequest + * @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.memcache.v1.ListInstancesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.MaintenancePolicy; /** - * Verifies a ListInstancesRequest message. + * 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 ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MaintenancePolicy message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListInstancesRequest + * @returns MaintenancePolicy */ - public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.ListInstancesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.MaintenancePolicy; /** - * 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 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.memcache.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.memcache.v1.MaintenancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListInstancesRequest to JSON. + * Converts this MaintenancePolicy to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListInstancesRequest + * Gets the default type url for MaintenancePolicy * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListInstancesResponse. */ - interface IListInstancesResponse { + /** Properties of a WeeklyMaintenanceWindow. */ + interface IWeeklyMaintenanceWindow { - /** ListInstancesResponse instances */ - instances?: (google.cloud.memcache.v1.IInstance[]|null); + /** WeeklyMaintenanceWindow day */ + day?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); - /** ListInstancesResponse nextPageToken */ - nextPageToken?: (string|null); + /** WeeklyMaintenanceWindow startTime */ + startTime?: (google.type.ITimeOfDay|null); - /** ListInstancesResponse unreachable */ - unreachable?: (string[]|null); + /** WeeklyMaintenanceWindow duration */ + duration?: (google.protobuf.IDuration|null); } - /** Represents a ListInstancesResponse. */ - class ListInstancesResponse implements IListInstancesResponse { + /** Represents a WeeklyMaintenanceWindow. */ + class WeeklyMaintenanceWindow implements IWeeklyMaintenanceWindow { /** - * Constructs a new ListInstancesResponse. + * Constructs a new WeeklyMaintenanceWindow. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.memcache.v1.IListInstancesResponse); + constructor(properties?: google.cloud.memcache.v1.IWeeklyMaintenanceWindow); - /** ListInstancesResponse instances. */ - public instances: google.cloud.memcache.v1.IInstance[]; + /** WeeklyMaintenanceWindow day. */ + public day: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); - /** ListInstancesResponse nextPageToken. */ - public nextPageToken: string; + /** WeeklyMaintenanceWindow startTime. */ + public startTime?: (google.type.ITimeOfDay|null); - /** ListInstancesResponse unreachable. */ - public unreachable: string[]; + /** WeeklyMaintenanceWindow duration. */ + public duration?: (google.protobuf.IDuration|null); /** - * Creates a new ListInstancesResponse instance using the specified properties. + * Creates a new WeeklyMaintenanceWindow instance using the specified properties. * @param [properties] Properties to set - * @returns ListInstancesResponse instance + * @returns WeeklyMaintenanceWindow instance */ - public static create(properties?: google.cloud.memcache.v1.IListInstancesResponse): google.cloud.memcache.v1.ListInstancesResponse; + public static create(properties?: google.cloud.memcache.v1.IWeeklyMaintenanceWindow): google.cloud.memcache.v1.WeeklyMaintenanceWindow; /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode + * Encodes the specified WeeklyMaintenanceWindow message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.memcache.v1.IWeeklyMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesResponse.verify|verify} messages. - * @param message ListInstancesResponse message or plain object to encode + * Encodes the specified WeeklyMaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.memcache.v1.IWeeklyMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. + * 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 ListInstancesResponse + * @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.memcache.v1.ListInstancesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.WeeklyMaintenanceWindow; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a WeeklyMaintenanceWindow message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListInstancesResponse + * @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.memcache.v1.ListInstancesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.WeeklyMaintenanceWindow; /** - * Verifies a ListInstancesResponse message. + * 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 ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a WeeklyMaintenanceWindow message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListInstancesResponse + * @returns WeeklyMaintenanceWindow */ - public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.ListInstancesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.WeeklyMaintenanceWindow; /** - * 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 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.memcache.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.memcache.v1.WeeklyMaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListInstancesResponse to JSON. + * Converts this WeeklyMaintenanceWindow to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListInstancesResponse + * Gets the default type url for WeeklyMaintenanceWindow * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetInstanceRequest. */ - interface IGetInstanceRequest { + /** Properties of a MaintenanceSchedule. */ + interface IMaintenanceSchedule { - /** GetInstanceRequest name */ - name?: (string|null); + /** MaintenanceSchedule startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceSchedule endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceSchedule scheduleDeadlineTime */ + scheduleDeadlineTime?: (google.protobuf.ITimestamp|null); } - /** Represents a GetInstanceRequest. */ - class GetInstanceRequest implements IGetInstanceRequest { + /** Represents a MaintenanceSchedule. */ + class MaintenanceSchedule implements IMaintenanceSchedule { /** - * Constructs a new GetInstanceRequest. + * Constructs a new MaintenanceSchedule. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.memcache.v1.IGetInstanceRequest); + constructor(properties?: google.cloud.memcache.v1.IMaintenanceSchedule); - /** GetInstanceRequest name. */ - public name: string; + /** MaintenanceSchedule startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceSchedule endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceSchedule scheduleDeadlineTime. */ + public scheduleDeadlineTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new GetInstanceRequest instance using the specified properties. + * Creates a new MaintenanceSchedule instance using the specified properties. * @param [properties] Properties to set - * @returns GetInstanceRequest instance + * @returns MaintenanceSchedule instance */ - public static create(properties?: google.cloud.memcache.v1.IGetInstanceRequest): google.cloud.memcache.v1.GetInstanceRequest; + public static create(properties?: google.cloud.memcache.v1.IMaintenanceSchedule): google.cloud.memcache.v1.MaintenanceSchedule; /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.memcache.v1.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.GetInstanceRequest.verify|verify} messages. - * @param message GetInstanceRequest message or plain object to encode + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.memcache.v1.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. + * 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 GetInstanceRequest + * @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.memcache.v1.GetInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.MaintenanceSchedule; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetInstanceRequest + * @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.memcache.v1.GetInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.MaintenanceSchedule; /** - * Verifies a GetInstanceRequest message. + * 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 GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetInstanceRequest + * @returns MaintenanceSchedule */ - public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.GetInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.MaintenanceSchedule; /** - * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. - * @param message GetInstanceRequest + * 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.memcache.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.memcache.v1.MaintenanceSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetInstanceRequest to JSON. + * Converts this MaintenanceSchedule to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetInstanceRequest + * Gets the default type url for MaintenanceSchedule * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateInstanceRequest. */ - interface ICreateInstanceRequest { + /** Properties of a RescheduleMaintenanceRequest. */ + interface IRescheduleMaintenanceRequest { - /** CreateInstanceRequest parent */ - parent?: (string|null); + /** RescheduleMaintenanceRequest instance */ + instance?: (string|null); - /** CreateInstanceRequest instanceId */ - instanceId?: (string|null); + /** RescheduleMaintenanceRequest rescheduleType */ + rescheduleType?: (google.cloud.memcache.v1.RescheduleMaintenanceRequest.RescheduleType|keyof typeof google.cloud.memcache.v1.RescheduleMaintenanceRequest.RescheduleType|null); - /** CreateInstanceRequest instance */ - instance?: (google.cloud.memcache.v1.IInstance|null); + /** RescheduleMaintenanceRequest scheduleTime */ + scheduleTime?: (google.protobuf.ITimestamp|null); } - /** Represents a CreateInstanceRequest. */ - class CreateInstanceRequest implements ICreateInstanceRequest { + /** Represents a RescheduleMaintenanceRequest. */ + class RescheduleMaintenanceRequest implements IRescheduleMaintenanceRequest { /** - * Constructs a new CreateInstanceRequest. + * Constructs a new RescheduleMaintenanceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.memcache.v1.ICreateInstanceRequest); + constructor(properties?: google.cloud.memcache.v1.IRescheduleMaintenanceRequest); - /** CreateInstanceRequest parent. */ - public parent: string; + /** RescheduleMaintenanceRequest instance. */ + public instance: string; - /** CreateInstanceRequest instanceId. */ - public instanceId: string; + /** RescheduleMaintenanceRequest rescheduleType. */ + public rescheduleType: (google.cloud.memcache.v1.RescheduleMaintenanceRequest.RescheduleType|keyof typeof google.cloud.memcache.v1.RescheduleMaintenanceRequest.RescheduleType); - /** CreateInstanceRequest instance. */ - public instance?: (google.cloud.memcache.v1.IInstance|null); + /** RescheduleMaintenanceRequest scheduleTime. */ + public scheduleTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new CreateInstanceRequest instance using the specified properties. + * Creates a new RescheduleMaintenanceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateInstanceRequest instance + * @returns RescheduleMaintenanceRequest instance */ - public static create(properties?: google.cloud.memcache.v1.ICreateInstanceRequest): google.cloud.memcache.v1.CreateInstanceRequest; + public static create(properties?: google.cloud.memcache.v1.IRescheduleMaintenanceRequest): google.cloud.memcache.v1.RescheduleMaintenanceRequest; /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode + * Encodes the specified RescheduleMaintenanceRequest message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.memcache.v1.IRescheduleMaintenanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.CreateInstanceRequest.verify|verify} messages. - * @param message CreateInstanceRequest message or plain object to encode + * Encodes the specified RescheduleMaintenanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.memcache.v1.IRescheduleMaintenanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * 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 CreateInstanceRequest + * @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.memcache.v1.CreateInstanceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1.RescheduleMaintenanceRequest; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a RescheduleMaintenanceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateInstanceRequest + * @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.memcache.v1.CreateInstanceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.memcache.v1.RescheduleMaintenanceRequest; /** - * Verifies a CreateInstanceRequest message. + * 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 CreateInstanceRequest 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. * @param object Plain object - * @returns CreateInstanceRequest + * @returns RescheduleMaintenanceRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.CreateInstanceRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.RescheduleMaintenanceRequest; /** - * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. - * @param message CreateInstanceRequest + * 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.memcache.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.memcache.v1.RescheduleMaintenanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateInstanceRequest to JSON. + * Converts this RescheduleMaintenanceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateInstanceRequest + * Gets the default type url for RescheduleMaintenanceRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateInstanceRequest. */ - interface IUpdateInstanceRequest { + namespace RescheduleMaintenanceRequest { - /** UpdateInstanceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** RescheduleType enum. */ + enum RescheduleType { + RESCHEDULE_TYPE_UNSPECIFIED = 0, + IMMEDIATE = 1, + NEXT_AVAILABLE_WINDOW = 2, + SPECIFIC_TIME = 3 + } + } - /** UpdateInstanceRequest instance */ - instance?: (google.cloud.memcache.v1.IInstance|null); + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); } - /** Represents an UpdateInstanceRequest. */ - class UpdateInstanceRequest implements IUpdateInstanceRequest { + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { /** - * Constructs a new UpdateInstanceRequest. + * Constructs a new ListInstancesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.memcache.v1.IUpdateInstanceRequest); + constructor(properties?: google.cloud.memcache.v1.IListInstancesRequest); - /** UpdateInstanceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ListInstancesRequest parent. */ + public parent: string; - /** UpdateInstanceRequest instance. */ - public instance?: (google.cloud.memcache.v1.IInstance|null); + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.memcache.v1.IListInstancesRequest): google.cloud.memcache.v1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.cloud.memcache.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.memcache.v1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.memcache.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.memcache.v1.IListInstancesResponse): google.cloud.memcache.v1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.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.memcache.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.memcache.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.memcache.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.memcache.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.memcache.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.memcache.v1.IGetInstanceRequest): google.cloud.memcache.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.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.memcache.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.memcache.v1.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.memcache.v1.GetInstanceRequest; + + /** + * 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 GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.GetInstanceRequest; + + /** + * 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.memcache.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.memcache.v1.IInstance|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.memcache.v1.IInstance|null); + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.memcache.v1.ICreateInstanceRequest): google.cloud.memcache.v1.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @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.memcache.v1.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @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.memcache.v1.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest 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 CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance */ + instance?: (google.cloud.memcache.v1.IInstance|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IUpdateInstanceRequest); + + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance. */ + public instance?: (google.cloud.memcache.v1.IInstance|null); /** * Creates a new UpdateInstanceRequest instance using the specified properties. @@ -1604,6 +2091,12 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** MemcacheVersion enum. */ + enum MemcacheVersion { + MEMCACHE_VERSION_UNSPECIFIED = 0, + MEMCACHE_1_5 = 1 + } + /** Properties of a MemcacheParameters. */ interface IMemcacheParameters { @@ -1814,37 +2307,219 @@ export namespace google { /** * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OperationMetadata + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LocationMetadata. */ + interface ILocationMetadata { + + /** LocationMetadata availableZones */ + availableZones?: ({ [k: string]: google.cloud.memcache.v1.IZoneMetadata }|null); + } + + /** Represents a LocationMetadata. */ + class LocationMetadata implements ILocationMetadata { + + /** + * Constructs a new LocationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.ILocationMetadata); + + /** LocationMetadata availableZones. */ + public availableZones: { [k: string]: google.cloud.memcache.v1.IZoneMetadata }; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationMetadata instance + */ + public static create(properties?: google.cloud.memcache.v1.ILocationMetadata): google.cloud.memcache.v1.LocationMetadata; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.memcache.v1.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationMetadata + * @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.memcache.v1.LocationMetadata; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationMetadata + * @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.memcache.v1.LocationMetadata; + + /** + * Verifies a LocationMetadata 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 LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.LocationMetadata; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @param message LocationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ZoneMetadata. */ + interface IZoneMetadata { + } + + /** Represents a ZoneMetadata. */ + class ZoneMetadata implements IZoneMetadata { + + /** + * Constructs a new ZoneMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1.IZoneMetadata); + + /** + * Creates a new ZoneMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ZoneMetadata instance + */ + public static create(properties?: google.cloud.memcache.v1.IZoneMetadata): google.cloud.memcache.v1.ZoneMetadata; + + /** + * Encodes the specified ZoneMetadata message. Does not implicitly {@link google.cloud.memcache.v1.ZoneMetadata.verify|verify} messages. + * @param message ZoneMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.memcache.v1.IZoneMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZoneMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ZoneMetadata.verify|verify} messages. + * @param message ZoneMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.memcache.v1.IZoneMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZoneMetadata + * @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.memcache.v1.ZoneMetadata; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZoneMetadata + * @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.memcache.v1.ZoneMetadata; + + /** + * Verifies a ZoneMetadata 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 ZoneMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZoneMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.OperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1.ZoneMetadata; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata + * Creates a plain object from a ZoneMetadata message. Also converts values to other types if specified. + * @param message ZoneMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.memcache.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.memcache.v1.ZoneMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OperationMetadata to JSON. + * Converts this ZoneMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for ZoneMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - - /** MemcacheVersion enum. */ - enum MemcacheVersion { - MEMCACHE_VERSION_UNSPECIFIED = 0, - MEMCACHE_1_5 = 1 - } } /** Namespace v1beta2. */ @@ -1981,6 +2656,20 @@ export namespace google { * @returns Promise */ public applySoftwareUpdate(request: google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest): 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.memcache.v1beta2.IRescheduleMaintenanceRequest, callback: google.cloud.memcache.v1beta2.CloudMemcache.RescheduleMaintenanceCallback): void; + + /** + * Calls RescheduleMaintenance. + * @param request RescheduleMaintenanceRequest message or plain object + * @returns Promise + */ + public rescheduleMaintenance(request: google.cloud.memcache.v1beta2.IRescheduleMaintenanceRequest): Promise; } namespace CloudMemcache { @@ -2040,6 +2729,13 @@ export namespace google { * @param [response] Operation */ type ApplySoftwareUpdateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|rescheduleMaintenance}. + * @param error Error, if any + * @param [response] Operation + */ + type RescheduleMaintenanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of an Instance. */ @@ -2095,6 +2791,12 @@ export namespace google { /** Instance updateAvailable */ updateAvailable?: (boolean|null); + + /** Instance maintenancePolicy */ + maintenancePolicy?: (google.cloud.memcache.v1beta2.IMaintenancePolicy|null); + + /** Instance maintenanceSchedule */ + maintenanceSchedule?: (google.cloud.memcache.v1beta2.IMaintenanceSchedule|null); } /** Represents an Instance. */ @@ -2157,6 +2859,12 @@ export namespace google { /** Instance updateAvailable. */ public updateAvailable: boolean; + /** Instance maintenancePolicy. */ + public maintenancePolicy?: (google.cloud.memcache.v1beta2.IMaintenancePolicy|null); + + /** Instance maintenanceSchedule. */ + public maintenanceSchedule?: (google.cloud.memcache.v1beta2.IMaintenanceSchedule|null); + /** * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set @@ -2237,6 +2945,16 @@ export namespace google { namespace Instance { + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + UPDATING = 3, + DELETING = 4, + PERFORMING_MAINTENANCE = 5 + } + /** Properties of a NodeConfig. */ interface INodeConfig { @@ -2543,68 +3261,392 @@ export namespace google { */ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.memcache.v1beta2.Instance.InstanceMessage; - /** - * Decodes an InstanceMessage message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceMessage - * @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.memcache.v1beta2.Instance.InstanceMessage; + /** + * Decodes an InstanceMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceMessage + * @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.memcache.v1beta2.Instance.InstanceMessage; + + /** + * Verifies an InstanceMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.Instance.InstanceMessage; + + /** + * Creates a plain object from an InstanceMessage message. Also converts values to other types if specified. + * @param message InstanceMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.memcache.v1beta2.Instance.InstanceMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstanceMessage { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + ZONE_DISTRIBUTION_UNBALANCED = 1 + } + } + } + + /** 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.memcache.v1beta2.IWeeklyMaintenanceWindow[]|null); + } + + /** Represents a MaintenancePolicy. */ + class MaintenancePolicy implements IMaintenancePolicy { + + /** + * Constructs a new MaintenancePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.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.memcache.v1beta2.IWeeklyMaintenanceWindow[]; + + /** + * Creates a new MaintenancePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns MaintenancePolicy instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IMaintenancePolicy): google.cloud.memcache.v1beta2.MaintenancePolicy; + + /** + * Encodes the specified MaintenancePolicy message. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.IMaintenancePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MaintenancePolicy message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.MaintenancePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MaintenancePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaintenancePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.memcache.v1beta2.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.memcache.v1beta2.IWeeklyMaintenanceWindow): google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow; + + /** + * Encodes the specified WeeklyMaintenanceWindow message. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.IWeeklyMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeeklyMaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.WeeklyMaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeeklyMaintenanceWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WeeklyMaintenanceWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaintenanceSchedule. */ + interface IMaintenanceSchedule { + + /** MaintenanceSchedule startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceSchedule endTime */ + endTime?: (google.protobuf.ITimestamp|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.memcache.v1beta2.IMaintenanceSchedule); + + /** MaintenanceSchedule startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** MaintenanceSchedule endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** 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.memcache.v1beta2.IMaintenanceSchedule): google.cloud.memcache.v1beta2.MaintenanceSchedule; + + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an InstanceMessage 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); + /** + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.IMaintenanceSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an InstanceMessage message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceMessage - */ - public static fromObject(object: { [k: string]: any }): google.cloud.memcache.v1beta2.Instance.InstanceMessage; + /** + * 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.memcache.v1beta2.MaintenanceSchedule; - /** - * Creates a plain object from an InstanceMessage message. Also converts values to other types if specified. - * @param message InstanceMessage - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.memcache.v1beta2.Instance.InstanceMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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.memcache.v1beta2.MaintenanceSchedule; - /** - * Converts this InstanceMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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); - /** - * Gets the default type url for InstanceMessage - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * 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.memcache.v1beta2.MaintenanceSchedule; - namespace InstanceMessage { + /** + * 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.memcache.v1beta2.MaintenanceSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Code enum. */ - enum Code { - CODE_UNSPECIFIED = 0, - ZONE_DISTRIBUTION_UNBALANCED = 1 - } - } + /** + * Converts this MaintenanceSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2, - DELETING = 4, - PERFORMING_MAINTENANCE = 5 - } + /** + * Gets the default type url for MaintenanceSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListInstancesRequest. */ @@ -3243,6 +4285,126 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a RescheduleMaintenanceRequest. */ + interface IRescheduleMaintenanceRequest { + + /** RescheduleMaintenanceRequest instance */ + instance?: (string|null); + + /** RescheduleMaintenanceRequest rescheduleType */ + rescheduleType?: (google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType|keyof typeof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType|null); + + /** RescheduleMaintenanceRequest scheduleTime */ + scheduleTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a RescheduleMaintenanceRequest. */ + class RescheduleMaintenanceRequest implements IRescheduleMaintenanceRequest { + + /** + * Constructs a new RescheduleMaintenanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.memcache.v1beta2.IRescheduleMaintenanceRequest); + + /** RescheduleMaintenanceRequest instance. */ + public instance: string; + + /** RescheduleMaintenanceRequest rescheduleType. */ + public rescheduleType: (google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType|keyof typeof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType); + + /** RescheduleMaintenanceRequest scheduleTime. */ + public scheduleTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new RescheduleMaintenanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RescheduleMaintenanceRequest instance + */ + public static create(properties?: google.cloud.memcache.v1beta2.IRescheduleMaintenanceRequest): google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest; + + /** + * Encodes the specified RescheduleMaintenanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.IRescheduleMaintenanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RescheduleMaintenanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.RescheduleMaintenanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RescheduleMaintenanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RescheduleMaintenanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RescheduleMaintenanceRequest { + + /** RescheduleType enum. */ + enum RescheduleType { + RESCHEDULE_TYPE_UNSPECIFIED = 0, + IMMEDIATE = 1, + NEXT_AVAILABLE_WINDOW = 2, + SPECIFIC_TIME = 3 + } + } + /** Properties of an ApplyParametersRequest. */ interface IApplyParametersRequest { @@ -3570,6 +4732,12 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** MemcacheVersion enum. */ + enum MemcacheVersion { + MEMCACHE_VERSION_UNSPECIFIED = 0, + MEMCACHE_1_5 = 1 + } + /** Properties of a MemcacheParameters. */ interface IMemcacheParameters { @@ -3806,12 +4974,6 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** MemcacheVersion enum. */ - enum MemcacheVersion { - MEMCACHE_VERSION_UNSPECIFIED = 0, - MEMCACHE_1_5 = 1 - } - /** Properties of a LocationMetadata. */ interface ILocationMetadata { @@ -9562,4 +10724,135 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } } + + /** Namespace type. */ + namespace type { + + /** DayOfWeek enum. */ + enum DayOfWeek { + DAY_OF_WEEK_UNSPECIFIED = 0, + MONDAY = 1, + TUESDAY = 2, + WEDNESDAY = 3, + THURSDAY = 4, + FRIDAY = 5, + SATURDAY = 6, + SUNDAY = 7 + } + + /** Properties of a TimeOfDay. */ + interface ITimeOfDay { + + /** TimeOfDay hours */ + hours?: (number|null); + + /** TimeOfDay minutes */ + minutes?: (number|null); + + /** TimeOfDay seconds */ + seconds?: (number|null); + + /** TimeOfDay nanos */ + nanos?: (number|null); + } + + /** Represents a TimeOfDay. */ + class TimeOfDay implements ITimeOfDay { + + /** + * Constructs a new TimeOfDay. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ITimeOfDay); + + /** TimeOfDay hours. */ + public hours: number; + + /** TimeOfDay minutes. */ + public minutes: number; + + /** TimeOfDay seconds. */ + public seconds: number; + + /** TimeOfDay nanos. */ + public nanos: number; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeOfDay instance + */ + public static create(properties?: google.type.ITimeOfDay): google.type.TimeOfDay; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @param message TimeOfDay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ITimeOfDay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.TimeOfDay; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.TimeOfDay; + + /** + * Verifies a TimeOfDay message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeOfDay + */ + public static fromObject(object: { [k: string]: any }): google.type.TimeOfDay; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @param message TimeOfDay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.TimeOfDay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeOfDay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeOfDay + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } } diff --git a/packages/google-cloud-memcache/protos/protos.js b/packages/google-cloud-memcache/protos/protos.js index 2d516c4af9e..ee6ead04cd0 100644 --- a/packages/google-cloud-memcache/protos/protos.js +++ b/packages/google-cloud-memcache/protos/protos.js @@ -329,6 +329,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.memcache.v1.CloudMemcache|rescheduleMaintenance}. + * @memberof google.cloud.memcache.v1.CloudMemcache + * @typedef RescheduleMaintenanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RescheduleMaintenance. + * @function rescheduleMaintenance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IRescheduleMaintenanceRequest} request RescheduleMaintenanceRequest message or plain object + * @param {google.cloud.memcache.v1.CloudMemcache.RescheduleMaintenanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.rescheduleMaintenance = function rescheduleMaintenance(request, callback) { + return this.rpcCall(rescheduleMaintenance, $root.google.cloud.memcache.v1.RescheduleMaintenanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RescheduleMaintenance" }); + + /** + * Calls RescheduleMaintenance. + * @function rescheduleMaintenance + * @memberof google.cloud.memcache.v1.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1.IRescheduleMaintenanceRequest} request RescheduleMaintenanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return CloudMemcache; })(); @@ -354,6 +387,8 @@ * @property {string|null} [memcacheFullVersion] Instance memcacheFullVersion * @property {Array.|null} [instanceMessages] Instance instanceMessages * @property {string|null} [discoveryEndpoint] Instance discoveryEndpoint + * @property {google.cloud.memcache.v1.IMaintenancePolicy|null} [maintenancePolicy] Instance maintenancePolicy + * @property {google.cloud.memcache.v1.IMaintenanceSchedule|null} [maintenanceSchedule] Instance maintenanceSchedule */ /** @@ -503,6 +538,22 @@ */ Instance.prototype.discoveryEndpoint = ""; + /** + * Instance maintenancePolicy. + * @member {google.cloud.memcache.v1.IMaintenancePolicy|null|undefined} maintenancePolicy + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.maintenancePolicy = null; + + /** + * Instance maintenanceSchedule. + * @member {google.cloud.memcache.v1.IMaintenanceSchedule|null|undefined} maintenanceSchedule + * @memberof google.cloud.memcache.v1.Instance + * @instance + */ + Instance.prototype.maintenanceSchedule = null; + /** * Creates a new Instance instance using the specified properties. * @function create @@ -563,6 +614,10 @@ $root.google.cloud.memcache.v1.Instance.InstanceMessage.encode(message.instanceMessages[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); if (message.discoveryEndpoint != null && Object.hasOwnProperty.call(message, "discoveryEndpoint")) writer.uint32(/* id 20, wireType 2 =*/162).string(message.discoveryEndpoint); + if (message.maintenancePolicy != null && Object.hasOwnProperty.call(message, "maintenancePolicy")) + $root.google.cloud.memcache.v1.MaintenancePolicy.encode(message.maintenancePolicy, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.maintenanceSchedule != null && Object.hasOwnProperty.call(message, "maintenanceSchedule")) + $root.google.cloud.memcache.v1.MaintenanceSchedule.encode(message.maintenanceSchedule, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); return writer; }; @@ -686,6 +741,14 @@ message.discoveryEndpoint = reader.string(); break; } + case 21: { + message.maintenancePolicy = $root.google.cloud.memcache.v1.MaintenancePolicy.decode(reader, reader.uint32()); + break; + } + case 22: { + message.maintenanceSchedule = $root.google.cloud.memcache.v1.MaintenanceSchedule.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -792,6 +855,7 @@ case 0: case 1: case 2: + case 3: case 4: case 5: break; @@ -811,6 +875,16 @@ if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) if (!$util.isString(message.discoveryEndpoint)) return "discoveryEndpoint: string expected"; + if (message.maintenancePolicy != null && message.hasOwnProperty("maintenancePolicy")) { + var error = $root.google.cloud.memcache.v1.MaintenancePolicy.verify(message.maintenancePolicy); + if (error) + return "maintenancePolicy." + error; + } + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) { + var error = $root.google.cloud.memcache.v1.MaintenanceSchedule.verify(message.maintenanceSchedule); + if (error) + return "maintenanceSchedule." + error; + } return null; }; @@ -913,6 +987,10 @@ case 2: message.state = 2; break; + case "UPDATING": + case 3: + message.state = 3; + break; case "DELETING": case 4: message.state = 4; @@ -936,6 +1014,16 @@ } if (object.discoveryEndpoint != null) message.discoveryEndpoint = String(object.discoveryEndpoint); + if (object.maintenancePolicy != null) { + if (typeof object.maintenancePolicy !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.maintenancePolicy: object expected"); + message.maintenancePolicy = $root.google.cloud.memcache.v1.MaintenancePolicy.fromObject(object.maintenancePolicy); + } + if (object.maintenanceSchedule != null) { + if (typeof object.maintenanceSchedule !== "object") + throw TypeError(".google.cloud.memcache.v1.Instance.maintenanceSchedule: object expected"); + message.maintenanceSchedule = $root.google.cloud.memcache.v1.MaintenanceSchedule.fromObject(object.maintenanceSchedule); + } return message; }; @@ -972,6 +1060,8 @@ object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; object.memcacheFullVersion = ""; object.discoveryEndpoint = ""; + object.maintenancePolicy = null; + object.maintenanceSchedule = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1018,6 +1108,10 @@ } if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) object.discoveryEndpoint = message.discoveryEndpoint; + if (message.maintenancePolicy != null && message.hasOwnProperty("maintenancePolicy")) + object.maintenancePolicy = $root.google.cloud.memcache.v1.MaintenancePolicy.toObject(message.maintenancePolicy, options); + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) + object.maintenanceSchedule = $root.google.cloud.memcache.v1.MaintenanceSchedule.toObject(message.maintenanceSchedule, options); return object; }; @@ -1047,6 +1141,28 @@ return typeUrlPrefix + "/google.cloud.memcache.v1.Instance"; }; + /** + * State enum. + * @name google.cloud.memcache.v1.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} UPDATING=3 UPDATING value + * @property {number} DELETING=4 DELETING value + * @property {number} PERFORMING_MAINTENANCE=5 PERFORMING_MAINTENANCE value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "PERFORMING_MAINTENANCE"] = 5; + return values; + })(); + Instance.NodeConfig = (function() { /** @@ -1912,51 +2028,31 @@ return InstanceMessage; })(); - /** - * State enum. - * @name google.cloud.memcache.v1.Instance.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - * @property {number} DELETING=4 DELETING value - * @property {number} PERFORMING_MAINTENANCE=5 PERFORMING_MAINTENANCE value - */ - Instance.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "PERFORMING_MAINTENANCE"] = 5; - return values; - })(); - return Instance; })(); - v1.ListInstancesRequest = (function() { + v1.MaintenancePolicy = (function() { /** - * Properties of a ListInstancesRequest. + * Properties of a MaintenancePolicy. * @memberof google.cloud.memcache.v1 - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {number|null} [pageSize] ListInstancesRequest pageSize - * @property {string|null} [pageToken] ListInstancesRequest pageToken - * @property {string|null} [filter] ListInstancesRequest filter - * @property {string|null} [orderBy] ListInstancesRequest orderBy + * @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 ListInstancesRequest. + * Constructs a new MaintenancePolicy. * @memberof google.cloud.memcache.v1 - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest + * @classdesc Represents a MaintenancePolicy. + * @implements IMaintenancePolicy * @constructor - * @param {google.cloud.memcache.v1.IListInstancesRequest=} [properties] Properties to set + * @param {google.cloud.memcache.v1.IMaintenancePolicy=} [properties] Properties to set */ - function ListInstancesRequest(properties) { + function MaintenancePolicy(properties) { + this.weeklyMaintenanceWindow = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1964,131 +2060,120 @@ } /** - * ListInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.memcache.v1.ListInstancesRequest - * @instance - */ - ListInstancesRequest.prototype.parent = ""; - - /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * MaintenancePolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.memcache.v1.MaintenancePolicy * @instance */ - ListInstancesRequest.prototype.pageSize = 0; + MaintenancePolicy.prototype.createTime = null; /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * MaintenancePolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.memcache.v1.MaintenancePolicy * @instance */ - ListInstancesRequest.prototype.pageToken = ""; + MaintenancePolicy.prototype.updateTime = null; /** - * ListInstancesRequest filter. - * @member {string} filter - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * MaintenancePolicy description. + * @member {string} description + * @memberof google.cloud.memcache.v1.MaintenancePolicy * @instance */ - ListInstancesRequest.prototype.filter = ""; + MaintenancePolicy.prototype.description = ""; /** - * ListInstancesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * MaintenancePolicy weeklyMaintenanceWindow. + * @member {Array.} weeklyMaintenanceWindow + * @memberof google.cloud.memcache.v1.MaintenancePolicy * @instance */ - ListInstancesRequest.prototype.orderBy = ""; + MaintenancePolicy.prototype.weeklyMaintenanceWindow = $util.emptyArray; /** - * Creates a new ListInstancesRequest instance using the specified properties. + * Creates a new MaintenancePolicy instance using the specified properties. * @function create - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @memberof google.cloud.memcache.v1.MaintenancePolicy * @static - * @param {google.cloud.memcache.v1.IListInstancesRequest=} [properties] Properties to set - * @returns {google.cloud.memcache.v1.ListInstancesRequest} ListInstancesRequest instance + * @param {google.cloud.memcache.v1.IMaintenancePolicy=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.MaintenancePolicy} MaintenancePolicy instance */ - ListInstancesRequest.create = function create(properties) { - return new ListInstancesRequest(properties); + MaintenancePolicy.create = function create(properties) { + return new MaintenancePolicy(properties); }; /** - * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesRequest.verify|verify} messages. + * Encodes the specified MaintenancePolicy message. Does not implicitly {@link google.cloud.memcache.v1.MaintenancePolicy.verify|verify} messages. * @function encode - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @memberof google.cloud.memcache.v1.MaintenancePolicy * @static - * @param {google.cloud.memcache.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {google.cloud.memcache.v1.IMaintenancePolicy} message MaintenancePolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesRequest.encode = function encode(message, writer) { + MaintenancePolicy.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.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + 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.memcache.v1.WeeklyMaintenanceWindow.encode(message.weeklyMaintenanceWindow[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesRequest.verify|verify} messages. + * Encodes the specified MaintenancePolicy message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.MaintenancePolicy.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @memberof google.cloud.memcache.v1.MaintenancePolicy * @static - * @param {google.cloud.memcache.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {google.cloud.memcache.v1.IMaintenancePolicy} message MaintenancePolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + MaintenancePolicy.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer. + * Decodes a MaintenancePolicy message from the specified reader or buffer. * @function decode - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @memberof google.cloud.memcache.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.memcache.v1.ListInstancesRequest} ListInstancesRequest + * @returns {google.cloud.memcache.v1.MaintenancePolicy} MaintenancePolicy * @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) { + 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.memcache.v1.ListInstancesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.MaintenancePolicy(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 2: { - message.pageSize = reader.int32(); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 3: { - message.pageToken = reader.string(); + message.description = reader.string(); break; } case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); + if (!(message.weeklyMaintenanceWindow && message.weeklyMaintenanceWindow.length)) + message.weeklyMaintenanceWindow = []; + message.weeklyMaintenanceWindow.push($root.google.cloud.memcache.v1.WeeklyMaintenanceWindow.decode(reader, reader.uint32())); break; } default: @@ -2100,159 +2185,177 @@ }; /** - * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * Decodes a MaintenancePolicy message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @memberof google.cloud.memcache.v1.MaintenancePolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1.ListInstancesRequest} ListInstancesRequest + * @returns {google.cloud.memcache.v1.MaintenancePolicy} MaintenancePolicy * @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) { + MaintenancePolicy.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListInstancesRequest message. + * Verifies a MaintenancePolicy message. * @function verify - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @memberof google.cloud.memcache.v1.MaintenancePolicy * @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) { + MaintenancePolicy.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.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: 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.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.memcache.v1.WeeklyMaintenanceWindow.verify(message.weeklyMaintenanceWindow[i]); + if (error) + return "weeklyMaintenanceWindow." + error; + } + } return null; }; /** - * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MaintenancePolicy message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @memberof google.cloud.memcache.v1.MaintenancePolicy * @static * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1.ListInstancesRequest} ListInstancesRequest + * @returns {google.cloud.memcache.v1.MaintenancePolicy} MaintenancePolicy */ - ListInstancesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1.ListInstancesRequest) + MaintenancePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.MaintenancePolicy) return object; - var message = new $root.google.cloud.memcache.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); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + var message = new $root.google.cloud.memcache.v1.MaintenancePolicy(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.memcache.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.memcache.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.memcache.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.memcache.v1.MaintenancePolicy.weeklyMaintenanceWindow: object expected"); + message.weeklyMaintenanceWindow[i] = $root.google.cloud.memcache.v1.WeeklyMaintenanceWindow.fromObject(object.weeklyMaintenanceWindow[i]); + } + } return message; }; /** - * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * Creates a plain object from a MaintenancePolicy message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @memberof google.cloud.memcache.v1.MaintenancePolicy * @static - * @param {google.cloud.memcache.v1.ListInstancesRequest} message ListInstancesRequest + * @param {google.cloud.memcache.v1.MaintenancePolicy} message MaintenancePolicy * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesRequest.toObject = function toObject(message, options) { + MaintenancePolicy.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.weeklyMaintenanceWindow = []; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + 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.memcache.v1.WeeklyMaintenanceWindow.toObject(message.weeklyMaintenanceWindow[j], options); } - 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.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; return object; }; /** - * Converts this ListInstancesRequest to JSON. + * Converts this MaintenancePolicy to JSON. * @function toJSON - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @memberof google.cloud.memcache.v1.MaintenancePolicy * @instance * @returns {Object.} JSON object */ - ListInstancesRequest.prototype.toJSON = function toJSON() { + MaintenancePolicy.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListInstancesRequest + * Gets the default type url for MaintenancePolicy * @function getTypeUrl - * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @memberof google.cloud.memcache.v1.MaintenancePolicy * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MaintenancePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.memcache.v1.ListInstancesRequest"; + return typeUrlPrefix + "/google.cloud.memcache.v1.MaintenancePolicy"; }; - return ListInstancesRequest; + return MaintenancePolicy; })(); - v1.ListInstancesResponse = (function() { + v1.WeeklyMaintenanceWindow = (function() { /** - * Properties of a ListInstancesResponse. + * Properties of a WeeklyMaintenanceWindow. * @memberof google.cloud.memcache.v1 - * @interface IListInstancesResponse - * @property {Array.|null} [instances] ListInstancesResponse instances - * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken - * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + * @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 ListInstancesResponse. + * Constructs a new WeeklyMaintenanceWindow. * @memberof google.cloud.memcache.v1 - * @classdesc Represents a ListInstancesResponse. - * @implements IListInstancesResponse + * @classdesc Represents a WeeklyMaintenanceWindow. + * @implements IWeeklyMaintenanceWindow * @constructor - * @param {google.cloud.memcache.v1.IListInstancesResponse=} [properties] Properties to set + * @param {google.cloud.memcache.v1.IWeeklyMaintenanceWindow=} [properties] Properties to set */ - function ListInstancesResponse(properties) { - this.instances = []; - this.unreachable = []; + function WeeklyMaintenanceWindow(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2260,109 +2363,103 @@ } /** - * ListInstancesResponse instances. - * @member {Array.} instances - * @memberof google.cloud.memcache.v1.ListInstancesResponse + * WeeklyMaintenanceWindow day. + * @member {google.type.DayOfWeek} day + * @memberof google.cloud.memcache.v1.WeeklyMaintenanceWindow * @instance */ - ListInstancesResponse.prototype.instances = $util.emptyArray; + WeeklyMaintenanceWindow.prototype.day = 0; /** - * ListInstancesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.memcache.v1.ListInstancesResponse + * WeeklyMaintenanceWindow startTime. + * @member {google.type.ITimeOfDay|null|undefined} startTime + * @memberof google.cloud.memcache.v1.WeeklyMaintenanceWindow * @instance */ - ListInstancesResponse.prototype.nextPageToken = ""; + WeeklyMaintenanceWindow.prototype.startTime = null; /** - * ListInstancesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.memcache.v1.ListInstancesResponse + * WeeklyMaintenanceWindow duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.memcache.v1.WeeklyMaintenanceWindow * @instance */ - ListInstancesResponse.prototype.unreachable = $util.emptyArray; + WeeklyMaintenanceWindow.prototype.duration = null; /** - * Creates a new ListInstancesResponse instance using the specified properties. + * Creates a new WeeklyMaintenanceWindow instance using the specified properties. * @function create - * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @memberof google.cloud.memcache.v1.WeeklyMaintenanceWindow * @static - * @param {google.cloud.memcache.v1.IListInstancesResponse=} [properties] Properties to set - * @returns {google.cloud.memcache.v1.ListInstancesResponse} ListInstancesResponse instance + * @param {google.cloud.memcache.v1.IWeeklyMaintenanceWindow=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.WeeklyMaintenanceWindow} WeeklyMaintenanceWindow instance */ - ListInstancesResponse.create = function create(properties) { - return new ListInstancesResponse(properties); + WeeklyMaintenanceWindow.create = function create(properties) { + return new WeeklyMaintenanceWindow(properties); }; /** - * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesResponse.verify|verify} messages. + * Encodes the specified WeeklyMaintenanceWindow message. Does not implicitly {@link google.cloud.memcache.v1.WeeklyMaintenanceWindow.verify|verify} messages. * @function encode - * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @memberof google.cloud.memcache.v1.WeeklyMaintenanceWindow * @static - * @param {google.cloud.memcache.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {google.cloud.memcache.v1.IWeeklyMaintenanceWindow} message WeeklyMaintenanceWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesResponse.encode = function encode(message, writer) { + WeeklyMaintenanceWindow.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.memcache.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.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 ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesResponse.verify|verify} messages. + * Encodes the specified WeeklyMaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.WeeklyMaintenanceWindow.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @memberof google.cloud.memcache.v1.WeeklyMaintenanceWindow * @static - * @param {google.cloud.memcache.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {google.cloud.memcache.v1.IWeeklyMaintenanceWindow} message WeeklyMaintenanceWindow message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + WeeklyMaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer. + * Decodes a WeeklyMaintenanceWindow message from the specified reader or buffer. * @function decode - * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @memberof google.cloud.memcache.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.memcache.v1.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.memcache.v1.WeeklyMaintenanceWindow} WeeklyMaintenanceWindow * @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) { + 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.memcache.v1.ListInstancesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.WeeklyMaintenanceWindow(); 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.memcache.v1.Instance.decode(reader, reader.uint32())); + message.day = reader.int32(); break; } case 2: { - message.nextPageToken = reader.string(); + message.startTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); break; } case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; } default: @@ -2374,169 +2471,200 @@ }; /** - * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * Decodes a WeeklyMaintenanceWindow message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @memberof google.cloud.memcache.v1.WeeklyMaintenanceWindow * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.memcache.v1.WeeklyMaintenanceWindow} WeeklyMaintenanceWindow * @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) { + WeeklyMaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListInstancesResponse message. + * Verifies a WeeklyMaintenanceWindow message. * @function verify - * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @memberof google.cloud.memcache.v1.WeeklyMaintenanceWindow * @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) { + WeeklyMaintenanceWindow.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.memcache.v1.Instance.verify(message.instances[i]); - if (error) - return "instances." + error; + 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.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.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; } return null; }; /** - * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a WeeklyMaintenanceWindow message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @memberof google.cloud.memcache.v1.WeeklyMaintenanceWindow * @static * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1.ListInstancesResponse} ListInstancesResponse + * @returns {google.cloud.memcache.v1.WeeklyMaintenanceWindow} WeeklyMaintenanceWindow */ - ListInstancesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1.ListInstancesResponse) + WeeklyMaintenanceWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.WeeklyMaintenanceWindow) return object; - var message = new $root.google.cloud.memcache.v1.ListInstancesResponse(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.memcache.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.memcache.v1.ListInstancesResponse.instances: object expected"); - message.instances[i] = $root.google.cloud.memcache.v1.Instance.fromObject(object.instances[i]); + var message = new $root.google.cloud.memcache.v1.WeeklyMaintenanceWindow(); + switch (object.day) { + default: + if (typeof object.day === "number") { + message.day = object.day; + break; } + break; + 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.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.memcache.v1.ListInstancesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.memcache.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.memcache.v1.WeeklyMaintenanceWindow.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); } return message; }; /** - * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * Creates a plain object from a WeeklyMaintenanceWindow message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @memberof google.cloud.memcache.v1.WeeklyMaintenanceWindow * @static - * @param {google.cloud.memcache.v1.ListInstancesResponse} message ListInstancesResponse + * @param {google.cloud.memcache.v1.WeeklyMaintenanceWindow} message WeeklyMaintenanceWindow * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListInstancesResponse.toObject = function toObject(message, options) { + WeeklyMaintenanceWindow.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.memcache.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]; - } + 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] === undefined ? message.day : $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 ListInstancesResponse to JSON. + * Converts this WeeklyMaintenanceWindow to JSON. * @function toJSON - * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @memberof google.cloud.memcache.v1.WeeklyMaintenanceWindow * @instance * @returns {Object.} JSON object */ - ListInstancesResponse.prototype.toJSON = function toJSON() { + WeeklyMaintenanceWindow.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListInstancesResponse + * Gets the default type url for WeeklyMaintenanceWindow * @function getTypeUrl - * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @memberof google.cloud.memcache.v1.WeeklyMaintenanceWindow * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + WeeklyMaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.memcache.v1.ListInstancesResponse"; + return typeUrlPrefix + "/google.cloud.memcache.v1.WeeklyMaintenanceWindow"; }; - return ListInstancesResponse; + return WeeklyMaintenanceWindow; })(); - v1.GetInstanceRequest = (function() { + v1.MaintenanceSchedule = (function() { /** - * Properties of a GetInstanceRequest. + * Properties of a MaintenanceSchedule. * @memberof google.cloud.memcache.v1 - * @interface IGetInstanceRequest - * @property {string|null} [name] GetInstanceRequest name + * @interface IMaintenanceSchedule + * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceSchedule startTime + * @property {google.protobuf.ITimestamp|null} [endTime] MaintenanceSchedule endTime + * @property {google.protobuf.ITimestamp|null} [scheduleDeadlineTime] MaintenanceSchedule scheduleDeadlineTime */ /** - * Constructs a new GetInstanceRequest. + * Constructs a new MaintenanceSchedule. * @memberof google.cloud.memcache.v1 - * @classdesc Represents a GetInstanceRequest. - * @implements IGetInstanceRequest + * @classdesc Represents a MaintenanceSchedule. + * @implements IMaintenanceSchedule * @constructor - * @param {google.cloud.memcache.v1.IGetInstanceRequest=} [properties] Properties to set + * @param {google.cloud.memcache.v1.IMaintenanceSchedule=} [properties] Properties to set */ - function GetInstanceRequest(properties) { + function MaintenanceSchedule(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2544,75 +2672,103 @@ } /** - * GetInstanceRequest name. - * @member {string} name - * @memberof google.cloud.memcache.v1.GetInstanceRequest + * MaintenanceSchedule startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.memcache.v1.MaintenanceSchedule * @instance */ - GetInstanceRequest.prototype.name = ""; + MaintenanceSchedule.prototype.startTime = null; /** - * Creates a new GetInstanceRequest instance using the specified properties. + * MaintenanceSchedule endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.memcache.v1.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.endTime = null; + + /** + * MaintenanceSchedule scheduleDeadlineTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduleDeadlineTime + * @memberof google.cloud.memcache.v1.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.scheduleDeadlineTime = null; + + /** + * Creates a new MaintenanceSchedule instance using the specified properties. * @function create - * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @memberof google.cloud.memcache.v1.MaintenanceSchedule * @static - * @param {google.cloud.memcache.v1.IGetInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.memcache.v1.GetInstanceRequest} GetInstanceRequest instance + * @param {google.cloud.memcache.v1.IMaintenanceSchedule=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.MaintenanceSchedule} MaintenanceSchedule instance */ - GetInstanceRequest.create = function create(properties) { - return new GetInstanceRequest(properties); + MaintenanceSchedule.create = function create(properties) { + return new MaintenanceSchedule(properties); }; /** - * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.GetInstanceRequest.verify|verify} messages. + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.memcache.v1.MaintenanceSchedule.verify|verify} messages. * @function encode - * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @memberof google.cloud.memcache.v1.MaintenanceSchedule * @static - * @param {google.cloud.memcache.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {google.cloud.memcache.v1.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetInstanceRequest.encode = function encode(message, writer) { + MaintenanceSchedule.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.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.scheduleDeadlineTime != null && Object.hasOwnProperty.call(message, "scheduleDeadlineTime")) + $root.google.protobuf.Timestamp.encode(message.scheduleDeadlineTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.GetInstanceRequest.verify|verify} messages. + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.MaintenanceSchedule.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @memberof google.cloud.memcache.v1.MaintenanceSchedule * @static - * @param {google.cloud.memcache.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {google.cloud.memcache.v1.IMaintenanceSchedule} message MaintenanceSchedule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + MaintenanceSchedule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer. + * Decodes a MaintenanceSchedule message from the specified reader or buffer. * @function decode - * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @memberof google.cloud.memcache.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.memcache.v1.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.memcache.v1.MaintenanceSchedule} MaintenanceSchedule * @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) { + 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.memcache.v1.GetInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.MaintenanceSchedule(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + 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 4: { + message.scheduleDeadlineTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -2624,124 +2780,156 @@ }; /** - * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @memberof google.cloud.memcache.v1.MaintenanceSchedule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.memcache.v1.MaintenanceSchedule} MaintenanceSchedule * @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) { + MaintenanceSchedule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetInstanceRequest message. + * Verifies a MaintenanceSchedule message. * @function verify - * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @memberof google.cloud.memcache.v1.MaintenanceSchedule * @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) { + MaintenanceSchedule.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.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.scheduleDeadlineTime != null && message.hasOwnProperty("scheduleDeadlineTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduleDeadlineTime); + if (error) + return "scheduleDeadlineTime." + error; + } return null; }; /** - * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @memberof google.cloud.memcache.v1.MaintenanceSchedule * @static * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1.GetInstanceRequest} GetInstanceRequest + * @returns {google.cloud.memcache.v1.MaintenanceSchedule} MaintenanceSchedule */ - GetInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1.GetInstanceRequest) + MaintenanceSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.MaintenanceSchedule) return object; - var message = new $root.google.cloud.memcache.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. + var message = new $root.google.cloud.memcache.v1.MaintenanceSchedule(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.memcache.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.memcache.v1.MaintenanceSchedule.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.scheduleDeadlineTime != null) { + if (typeof object.scheduleDeadlineTime !== "object") + throw TypeError(".google.cloud.memcache.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.memcache.v1.GetInstanceRequest + * @memberof google.cloud.memcache.v1.MaintenanceSchedule * @static - * @param {google.cloud.memcache.v1.GetInstanceRequest} message GetInstanceRequest + * @param {google.cloud.memcache.v1.MaintenanceSchedule} message MaintenanceSchedule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetInstanceRequest.toObject = function toObject(message, options) { + MaintenanceSchedule.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; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + 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.scheduleDeadlineTime != null && message.hasOwnProperty("scheduleDeadlineTime")) + object.scheduleDeadlineTime = $root.google.protobuf.Timestamp.toObject(message.scheduleDeadlineTime, options); return object; }; /** - * Converts this GetInstanceRequest to JSON. + * Converts this MaintenanceSchedule to JSON. * @function toJSON - * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @memberof google.cloud.memcache.v1.MaintenanceSchedule * @instance * @returns {Object.} JSON object */ - GetInstanceRequest.prototype.toJSON = function toJSON() { + MaintenanceSchedule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetInstanceRequest + * Gets the default type url for MaintenanceSchedule * @function getTypeUrl - * @memberof google.cloud.memcache.v1.GetInstanceRequest + * @memberof google.cloud.memcache.v1.MaintenanceSchedule * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MaintenanceSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.memcache.v1.GetInstanceRequest"; + return typeUrlPrefix + "/google.cloud.memcache.v1.MaintenanceSchedule"; }; - return GetInstanceRequest; + return MaintenanceSchedule; })(); - v1.CreateInstanceRequest = (function() { + v1.RescheduleMaintenanceRequest = (function() { /** - * Properties of a CreateInstanceRequest. + * Properties of a RescheduleMaintenanceRequest. * @memberof google.cloud.memcache.v1 - * @interface ICreateInstanceRequest - * @property {string|null} [parent] CreateInstanceRequest parent - * @property {string|null} [instanceId] CreateInstanceRequest instanceId - * @property {google.cloud.memcache.v1.IInstance|null} [instance] CreateInstanceRequest instance + * @interface IRescheduleMaintenanceRequest + * @property {string|null} [instance] RescheduleMaintenanceRequest instance + * @property {google.cloud.memcache.v1.RescheduleMaintenanceRequest.RescheduleType|null} [rescheduleType] RescheduleMaintenanceRequest rescheduleType + * @property {google.protobuf.ITimestamp|null} [scheduleTime] RescheduleMaintenanceRequest scheduleTime */ /** - * Constructs a new CreateInstanceRequest. + * Constructs a new RescheduleMaintenanceRequest. * @memberof google.cloud.memcache.v1 - * @classdesc Represents a CreateInstanceRequest. - * @implements ICreateInstanceRequest + * @classdesc Represents a RescheduleMaintenanceRequest. + * @implements IRescheduleMaintenanceRequest * @constructor - * @param {google.cloud.memcache.v1.ICreateInstanceRequest=} [properties] Properties to set + * @param {google.cloud.memcache.v1.IRescheduleMaintenanceRequest=} [properties] Properties to set */ - function CreateInstanceRequest(properties) { + function RescheduleMaintenanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2749,103 +2937,103 @@ } /** - * CreateInstanceRequest parent. - * @member {string} parent - * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * RescheduleMaintenanceRequest instance. + * @member {string} instance + * @memberof google.cloud.memcache.v1.RescheduleMaintenanceRequest * @instance */ - CreateInstanceRequest.prototype.parent = ""; + RescheduleMaintenanceRequest.prototype.instance = ""; /** - * CreateInstanceRequest instanceId. - * @member {string} instanceId - * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * RescheduleMaintenanceRequest rescheduleType. + * @member {google.cloud.memcache.v1.RescheduleMaintenanceRequest.RescheduleType} rescheduleType + * @memberof google.cloud.memcache.v1.RescheduleMaintenanceRequest * @instance */ - CreateInstanceRequest.prototype.instanceId = ""; + RescheduleMaintenanceRequest.prototype.rescheduleType = 0; /** - * CreateInstanceRequest instance. - * @member {google.cloud.memcache.v1.IInstance|null|undefined} instance - * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * RescheduleMaintenanceRequest scheduleTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime + * @memberof google.cloud.memcache.v1.RescheduleMaintenanceRequest * @instance */ - CreateInstanceRequest.prototype.instance = null; + RescheduleMaintenanceRequest.prototype.scheduleTime = null; /** - * Creates a new CreateInstanceRequest instance using the specified properties. + * Creates a new RescheduleMaintenanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @memberof google.cloud.memcache.v1.RescheduleMaintenanceRequest * @static - * @param {google.cloud.memcache.v1.ICreateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.memcache.v1.CreateInstanceRequest} CreateInstanceRequest instance + * @param {google.cloud.memcache.v1.IRescheduleMaintenanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.RescheduleMaintenanceRequest} RescheduleMaintenanceRequest instance */ - CreateInstanceRequest.create = function create(properties) { - return new CreateInstanceRequest(properties); + RescheduleMaintenanceRequest.create = function create(properties) { + return new RescheduleMaintenanceRequest(properties); }; /** - * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.CreateInstanceRequest.verify|verify} messages. + * Encodes the specified RescheduleMaintenanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.RescheduleMaintenanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @memberof google.cloud.memcache.v1.RescheduleMaintenanceRequest * @static - * @param {google.cloud.memcache.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {google.cloud.memcache.v1.IRescheduleMaintenanceRequest} message RescheduleMaintenanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceRequest.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.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.memcache.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); + 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 CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.CreateInstanceRequest.verify|verify} messages. + * Encodes the specified RescheduleMaintenanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.RescheduleMaintenanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @memberof google.cloud.memcache.v1.RescheduleMaintenanceRequest * @static - * @param {google.cloud.memcache.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {google.cloud.memcache.v1.IRescheduleMaintenanceRequest} message RescheduleMaintenanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + RescheduleMaintenanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * Decodes a RescheduleMaintenanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @memberof google.cloud.memcache.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.memcache.v1.CreateInstanceRequest} CreateInstanceRequest + * @returns {google.cloud.memcache.v1.RescheduleMaintenanceRequest} RescheduleMaintenanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateInstanceRequest.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.memcache.v1.CreateInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.RescheduleMaintenanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.instance = reader.string(); break; } case 2: { - message.instanceId = reader.string(); + message.rescheduleType = reader.int32(); break; } case 3: { - message.instance = $root.google.cloud.memcache.v1.Instance.decode(reader, reader.uint32()); + message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -2857,145 +3045,195 @@ }; /** - * Decodes a CreateInstanceRequest 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.memcache.v1.CreateInstanceRequest + * @memberof google.cloud.memcache.v1.RescheduleMaintenanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1.CreateInstanceRequest} CreateInstanceRequest + * @returns {google.cloud.memcache.v1.RescheduleMaintenanceRequest} RescheduleMaintenanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateInstanceRequest.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 CreateInstanceRequest message. + * Verifies a RescheduleMaintenanceRequest message. * @function verify - * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @memberof google.cloud.memcache.v1.RescheduleMaintenanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateInstanceRequest.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.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.memcache.v1.Instance.verify(message.instance); + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: 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 "instance." + error; + return "scheduleTime." + error; } return null; }; /** - * Creates a CreateInstanceRequest 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.memcache.v1.CreateInstanceRequest + * @memberof google.cloud.memcache.v1.RescheduleMaintenanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1.CreateInstanceRequest} CreateInstanceRequest + * @returns {google.cloud.memcache.v1.RescheduleMaintenanceRequest} RescheduleMaintenanceRequest */ - CreateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1.CreateInstanceRequest) + RescheduleMaintenanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.RescheduleMaintenanceRequest) return object; - var message = new $root.google.cloud.memcache.v1.CreateInstanceRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.memcache.v1.CreateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.memcache.v1.Instance.fromObject(object.instance); + var message = new $root.google.cloud.memcache.v1.RescheduleMaintenanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + switch (object.rescheduleType) { + default: + if (typeof object.rescheduleType === "number") { + message.rescheduleType = object.rescheduleType; + break; + } + break; + 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.memcache.v1.RescheduleMaintenanceRequest.scheduleTime: object expected"); + message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); } return message; }; /** - * Creates a plain object from a CreateInstanceRequest 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.memcache.v1.CreateInstanceRequest + * @memberof google.cloud.memcache.v1.RescheduleMaintenanceRequest * @static - * @param {google.cloud.memcache.v1.CreateInstanceRequest} message CreateInstanceRequest + * @param {google.cloud.memcache.v1.RescheduleMaintenanceRequest} message RescheduleMaintenanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateInstanceRequest.toObject = function toObject(message, options) { + RescheduleMaintenanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.instanceId = ""; - object.instance = null; + object.instance = ""; + 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.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.memcache.v1.Instance.toObject(message.instance, options); + object.instance = message.instance; + if (message.rescheduleType != null && message.hasOwnProperty("rescheduleType")) + object.rescheduleType = options.enums === String ? $root.google.cloud.memcache.v1.RescheduleMaintenanceRequest.RescheduleType[message.rescheduleType] === undefined ? message.rescheduleType : $root.google.cloud.memcache.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 CreateInstanceRequest to JSON. + * Converts this RescheduleMaintenanceRequest to JSON. * @function toJSON - * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @memberof google.cloud.memcache.v1.RescheduleMaintenanceRequest * @instance * @returns {Object.} JSON object */ - CreateInstanceRequest.prototype.toJSON = function toJSON() { + RescheduleMaintenanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateInstanceRequest + * Gets the default type url for RescheduleMaintenanceRequest * @function getTypeUrl - * @memberof google.cloud.memcache.v1.CreateInstanceRequest + * @memberof google.cloud.memcache.v1.RescheduleMaintenanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RescheduleMaintenanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.memcache.v1.CreateInstanceRequest"; + return typeUrlPrefix + "/google.cloud.memcache.v1.RescheduleMaintenanceRequest"; }; - return CreateInstanceRequest; + /** + * RescheduleType enum. + * @name google.cloud.memcache.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.UpdateInstanceRequest = (function() { + v1.ListInstancesRequest = (function() { /** - * Properties of an UpdateInstanceRequest. + * Properties of a ListInstancesRequest. * @memberof google.cloud.memcache.v1 - * @interface IUpdateInstanceRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask - * @property {google.cloud.memcache.v1.IInstance|null} [instance] UpdateInstanceRequest instance + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy */ /** - * Constructs a new UpdateInstanceRequest. + * Constructs a new ListInstancesRequest. * @memberof google.cloud.memcache.v1 - * @classdesc Represents an UpdateInstanceRequest. - * @implements IUpdateInstanceRequest + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest * @constructor - * @param {google.cloud.memcache.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @param {google.cloud.memcache.v1.IListInstancesRequest=} [properties] Properties to set */ - function UpdateInstanceRequest(properties) { + function ListInstancesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3003,89 +3241,131 @@ } /** - * UpdateInstanceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.memcache.v1.ListInstancesRequest * @instance */ - UpdateInstanceRequest.prototype.updateMask = null; + ListInstancesRequest.prototype.parent = ""; /** - * UpdateInstanceRequest instance. - * @member {google.cloud.memcache.v1.IInstance|null|undefined} instance - * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.memcache.v1.ListInstancesRequest * @instance */ - UpdateInstanceRequest.prototype.instance = null; + ListInstancesRequest.prototype.pageSize = 0; /** - * Creates a new UpdateInstanceRequest instance using the specified properties. + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.memcache.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. * @function create - * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesRequest * @static - * @param {google.cloud.memcache.v1.IUpdateInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest instance + * @param {google.cloud.memcache.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.ListInstancesRequest} ListInstancesRequest instance */ - UpdateInstanceRequest.create = function create(properties) { - return new UpdateInstanceRequest(properties); + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); }; /** - * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.UpdateInstanceRequest.verify|verify} messages. + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesRequest * @static - * @param {google.cloud.memcache.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {google.cloud.memcache.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstanceRequest.encode = function encode(message, writer) { + ListInstancesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) - $root.google.cloud.memcache.v1.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + 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.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; /** - * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.UpdateInstanceRequest.verify|verify} messages. + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesRequest * @static - * @param {google.cloud.memcache.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {google.cloud.memcache.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * Decodes a ListInstancesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @memberof google.cloud.memcache.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.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @returns {google.cloud.memcache.v1.ListInstancesRequest} ListInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateInstanceRequest.decode = function decode(reader, length) { + 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.memcache.v1.UpdateInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.ListInstancesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.parent = reader.string(); break; } case 2: { - message.instance = $root.google.cloud.memcache.v1.Instance.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -3097,141 +3377,159 @@ }; /** - * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @returns {google.cloud.memcache.v1.ListInstancesRequest} ListInstancesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateInstanceRequest message. + * Verifies a ListInstancesRequest message. * @function verify - * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateInstanceRequest.verify = function verify(message) { + ListInstancesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.instance != null && message.hasOwnProperty("instance")) { - var error = $root.google.cloud.memcache.v1.Instance.verify(message.instance); - if (error) - return "instance." + error; - } + 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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @returns {google.cloud.memcache.v1.ListInstancesRequest} ListInstancesRequest */ - UpdateInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1.UpdateInstanceRequest) + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.ListInstancesRequest) return object; - var message = new $root.google.cloud.memcache.v1.UpdateInstanceRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.memcache.v1.UpdateInstanceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.instance != null) { - if (typeof object.instance !== "object") - throw TypeError(".google.cloud.memcache.v1.UpdateInstanceRequest.instance: object expected"); - message.instance = $root.google.cloud.memcache.v1.Instance.fromObject(object.instance); - } + var message = new $root.google.cloud.memcache.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); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesRequest * @static - * @param {google.cloud.memcache.v1.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {google.cloud.memcache.v1.ListInstancesRequest} message ListInstancesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateInstanceRequest.toObject = function toObject(message, options) { + ListInstancesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.updateMask = null; - object.instance = null; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.instance != null && message.hasOwnProperty("instance")) - object.instance = $root.google.cloud.memcache.v1.Instance.toObject(message.instance, options); + 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.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this UpdateInstanceRequest to JSON. + * Converts this ListInstancesRequest to JSON. * @function toJSON - * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesRequest * @instance * @returns {Object.} JSON object */ - UpdateInstanceRequest.prototype.toJSON = function toJSON() { + ListInstancesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateInstanceRequest + * Gets the default type url for ListInstancesRequest * @function getTypeUrl - * @memberof google.cloud.memcache.v1.UpdateInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.memcache.v1.UpdateInstanceRequest"; + return typeUrlPrefix + "/google.cloud.memcache.v1.ListInstancesRequest"; }; - return UpdateInstanceRequest; + return ListInstancesRequest; })(); - v1.DeleteInstanceRequest = (function() { + v1.ListInstancesResponse = (function() { /** - * Properties of a DeleteInstanceRequest. + * Properties of a ListInstancesResponse. * @memberof google.cloud.memcache.v1 - * @interface IDeleteInstanceRequest - * @property {string|null} [name] DeleteInstanceRequest name + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable */ /** - * Constructs a new DeleteInstanceRequest. + * Constructs a new ListInstancesResponse. * @memberof google.cloud.memcache.v1 - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse * @constructor - * @param {google.cloud.memcache.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @param {google.cloud.memcache.v1.IListInstancesResponse=} [properties] Properties to set */ - function DeleteInstanceRequest(properties) { + 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) @@ -3239,75 +3537,109 @@ } /** - * DeleteInstanceRequest name. - * @member {string} name - * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.memcache.v1.ListInstancesResponse * @instance */ - DeleteInstanceRequest.prototype.name = ""; + ListInstancesResponse.prototype.instances = $util.emptyArray; /** - * Creates a new DeleteInstanceRequest instance using the specified properties. + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.memcache.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. * @function create - * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesResponse * @static - * @param {google.cloud.memcache.v1.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + * @param {google.cloud.memcache.v1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.ListInstancesResponse} ListInstancesResponse instance */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); }; /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.DeleteInstanceRequest.verify|verify} messages. + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesResponse * @static - * @param {google.cloud.memcache.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {google.cloud.memcache.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInstanceRequest.encode = function encode(message, writer) { + ListInstancesResponse.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.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.memcache.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 DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.DeleteInstanceRequest.verify|verify} messages. + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ListInstancesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesResponse * @static - * @param {google.cloud.memcache.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {google.cloud.memcache.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * Decodes a ListInstancesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @memberof google.cloud.memcache.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.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.memcache.v1.ListInstancesResponse} ListInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteInstanceRequest.decode = function decode(reader, length) { + 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.memcache.v1.DeleteInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.ListInstancesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.memcache.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: @@ -3319,125 +3651,169 @@ }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.memcache.v1.ListInstancesResponse} ListInstancesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteInstanceRequest message. + * Verifies a ListInstancesResponse message. * @function verify - * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteInstanceRequest.verify = function verify(message) { + ListInstancesResponse.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.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.memcache.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 DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.memcache.v1.ListInstancesResponse} ListInstancesResponse */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1.DeleteInstanceRequest) + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.ListInstancesResponse) return object; - var message = new $root.google.cloud.memcache.v1.DeleteInstanceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.memcache.v1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.memcache.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.memcache.v1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.memcache.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.memcache.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 DeleteInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesResponse * @static - * @param {google.cloud.memcache.v1.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {google.cloud.memcache.v1.ListInstancesResponse} message ListInstancesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteInstanceRequest.toObject = function toObject(message, options) { + ListInstancesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.unreachable = []; + } if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + 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.memcache.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 DeleteInstanceRequest to JSON. + * Converts this ListInstancesResponse to JSON. * @function toJSON - * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesResponse * @instance * @returns {Object.} JSON object */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { + ListInstancesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteInstanceRequest + * Gets the default type url for ListInstancesResponse * @function getTypeUrl - * @memberof google.cloud.memcache.v1.DeleteInstanceRequest + * @memberof google.cloud.memcache.v1.ListInstancesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.memcache.v1.DeleteInstanceRequest"; + return typeUrlPrefix + "/google.cloud.memcache.v1.ListInstancesResponse"; }; - return DeleteInstanceRequest; + return ListInstancesResponse; })(); - v1.ApplyParametersRequest = (function() { + v1.GetInstanceRequest = (function() { /** - * Properties of an ApplyParametersRequest. + * Properties of a GetInstanceRequest. * @memberof google.cloud.memcache.v1 - * @interface IApplyParametersRequest - * @property {string|null} [name] ApplyParametersRequest name - * @property {Array.|null} [nodeIds] ApplyParametersRequest nodeIds - * @property {boolean|null} [applyAll] ApplyParametersRequest applyAll + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name */ /** - * Constructs a new ApplyParametersRequest. + * Constructs a new GetInstanceRequest. * @memberof google.cloud.memcache.v1 - * @classdesc Represents an ApplyParametersRequest. - * @implements IApplyParametersRequest + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest * @constructor - * @param {google.cloud.memcache.v1.IApplyParametersRequest=} [properties] Properties to set + * @param {google.cloud.memcache.v1.IGetInstanceRequest=} [properties] Properties to set */ - function ApplyParametersRequest(properties) { - this.nodeIds = []; + function GetInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3445,91 +3821,70 @@ } /** - * ApplyParametersRequest name. + * GetInstanceRequest name. * @member {string} name - * @memberof google.cloud.memcache.v1.ApplyParametersRequest - * @instance - */ - ApplyParametersRequest.prototype.name = ""; - - /** - * ApplyParametersRequest nodeIds. - * @member {Array.} nodeIds - * @memberof google.cloud.memcache.v1.ApplyParametersRequest - * @instance - */ - ApplyParametersRequest.prototype.nodeIds = $util.emptyArray; - - /** - * ApplyParametersRequest applyAll. - * @member {boolean} applyAll - * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @memberof google.cloud.memcache.v1.GetInstanceRequest * @instance */ - ApplyParametersRequest.prototype.applyAll = false; + GetInstanceRequest.prototype.name = ""; /** - * Creates a new ApplyParametersRequest instance using the specified properties. + * Creates a new GetInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @memberof google.cloud.memcache.v1.GetInstanceRequest * @static - * @param {google.cloud.memcache.v1.IApplyParametersRequest=} [properties] Properties to set - * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest instance + * @param {google.cloud.memcache.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.GetInstanceRequest} GetInstanceRequest instance */ - ApplyParametersRequest.create = function create(properties) { - return new ApplyParametersRequest(properties); + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); }; /** - * Encodes the specified ApplyParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1.ApplyParametersRequest.verify|verify} messages. + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.GetInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @memberof google.cloud.memcache.v1.GetInstanceRequest * @static - * @param {google.cloud.memcache.v1.IApplyParametersRequest} message ApplyParametersRequest message or plain object to encode + * @param {google.cloud.memcache.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ApplyParametersRequest.encode = function encode(message, 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); - if (message.nodeIds != null && message.nodeIds.length) - for (var i = 0; i < message.nodeIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIds[i]); - if (message.applyAll != null && Object.hasOwnProperty.call(message, "applyAll")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.applyAll); return writer; }; /** - * Encodes the specified ApplyParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ApplyParametersRequest.verify|verify} messages. + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.GetInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @memberof google.cloud.memcache.v1.GetInstanceRequest * @static - * @param {google.cloud.memcache.v1.IApplyParametersRequest} message ApplyParametersRequest message or plain object to encode + * @param {google.cloud.memcache.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ApplyParametersRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ApplyParametersRequest message from the specified reader or buffer. + * Decodes a GetInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @memberof google.cloud.memcache.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.memcache.v1.ApplyParametersRequest} ApplyParametersRequest + * @returns {google.cloud.memcache.v1.GetInstanceRequest} GetInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ApplyParametersRequest.decode = function decode(reader, length) { + 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.memcache.v1.ApplyParametersRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.GetInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3537,16 +3892,6 @@ message.name = reader.string(); break; } - case 2: { - if (!(message.nodeIds && message.nodeIds.length)) - message.nodeIds = []; - message.nodeIds.push(reader.string()); - break; - } - case 3: { - message.applyAll = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -3556,154 +3901,124 @@ }; /** - * Decodes an ApplyParametersRequest message from the specified reader or buffer, length delimited. + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @memberof google.cloud.memcache.v1.GetInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest + * @returns {google.cloud.memcache.v1.GetInstanceRequest} GetInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ApplyParametersRequest.decodeDelimited = function decodeDelimited(reader) { + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ApplyParametersRequest message. + * Verifies a GetInstanceRequest message. * @function verify - * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @memberof google.cloud.memcache.v1.GetInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ApplyParametersRequest.verify = function verify(message) { + 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"; - if (message.nodeIds != null && message.hasOwnProperty("nodeIds")) { - if (!Array.isArray(message.nodeIds)) - return "nodeIds: array expected"; - for (var i = 0; i < message.nodeIds.length; ++i) - if (!$util.isString(message.nodeIds[i])) - return "nodeIds: string[] expected"; - } - if (message.applyAll != null && message.hasOwnProperty("applyAll")) - if (typeof message.applyAll !== "boolean") - return "applyAll: boolean expected"; return null; }; /** - * Creates an ApplyParametersRequest 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. * @function fromObject - * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @memberof google.cloud.memcache.v1.GetInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest + * @returns {google.cloud.memcache.v1.GetInstanceRequest} GetInstanceRequest */ - ApplyParametersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1.ApplyParametersRequest) - return object; - var message = new $root.google.cloud.memcache.v1.ApplyParametersRequest(); + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1.GetInstanceRequest(); if (object.name != null) message.name = String(object.name); - if (object.nodeIds) { - if (!Array.isArray(object.nodeIds)) - throw TypeError(".google.cloud.memcache.v1.ApplyParametersRequest.nodeIds: array expected"); - message.nodeIds = []; - for (var i = 0; i < object.nodeIds.length; ++i) - message.nodeIds[i] = String(object.nodeIds[i]); - } - if (object.applyAll != null) - message.applyAll = Boolean(object.applyAll); return message; }; /** - * Creates a plain object from an ApplyParametersRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @memberof google.cloud.memcache.v1.GetInstanceRequest * @static - * @param {google.cloud.memcache.v1.ApplyParametersRequest} message ApplyParametersRequest + * @param {google.cloud.memcache.v1.GetInstanceRequest} message GetInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ApplyParametersRequest.toObject = function toObject(message, options) { + GetInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.nodeIds = []; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.applyAll = false; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.nodeIds && message.nodeIds.length) { - object.nodeIds = []; - for (var j = 0; j < message.nodeIds.length; ++j) - object.nodeIds[j] = message.nodeIds[j]; - } - if (message.applyAll != null && message.hasOwnProperty("applyAll")) - object.applyAll = message.applyAll; return object; }; /** - * Converts this ApplyParametersRequest to JSON. + * Converts this GetInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @memberof google.cloud.memcache.v1.GetInstanceRequest * @instance * @returns {Object.} JSON object */ - ApplyParametersRequest.prototype.toJSON = function toJSON() { + GetInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ApplyParametersRequest + * Gets the default type url for GetInstanceRequest * @function getTypeUrl - * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @memberof google.cloud.memcache.v1.GetInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ApplyParametersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.memcache.v1.ApplyParametersRequest"; + return typeUrlPrefix + "/google.cloud.memcache.v1.GetInstanceRequest"; }; - return ApplyParametersRequest; + return GetInstanceRequest; })(); - v1.UpdateParametersRequest = (function() { + v1.CreateInstanceRequest = (function() { /** - * Properties of an UpdateParametersRequest. + * Properties of a CreateInstanceRequest. * @memberof google.cloud.memcache.v1 - * @interface IUpdateParametersRequest - * @property {string|null} [name] UpdateParametersRequest name - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateParametersRequest updateMask - * @property {google.cloud.memcache.v1.IMemcacheParameters|null} [parameters] UpdateParametersRequest parameters + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.memcache.v1.IInstance|null} [instance] CreateInstanceRequest instance */ /** - * Constructs a new UpdateParametersRequest. + * Constructs a new CreateInstanceRequest. * @memberof google.cloud.memcache.v1 - * @classdesc Represents an UpdateParametersRequest. - * @implements IUpdateParametersRequest + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest * @constructor - * @param {google.cloud.memcache.v1.IUpdateParametersRequest=} [properties] Properties to set + * @param {google.cloud.memcache.v1.ICreateInstanceRequest=} [properties] Properties to set */ - function UpdateParametersRequest(properties) { + function CreateInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3711,103 +4026,103 @@ } /** - * UpdateParametersRequest name. - * @member {string} name - * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.memcache.v1.CreateInstanceRequest * @instance */ - UpdateParametersRequest.prototype.name = ""; + CreateInstanceRequest.prototype.parent = ""; /** - * UpdateParametersRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.memcache.v1.CreateInstanceRequest * @instance */ - UpdateParametersRequest.prototype.updateMask = null; + CreateInstanceRequest.prototype.instanceId = ""; /** - * UpdateParametersRequest parameters. - * @member {google.cloud.memcache.v1.IMemcacheParameters|null|undefined} parameters - * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * CreateInstanceRequest instance. + * @member {google.cloud.memcache.v1.IInstance|null|undefined} instance + * @memberof google.cloud.memcache.v1.CreateInstanceRequest * @instance */ - UpdateParametersRequest.prototype.parameters = null; + CreateInstanceRequest.prototype.instance = null; /** - * Creates a new UpdateParametersRequest instance using the specified properties. + * Creates a new CreateInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @memberof google.cloud.memcache.v1.CreateInstanceRequest * @static - * @param {google.cloud.memcache.v1.IUpdateParametersRequest=} [properties] Properties to set - * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest instance + * @param {google.cloud.memcache.v1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.CreateInstanceRequest} CreateInstanceRequest instance */ - UpdateParametersRequest.create = function create(properties) { - return new UpdateParametersRequest(properties); + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); }; /** - * Encodes the specified UpdateParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1.UpdateParametersRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.CreateInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @memberof google.cloud.memcache.v1.CreateInstanceRequest * @static - * @param {google.cloud.memcache.v1.IUpdateParametersRequest} message UpdateParametersRequest message or plain object to encode + * @param {google.cloud.memcache.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateParametersRequest.encode = function encode(message, writer) { + CreateInstanceRequest.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.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.cloud.memcache.v1.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.memcache.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.UpdateParametersRequest.verify|verify} messages. + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.CreateInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @memberof google.cloud.memcache.v1.CreateInstanceRequest * @static - * @param {google.cloud.memcache.v1.IUpdateParametersRequest} message UpdateParametersRequest message or plain object to encode + * @param {google.cloud.memcache.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateParametersRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateParametersRequest message from the specified reader or buffer. + * Decodes a CreateInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @memberof google.cloud.memcache.v1.CreateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest + * @returns {google.cloud.memcache.v1.CreateInstanceRequest} CreateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateParametersRequest.decode = function decode(reader, length) { + CreateInstanceRequest.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.memcache.v1.UpdateParametersRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.CreateInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.instanceId = reader.string(); break; } case 3: { - message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); + message.instance = $root.google.cloud.memcache.v1.Instance.decode(reader, reader.uint32()); break; } default: @@ -3819,151 +4134,145 @@ }; /** - * Decodes an UpdateParametersRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @memberof google.cloud.memcache.v1.CreateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest + * @returns {google.cloud.memcache.v1.CreateInstanceRequest} CreateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateParametersRequest.decodeDelimited = function decodeDelimited(reader) { + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateParametersRequest message. + * Verifies a CreateInstanceRequest message. * @function verify - * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @memberof google.cloud.memcache.v1.CreateInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateParametersRequest.verify = function verify(message) { + CreateInstanceRequest.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.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.parameters != null && message.hasOwnProperty("parameters")) { - var error = $root.google.cloud.memcache.v1.MemcacheParameters.verify(message.parameters); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.memcache.v1.Instance.verify(message.instance); if (error) - return "parameters." + error; + return "instance." + error; } return null; }; /** - * Creates an UpdateParametersRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @memberof google.cloud.memcache.v1.CreateInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest + * @returns {google.cloud.memcache.v1.CreateInstanceRequest} CreateInstanceRequest */ - UpdateParametersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1.UpdateParametersRequest) + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.CreateInstanceRequest) return object; - var message = new $root.google.cloud.memcache.v1.UpdateParametersRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.memcache.v1.UpdateParametersRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.parameters != null) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.memcache.v1.UpdateParametersRequest.parameters: object expected"); - message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.fromObject(object.parameters); + var message = new $root.google.cloud.memcache.v1.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.memcache.v1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.memcache.v1.Instance.fromObject(object.instance); } return message; }; /** - * Creates a plain object from an UpdateParametersRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @memberof google.cloud.memcache.v1.CreateInstanceRequest * @static - * @param {google.cloud.memcache.v1.UpdateParametersRequest} message UpdateParametersRequest + * @param {google.cloud.memcache.v1.CreateInstanceRequest} message CreateInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateParametersRequest.toObject = function toObject(message, options) { + CreateInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.updateMask = null; - object.parameters = null; + object.parent = ""; + object.instanceId = ""; + object.instance = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.parameters != null && message.hasOwnProperty("parameters")) - object.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.toObject(message.parameters, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.memcache.v1.Instance.toObject(message.instance, options); return object; }; /** - * Converts this UpdateParametersRequest to JSON. + * Converts this CreateInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @memberof google.cloud.memcache.v1.CreateInstanceRequest * @instance * @returns {Object.} JSON object */ - UpdateParametersRequest.prototype.toJSON = function toJSON() { + CreateInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateParametersRequest + * Gets the default type url for CreateInstanceRequest * @function getTypeUrl - * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @memberof google.cloud.memcache.v1.CreateInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateParametersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.memcache.v1.UpdateParametersRequest"; + return typeUrlPrefix + "/google.cloud.memcache.v1.CreateInstanceRequest"; }; - return UpdateParametersRequest; + return CreateInstanceRequest; })(); - v1.MemcacheParameters = (function() { + v1.UpdateInstanceRequest = (function() { /** - * Properties of a MemcacheParameters. + * Properties of an UpdateInstanceRequest. * @memberof google.cloud.memcache.v1 - * @interface IMemcacheParameters - * @property {string|null} [id] MemcacheParameters id - * @property {Object.|null} [params] MemcacheParameters params + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.memcache.v1.IInstance|null} [instance] UpdateInstanceRequest instance */ /** - * Constructs a new MemcacheParameters. + * Constructs a new UpdateInstanceRequest. * @memberof google.cloud.memcache.v1 - * @classdesc Represents a MemcacheParameters. - * @implements IMemcacheParameters + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest * @constructor - * @param {google.cloud.memcache.v1.IMemcacheParameters=} [properties] Properties to set + * @param {google.cloud.memcache.v1.IUpdateInstanceRequest=} [properties] Properties to set */ - function MemcacheParameters(properties) { - this.params = {}; + function UpdateInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3971,109 +4280,89 @@ } /** - * MemcacheParameters id. - * @member {string} id - * @memberof google.cloud.memcache.v1.MemcacheParameters + * UpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest * @instance */ - MemcacheParameters.prototype.id = ""; + UpdateInstanceRequest.prototype.updateMask = null; /** - * MemcacheParameters params. - * @member {Object.} params - * @memberof google.cloud.memcache.v1.MemcacheParameters + * UpdateInstanceRequest instance. + * @member {google.cloud.memcache.v1.IInstance|null|undefined} instance + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest * @instance */ - MemcacheParameters.prototype.params = $util.emptyObject; + UpdateInstanceRequest.prototype.instance = null; /** - * Creates a new MemcacheParameters instance using the specified properties. + * Creates a new UpdateInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.memcache.v1.MemcacheParameters + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest * @static - * @param {google.cloud.memcache.v1.IMemcacheParameters=} [properties] Properties to set - * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters instance + * @param {google.cloud.memcache.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest instance */ - MemcacheParameters.create = function create(properties) { - return new MemcacheParameters(properties); + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); }; /** - * Encodes the specified MemcacheParameters message. Does not implicitly {@link google.cloud.memcache.v1.MemcacheParameters.verify|verify} messages. + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.UpdateInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.memcache.v1.MemcacheParameters + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest * @static - * @param {google.cloud.memcache.v1.IMemcacheParameters} message MemcacheParameters message or plain object to encode + * @param {google.cloud.memcache.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MemcacheParameters.encode = function encode(message, writer) { + UpdateInstanceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.memcache.v1.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified MemcacheParameters message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.MemcacheParameters.verify|verify} messages. + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.UpdateInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.memcache.v1.MemcacheParameters + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest * @static - * @param {google.cloud.memcache.v1.IMemcacheParameters} message MemcacheParameters message or plain object to encode + * @param {google.cloud.memcache.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MemcacheParameters.encodeDelimited = function encodeDelimited(message, writer) { + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MemcacheParameters message from the specified reader or buffer. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.memcache.v1.MemcacheParameters + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters + * @returns {google.cloud.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MemcacheParameters.decode = function decode(reader, length) { + UpdateInstanceRequest.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.memcache.v1.MemcacheParameters(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.UpdateInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.id = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } - case 3: { - if (message.params === $util.emptyObject) - message.params = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.params[key] = value; + case 2: { + message.instance = $root.google.cloud.memcache.v1.Instance.decode(reader, reader.uint32()); break; } default: @@ -4085,151 +4374,141 @@ }; /** - * Decodes a MemcacheParameters message from the specified reader or buffer, length delimited. + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.memcache.v1.MemcacheParameters + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters + * @returns {google.cloud.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MemcacheParameters.decodeDelimited = function decodeDelimited(reader) { + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MemcacheParameters message. + * Verifies an UpdateInstanceRequest message. * @function verify - * @memberof google.cloud.memcache.v1.MemcacheParameters + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MemcacheParameters.verify = function verify(message) { + UpdateInstanceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - if (!$util.isObject(message.params)) - return "params: object expected"; - var key = Object.keys(message.params); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.params[key[i]])) - return "params: string{k:string} expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.memcache.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; } return null; }; /** - * Creates a MemcacheParameters message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.memcache.v1.MemcacheParameters + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters + * @returns {google.cloud.memcache.v1.UpdateInstanceRequest} UpdateInstanceRequest */ - MemcacheParameters.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1.MemcacheParameters) + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.UpdateInstanceRequest) return object; - var message = new $root.google.cloud.memcache.v1.MemcacheParameters(); - if (object.id != null) - message.id = String(object.id); - if (object.params) { - if (typeof object.params !== "object") - throw TypeError(".google.cloud.memcache.v1.MemcacheParameters.params: object expected"); - message.params = {}; - for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) - message.params[keys[i]] = String(object.params[keys[i]]); + var message = new $root.google.cloud.memcache.v1.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.memcache.v1.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.memcache.v1.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.memcache.v1.Instance.fromObject(object.instance); } return message; }; /** - * Creates a plain object from a MemcacheParameters message. Also converts values to other types if specified. + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.memcache.v1.MemcacheParameters + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest * @static - * @param {google.cloud.memcache.v1.MemcacheParameters} message MemcacheParameters + * @param {google.cloud.memcache.v1.UpdateInstanceRequest} message UpdateInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MemcacheParameters.toObject = function toObject(message, options) { + UpdateInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.params = {}; - if (options.defaults) - object.id = ""; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - var keys2; - if (message.params && (keys2 = Object.keys(message.params)).length) { - object.params = {}; - for (var j = 0; j < keys2.length; ++j) - object.params[keys2[j]] = message.params[keys2[j]]; + if (options.defaults) { + object.updateMask = null; + object.instance = null; } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.memcache.v1.Instance.toObject(message.instance, options); return object; }; /** - * Converts this MemcacheParameters to JSON. + * Converts this UpdateInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.memcache.v1.MemcacheParameters + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest * @instance * @returns {Object.} JSON object */ - MemcacheParameters.prototype.toJSON = function toJSON() { + UpdateInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MemcacheParameters + * Gets the default type url for UpdateInstanceRequest * @function getTypeUrl - * @memberof google.cloud.memcache.v1.MemcacheParameters + * @memberof google.cloud.memcache.v1.UpdateInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MemcacheParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.memcache.v1.MemcacheParameters"; + return typeUrlPrefix + "/google.cloud.memcache.v1.UpdateInstanceRequest"; }; - return MemcacheParameters; + return UpdateInstanceRequest; })(); - v1.OperationMetadata = (function() { + v1.DeleteInstanceRequest = (function() { /** - * Properties of an OperationMetadata. + * Properties of a DeleteInstanceRequest. * @memberof google.cloud.memcache.v1 - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusDetail] OperationMetadata statusDetail - * @property {boolean|null} [cancelRequested] OperationMetadata cancelRequested - * @property {string|null} [apiVersion] OperationMetadata apiVersion + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name */ /** - * Constructs a new OperationMetadata. + * Constructs a new DeleteInstanceRequest. * @memberof google.cloud.memcache.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest * @constructor - * @param {google.cloud.memcache.v1.IOperationMetadata=} [properties] Properties to set + * @param {google.cloud.memcache.v1.IDeleteInstanceRequest=} [properties] Properties to set */ - function OperationMetadata(properties) { + function DeleteInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4237,159 +4516,75 @@ } /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.memcache.v1.OperationMetadata + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest * @instance */ - OperationMetadata.prototype.createTime = null; + DeleteInstanceRequest.prototype.name = ""; /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.memcache.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.memcache.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.memcache.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusDetail. - * @member {string} statusDetail - * @memberof google.cloud.memcache.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusDetail = ""; - - /** - * OperationMetadata cancelRequested. - * @member {boolean} cancelRequested - * @memberof google.cloud.memcache.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.cancelRequested = false; - - /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.memcache.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.apiVersion = ""; - - /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new DeleteInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.memcache.v1.OperationMetadata + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest * @static - * @param {google.cloud.memcache.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata instance + * @param {google.cloud.memcache.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest instance */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); }; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.memcache.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.memcache.v1.DeleteInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.memcache.v1.OperationMetadata + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest * @static - * @param {google.cloud.memcache.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.memcache.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encode = function encode(message, writer) { + DeleteInstanceRequest.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.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.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusDetail != null && Object.hasOwnProperty.call(message, "statusDetail")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusDetail); - if (message.cancelRequested != null && Object.hasOwnProperty.call(message, "cancelRequested")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancelRequested); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.DeleteInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.memcache.v1.OperationMetadata + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest * @static - * @param {google.cloud.memcache.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.memcache.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.memcache.v1.OperationMetadata + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OperationMetadata.decode = function decode(reader, length) { + DeleteInstanceRequest.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.memcache.v1.OperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.DeleteInstanceRequest(); 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.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusDetail = reader.string(); - break; - } - case 6: { - message.cancelRequested = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); + message.name = reader.string(); break; } default: @@ -4401,526 +4596,665 @@ }; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.memcache.v1.OperationMetadata + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OperationMetadata message. + * Verifies a DeleteInstanceRequest message. * @function verify - * @memberof google.cloud.memcache.v1.OperationMetadata + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OperationMetadata.verify = function verify(message) { + DeleteInstanceRequest.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.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) - if (!$util.isString(message.statusDetail)) - return "statusDetail: string expected"; - if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) - if (typeof message.cancelRequested !== "boolean") - return "cancelRequested: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.memcache.v1.OperationMetadata + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.memcache.v1.DeleteInstanceRequest} DeleteInstanceRequest */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1.OperationMetadata) + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.DeleteInstanceRequest) return object; - var message = new $root.google.cloud.memcache.v1.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.memcache.v1.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.memcache.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusDetail != null) - message.statusDetail = String(object.statusDetail); - if (object.cancelRequested != null) - message.cancelRequested = Boolean(object.cancelRequested); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); + var message = new $root.google.cloud.memcache.v1.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.memcache.v1.OperationMetadata + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest * @static - * @param {google.cloud.memcache.v1.OperationMetadata} message OperationMetadata + * @param {google.cloud.memcache.v1.DeleteInstanceRequest} message DeleteInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationMetadata.toObject = function toObject(message, options) { + DeleteInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusDetail = ""; - object.cancelRequested = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) - object.statusDetail = message.statusDetail; - if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) - object.cancelRequested = message.cancelRequested; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this OperationMetadata to JSON. + * Converts this DeleteInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.memcache.v1.OperationMetadata + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest * @instance * @returns {Object.} JSON object */ - OperationMetadata.prototype.toJSON = function toJSON() { + DeleteInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for DeleteInstanceRequest * @function getTypeUrl - * @memberof google.cloud.memcache.v1.OperationMetadata + * @memberof google.cloud.memcache.v1.DeleteInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.memcache.v1.OperationMetadata"; + return typeUrlPrefix + "/google.cloud.memcache.v1.DeleteInstanceRequest"; }; - return OperationMetadata; + return DeleteInstanceRequest; })(); - /** - * MemcacheVersion enum. - * @name google.cloud.memcache.v1.MemcacheVersion - * @enum {number} - * @property {number} MEMCACHE_VERSION_UNSPECIFIED=0 MEMCACHE_VERSION_UNSPECIFIED value - * @property {number} MEMCACHE_1_5=1 MEMCACHE_1_5 value - */ - v1.MemcacheVersion = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MEMCACHE_VERSION_UNSPECIFIED"] = 0; - values[valuesById[1] = "MEMCACHE_1_5"] = 1; - return values; - })(); - - return v1; - })(); - - memcache.v1beta2 = (function() { - - /** - * Namespace v1beta2. - * @memberof google.cloud.memcache - * @namespace - */ - var v1beta2 = {}; + v1.ApplyParametersRequest = (function() { - v1beta2.CloudMemcache = (function() { + /** + * Properties of an ApplyParametersRequest. + * @memberof google.cloud.memcache.v1 + * @interface IApplyParametersRequest + * @property {string|null} [name] ApplyParametersRequest name + * @property {Array.|null} [nodeIds] ApplyParametersRequest nodeIds + * @property {boolean|null} [applyAll] ApplyParametersRequest applyAll + */ /** - * Constructs a new CloudMemcache service. - * @memberof google.cloud.memcache.v1beta2 - * @classdesc Represents a CloudMemcache - * @extends $protobuf.rpc.Service + * Constructs a new ApplyParametersRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents an ApplyParametersRequest. + * @implements IApplyParametersRequest * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.cloud.memcache.v1.IApplyParametersRequest=} [properties] Properties to set */ - function CloudMemcache(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function ApplyParametersRequest(properties) { + this.nodeIds = []; + 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]]; } - (CloudMemcache.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudMemcache; - /** - * Creates new CloudMemcache service using the specified rpc implementation. - * @function create - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {CloudMemcache} RPC service. Useful where requests and/or responses are streamed. + * ApplyParametersRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @instance */ - CloudMemcache.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + ApplyParametersRequest.prototype.name = ""; /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|listInstances}. - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @typedef ListInstancesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.memcache.v1beta2.ListInstancesResponse} [response] ListInstancesResponse + * ApplyParametersRequest nodeIds. + * @member {Array.} nodeIds + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @instance */ + ApplyParametersRequest.prototype.nodeIds = $util.emptyArray; /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * ApplyParametersRequest applyAll. + * @member {boolean} applyAll + * @memberof google.cloud.memcache.v1.ApplyParametersRequest * @instance - * @param {google.cloud.memcache.v1beta2.IListInstancesRequest} request ListInstancesRequest message or plain object - * @param {google.cloud.memcache.v1beta2.CloudMemcache.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(CloudMemcache.prototype.listInstances = function listInstances(request, callback) { - return this.rpcCall(listInstances, $root.google.cloud.memcache.v1beta2.ListInstancesRequest, $root.google.cloud.memcache.v1beta2.ListInstancesResponse, request, callback); - }, "name", { value: "ListInstances" }); + ApplyParametersRequest.prototype.applyAll = false; /** - * Calls ListInstances. - * @function listInstances - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @instance - * @param {google.cloud.memcache.v1beta2.IListInstancesRequest} request ListInstancesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new ApplyParametersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1.IApplyParametersRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest instance */ + ApplyParametersRequest.create = function create(properties) { + return new ApplyParametersRequest(properties); + }; /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|getInstance}. - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @typedef GetInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.memcache.v1beta2.Instance} [response] Instance + * Encodes the specified ApplyParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1.ApplyParametersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1.IApplyParametersRequest} message ApplyParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + ApplyParametersRequest.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.nodeIds != null && message.nodeIds.length) + for (var i = 0; i < message.nodeIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeIds[i]); + if (message.applyAll != null && Object.hasOwnProperty.call(message, "applyAll")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.applyAll); + return writer; + }; /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @instance - * @param {google.cloud.memcache.v1beta2.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @param {google.cloud.memcache.v1beta2.CloudMemcache.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance - * @returns {undefined} - * @variation 1 + * Encodes the specified ApplyParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ApplyParametersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1.IApplyParametersRequest} message ApplyParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(CloudMemcache.prototype.getInstance = function getInstance(request, callback) { - return this.rpcCall(getInstance, $root.google.cloud.memcache.v1beta2.GetInstanceRequest, $root.google.cloud.memcache.v1beta2.Instance, request, callback); - }, "name", { value: "GetInstance" }); + ApplyParametersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls GetInstance. - * @function getInstance - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @instance - * @param {google.cloud.memcache.v1beta2.IGetInstanceRequest} request GetInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an ApplyParametersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + ApplyParametersRequest.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.memcache.v1.ApplyParametersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + } + case 3: { + message.applyAll = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|createInstance}. - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @typedef CreateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Decodes an ApplyParametersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + ApplyParametersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @instance - * @param {google.cloud.memcache.v1beta2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @param {google.cloud.memcache.v1beta2.CloudMemcache.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Verifies an ApplyParametersRequest message. + * @function verify + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(CloudMemcache.prototype.createInstance = function createInstance(request, callback) { - return this.rpcCall(createInstance, $root.google.cloud.memcache.v1beta2.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateInstance" }); + ApplyParametersRequest.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.nodeIds != null && message.hasOwnProperty("nodeIds")) { + if (!Array.isArray(message.nodeIds)) + return "nodeIds: array expected"; + for (var i = 0; i < message.nodeIds.length; ++i) + if (!$util.isString(message.nodeIds[i])) + return "nodeIds: string[] expected"; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + if (typeof message.applyAll !== "boolean") + return "applyAll: boolean expected"; + return null; + }; /** - * Calls CreateInstance. - * @function createInstance - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @instance - * @param {google.cloud.memcache.v1beta2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an ApplyParametersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.ApplyParametersRequest} ApplyParametersRequest */ + ApplyParametersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.ApplyParametersRequest) + return object; + var message = new $root.google.cloud.memcache.v1.ApplyParametersRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.nodeIds) { + if (!Array.isArray(object.nodeIds)) + throw TypeError(".google.cloud.memcache.v1.ApplyParametersRequest.nodeIds: array expected"); + message.nodeIds = []; + for (var i = 0; i < object.nodeIds.length; ++i) + message.nodeIds[i] = String(object.nodeIds[i]); + } + if (object.applyAll != null) + message.applyAll = Boolean(object.applyAll); + return message; + }; /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|updateInstance}. - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @typedef UpdateInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a plain object from an ApplyParametersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {google.cloud.memcache.v1.ApplyParametersRequest} message ApplyParametersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + ApplyParametersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeIds = []; + if (options.defaults) { + object.name = ""; + object.applyAll = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.nodeIds && message.nodeIds.length) { + object.nodeIds = []; + for (var j = 0; j < message.nodeIds.length; ++j) + object.nodeIds[j] = message.nodeIds[j]; + } + if (message.applyAll != null && message.hasOwnProperty("applyAll")) + object.applyAll = message.applyAll; + return object; + }; /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * Converts this ApplyParametersRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.ApplyParametersRequest * @instance - * @param {google.cloud.memcache.v1beta2.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @param {google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(CloudMemcache.prototype.updateInstance = function updateInstance(request, callback) { - return this.rpcCall(updateInstance, $root.google.cloud.memcache.v1beta2.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateInstance" }); + ApplyParametersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls UpdateInstance. - * @function updateInstance - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @instance - * @param {google.cloud.memcache.v1beta2.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for ApplyParametersRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.ApplyParametersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + ApplyParametersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.ApplyParametersRequest"; + }; - /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|updateParameters}. - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @typedef UpdateParametersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + return ApplyParametersRequest; + })(); - /** - * Calls UpdateParameters. - * @function updateParameters - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @instance - * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest} request UpdateParametersRequest message or plain object - * @param {google.cloud.memcache.v1beta2.CloudMemcache.UpdateParametersCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudMemcache.prototype.updateParameters = function updateParameters(request, callback) { - return this.rpcCall(updateParameters, $root.google.cloud.memcache.v1beta2.UpdateParametersRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateParameters" }); + v1.UpdateParametersRequest = (function() { /** - * Calls UpdateParameters. - * @function updateParameters - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @instance - * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest} request UpdateParametersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of an UpdateParametersRequest. + * @memberof google.cloud.memcache.v1 + * @interface IUpdateParametersRequest + * @property {string|null} [name] UpdateParametersRequest name + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateParametersRequest updateMask + * @property {google.cloud.memcache.v1.IMemcacheParameters|null} [parameters] UpdateParametersRequest parameters */ /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|deleteInstance}. - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @typedef DeleteInstanceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Constructs a new UpdateParametersRequest. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents an UpdateParametersRequest. + * @implements IUpdateParametersRequest + * @constructor + * @param {google.cloud.memcache.v1.IUpdateParametersRequest=} [properties] Properties to set */ + function UpdateParametersRequest(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]]; + } /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * UpdateParametersRequest name. + * @member {string} name + * @memberof google.cloud.memcache.v1.UpdateParametersRequest * @instance - * @param {google.cloud.memcache.v1beta2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @param {google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(CloudMemcache.prototype.deleteInstance = function deleteInstance(request, callback) { - return this.rpcCall(deleteInstance, $root.google.cloud.memcache.v1beta2.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteInstance" }); + UpdateParametersRequest.prototype.name = ""; /** - * Calls DeleteInstance. - * @function deleteInstance - * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * UpdateParametersRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.memcache.v1.UpdateParametersRequest * @instance - * @param {google.cloud.memcache.v1beta2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + UpdateParametersRequest.prototype.updateMask = null; /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|applyParameters}. - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @typedef ApplyParametersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * UpdateParametersRequest parameters. + * @member {google.cloud.memcache.v1.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @instance */ + UpdateParametersRequest.prototype.parameters = null; /** - * Calls ApplyParameters. - * @function applyParameters - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @instance - * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest} request ApplyParametersRequest message or plain object - * @param {google.cloud.memcache.v1beta2.CloudMemcache.ApplyParametersCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Creates a new UpdateParametersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1.IUpdateParametersRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest instance */ - Object.defineProperty(CloudMemcache.prototype.applyParameters = function applyParameters(request, callback) { - return this.rpcCall(applyParameters, $root.google.cloud.memcache.v1beta2.ApplyParametersRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ApplyParameters" }); + UpdateParametersRequest.create = function create(properties) { + return new UpdateParametersRequest(properties); + }; /** - * Calls ApplyParameters. - * @function applyParameters - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @instance - * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest} request ApplyParametersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified UpdateParametersRequest message. Does not implicitly {@link google.cloud.memcache.v1.UpdateParametersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1.IUpdateParametersRequest} message UpdateParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateParametersRequest.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.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.memcache.v1.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; /** - * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|applySoftwareUpdate}. - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @typedef ApplySoftwareUpdateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Encodes the specified UpdateParametersRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.UpdateParametersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1.IUpdateParametersRequest} message UpdateParametersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateParametersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ApplySoftwareUpdate. - * @function applySoftwareUpdate - * @memberof google.cloud.memcache.v1beta2.CloudMemcache - * @instance - * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest} request ApplySoftwareUpdateRequest message or plain object - * @param {google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdateCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(CloudMemcache.prototype.applySoftwareUpdate = function applySoftwareUpdate(request, callback) { - return this.rpcCall(applySoftwareUpdate, $root.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ApplySoftwareUpdate" }); + * Decodes an UpdateParametersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateParametersRequest.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.memcache.v1.UpdateParametersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls ApplySoftwareUpdate. - * @function applySoftwareUpdate - * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * Decodes an UpdateParametersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateParametersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateParametersRequest message. + * @function verify + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateParametersRequest.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + return null; + }; + + /** + * Creates an UpdateParametersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.UpdateParametersRequest} UpdateParametersRequest + */ + UpdateParametersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.UpdateParametersRequest) + return object; + var message = new $root.google.cloud.memcache.v1.UpdateParametersRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.memcache.v1.UpdateParametersRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1.UpdateParametersRequest.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.fromObject(object.parameters); + } + return message; + }; + + /** + * Creates a plain object from an UpdateParametersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {google.cloud.memcache.v1.UpdateParametersRequest} message UpdateParametersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateParametersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.updateMask = null; + object.parameters = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1.MemcacheParameters.toObject(message.parameters, options); + return object; + }; + + /** + * Converts this UpdateParametersRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.UpdateParametersRequest * @instance - * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest} request ApplySoftwareUpdateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + UpdateParametersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return CloudMemcache; + /** + * Gets the default type url for UpdateParametersRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.UpdateParametersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateParametersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.UpdateParametersRequest"; + }; + + return UpdateParametersRequest; })(); - v1beta2.Instance = (function() { + /** + * MemcacheVersion enum. + * @name google.cloud.memcache.v1.MemcacheVersion + * @enum {number} + * @property {number} MEMCACHE_VERSION_UNSPECIFIED=0 MEMCACHE_VERSION_UNSPECIFIED value + * @property {number} MEMCACHE_1_5=1 MEMCACHE_1_5 value + */ + v1.MemcacheVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEMCACHE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEMCACHE_1_5"] = 1; + return values; + })(); + + v1.MemcacheParameters = (function() { /** - * Properties of an Instance. - * @memberof google.cloud.memcache.v1beta2 - * @interface IInstance - * @property {string|null} [name] Instance name - * @property {string|null} [displayName] Instance displayName - * @property {Object.|null} [labels] Instance labels - * @property {string|null} [authorizedNetwork] Instance authorizedNetwork - * @property {Array.|null} [zones] Instance zones - * @property {number|null} [nodeCount] Instance nodeCount - * @property {google.cloud.memcache.v1beta2.Instance.INodeConfig|null} [nodeConfig] Instance nodeConfig - * @property {google.cloud.memcache.v1beta2.MemcacheVersion|null} [memcacheVersion] Instance memcacheVersion - * @property {google.cloud.memcache.v1beta2.IMemcacheParameters|null} [parameters] Instance parameters - * @property {Array.|null} [memcacheNodes] Instance memcacheNodes - * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime - * @property {google.cloud.memcache.v1beta2.Instance.State|null} [state] Instance state - * @property {string|null} [memcacheFullVersion] Instance memcacheFullVersion - * @property {Array.|null} [instanceMessages] Instance instanceMessages - * @property {string|null} [discoveryEndpoint] Instance discoveryEndpoint - * @property {boolean|null} [updateAvailable] Instance updateAvailable + * Properties of a MemcacheParameters. + * @memberof google.cloud.memcache.v1 + * @interface IMemcacheParameters + * @property {string|null} [id] MemcacheParameters id + * @property {Object.|null} [params] MemcacheParameters params */ /** - * Constructs a new Instance. - * @memberof google.cloud.memcache.v1beta2 - * @classdesc Represents an Instance. - * @implements IInstance + * Constructs a new MemcacheParameters. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a MemcacheParameters. + * @implements IMemcacheParameters * @constructor - * @param {google.cloud.memcache.v1beta2.IInstance=} [properties] Properties to set + * @param {google.cloud.memcache.v1.IMemcacheParameters=} [properties] Properties to set */ - function Instance(properties) { - this.labels = {}; - this.zones = []; - this.memcacheNodes = []; - this.instanceMessages = []; + function MemcacheParameters(properties) { + this.params = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4928,248 +5262,91 @@ } /** - * Instance name. - * @member {string} name - * @memberof google.cloud.memcache.v1beta2.Instance + * MemcacheParameters id. + * @member {string} id + * @memberof google.cloud.memcache.v1.MemcacheParameters * @instance */ - Instance.prototype.name = ""; + MemcacheParameters.prototype.id = ""; /** - * Instance displayName. - * @member {string} displayName - * @memberof google.cloud.memcache.v1beta2.Instance + * MemcacheParameters params. + * @member {Object.} params + * @memberof google.cloud.memcache.v1.MemcacheParameters * @instance */ - Instance.prototype.displayName = ""; + MemcacheParameters.prototype.params = $util.emptyObject; /** - * Instance labels. - * @member {Object.} labels - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance + * Creates a new MemcacheParameters instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.MemcacheParameters + * @static + * @param {google.cloud.memcache.v1.IMemcacheParameters=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters instance */ - Instance.prototype.labels = $util.emptyObject; + MemcacheParameters.create = function create(properties) { + return new MemcacheParameters(properties); + }; /** - * Instance authorizedNetwork. - * @member {string} authorizedNetwork - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.authorizedNetwork = ""; - - /** - * Instance zones. - * @member {Array.} zones - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.zones = $util.emptyArray; - - /** - * Instance nodeCount. - * @member {number} nodeCount - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.nodeCount = 0; - - /** - * Instance nodeConfig. - * @member {google.cloud.memcache.v1beta2.Instance.INodeConfig|null|undefined} nodeConfig - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.nodeConfig = null; - - /** - * Instance memcacheVersion. - * @member {google.cloud.memcache.v1beta2.MemcacheVersion} memcacheVersion - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.memcacheVersion = 0; - - /** - * Instance parameters. - * @member {google.cloud.memcache.v1beta2.IMemcacheParameters|null|undefined} parameters - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.parameters = null; - - /** - * Instance memcacheNodes. - * @member {Array.} memcacheNodes - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.memcacheNodes = $util.emptyArray; - - /** - * Instance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.createTime = null; - - /** - * Instance updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.updateTime = null; - - /** - * Instance state. - * @member {google.cloud.memcache.v1beta2.Instance.State} state - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.state = 0; - - /** - * Instance memcacheFullVersion. - * @member {string} memcacheFullVersion - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.memcacheFullVersion = ""; - - /** - * Instance instanceMessages. - * @member {Array.} instanceMessages - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.instanceMessages = $util.emptyArray; - - /** - * Instance discoveryEndpoint. - * @member {string} discoveryEndpoint - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.discoveryEndpoint = ""; - - /** - * Instance updateAvailable. - * @member {boolean} updateAvailable - * @memberof google.cloud.memcache.v1beta2.Instance - * @instance - */ - Instance.prototype.updateAvailable = false; - - /** - * Creates a new Instance instance using the specified properties. - * @function create - * @memberof google.cloud.memcache.v1beta2.Instance - * @static - * @param {google.cloud.memcache.v1beta2.IInstance=} [properties] Properties to set - * @returns {google.cloud.memcache.v1beta2.Instance} Instance instance - */ - Instance.create = function create(properties) { - return new Instance(properties); - }; - - /** - * Encodes the specified Instance message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.verify|verify} messages. + * Encodes the specified MemcacheParameters message. Does not implicitly {@link google.cloud.memcache.v1.MemcacheParameters.verify|verify} messages. * @function encode - * @memberof google.cloud.memcache.v1beta2.Instance + * @memberof google.cloud.memcache.v1.MemcacheParameters * @static - * @param {google.cloud.memcache.v1beta2.IInstance} message Instance message or plain object to encode + * @param {google.cloud.memcache.v1.IMemcacheParameters} message MemcacheParameters message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Instance.encode = function encode(message, writer) { + MemcacheParameters.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.authorizedNetwork != null && Object.hasOwnProperty.call(message, "authorizedNetwork")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.authorizedNetwork); - if (message.zones != null && message.zones.length) - for (var i = 0; i < message.zones.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.zones[i]); - if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.nodeCount); - if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) - $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.memcacheVersion != null && Object.hasOwnProperty.call(message, "memcacheVersion")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.memcacheVersion); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.memcacheNodes != null && message.memcacheNodes.length) - for (var i = 0; i < message.memcacheNodes.length; ++i) - $root.google.cloud.memcache.v1beta2.Instance.Node.encode(message.memcacheNodes[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); - if (message.memcacheFullVersion != null && Object.hasOwnProperty.call(message, "memcacheFullVersion")) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.memcacheFullVersion); - if (message.instanceMessages != null && message.instanceMessages.length) - for (var i = 0; i < message.instanceMessages.length; ++i) - $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.encode(message.instanceMessages[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.discoveryEndpoint != null && Object.hasOwnProperty.call(message, "discoveryEndpoint")) - writer.uint32(/* id 20, wireType 2 =*/162).string(message.discoveryEndpoint); - if (message.updateAvailable != null && Object.hasOwnProperty.call(message, "updateAvailable")) - writer.uint32(/* id 21, wireType 0 =*/168).bool(message.updateAvailable); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.params[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.verify|verify} messages. + * Encodes the specified MemcacheParameters message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.MemcacheParameters.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.memcache.v1beta2.Instance + * @memberof google.cloud.memcache.v1.MemcacheParameters * @static - * @param {google.cloud.memcache.v1beta2.IInstance} message Instance message or plain object to encode + * @param {google.cloud.memcache.v1.IMemcacheParameters} message MemcacheParameters message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Instance.encodeDelimited = function encodeDelimited(message, writer) { + MemcacheParameters.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Instance message from the specified reader or buffer. + * Decodes a MemcacheParameters message from the specified reader or buffer. * @function decode - * @memberof google.cloud.memcache.v1beta2.Instance + * @memberof google.cloud.memcache.v1.MemcacheParameters * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.memcache.v1beta2.Instance} Instance + * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Instance.decode = function decode(reader, length) { + MemcacheParameters.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.memcache.v1beta2.Instance(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.MemcacheParameters(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); + message.id = reader.string(); break; } case 3: { - if (message.labels === $util.emptyObject) - message.labels = {}; + if (message.params === $util.emptyObject) + message.params = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = ""; @@ -5187,69 +5364,7 @@ break; } } - message.labels[key] = value; - break; - } - case 4: { - message.authorizedNetwork = reader.string(); - break; - } - case 5: { - if (!(message.zones && message.zones.length)) - message.zones = []; - message.zones.push(reader.string()); - break; - } - case 6: { - message.nodeCount = reader.int32(); - break; - } - case 7: { - message.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.decode(reader, reader.uint32()); - break; - } - case 9: { - message.memcacheVersion = reader.int32(); - break; - } - case 11: { - message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); - break; - } - case 12: { - if (!(message.memcacheNodes && message.memcacheNodes.length)) - message.memcacheNodes = []; - message.memcacheNodes.push($root.google.cloud.memcache.v1beta2.Instance.Node.decode(reader, reader.uint32())); - break; - } - case 13: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 14: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 15: { - message.state = reader.int32(); - break; - } - case 18: { - message.memcacheFullVersion = reader.string(); - break; - } - case 19: { - if (!(message.instanceMessages && message.instanceMessages.length)) - message.instanceMessages = []; - message.instanceMessages.push($root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.decode(reader, reader.uint32())); - break; - } - case 20: { - message.discoveryEndpoint = reader.string(); - break; - } - case 21: { - message.updateAvailable = reader.bool(); + message.params[key] = value; break; } default: @@ -5261,1275 +5376,3832 @@ }; /** - * Decodes an Instance message from the specified reader or buffer, length delimited. + * Decodes a MemcacheParameters message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.memcache.v1beta2.Instance + * @memberof google.cloud.memcache.v1.MemcacheParameters * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1beta2.Instance} Instance + * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Instance.decodeDelimited = function decodeDelimited(reader) { + MemcacheParameters.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Instance message. + * Verifies a MemcacheParameters message. * @function verify - * @memberof google.cloud.memcache.v1beta2.Instance + * @memberof google.cloud.memcache.v1.MemcacheParameters * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Instance.verify = function verify(message) { + MemcacheParameters.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.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) - if (!$util.isString(message.authorizedNetwork)) - return "authorizedNetwork: string expected"; - if (message.zones != null && message.hasOwnProperty("zones")) { - if (!Array.isArray(message.zones)) - return "zones: array expected"; - for (var i = 0; i < message.zones.length; ++i) - if (!$util.isString(message.zones[i])) - return "zones: string[] expected"; - } - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - if (!$util.isInteger(message.nodeCount)) - return "nodeCount: integer expected"; - if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { - var error = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.verify(message.nodeConfig); - if (error) - return "nodeConfig." + error; - } - if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) - switch (message.memcacheVersion) { - default: - return "memcacheVersion: enum value expected"; - case 0: - case 1: - break; - } - if (message.parameters != null && message.hasOwnProperty("parameters")) { - var error = $root.google.cloud.memcache.v1beta2.MemcacheParameters.verify(message.parameters); - if (error) - return "parameters." + error; - } - if (message.memcacheNodes != null && message.hasOwnProperty("memcacheNodes")) { - if (!Array.isArray(message.memcacheNodes)) - return "memcacheNodes: array expected"; - for (var i = 0; i < message.memcacheNodes.length; ++i) { - var error = $root.google.cloud.memcache.v1beta2.Instance.Node.verify(message.memcacheNodes[i]); - if (error) - return "memcacheNodes." + error; - } - } - 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.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 4: - case 5: - break; - } - if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) - if (!$util.isString(message.memcacheFullVersion)) - return "memcacheFullVersion: string expected"; - if (message.instanceMessages != null && message.hasOwnProperty("instanceMessages")) { - if (!Array.isArray(message.instanceMessages)) - return "instanceMessages: array expected"; - for (var i = 0; i < message.instanceMessages.length; ++i) { - var error = $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify(message.instanceMessages[i]); - if (error) - return "instanceMessages." + error; - } + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; } - if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) - if (!$util.isString(message.discoveryEndpoint)) - return "discoveryEndpoint: string expected"; - if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) - if (typeof message.updateAvailable !== "boolean") - return "updateAvailable: boolean expected"; return null; }; /** - * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * Creates a MemcacheParameters message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.memcache.v1beta2.Instance + * @memberof google.cloud.memcache.v1.MemcacheParameters * @static * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1beta2.Instance} Instance + * @returns {google.cloud.memcache.v1.MemcacheParameters} MemcacheParameters */ - Instance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1beta2.Instance) + MemcacheParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.MemcacheParameters) return object; - var message = new $root.google.cloud.memcache.v1beta2.Instance(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.memcache.v1beta2.Instance.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.authorizedNetwork != null) - message.authorizedNetwork = String(object.authorizedNetwork); - if (object.zones) { - if (!Array.isArray(object.zones)) - throw TypeError(".google.cloud.memcache.v1beta2.Instance.zones: array expected"); - message.zones = []; - for (var i = 0; i < object.zones.length; ++i) - message.zones[i] = String(object.zones[i]); - } - if (object.nodeCount != null) - message.nodeCount = object.nodeCount | 0; - if (object.nodeConfig != null) { - if (typeof object.nodeConfig !== "object") - throw TypeError(".google.cloud.memcache.v1beta2.Instance.nodeConfig: object expected"); - message.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.fromObject(object.nodeConfig); - } - switch (object.memcacheVersion) { - default: - if (typeof object.memcacheVersion === "number") { - message.memcacheVersion = object.memcacheVersion; - break; - } - break; - case "MEMCACHE_VERSION_UNSPECIFIED": - case 0: - message.memcacheVersion = 0; - break; - case "MEMCACHE_1_5": - case 1: - message.memcacheVersion = 1; - break; - } - if (object.parameters != null) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.memcache.v1beta2.Instance.parameters: object expected"); - message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.fromObject(object.parameters); - } - if (object.memcacheNodes) { - if (!Array.isArray(object.memcacheNodes)) - throw TypeError(".google.cloud.memcache.v1beta2.Instance.memcacheNodes: array expected"); - message.memcacheNodes = []; - for (var i = 0; i < object.memcacheNodes.length; ++i) { - if (typeof object.memcacheNodes[i] !== "object") - throw TypeError(".google.cloud.memcache.v1beta2.Instance.memcacheNodes: object expected"); - message.memcacheNodes[i] = $root.google.cloud.memcache.v1beta2.Instance.Node.fromObject(object.memcacheNodes[i]); - } - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.memcache.v1beta2.Instance.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.memcache.v1beta2.Instance.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "PERFORMING_MAINTENANCE": - case 5: - message.state = 5; - break; - } - if (object.memcacheFullVersion != null) - message.memcacheFullVersion = String(object.memcacheFullVersion); - if (object.instanceMessages) { - if (!Array.isArray(object.instanceMessages)) - throw TypeError(".google.cloud.memcache.v1beta2.Instance.instanceMessages: array expected"); - message.instanceMessages = []; - for (var i = 0; i < object.instanceMessages.length; ++i) { - if (typeof object.instanceMessages[i] !== "object") - throw TypeError(".google.cloud.memcache.v1beta2.Instance.instanceMessages: object expected"); - message.instanceMessages[i] = $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.fromObject(object.instanceMessages[i]); - } + var message = new $root.google.cloud.memcache.v1.MemcacheParameters(); + if (object.id != null) + message.id = String(object.id); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.memcache.v1.MemcacheParameters.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); } - if (object.discoveryEndpoint != null) - message.discoveryEndpoint = String(object.discoveryEndpoint); - if (object.updateAvailable != null) - message.updateAvailable = Boolean(object.updateAvailable); return message; }; /** - * Creates a plain object from an Instance message. Also converts values to other types if specified. + * Creates a plain object from a MemcacheParameters message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.memcache.v1beta2.Instance + * @memberof google.cloud.memcache.v1.MemcacheParameters * @static - * @param {google.cloud.memcache.v1beta2.Instance} message Instance + * @param {google.cloud.memcache.v1.MemcacheParameters} message MemcacheParameters * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Instance.toObject = function toObject(message, options) { + MemcacheParameters.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.zones = []; - object.memcacheNodes = []; - object.instanceMessages = []; - } if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.authorizedNetwork = ""; - object.nodeCount = 0; - object.nodeConfig = null; - object.memcacheVersion = options.enums === String ? "MEMCACHE_VERSION_UNSPECIFIED" : 0; - object.parameters = null; - object.createTime = null; - object.updateTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.memcacheFullVersion = ""; - object.discoveryEndpoint = ""; - object.updateAvailable = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; + object.params = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) - object.authorizedNetwork = message.authorizedNetwork; - if (message.zones && message.zones.length) { - object.zones = []; - for (var j = 0; j < message.zones.length; ++j) - object.zones[j] = message.zones[j]; - } - if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) - object.nodeCount = message.nodeCount; - if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) - object.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.toObject(message.nodeConfig, options); - if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) - object.memcacheVersion = options.enums === String ? $root.google.cloud.memcache.v1beta2.MemcacheVersion[message.memcacheVersion] === undefined ? message.memcacheVersion : $root.google.cloud.memcache.v1beta2.MemcacheVersion[message.memcacheVersion] : message.memcacheVersion; - if (message.parameters != null && message.hasOwnProperty("parameters")) - object.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.toObject(message.parameters, options); - if (message.memcacheNodes && message.memcacheNodes.length) { - object.memcacheNodes = []; - for (var j = 0; j < message.memcacheNodes.length; ++j) - object.memcacheNodes[j] = $root.google.cloud.memcache.v1beta2.Instance.Node.toObject(message.memcacheNodes[j], options); - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.memcache.v1beta2.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.memcache.v1beta2.Instance.State[message.state] : message.state; - if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) - object.memcacheFullVersion = message.memcacheFullVersion; - if (message.instanceMessages && message.instanceMessages.length) { - object.instanceMessages = []; - for (var j = 0; j < message.instanceMessages.length; ++j) - object.instanceMessages[j] = $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.toObject(message.instanceMessages[j], options); + object.params[keys2[j]] = message.params[keys2[j]]; } - if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) - object.discoveryEndpoint = message.discoveryEndpoint; - if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) - object.updateAvailable = message.updateAvailable; return object; }; /** - * Converts this Instance to JSON. + * Converts this MemcacheParameters to JSON. * @function toJSON - * @memberof google.cloud.memcache.v1beta2.Instance + * @memberof google.cloud.memcache.v1.MemcacheParameters * @instance * @returns {Object.} JSON object */ - Instance.prototype.toJSON = function toJSON() { + MemcacheParameters.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Instance + * Gets the default type url for MemcacheParameters * @function getTypeUrl - * @memberof google.cloud.memcache.v1beta2.Instance + * @memberof google.cloud.memcache.v1.MemcacheParameters * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MemcacheParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance"; + return typeUrlPrefix + "/google.cloud.memcache.v1.MemcacheParameters"; }; - Instance.NodeConfig = (function() { + return MemcacheParameters; + })(); - /** - * Properties of a NodeConfig. - * @memberof google.cloud.memcache.v1beta2.Instance - * @interface INodeConfig - * @property {number|null} [cpuCount] NodeConfig cpuCount - * @property {number|null} [memorySizeMb] NodeConfig memorySizeMb - */ + v1.OperationMetadata = (function() { - /** - * Constructs a new NodeConfig. - * @memberof google.cloud.memcache.v1beta2.Instance - * @classdesc Represents a NodeConfig. - * @implements INodeConfig - * @constructor - * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig=} [properties] Properties to set - */ - function NodeConfig(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]]; - } + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.memcache.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusDetail] OperationMetadata statusDetail + * @property {boolean|null} [cancelRequested] OperationMetadata cancelRequested + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ - /** - * NodeConfig cpuCount. - * @member {number} cpuCount - * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig - * @instance - */ - NodeConfig.prototype.cpuCount = 0; + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.memcache.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(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]]; + } - /** - * NodeConfig memorySizeMb. - * @member {number} memorySizeMb - * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig - * @instance - */ - NodeConfig.prototype.memorySizeMb = 0; + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; - /** - * Creates a new NodeConfig instance using the specified properties. - * @function create - * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig - * @static - * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig=} [properties] Properties to set - * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig instance - */ - NodeConfig.create = function create(properties) { - return new NodeConfig(properties); - }; + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; - /** - * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.NodeConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig - * @static - * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig} message NodeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); - if (message.memorySizeMb != null && Object.hasOwnProperty.call(message, "memorySizeMb")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.memorySizeMb); - return writer; - }; + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; - /** - * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.NodeConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig - * @static - * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig} message NodeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; - /** - * Decodes a NodeConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeConfig.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.memcache.v1beta2.Instance.NodeConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.cpuCount = reader.int32(); - break; - } - case 2: { - message.memorySizeMb = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } + /** + * OperationMetadata statusDetail. + * @member {string} statusDetail + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusDetail = ""; + + /** + * OperationMetadata cancelRequested. + * @member {boolean} cancelRequested + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.cancelRequested = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {google.cloud.memcache.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.memcache.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {google.cloud.memcache.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.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.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.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusDetail != null && Object.hasOwnProperty.call(message, "statusDetail")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusDetail); + if (message.cancelRequested != null && Object.hasOwnProperty.call(message, "cancelRequested")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancelRequested); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {google.cloud.memcache.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.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.memcache.v1.OperationMetadata(); + 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.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusDetail = reader.string(); + break; + } + case 6: { + message.cancelRequested = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.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.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) + if (!$util.isString(message.statusDetail)) + return "statusDetail: string expected"; + if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + if (typeof message.cancelRequested !== "boolean") + return "cancelRequested: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.memcache.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.memcache.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.memcache.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusDetail != null) + message.statusDetail = String(object.statusDetail); + if (object.cancelRequested != null) + message.cancelRequested = Boolean(object.cancelRequested); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {google.cloud.memcache.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusDetail = ""; + object.cancelRequested = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusDetail != null && message.hasOwnProperty("statusDetail")) + object.statusDetail = message.statusDetail; + if (message.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + object.cancelRequested = message.cancelRequested; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.LocationMetadata = (function() { + + /** + * Properties of a LocationMetadata. + * @memberof google.cloud.memcache.v1 + * @interface ILocationMetadata + * @property {Object.|null} [availableZones] LocationMetadata availableZones + */ + + /** + * Constructs a new LocationMetadata. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a LocationMetadata. + * @implements ILocationMetadata + * @constructor + * @param {google.cloud.memcache.v1.ILocationMetadata=} [properties] Properties to set + */ + function LocationMetadata(properties) { + this.availableZones = {}; + 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]]; + } + + /** + * LocationMetadata availableZones. + * @member {Object.} availableZones + * @memberof google.cloud.memcache.v1.LocationMetadata + * @instance + */ + LocationMetadata.prototype.availableZones = $util.emptyObject; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.LocationMetadata + * @static + * @param {google.cloud.memcache.v1.ILocationMetadata=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.LocationMetadata} LocationMetadata instance + */ + LocationMetadata.create = function create(properties) { + return new LocationMetadata(properties); + }; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.memcache.v1.LocationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.LocationMetadata + * @static + * @param {google.cloud.memcache.v1.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.availableZones != null && Object.hasOwnProperty.call(message, "availableZones")) + for (var keys = Object.keys(message.availableZones), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.memcache.v1.ZoneMetadata.encode(message.availableZones[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.LocationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.LocationMetadata + * @static + * @param {google.cloud.memcache.v1.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.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.memcache.v1.LocationMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.availableZones === $util.emptyObject) + message.availableZones = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.memcache.v1.ZoneMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.availableZones[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationMetadata message. + * @function verify + * @memberof google.cloud.memcache.v1.LocationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.availableZones != null && message.hasOwnProperty("availableZones")) { + if (!$util.isObject(message.availableZones)) + return "availableZones: object expected"; + var key = Object.keys(message.availableZones); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.memcache.v1.ZoneMetadata.verify(message.availableZones[key[i]]); + if (error) + return "availableZones." + error; + } + } + return null; + }; + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.LocationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.LocationMetadata} LocationMetadata + */ + LocationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.LocationMetadata) + return object; + var message = new $root.google.cloud.memcache.v1.LocationMetadata(); + if (object.availableZones) { + if (typeof object.availableZones !== "object") + throw TypeError(".google.cloud.memcache.v1.LocationMetadata.availableZones: object expected"); + message.availableZones = {}; + for (var keys = Object.keys(object.availableZones), i = 0; i < keys.length; ++i) { + if (typeof object.availableZones[keys[i]] !== "object") + throw TypeError(".google.cloud.memcache.v1.LocationMetadata.availableZones: object expected"); + message.availableZones[keys[i]] = $root.google.cloud.memcache.v1.ZoneMetadata.fromObject(object.availableZones[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.LocationMetadata + * @static + * @param {google.cloud.memcache.v1.LocationMetadata} message LocationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.availableZones = {}; + var keys2; + if (message.availableZones && (keys2 = Object.keys(message.availableZones)).length) { + object.availableZones = {}; + for (var j = 0; j < keys2.length; ++j) + object.availableZones[keys2[j]] = $root.google.cloud.memcache.v1.ZoneMetadata.toObject(message.availableZones[keys2[j]], options); + } + return object; + }; + + /** + * Converts this LocationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.LocationMetadata + * @instance + * @returns {Object.} JSON object + */ + LocationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationMetadata + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.LocationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.LocationMetadata"; + }; + + return LocationMetadata; + })(); + + v1.ZoneMetadata = (function() { + + /** + * Properties of a ZoneMetadata. + * @memberof google.cloud.memcache.v1 + * @interface IZoneMetadata + */ + + /** + * Constructs a new ZoneMetadata. + * @memberof google.cloud.memcache.v1 + * @classdesc Represents a ZoneMetadata. + * @implements IZoneMetadata + * @constructor + * @param {google.cloud.memcache.v1.IZoneMetadata=} [properties] Properties to set + */ + function ZoneMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ZoneMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1.ZoneMetadata + * @static + * @param {google.cloud.memcache.v1.IZoneMetadata=} [properties] Properties to set + * @returns {google.cloud.memcache.v1.ZoneMetadata} ZoneMetadata instance + */ + ZoneMetadata.create = function create(properties) { + return new ZoneMetadata(properties); + }; + + /** + * Encodes the specified ZoneMetadata message. Does not implicitly {@link google.cloud.memcache.v1.ZoneMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1.ZoneMetadata + * @static + * @param {google.cloud.memcache.v1.IZoneMetadata} message ZoneMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ZoneMetadata message, length delimited. Does not implicitly {@link google.cloud.memcache.v1.ZoneMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1.ZoneMetadata + * @static + * @param {google.cloud.memcache.v1.IZoneMetadata} message ZoneMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1.ZoneMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1.ZoneMetadata} ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.memcache.v1.ZoneMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZoneMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1.ZoneMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1.ZoneMetadata} ZoneMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZoneMetadata message. + * @function verify + * @memberof google.cloud.memcache.v1.ZoneMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZoneMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ZoneMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1.ZoneMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1.ZoneMetadata} ZoneMetadata + */ + ZoneMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1.ZoneMetadata) + return object; + return new $root.google.cloud.memcache.v1.ZoneMetadata(); + }; + + /** + * Creates a plain object from a ZoneMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1.ZoneMetadata + * @static + * @param {google.cloud.memcache.v1.ZoneMetadata} message ZoneMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZoneMetadata.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ZoneMetadata to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1.ZoneMetadata + * @instance + * @returns {Object.} JSON object + */ + ZoneMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ZoneMetadata + * @function getTypeUrl + * @memberof google.cloud.memcache.v1.ZoneMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ZoneMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1.ZoneMetadata"; + }; + + return ZoneMetadata; + })(); + + return v1; + })(); + + memcache.v1beta2 = (function() { + + /** + * Namespace v1beta2. + * @memberof google.cloud.memcache + * @namespace + */ + var v1beta2 = {}; + + v1beta2.CloudMemcache = (function() { + + /** + * Constructs a new CloudMemcache service. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a CloudMemcache + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function CloudMemcache(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudMemcache.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudMemcache; + + /** + * Creates new CloudMemcache service using the specified rpc implementation. + * @function create + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {CloudMemcache} RPC service. Useful where requests and/or responses are streamed. + */ + CloudMemcache.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|listInstances}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.memcache.v1beta2.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.memcache.v1beta2.ListInstancesRequest, $root.google.cloud.memcache.v1beta2.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|getInstance}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.memcache.v1beta2.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.memcache.v1beta2.GetInstanceRequest, $root.google.cloud.memcache.v1beta2.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|createInstance}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.memcache.v1beta2.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|updateInstance}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.memcache.v1beta2.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|updateParameters}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef UpdateParametersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateParameters. + * @function updateParameters + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest} request UpdateParametersRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.UpdateParametersCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.updateParameters = function updateParameters(request, callback) { + return this.rpcCall(updateParameters, $root.google.cloud.memcache.v1beta2.UpdateParametersRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateParameters" }); + + /** + * Calls UpdateParameters. + * @function updateParameters + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IUpdateParametersRequest} request UpdateParametersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|deleteInstance}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.memcache.v1beta2.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|applyParameters}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef ApplyParametersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ApplyParameters. + * @function applyParameters + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest} request ApplyParametersRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.ApplyParametersCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.applyParameters = function applyParameters(request, callback) { + return this.rpcCall(applyParameters, $root.google.cloud.memcache.v1beta2.ApplyParametersRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ApplyParameters" }); + + /** + * Calls ApplyParameters. + * @function applyParameters + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IApplyParametersRequest} request ApplyParametersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|applySoftwareUpdate}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef ApplySoftwareUpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ApplySoftwareUpdate. + * @function applySoftwareUpdate + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest} request ApplySoftwareUpdateRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.applySoftwareUpdate = function applySoftwareUpdate(request, callback) { + return this.rpcCall(applySoftwareUpdate, $root.google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ApplySoftwareUpdate" }); + + /** + * Calls ApplySoftwareUpdate. + * @function applySoftwareUpdate + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IApplySoftwareUpdateRequest} request ApplySoftwareUpdateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.memcache.v1beta2.CloudMemcache|rescheduleMaintenance}. + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @typedef RescheduleMaintenanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RescheduleMaintenance. + * @function rescheduleMaintenance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IRescheduleMaintenanceRequest} request RescheduleMaintenanceRequest message or plain object + * @param {google.cloud.memcache.v1beta2.CloudMemcache.RescheduleMaintenanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudMemcache.prototype.rescheduleMaintenance = function rescheduleMaintenance(request, callback) { + return this.rpcCall(rescheduleMaintenance, $root.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RescheduleMaintenance" }); + + /** + * Calls RescheduleMaintenance. + * @function rescheduleMaintenance + * @memberof google.cloud.memcache.v1beta2.CloudMemcache + * @instance + * @param {google.cloud.memcache.v1beta2.IRescheduleMaintenanceRequest} request RescheduleMaintenanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudMemcache; + })(); + + v1beta2.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.memcache.v1beta2 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [displayName] Instance displayName + * @property {Object.|null} [labels] Instance labels + * @property {string|null} [authorizedNetwork] Instance authorizedNetwork + * @property {Array.|null} [zones] Instance zones + * @property {number|null} [nodeCount] Instance nodeCount + * @property {google.cloud.memcache.v1beta2.Instance.INodeConfig|null} [nodeConfig] Instance nodeConfig + * @property {google.cloud.memcache.v1beta2.MemcacheVersion|null} [memcacheVersion] Instance memcacheVersion + * @property {google.cloud.memcache.v1beta2.IMemcacheParameters|null} [parameters] Instance parameters + * @property {Array.|null} [memcacheNodes] Instance memcacheNodes + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.cloud.memcache.v1beta2.Instance.State|null} [state] Instance state + * @property {string|null} [memcacheFullVersion] Instance memcacheFullVersion + * @property {Array.|null} [instanceMessages] Instance instanceMessages + * @property {string|null} [discoveryEndpoint] Instance discoveryEndpoint + * @property {boolean|null} [updateAvailable] Instance updateAvailable + * @property {google.cloud.memcache.v1beta2.IMaintenancePolicy|null} [maintenancePolicy] Instance maintenancePolicy + * @property {google.cloud.memcache.v1beta2.IMaintenanceSchedule|null} [maintenanceSchedule] Instance maintenanceSchedule + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.memcache.v1beta2.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.zones = []; + this.memcacheNodes = []; + this.instanceMessages = []; + 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]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance authorizedNetwork. + * @member {string} authorizedNetwork + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.authorizedNetwork = ""; + + /** + * Instance zones. + * @member {Array.} zones + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.zones = $util.emptyArray; + + /** + * Instance nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.nodeCount = 0; + + /** + * Instance nodeConfig. + * @member {google.cloud.memcache.v1beta2.Instance.INodeConfig|null|undefined} nodeConfig + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.nodeConfig = null; + + /** + * Instance memcacheVersion. + * @member {google.cloud.memcache.v1beta2.MemcacheVersion} memcacheVersion + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.memcacheVersion = 0; + + /** + * Instance parameters. + * @member {google.cloud.memcache.v1beta2.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.parameters = null; + + /** + * Instance memcacheNodes. + * @member {Array.} memcacheNodes + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.memcacheNodes = $util.emptyArray; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance state. + * @member {google.cloud.memcache.v1beta2.Instance.State} state + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance memcacheFullVersion. + * @member {string} memcacheFullVersion + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.memcacheFullVersion = ""; + + /** + * Instance instanceMessages. + * @member {Array.} instanceMessages + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.instanceMessages = $util.emptyArray; + + /** + * Instance discoveryEndpoint. + * @member {string} discoveryEndpoint + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.discoveryEndpoint = ""; + + /** + * Instance updateAvailable. + * @member {boolean} updateAvailable + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.updateAvailable = false; + + /** + * Instance maintenancePolicy. + * @member {google.cloud.memcache.v1beta2.IMaintenancePolicy|null|undefined} maintenancePolicy + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.maintenancePolicy = null; + + /** + * Instance maintenanceSchedule. + * @member {google.cloud.memcache.v1beta2.IMaintenanceSchedule|null|undefined} maintenanceSchedule + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + */ + Instance.prototype.maintenanceSchedule = null; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {google.cloud.memcache.v1beta2.IInstance=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {google.cloud.memcache.v1beta2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.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.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.authorizedNetwork != null && Object.hasOwnProperty.call(message, "authorizedNetwork")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.authorizedNetwork); + if (message.zones != null && message.zones.length) + for (var i = 0; i < message.zones.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.zones[i]); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.nodeCount); + if (message.nodeConfig != null && Object.hasOwnProperty.call(message, "nodeConfig")) + $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.encode(message.nodeConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.memcacheVersion != null && Object.hasOwnProperty.call(message, "memcacheVersion")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.memcacheVersion); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.memcacheNodes != null && message.memcacheNodes.length) + for (var i = 0; i < message.memcacheNodes.length; ++i) + $root.google.cloud.memcache.v1beta2.Instance.Node.encode(message.memcacheNodes[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); + if (message.memcacheFullVersion != null && Object.hasOwnProperty.call(message, "memcacheFullVersion")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.memcacheFullVersion); + if (message.instanceMessages != null && message.instanceMessages.length) + for (var i = 0; i < message.instanceMessages.length; ++i) + $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.encode(message.instanceMessages[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.discoveryEndpoint != null && Object.hasOwnProperty.call(message, "discoveryEndpoint")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.discoveryEndpoint); + if (message.updateAvailable != null && Object.hasOwnProperty.call(message, "updateAvailable")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.updateAvailable); + if (message.maintenancePolicy != null && Object.hasOwnProperty.call(message, "maintenancePolicy")) + $root.google.cloud.memcache.v1beta2.MaintenancePolicy.encode(message.maintenancePolicy, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.maintenanceSchedule != null && Object.hasOwnProperty.call(message, "maintenanceSchedule")) + $root.google.cloud.memcache.v1beta2.MaintenanceSchedule.encode(message.maintenanceSchedule, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {google.cloud.memcache.v1beta2.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.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.memcache.v1beta2.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 4: { + message.authorizedNetwork = reader.string(); + break; + } + case 5: { + if (!(message.zones && message.zones.length)) + message.zones = []; + message.zones.push(reader.string()); + break; + } + case 6: { + message.nodeCount = reader.int32(); + break; + } + case 7: { + message.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.memcacheVersion = reader.int32(); + break; + } + case 11: { + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); + break; + } + case 12: { + if (!(message.memcacheNodes && message.memcacheNodes.length)) + message.memcacheNodes = []; + message.memcacheNodes.push($root.google.cloud.memcache.v1beta2.Instance.Node.decode(reader, reader.uint32())); + break; + } + case 13: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 15: { + message.state = reader.int32(); + break; + } + case 18: { + message.memcacheFullVersion = reader.string(); + break; + } + case 19: { + if (!(message.instanceMessages && message.instanceMessages.length)) + message.instanceMessages = []; + message.instanceMessages.push($root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.decode(reader, reader.uint32())); + break; + } + case 20: { + message.discoveryEndpoint = reader.string(); + break; + } + case 21: { + message.updateAvailable = reader.bool(); + break; + } + case 22: { + message.maintenancePolicy = $root.google.cloud.memcache.v1beta2.MaintenancePolicy.decode(reader, reader.uint32()); + break; + } + case 23: { + message.maintenanceSchedule = $root.google.cloud.memcache.v1beta2.MaintenanceSchedule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) + if (!$util.isString(message.authorizedNetwork)) + return "authorizedNetwork: string expected"; + if (message.zones != null && message.hasOwnProperty("zones")) { + if (!Array.isArray(message.zones)) + return "zones: array expected"; + for (var i = 0; i < message.zones.length; ++i) + if (!$util.isString(message.zones[i])) + return "zones: string[] expected"; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) { + var error = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.verify(message.nodeConfig); + if (error) + return "nodeConfig." + error; + } + if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) + switch (message.memcacheVersion) { + default: + return "memcacheVersion: enum value expected"; + case 0: + case 1: + break; + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1beta2.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.memcacheNodes != null && message.hasOwnProperty("memcacheNodes")) { + if (!Array.isArray(message.memcacheNodes)) + return "memcacheNodes: array expected"; + for (var i = 0; i < message.memcacheNodes.length; ++i) { + var error = $root.google.cloud.memcache.v1beta2.Instance.Node.verify(message.memcacheNodes[i]); + if (error) + return "memcacheNodes." + error; + } + } + 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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) + if (!$util.isString(message.memcacheFullVersion)) + return "memcacheFullVersion: string expected"; + if (message.instanceMessages != null && message.hasOwnProperty("instanceMessages")) { + if (!Array.isArray(message.instanceMessages)) + return "instanceMessages: array expected"; + for (var i = 0; i < message.instanceMessages.length; ++i) { + var error = $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify(message.instanceMessages[i]); + if (error) + return "instanceMessages." + error; + } + } + if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) + if (!$util.isString(message.discoveryEndpoint)) + return "discoveryEndpoint: string expected"; + if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) + if (typeof message.updateAvailable !== "boolean") + return "updateAvailable: boolean expected"; + if (message.maintenancePolicy != null && message.hasOwnProperty("maintenancePolicy")) { + var error = $root.google.cloud.memcache.v1beta2.MaintenancePolicy.verify(message.maintenancePolicy); + if (error) + return "maintenancePolicy." + error; + } + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) { + var error = $root.google.cloud.memcache.v1beta2.MaintenanceSchedule.verify(message.maintenanceSchedule); + if (error) + return "maintenanceSchedule." + error; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.Instance) + return object; + var message = new $root.google.cloud.memcache.v1beta2.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.authorizedNetwork != null) + message.authorizedNetwork = String(object.authorizedNetwork); + if (object.zones) { + if (!Array.isArray(object.zones)) + throw TypeError(".google.cloud.memcache.v1beta2.Instance.zones: array expected"); + message.zones = []; + for (var i = 0; i < object.zones.length; ++i) + message.zones[i] = String(object.zones[i]); + } + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.nodeConfig != null) { + if (typeof object.nodeConfig !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.nodeConfig: object expected"); + message.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.fromObject(object.nodeConfig); + } + switch (object.memcacheVersion) { + default: + if (typeof object.memcacheVersion === "number") { + message.memcacheVersion = object.memcacheVersion; + break; + } + break; + case "MEMCACHE_VERSION_UNSPECIFIED": + case 0: + message.memcacheVersion = 0; + break; + case "MEMCACHE_1_5": + case 1: + message.memcacheVersion = 1; + break; + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.fromObject(object.parameters); + } + if (object.memcacheNodes) { + if (!Array.isArray(object.memcacheNodes)) + throw TypeError(".google.cloud.memcache.v1beta2.Instance.memcacheNodes: array expected"); + message.memcacheNodes = []; + for (var i = 0; i < object.memcacheNodes.length; ++i) { + if (typeof object.memcacheNodes[i] !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.memcacheNodes: object expected"); + message.memcacheNodes[i] = $root.google.cloud.memcache.v1beta2.Instance.Node.fromObject(object.memcacheNodes[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.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.memcache.v1beta2.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "PERFORMING_MAINTENANCE": + case 5: + message.state = 5; + break; + } + if (object.memcacheFullVersion != null) + message.memcacheFullVersion = String(object.memcacheFullVersion); + if (object.instanceMessages) { + if (!Array.isArray(object.instanceMessages)) + throw TypeError(".google.cloud.memcache.v1beta2.Instance.instanceMessages: array expected"); + message.instanceMessages = []; + for (var i = 0; i < object.instanceMessages.length; ++i) { + if (typeof object.instanceMessages[i] !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.instanceMessages: object expected"); + message.instanceMessages[i] = $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.fromObject(object.instanceMessages[i]); + } + } + if (object.discoveryEndpoint != null) + message.discoveryEndpoint = String(object.discoveryEndpoint); + if (object.updateAvailable != null) + message.updateAvailable = Boolean(object.updateAvailable); + if (object.maintenancePolicy != null) { + if (typeof object.maintenancePolicy !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.maintenancePolicy: object expected"); + message.maintenancePolicy = $root.google.cloud.memcache.v1beta2.MaintenancePolicy.fromObject(object.maintenancePolicy); + } + if (object.maintenanceSchedule != null) { + if (typeof object.maintenanceSchedule !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.maintenanceSchedule: object expected"); + message.maintenanceSchedule = $root.google.cloud.memcache.v1beta2.MaintenanceSchedule.fromObject(object.maintenanceSchedule); + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {google.cloud.memcache.v1beta2.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.zones = []; + object.memcacheNodes = []; + object.instanceMessages = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.authorizedNetwork = ""; + object.nodeCount = 0; + object.nodeConfig = null; + object.memcacheVersion = options.enums === String ? "MEMCACHE_VERSION_UNSPECIFIED" : 0; + object.parameters = null; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.memcacheFullVersion = ""; + object.discoveryEndpoint = ""; + object.updateAvailable = false; + object.maintenancePolicy = null; + object.maintenanceSchedule = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.authorizedNetwork != null && message.hasOwnProperty("authorizedNetwork")) + object.authorizedNetwork = message.authorizedNetwork; + if (message.zones && message.zones.length) { + object.zones = []; + for (var j = 0; j < message.zones.length; ++j) + object.zones[j] = message.zones[j]; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.nodeConfig != null && message.hasOwnProperty("nodeConfig")) + object.nodeConfig = $root.google.cloud.memcache.v1beta2.Instance.NodeConfig.toObject(message.nodeConfig, options); + if (message.memcacheVersion != null && message.hasOwnProperty("memcacheVersion")) + object.memcacheVersion = options.enums === String ? $root.google.cloud.memcache.v1beta2.MemcacheVersion[message.memcacheVersion] === undefined ? message.memcacheVersion : $root.google.cloud.memcache.v1beta2.MemcacheVersion[message.memcacheVersion] : message.memcacheVersion; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.toObject(message.parameters, options); + if (message.memcacheNodes && message.memcacheNodes.length) { + object.memcacheNodes = []; + for (var j = 0; j < message.memcacheNodes.length; ++j) + object.memcacheNodes[j] = $root.google.cloud.memcache.v1beta2.Instance.Node.toObject(message.memcacheNodes[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.memcache.v1beta2.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.memcache.v1beta2.Instance.State[message.state] : message.state; + if (message.memcacheFullVersion != null && message.hasOwnProperty("memcacheFullVersion")) + object.memcacheFullVersion = message.memcacheFullVersion; + if (message.instanceMessages && message.instanceMessages.length) { + object.instanceMessages = []; + for (var j = 0; j < message.instanceMessages.length; ++j) + object.instanceMessages[j] = $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.toObject(message.instanceMessages[j], options); + } + if (message.discoveryEndpoint != null && message.hasOwnProperty("discoveryEndpoint")) + object.discoveryEndpoint = message.discoveryEndpoint; + if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) + object.updateAvailable = message.updateAvailable; + if (message.maintenancePolicy != null && message.hasOwnProperty("maintenancePolicy")) + object.maintenancePolicy = $root.google.cloud.memcache.v1beta2.MaintenancePolicy.toObject(message.maintenancePolicy, options); + if (message.maintenanceSchedule != null && message.hasOwnProperty("maintenanceSchedule")) + object.maintenanceSchedule = $root.google.cloud.memcache.v1beta2.MaintenanceSchedule.toObject(message.maintenanceSchedule, options); + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance"; + }; + + /** + * State enum. + * @name google.cloud.memcache.v1beta2.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} UPDATING=3 UPDATING value + * @property {number} DELETING=4 DELETING value + * @property {number} PERFORMING_MAINTENANCE=5 PERFORMING_MAINTENANCE value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "PERFORMING_MAINTENANCE"] = 5; + return values; + })(); + + Instance.NodeConfig = (function() { + + /** + * Properties of a NodeConfig. + * @memberof google.cloud.memcache.v1beta2.Instance + * @interface INodeConfig + * @property {number|null} [cpuCount] NodeConfig cpuCount + * @property {number|null} [memorySizeMb] NodeConfig memorySizeMb + */ + + /** + * Constructs a new NodeConfig. + * @memberof google.cloud.memcache.v1beta2.Instance + * @classdesc Represents a NodeConfig. + * @implements INodeConfig + * @constructor + * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig=} [properties] Properties to set + */ + function NodeConfig(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]]; + } + + /** + * NodeConfig cpuCount. + * @member {number} cpuCount + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @instance + */ + NodeConfig.prototype.cpuCount = 0; + + /** + * NodeConfig memorySizeMb. + * @member {number} memorySizeMb + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @instance + */ + NodeConfig.prototype.memorySizeMb = 0; + + /** + * Creates a new NodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig instance + */ + NodeConfig.create = function create(properties) { + return new NodeConfig(properties); + }; + + /** + * Encodes the specified NodeConfig message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.NodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpuCount != null && Object.hasOwnProperty.call(message, "cpuCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cpuCount); + if (message.memorySizeMb != null && Object.hasOwnProperty.call(message, "memorySizeMb")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.memorySizeMb); + return writer; + }; + + /** + * Encodes the specified NodeConfig message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.NodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INodeConfig} message NodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.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.memcache.v1beta2.Instance.NodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cpuCount = reader.int32(); + break; + } + case 2: { + message.memorySizeMb = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeConfig message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + if (!$util.isInteger(message.cpuCount)) + return "cpuCount: integer expected"; + if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) + if (!$util.isInteger(message.memorySizeMb)) + return "memorySizeMb: integer expected"; + return null; + }; + + /** + * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig + */ + NodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.Instance.NodeConfig) + return object; + var message = new $root.google.cloud.memcache.v1beta2.Instance.NodeConfig(); + if (object.cpuCount != null) + message.cpuCount = object.cpuCount | 0; + if (object.memorySizeMb != null) + message.memorySizeMb = object.memorySizeMb | 0; + return message; + }; + + /** + * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {google.cloud.memcache.v1beta2.Instance.NodeConfig} message NodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpuCount = 0; + object.memorySizeMb = 0; + } + if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) + object.cpuCount = message.cpuCount; + if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) + object.memorySizeMb = message.memorySizeMb; + return object; + }; + + /** + * Converts this NodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @instance + * @returns {Object.} JSON object + */ + NodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeConfig + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance.NodeConfig"; + }; + + return NodeConfig; + })(); + + Instance.Node = (function() { + + /** + * Properties of a Node. + * @memberof google.cloud.memcache.v1beta2.Instance + * @interface INode + * @property {string|null} [nodeId] Node nodeId + * @property {string|null} [zone] Node zone + * @property {google.cloud.memcache.v1beta2.Instance.Node.State|null} [state] Node state + * @property {string|null} [host] Node host + * @property {number|null} [port] Node port + * @property {google.cloud.memcache.v1beta2.IMemcacheParameters|null} [parameters] Node parameters + * @property {boolean|null} [updateAvailable] Node updateAvailable + */ + + /** + * Constructs a new Node. + * @memberof google.cloud.memcache.v1beta2.Instance + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {google.cloud.memcache.v1beta2.Instance.INode=} [properties] Properties to set + */ + function Node(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]]; + } + + /** + * Node nodeId. + * @member {string} nodeId + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.nodeId = ""; + + /** + * Node zone. + * @member {string} zone + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.zone = ""; + + /** + * Node state. + * @member {google.cloud.memcache.v1beta2.Instance.Node.State} state + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.state = 0; + + /** + * Node host. + * @member {string} host + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.host = ""; + + /** + * Node port. + * @member {number} port + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.port = 0; + + /** + * Node parameters. + * @member {google.cloud.memcache.v1beta2.IMemcacheParameters|null|undefined} parameters + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.parameters = null; + + /** + * Node updateAvailable. + * @member {boolean} updateAvailable + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + */ + Node.prototype.updateAvailable = false; + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INode=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.Node.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.port); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateAvailable != null && Object.hasOwnProperty.call(message, "updateAvailable")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.updateAvailable); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {google.cloud.memcache.v1beta2.Instance.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.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.memcache.v1beta2.Instance.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeId = reader.string(); + break; + } + case 2: { + message.zone = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.host = reader.string(); + break; + } + case 5: { + message.port = reader.int32(); + break; + } + case 6: { + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateAvailable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + if (!$util.isString(message.nodeId)) + return "nodeId: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.memcache.v1beta2.MemcacheParameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) + if (typeof message.updateAvailable !== "boolean") + return "updateAvailable: boolean expected"; + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.Instance.Node) + return object; + var message = new $root.google.cloud.memcache.v1beta2.Instance.Node(); + if (object.nodeId != null) + message.nodeId = String(object.nodeId); + if (object.zone != null) + message.zone = String(object.zone); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "UPDATING": + case 4: + message.state = 4; + break; + } + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.Instance.Node.parameters: object expected"); + message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.fromObject(object.parameters); + } + if (object.updateAvailable != null) + message.updateAvailable = Boolean(object.updateAvailable); + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {google.cloud.memcache.v1beta2.Instance.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nodeId = ""; + object.zone = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.host = ""; + object.port = 0; + object.parameters = null; + object.updateAvailable = false; + } + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + object.nodeId = message.nodeId; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.memcache.v1beta2.Instance.Node.State[message.state] === undefined ? message.state : $root.google.cloud.memcache.v1beta2.Instance.Node.State[message.state] : message.state; + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.toObject(message.parameters, options); + if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) + object.updateAvailable = message.updateAvailable; + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.Instance.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance.Node"; + }; + + /** + * State enum. + * @name google.cloud.memcache.v1beta2.Instance.Node.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} DELETING=3 DELETING value + * @property {number} UPDATING=4 UPDATING value + */ + Node.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "UPDATING"] = 4; + return values; + })(); + + return Node; + })(); + + Instance.InstanceMessage = (function() { + + /** + * Properties of an InstanceMessage. + * @memberof google.cloud.memcache.v1beta2.Instance + * @interface IInstanceMessage + * @property {google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code|null} [code] InstanceMessage code + * @property {string|null} [message] InstanceMessage message + */ + + /** + * Constructs a new InstanceMessage. + * @memberof google.cloud.memcache.v1beta2.Instance + * @classdesc Represents an InstanceMessage. + * @implements IInstanceMessage + * @constructor + * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage=} [properties] Properties to set + */ + function InstanceMessage(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]]; + } + + /** + * InstanceMessage code. + * @member {google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code} code + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @instance + */ + InstanceMessage.prototype.code = 0; + + /** + * InstanceMessage message. + * @member {string} message + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @instance + */ + InstanceMessage.prototype.message = ""; + + /** + * Creates a new InstanceMessage instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage instance + */ + InstanceMessage.create = function create(properties) { + return new InstanceMessage(properties); + }; + + /** + * Encodes the specified InstanceMessage message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage} message InstanceMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + return writer; + }; + + /** + * Encodes the specified InstanceMessage message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage} message InstanceMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceMessage.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.memcache.v1beta2.Instance.InstanceMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } return message; }; /** - * Decodes a NodeConfig message from the specified reader or buffer, length delimited. + * Decodes an InstanceMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig + * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NodeConfig.decodeDelimited = function decodeDelimited(reader) { + InstanceMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NodeConfig message. + * Verifies an InstanceMessage message. * @function verify - * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NodeConfig.verify = function verify(message) { + InstanceMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - if (!$util.isInteger(message.cpuCount)) - return "cpuCount: integer expected"; - if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) - if (!$util.isInteger(message.memorySizeMb)) - return "memorySizeMb: integer expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; return null; }; /** - * Creates a NodeConfig message from a plain object. Also converts values to their respective internal types. + * Creates an InstanceMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage * @static * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1beta2.Instance.NodeConfig} NodeConfig + * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage */ - NodeConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1beta2.Instance.NodeConfig) + InstanceMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage) return object; - var message = new $root.google.cloud.memcache.v1beta2.Instance.NodeConfig(); - if (object.cpuCount != null) - message.cpuCount = object.cpuCount | 0; - if (object.memorySizeMb != null) - message.memorySizeMb = object.memorySizeMb | 0; + var message = new $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "ZONE_DISTRIBUTION_UNBALANCED": + case 1: + message.code = 1; + break; + } + if (object.message != null) + message.message = String(object.message); return message; }; - /** - * Creates a plain object from a NodeConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig - * @static - * @param {google.cloud.memcache.v1beta2.Instance.NodeConfig} message NodeConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cpuCount = 0; - object.memorySizeMb = 0; + /** + * Creates a plain object from an InstanceMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {google.cloud.memcache.v1beta2.Instance.InstanceMessage} message InstanceMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code[message.code] === undefined ? message.code : $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code[message.code] : message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this InstanceMessage to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @instance + * @returns {Object.} JSON object + */ + InstanceMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceMessage + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance.InstanceMessage"; + }; + + /** + * Code enum. + * @name google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} ZONE_DISTRIBUTION_UNBALANCED=1 ZONE_DISTRIBUTION_UNBALANCED value + */ + InstanceMessage.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONE_DISTRIBUTION_UNBALANCED"] = 1; + return values; + })(); + + return InstanceMessage; + })(); + + return Instance; + })(); + + v1beta2.MaintenancePolicy = (function() { + + /** + * Properties of a MaintenancePolicy. + * @memberof google.cloud.memcache.v1beta2 + * @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 MaintenancePolicy. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a MaintenancePolicy. + * @implements IMaintenancePolicy + * @constructor + * @param {google.cloud.memcache.v1beta2.IMaintenancePolicy=} [properties] Properties to set + */ + function MaintenancePolicy(properties) { + this.weeklyMaintenanceWindow = []; + 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]]; + } + + /** + * MaintenancePolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.memcache.v1beta2.MaintenancePolicy + * @instance + */ + MaintenancePolicy.prototype.createTime = null; + + /** + * MaintenancePolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.memcache.v1beta2.MaintenancePolicy + * @instance + */ + MaintenancePolicy.prototype.updateTime = null; + + /** + * MaintenancePolicy description. + * @member {string} description + * @memberof google.cloud.memcache.v1beta2.MaintenancePolicy + * @instance + */ + MaintenancePolicy.prototype.description = ""; + + /** + * MaintenancePolicy weeklyMaintenanceWindow. + * @member {Array.} weeklyMaintenanceWindow + * @memberof google.cloud.memcache.v1beta2.MaintenancePolicy + * @instance + */ + MaintenancePolicy.prototype.weeklyMaintenanceWindow = $util.emptyArray; + + /** + * Creates a new MaintenancePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.MaintenancePolicy + * @static + * @param {google.cloud.memcache.v1beta2.IMaintenancePolicy=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.MaintenancePolicy} MaintenancePolicy instance + */ + MaintenancePolicy.create = function create(properties) { + return new MaintenancePolicy(properties); + }; + + /** + * Encodes the specified MaintenancePolicy message. Does not implicitly {@link google.cloud.memcache.v1beta2.MaintenancePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.MaintenancePolicy + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.MaintenancePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.MaintenancePolicy + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.MaintenancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.WeeklyMaintenanceWindow.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; } - if (message.cpuCount != null && message.hasOwnProperty("cpuCount")) - object.cpuCount = message.cpuCount; - if (message.memorySizeMb != null && message.hasOwnProperty("memorySizeMb")) - object.memorySizeMb = message.memorySizeMb; - return object; - }; + } + return message; + }; - /** - * Converts this NodeConfig to JSON. - * @function toJSON - * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig - * @instance - * @returns {Object.} JSON object - */ - NodeConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a MaintenancePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.MaintenancePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.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()); + }; - /** - * Gets the default type url for NodeConfig - * @function getTypeUrl - * @memberof google.cloud.memcache.v1beta2.Instance.NodeConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Verifies a MaintenancePolicy message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.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.memcache.v1beta2.WeeklyMaintenanceWindow.verify(message.weeklyMaintenanceWindow[i]); + if (error) + return "weeklyMaintenanceWindow." + error; } - return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance.NodeConfig"; - }; + } + return null; + }; - return NodeConfig; - })(); + /** + * Creates a MaintenancePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.MaintenancePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.MaintenancePolicy} MaintenancePolicy + */ + MaintenancePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.MaintenancePolicy) + return object; + var message = new $root.google.cloud.memcache.v1beta2.MaintenancePolicy(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.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.memcache.v1beta2.MaintenancePolicy.weeklyMaintenanceWindow: object expected"); + message.weeklyMaintenanceWindow[i] = $root.google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow.fromObject(object.weeklyMaintenanceWindow[i]); + } + } + return message; + }; - Instance.Node = (function() { + /** + * Creates a plain object from a MaintenancePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.MaintenancePolicy + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.WeeklyMaintenanceWindow.toObject(message.weeklyMaintenanceWindow[j], options); + } + return object; + }; - /** - * Properties of a Node. - * @memberof google.cloud.memcache.v1beta2.Instance - * @interface INode - * @property {string|null} [nodeId] Node nodeId - * @property {string|null} [zone] Node zone - * @property {google.cloud.memcache.v1beta2.Instance.Node.State|null} [state] Node state - * @property {string|null} [host] Node host - * @property {number|null} [port] Node port - * @property {google.cloud.memcache.v1beta2.IMemcacheParameters|null} [parameters] Node parameters - * @property {boolean|null} [updateAvailable] Node updateAvailable - */ + /** + * Converts this MaintenancePolicy to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.MaintenancePolicy + * @instance + * @returns {Object.} JSON object + */ + MaintenancePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new Node. - * @memberof google.cloud.memcache.v1beta2.Instance - * @classdesc Represents a Node. - * @implements INode - * @constructor - * @param {google.cloud.memcache.v1beta2.Instance.INode=} [properties] Properties to set - */ - function Node(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]]; + /** + * Gets the default type url for MaintenancePolicy + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.MaintenancePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaintenancePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.MaintenancePolicy"; + }; - /** - * Node nodeId. - * @member {string} nodeId - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @instance - */ - Node.prototype.nodeId = ""; - - /** - * Node zone. - * @member {string} zone - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @instance - */ - Node.prototype.zone = ""; + return MaintenancePolicy; + })(); - /** - * Node state. - * @member {google.cloud.memcache.v1beta2.Instance.Node.State} state - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @instance - */ - Node.prototype.state = 0; + v1beta2.WeeklyMaintenanceWindow = (function() { - /** - * Node host. - * @member {string} host - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @instance - */ - Node.prototype.host = ""; + /** + * Properties of a WeeklyMaintenanceWindow. + * @memberof google.cloud.memcache.v1beta2 + * @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 + */ - /** - * Node port. - * @member {number} port - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @instance - */ - Node.prototype.port = 0; + /** + * Constructs a new WeeklyMaintenanceWindow. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a WeeklyMaintenanceWindow. + * @implements IWeeklyMaintenanceWindow + * @constructor + * @param {google.cloud.memcache.v1beta2.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]]; + } - /** - * Node parameters. - * @member {google.cloud.memcache.v1beta2.IMemcacheParameters|null|undefined} parameters - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @instance - */ - Node.prototype.parameters = null; + /** + * WeeklyMaintenanceWindow day. + * @member {google.type.DayOfWeek} day + * @memberof google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow + * @instance + */ + WeeklyMaintenanceWindow.prototype.day = 0; - /** - * Node updateAvailable. - * @member {boolean} updateAvailable - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @instance - */ - Node.prototype.updateAvailable = false; + /** + * WeeklyMaintenanceWindow startTime. + * @member {google.type.ITimeOfDay|null|undefined} startTime + * @memberof google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow + * @instance + */ + WeeklyMaintenanceWindow.prototype.startTime = null; - /** - * Creates a new Node instance using the specified properties. - * @function create - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @static - * @param {google.cloud.memcache.v1beta2.Instance.INode=} [properties] Properties to set - * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node instance - */ - Node.create = function create(properties) { - return new Node(properties); - }; + /** + * WeeklyMaintenanceWindow duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow + * @instance + */ + WeeklyMaintenanceWindow.prototype.duration = null; - /** - * Encodes the specified Node message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.Node.verify|verify} messages. - * @function encode - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @static - * @param {google.cloud.memcache.v1beta2.Instance.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); - if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); - if (message.host != null && Object.hasOwnProperty.call(message, "host")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.host); - if (message.port != null && Object.hasOwnProperty.call(message, "port")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.port); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.cloud.memcache.v1beta2.MemcacheParameters.encode(message.parameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateAvailable != null && Object.hasOwnProperty.call(message, "updateAvailable")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.updateAvailable); - return writer; - }; + /** + * Creates a new WeeklyMaintenanceWindow instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow + * @static + * @param {google.cloud.memcache.v1beta2.IWeeklyMaintenanceWindow=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow} WeeklyMaintenanceWindow instance + */ + WeeklyMaintenanceWindow.create = function create(properties) { + return new WeeklyMaintenanceWindow(properties); + }; - /** - * Encodes the specified Node message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.Node.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @static - * @param {google.cloud.memcache.v1beta2.Instance.INode} message Node message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Node.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified WeeklyMaintenanceWindow message. Does not implicitly {@link google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow + * @static + * @param {google.cloud.memcache.v1beta2.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; + }; - /** - * Decodes a Node message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.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.memcache.v1beta2.Instance.Node(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.nodeId = reader.string(); - break; - } - case 2: { - message.zone = reader.string(); - break; - } - case 3: { - message.state = reader.int32(); - break; - } - case 4: { - message.host = reader.string(); - break; - } - case 5: { - message.port = reader.int32(); - break; - } - case 6: { - message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateAvailable = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Encodes the specified WeeklyMaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow + * @static + * @param {google.cloud.memcache.v1beta2.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.memcache.v1beta2.WeeklyMaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.WeeklyMaintenanceWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.day = reader.int32(); break; } - } - return message; - }; - - /** - * Decodes a Node message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Node.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Node message. - * @function verify - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Node.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodeId != null && message.hasOwnProperty("nodeId")) - if (!$util.isString(message.nodeId)) - return "nodeId: string expected"; - if (message.zone != null && message.hasOwnProperty("zone")) - if (!$util.isString(message.zone)) - return "zone: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: + case 2: { + message.startTime = $root.google.type.TimeOfDay.decode(reader, reader.uint32()); break; } - if (message.host != null && message.hasOwnProperty("host")) - if (!$util.isString(message.host)) - return "host: string expected"; - if (message.port != null && message.hasOwnProperty("port")) - if (!$util.isInteger(message.port)) - return "port: integer expected"; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - var error = $root.google.cloud.memcache.v1beta2.MemcacheParameters.verify(message.parameters); - if (error) - return "parameters." + error; + case 3: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; } - if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) - if (typeof message.updateAvailable !== "boolean") - return "updateAvailable: boolean expected"; - return null; - }; + } + return message; + }; - /** - * Creates a Node message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1beta2.Instance.Node} Node - */ - Node.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1beta2.Instance.Node) - return object; - var message = new $root.google.cloud.memcache.v1beta2.Instance.Node(); - if (object.nodeId != null) - message.nodeId = String(object.nodeId); - if (object.zone != null) - message.zone = String(object.zone); - switch (object.state) { + /** + * Decodes a WeeklyMaintenanceWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": + return "day: enum value expected"; case 0: - message.state = 0; - break; - case "CREATING": case 1: - message.state = 1; - break; - case "READY": case 2: - message.state = 2; - break; - case "DELETING": case 3: - message.state = 3; - break; - case "UPDATING": case 4: - message.state = 4; + case 5: + case 6: + case 7: break; } - if (object.host != null) - message.host = String(object.host); - if (object.port != null) - message.port = object.port | 0; - if (object.parameters != null) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.memcache.v1beta2.Instance.Node.parameters: object expected"); - message.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.fromObject(object.parameters); - } - if (object.updateAvailable != null) - message.updateAvailable = Boolean(object.updateAvailable); - return message; - }; + 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 plain object from a Node message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @static - * @param {google.cloud.memcache.v1beta2.Instance.Node} message Node - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Node.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.nodeId = ""; - object.zone = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.host = ""; - object.port = 0; - object.parameters = null; - object.updateAvailable = false; - } - if (message.nodeId != null && message.hasOwnProperty("nodeId")) - object.nodeId = message.nodeId; - if (message.zone != null && message.hasOwnProperty("zone")) - object.zone = message.zone; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.memcache.v1beta2.Instance.Node.State[message.state] === undefined ? message.state : $root.google.cloud.memcache.v1beta2.Instance.Node.State[message.state] : message.state; - if (message.host != null && message.hasOwnProperty("host")) - object.host = message.host; - if (message.port != null && message.hasOwnProperty("port")) - object.port = message.port; - if (message.parameters != null && message.hasOwnProperty("parameters")) - object.parameters = $root.google.cloud.memcache.v1beta2.MemcacheParameters.toObject(message.parameters, options); - if (message.updateAvailable != null && message.hasOwnProperty("updateAvailable")) - object.updateAvailable = message.updateAvailable; + /** + * Creates a WeeklyMaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow} WeeklyMaintenanceWindow + */ + WeeklyMaintenanceWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow) return object; - }; + var message = new $root.google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow(); + switch (object.day) { + default: + if (typeof object.day === "number") { + message.day = object.day; + break; + } + break; + 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.memcache.v1beta2.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.memcache.v1beta2.WeeklyMaintenanceWindow.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + return message; + }; - /** - * Converts this Node to JSON. - * @function toJSON - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @instance - * @returns {Object.} JSON object - */ - Node.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a WeeklyMaintenanceWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow + * @static + * @param {google.cloud.memcache.v1beta2.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] === undefined ? message.day : $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; + }; - /** - * Gets the default type url for Node - * @function getTypeUrl - * @memberof google.cloud.memcache.v1beta2.Instance.Node - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance.Node"; - }; + /** + * Converts this WeeklyMaintenanceWindow to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow + * @instance + * @returns {Object.} JSON object + */ + WeeklyMaintenanceWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * State enum. - * @name google.cloud.memcache.v1beta2.Instance.Node.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - * @property {number} DELETING=3 DELETING value - * @property {number} UPDATING=4 UPDATING value - */ - Node.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - values[valuesById[3] = "DELETING"] = 3; - values[valuesById[4] = "UPDATING"] = 4; - return values; - })(); + /** + * Gets the default type url for WeeklyMaintenanceWindow + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeeklyMaintenanceWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow"; + }; - return Node; - })(); + return WeeklyMaintenanceWindow; + })(); - Instance.InstanceMessage = (function() { + v1beta2.MaintenanceSchedule = (function() { - /** - * Properties of an InstanceMessage. - * @memberof google.cloud.memcache.v1beta2.Instance - * @interface IInstanceMessage - * @property {google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code|null} [code] InstanceMessage code - * @property {string|null} [message] InstanceMessage message - */ + /** + * Properties of a MaintenanceSchedule. + * @memberof google.cloud.memcache.v1beta2 + * @interface IMaintenanceSchedule + * @property {google.protobuf.ITimestamp|null} [startTime] MaintenanceSchedule startTime + * @property {google.protobuf.ITimestamp|null} [endTime] MaintenanceSchedule endTime + * @property {google.protobuf.ITimestamp|null} [scheduleDeadlineTime] MaintenanceSchedule scheduleDeadlineTime + */ - /** - * Constructs a new InstanceMessage. - * @memberof google.cloud.memcache.v1beta2.Instance - * @classdesc Represents an InstanceMessage. - * @implements IInstanceMessage - * @constructor - * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage=} [properties] Properties to set - */ - function InstanceMessage(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]]; - } + /** + * Constructs a new MaintenanceSchedule. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a MaintenanceSchedule. + * @implements IMaintenanceSchedule + * @constructor + * @param {google.cloud.memcache.v1beta2.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]]; + } - /** - * InstanceMessage code. - * @member {google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code} code - * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage - * @instance - */ - InstanceMessage.prototype.code = 0; + /** + * MaintenanceSchedule startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.memcache.v1beta2.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.startTime = null; - /** - * InstanceMessage message. - * @member {string} message - * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage - * @instance - */ - InstanceMessage.prototype.message = ""; + /** + * MaintenanceSchedule endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.memcache.v1beta2.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.endTime = null; - /** - * Creates a new InstanceMessage instance using the specified properties. - * @function create - * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage - * @static - * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage=} [properties] Properties to set - * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage instance - */ - InstanceMessage.create = function create(properties) { - return new InstanceMessage(properties); - }; + /** + * MaintenanceSchedule scheduleDeadlineTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduleDeadlineTime + * @memberof google.cloud.memcache.v1beta2.MaintenanceSchedule + * @instance + */ + MaintenanceSchedule.prototype.scheduleDeadlineTime = null; + + /** + * Creates a new MaintenanceSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.MaintenanceSchedule + * @static + * @param {google.cloud.memcache.v1beta2.IMaintenanceSchedule=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.MaintenanceSchedule} MaintenanceSchedule instance + */ + MaintenanceSchedule.create = function create(properties) { + return new MaintenanceSchedule(properties); + }; - /** - * Encodes the specified InstanceMessage message. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify|verify} messages. - * @function encode - * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage - * @static - * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage} message InstanceMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - return writer; - }; + /** + * Encodes the specified MaintenanceSchedule message. Does not implicitly {@link google.cloud.memcache.v1beta2.MaintenanceSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.MaintenanceSchedule + * @static + * @param {google.cloud.memcache.v1beta2.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.scheduleDeadlineTime != null && Object.hasOwnProperty.call(message, "scheduleDeadlineTime")) + $root.google.protobuf.Timestamp.encode(message.scheduleDeadlineTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified InstanceMessage message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.Instance.InstanceMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage - * @static - * @param {google.cloud.memcache.v1beta2.Instance.IInstanceMessage} message InstanceMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified MaintenanceSchedule message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.MaintenanceSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.MaintenanceSchedule + * @static + * @param {google.cloud.memcache.v1beta2.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 an InstanceMessage message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceMessage.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.memcache.v1beta2.Instance.InstanceMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.MaintenanceSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.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.memcache.v1beta2.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; } - } - return message; - }; - - /** - * Decodes an InstanceMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceMessage message. - * @function verify - * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - switch (message.code) { - default: - return "code: enum value expected"; - case 0: - case 1: + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - return null; - }; - - /** - * Creates an InstanceMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.memcache.v1beta2.Instance.InstanceMessage} InstanceMessage - */ - InstanceMessage.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage) - return object; - var message = new $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage(); - switch (object.code) { - default: - if (typeof object.code === "number") { - message.code = object.code; + case 4: { + message.scheduleDeadlineTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - break; - case "CODE_UNSPECIFIED": - case 0: - message.code = 0; - break; - case "ZONE_DISTRIBUTION_UNBALANCED": - case 1: - message.code = 1; + default: + reader.skipType(tag & 7); break; } - if (object.message != null) - message.message = String(object.message); - return message; - }; + } + return message; + }; - /** - * Creates a plain object from an InstanceMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage - * @static - * @param {google.cloud.memcache.v1beta2.Instance.InstanceMessage} message InstanceMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = options.enums === String ? $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code[message.code] === undefined ? message.code : $root.google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code[message.code] : message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - return object; - }; + /** + * Decodes a MaintenanceSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.MaintenanceSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.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()); + }; - /** - * Converts this InstanceMessage to JSON. - * @function toJSON - * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage - * @instance - * @returns {Object.} JSON object - */ - InstanceMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a MaintenanceSchedule message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.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.scheduleDeadlineTime != null && message.hasOwnProperty("scheduleDeadlineTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduleDeadlineTime); + if (error) + return "scheduleDeadlineTime." + error; + } + return null; + }; - /** - * Gets the default type url for InstanceMessage - * @function getTypeUrl - * @memberof google.cloud.memcache.v1beta2.Instance.InstanceMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.memcache.v1beta2.Instance.InstanceMessage"; - }; + /** + * Creates a MaintenanceSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.MaintenanceSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.MaintenanceSchedule} MaintenanceSchedule + */ + MaintenanceSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.MaintenanceSchedule) + return object; + var message = new $root.google.cloud.memcache.v1beta2.MaintenanceSchedule(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.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.memcache.v1beta2.MaintenanceSchedule.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.scheduleDeadlineTime != null) { + if (typeof object.scheduleDeadlineTime !== "object") + throw TypeError(".google.cloud.memcache.v1beta2.MaintenanceSchedule.scheduleDeadlineTime: object expected"); + message.scheduleDeadlineTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleDeadlineTime); + } + return message; + }; - /** - * Code enum. - * @name google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code - * @enum {number} - * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value - * @property {number} ZONE_DISTRIBUTION_UNBALANCED=1 ZONE_DISTRIBUTION_UNBALANCED value - */ - InstanceMessage.Code = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ZONE_DISTRIBUTION_UNBALANCED"] = 1; - return values; - })(); + /** + * Creates a plain object from a MaintenanceSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.MaintenanceSchedule + * @static + * @param {google.cloud.memcache.v1beta2.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.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.scheduleDeadlineTime != null && message.hasOwnProperty("scheduleDeadlineTime")) + object.scheduleDeadlineTime = $root.google.protobuf.Timestamp.toObject(message.scheduleDeadlineTime, options); + return object; + }; - return InstanceMessage; - })(); + /** + * Converts this MaintenanceSchedule to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.MaintenanceSchedule + * @instance + * @returns {Object.} JSON object + */ + MaintenanceSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * State enum. - * @name google.cloud.memcache.v1beta2.Instance.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - * @property {number} DELETING=4 DELETING value - * @property {number} PERFORMING_MAINTENANCE=5 PERFORMING_MAINTENANCE value + * Gets the default type url for MaintenanceSchedule + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.MaintenanceSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - Instance.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "PERFORMING_MAINTENANCE"] = 5; - return values; - })(); + MaintenanceSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.MaintenanceSchedule"; + }; - return Instance; + return MaintenanceSchedule; })(); v1beta2.ListInstancesRequest = (function() { @@ -7966,52 +10638,354 @@ }; /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.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 DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v1beta2.RescheduleMaintenanceRequest = (function() { + + /** + * Properties of a RescheduleMaintenanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @interface IRescheduleMaintenanceRequest + * @property {string|null} [instance] RescheduleMaintenanceRequest instance + * @property {google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType|null} [rescheduleType] RescheduleMaintenanceRequest rescheduleType + * @property {google.protobuf.ITimestamp|null} [scheduleTime] RescheduleMaintenanceRequest scheduleTime + */ + + /** + * Constructs a new RescheduleMaintenanceRequest. + * @memberof google.cloud.memcache.v1beta2 + * @classdesc Represents a RescheduleMaintenanceRequest. + * @implements IRescheduleMaintenanceRequest + * @constructor + * @param {google.cloud.memcache.v1beta2.IRescheduleMaintenanceRequest=} [properties] Properties to set + */ + function RescheduleMaintenanceRequest(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]]; + } + + /** + * RescheduleMaintenanceRequest instance. + * @member {string} instance + * @memberof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest + * @instance + */ + RescheduleMaintenanceRequest.prototype.instance = ""; + + /** + * RescheduleMaintenanceRequest rescheduleType. + * @member {google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType} rescheduleType + * @memberof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest + * @instance + */ + RescheduleMaintenanceRequest.prototype.rescheduleType = 0; + + /** + * RescheduleMaintenanceRequest scheduleTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduleTime + * @memberof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest + * @instance + */ + RescheduleMaintenanceRequest.prototype.scheduleTime = null; + + /** + * Creates a new RescheduleMaintenanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IRescheduleMaintenanceRequest=} [properties] Properties to set + * @returns {google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest} RescheduleMaintenanceRequest instance + */ + RescheduleMaintenanceRequest.create = function create(properties) { + return new RescheduleMaintenanceRequest(properties); + }; + + /** + * Encodes the specified RescheduleMaintenanceRequest message. Does not implicitly {@link google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IRescheduleMaintenanceRequest} message RescheduleMaintenanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RescheduleMaintenanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instance); + 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 RescheduleMaintenanceRequest message, length delimited. Does not implicitly {@link google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest + * @static + * @param {google.cloud.memcache.v1beta2.IRescheduleMaintenanceRequest} message RescheduleMaintenanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RescheduleMaintenanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RescheduleMaintenanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest} RescheduleMaintenanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.memcache.v1beta2.RescheduleMaintenanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.instance = reader.string(); + break; + } + case 2: { + message.rescheduleType = reader.int32(); + break; + } + case 3: { + message.scheduleTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RescheduleMaintenanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest} RescheduleMaintenanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RescheduleMaintenanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RescheduleMaintenanceRequest message. + * @function verify + * @memberof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RescheduleMaintenanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: 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 RescheduleMaintenanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest} RescheduleMaintenanceRequest + */ + RescheduleMaintenanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest) + return object; + var message = new $root.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + switch (object.rescheduleType) { + default: + if (typeof object.rescheduleType === "number") { + message.rescheduleType = object.rescheduleType; + break; + } + break; + 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.memcache.v1beta2.RescheduleMaintenanceRequest.scheduleTime: object expected"); + message.scheduleTime = $root.google.protobuf.Timestamp.fromObject(object.scheduleTime); + } + return message; + }; + + /** + * Creates a plain object from a RescheduleMaintenanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @memberof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest * @static - * @param {google.cloud.memcache.v1beta2.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest} message RescheduleMaintenanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteInstanceRequest.toObject = function toObject(message, options) { + RescheduleMaintenanceRequest.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; + if (options.defaults) { + object.instance = ""; + object.rescheduleType = options.enums === String ? "RESCHEDULE_TYPE_UNSPECIFIED" : 0; + object.scheduleTime = null; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.rescheduleType != null && message.hasOwnProperty("rescheduleType")) + object.rescheduleType = options.enums === String ? $root.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType[message.rescheduleType] === undefined ? message.rescheduleType : $root.google.cloud.memcache.v1beta2.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 DeleteInstanceRequest to JSON. + * Converts this RescheduleMaintenanceRequest to JSON. * @function toJSON - * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @memberof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest * @instance * @returns {Object.} JSON object */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { + RescheduleMaintenanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteInstanceRequest + * Gets the default type url for RescheduleMaintenanceRequest * @function getTypeUrl - * @memberof google.cloud.memcache.v1beta2.DeleteInstanceRequest + * @memberof google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RescheduleMaintenanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.memcache.v1beta2.DeleteInstanceRequest"; + return typeUrlPrefix + "/google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest"; }; - return DeleteInstanceRequest; + /** + * RescheduleType enum. + * @name google.cloud.memcache.v1beta2.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; })(); v1beta2.ApplyParametersRequest = (function() { @@ -8808,6 +11782,20 @@ return ApplySoftwareUpdateRequest; })(); + /** + * MemcacheVersion enum. + * @name google.cloud.memcache.v1beta2.MemcacheVersion + * @enum {number} + * @property {number} MEMCACHE_VERSION_UNSPECIFIED=0 MEMCACHE_VERSION_UNSPECIFIED value + * @property {number} MEMCACHE_1_5=1 MEMCACHE_1_5 value + */ + v1beta2.MemcacheVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEMCACHE_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEMCACHE_1_5"] = 1; + return values; + })(); + v1beta2.MemcacheParameters = (function() { /** @@ -9422,20 +12410,6 @@ return OperationMetadata; })(); - /** - * MemcacheVersion enum. - * @name google.cloud.memcache.v1beta2.MemcacheVersion - * @enum {number} - * @property {number} MEMCACHE_VERSION_UNSPECIFIED=0 MEMCACHE_VERSION_UNSPECIFIED value - * @property {number} MEMCACHE_1_5=1 MEMCACHE_1_5 value - */ - v1beta2.MemcacheVersion = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MEMCACHE_VERSION_UNSPECIFIED"] = 0; - values[valuesById[1] = "MEMCACHE_1_5"] = 1; - return values; - })(); - v1beta2.LocationMetadata = (function() { /** @@ -24497,6 +27471,317 @@ return rpc; })(); + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + /** + * DayOfWeek enum. + * @name google.type.DayOfWeek + * @enum {number} + * @property {number} DAY_OF_WEEK_UNSPECIFIED=0 DAY_OF_WEEK_UNSPECIFIED value + * @property {number} MONDAY=1 MONDAY value + * @property {number} TUESDAY=2 TUESDAY value + * @property {number} WEDNESDAY=3 WEDNESDAY value + * @property {number} THURSDAY=4 THURSDAY value + * @property {number} FRIDAY=5 FRIDAY value + * @property {number} SATURDAY=6 SATURDAY value + * @property {number} SUNDAY=7 SUNDAY value + */ + type.DayOfWeek = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONDAY"] = 1; + values[valuesById[2] = "TUESDAY"] = 2; + values[valuesById[3] = "WEDNESDAY"] = 3; + values[valuesById[4] = "THURSDAY"] = 4; + values[valuesById[5] = "FRIDAY"] = 5; + values[valuesById[6] = "SATURDAY"] = 6; + values[valuesById[7] = "SUNDAY"] = 7; + return values; + })(); + + type.TimeOfDay = (function() { + + /** + * Properties of a TimeOfDay. + * @memberof google.type + * @interface ITimeOfDay + * @property {number|null} [hours] TimeOfDay hours + * @property {number|null} [minutes] TimeOfDay minutes + * @property {number|null} [seconds] TimeOfDay seconds + * @property {number|null} [nanos] TimeOfDay nanos + */ + + /** + * Constructs a new TimeOfDay. + * @memberof google.type + * @classdesc Represents a TimeOfDay. + * @implements ITimeOfDay + * @constructor + * @param {google.type.ITimeOfDay=} [properties] Properties to set + */ + function TimeOfDay(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeOfDay hours. + * @member {number} hours + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.hours = 0; + + /** + * TimeOfDay minutes. + * @member {number} minutes + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.minutes = 0; + + /** + * TimeOfDay seconds. + * @member {number} seconds + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.seconds = 0; + + /** + * TimeOfDay nanos. + * @member {number} nanos + * @memberof google.type.TimeOfDay + * @instance + */ + TimeOfDay.prototype.nanos = 0; + + /** + * Creates a new TimeOfDay instance using the specified properties. + * @function create + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay=} [properties] Properties to set + * @returns {google.type.TimeOfDay} TimeOfDay instance + */ + TimeOfDay.create = function create(properties) { + return new TimeOfDay(properties); + }; + + /** + * Encodes the specified TimeOfDay message. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encode + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hours != null && Object.hasOwnProperty.call(message, "hours")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.hours); + if (message.minutes != null && Object.hasOwnProperty.call(message, "minutes")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minutes); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified TimeOfDay message, length delimited. Does not implicitly {@link google.type.TimeOfDay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.ITimeOfDay} message TimeOfDay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeOfDay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer. + * @function decode + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.TimeOfDay(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hours = reader.int32(); + break; + } + case 2: { + message.minutes = reader.int32(); + break; + } + case 3: { + message.seconds = reader.int32(); + break; + } + case 4: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeOfDay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.TimeOfDay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.TimeOfDay} TimeOfDay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeOfDay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeOfDay message. + * @function verify + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeOfDay.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hours != null && message.hasOwnProperty("hours")) + if (!$util.isInteger(message.hours)) + return "hours: integer expected"; + if (message.minutes != null && message.hasOwnProperty("minutes")) + if (!$util.isInteger(message.minutes)) + return "minutes: integer expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a TimeOfDay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.TimeOfDay + * @static + * @param {Object.} object Plain object + * @returns {google.type.TimeOfDay} TimeOfDay + */ + TimeOfDay.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.TimeOfDay) + return object; + var message = new $root.google.type.TimeOfDay(); + if (object.hours != null) + message.hours = object.hours | 0; + if (object.minutes != null) + message.minutes = object.minutes | 0; + if (object.seconds != null) + message.seconds = object.seconds | 0; + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a TimeOfDay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.TimeOfDay + * @static + * @param {google.type.TimeOfDay} message TimeOfDay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeOfDay.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.hours = 0; + object.minutes = 0; + object.seconds = 0; + object.nanos = 0; + } + if (message.hours != null && message.hasOwnProperty("hours")) + object.hours = message.hours; + if (message.minutes != null && message.hasOwnProperty("minutes")) + object.minutes = message.minutes; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this TimeOfDay to JSON. + * @function toJSON + * @memberof google.type.TimeOfDay + * @instance + * @returns {Object.} JSON object + */ + TimeOfDay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeOfDay + * @function getTypeUrl + * @memberof google.type.TimeOfDay + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeOfDay.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.TimeOfDay"; + }; + + return TimeOfDay; + })(); + + return type; + })(); + return google; })(); diff --git a/packages/google-cloud-memcache/protos/protos.json b/packages/google-cloud-memcache/protos/protos.json index c2caeed30cd..983de7d59e6 100644 --- a/packages/google-cloud-memcache/protos/protos.json +++ b/packages/google-cloud-memcache/protos/protos.json @@ -193,6 +193,34 @@ } } ] + }, + "RescheduleMaintenance": { + "requestType": "RescheduleMaintenanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{instance=projects/*/locations/*/instances/*}:rescheduleMaintenance", + "(google.api.http).body": "*", + "(google.api.method_signature)": "instance, reschedule_type, schedule_time", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{instance=projects/*/locations/*/instances/*}:rescheduleMaintenance", + "body": "*" + } + }, + { + "(google.api.method_signature)": "instance, reschedule_type, schedule_time" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1.Instance", + "metadata_type": "google.cloud.memcache.v1.OperationMetadata" + } + } + ] } } }, @@ -296,9 +324,30 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "maintenancePolicy": { + "type": "MaintenancePolicy", + "id": 21 + }, + "maintenanceSchedule": { + "type": "MaintenanceSchedule", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "UPDATING": 3, + "DELETING": 4, + "PERFORMING_MAINTENANCE": 5 + } + }, "NodeConfig": { "fields": { "cpuCount": { @@ -390,14 +439,118 @@ } } } + } + } + }, + "MaintenancePolicy": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "State": { + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "weeklyMaintenanceWindow": { + "rule": "repeated", + "type": "WeeklyMaintenanceWindow", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "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)": "REQUIRED" + } + } + } + }, + "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" + } + }, + "scheduleDeadlineTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "RescheduleMaintenanceRequest": { + "fields": { + "instance": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + }, + "rescheduleType": { + "type": "RescheduleType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scheduleTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + }, + "nested": { + "RescheduleType": { "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2, - "DELETING": 4, - "PERFORMING_MAINTENANCE": 5 + "RESCHEDULE_TYPE_UNSPECIFIED": 0, + "IMMEDIATE": 1, + "NEXT_AVAILABLE_WINDOW": 2, + "SPECIFIC_TIME": 3 } } } @@ -560,6 +713,12 @@ } } }, + "MemcacheVersion": { + "values": { + "MEMCACHE_VERSION_UNSPECIFIED": 0, + "MEMCACHE_1_5": 1 + } + }, "MemcacheParameters": { "fields": { "id": { @@ -629,11 +788,20 @@ } } }, - "MemcacheVersion": { - "values": { - "MEMCACHE_VERSION_UNSPECIFIED": 0, - "MEMCACHE_1_5": 1 + "LocationMetadata": { + "fields": { + "availableZones": { + "keyType": "string", + "type": "ZoneMetadata", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } } + }, + "ZoneMetadata": { + "fields": {} } } }, @@ -852,6 +1020,34 @@ } } ] + }, + "RescheduleMaintenance": { + "requestType": "RescheduleMaintenanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta2/{instance=projects/*/locations/*/instances/*}:rescheduleMaintenance", + "(google.api.http).body": "*", + "(google.api.method_signature)": "instance, reschedule_type, schedule_time", + "(google.longrunning.operation_info).response_type": "google.cloud.memcache.v1beta2.Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta2/{instance=projects/*/locations/*/instances/*}:rescheduleMaintenance", + "body": "*" + } + }, + { + "(google.api.method_signature)": "instance, reschedule_type, schedule_time" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.memcache.v1beta2.Instance", + "metadata_type": "google.cloud.memcache.v1beta2.OperationMetadata" + } + } + ] } } }, @@ -962,9 +1158,30 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "maintenancePolicy": { + "type": "MaintenancePolicy", + "id": 22 + }, + "maintenanceSchedule": { + "type": "MaintenanceSchedule", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "UPDATING": 3, + "DELETING": 4, + "PERFORMING_MAINTENANCE": 5 + } + }, "NodeConfig": { "fields": { "cpuCount": { @@ -1063,14 +1280,85 @@ } } } + } + } + }, + "MaintenancePolicy": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2, - "DELETING": 4, - "PERFORMING_MAINTENANCE": 5 + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 3 + }, + "weeklyMaintenanceWindow": { + "rule": "repeated", + "type": "WeeklyMaintenanceWindow", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "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)": "REQUIRED" + } + } + } + }, + "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" + } + }, + "scheduleDeadlineTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" } } } @@ -1189,6 +1477,39 @@ } } }, + "RescheduleMaintenanceRequest": { + "fields": { + "instance": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "memcache.googleapis.com/Instance" + } + }, + "rescheduleType": { + "type": "RescheduleType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scheduleTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + }, + "nested": { + "RescheduleType": { + "values": { + "RESCHEDULE_TYPE_UNSPECIFIED": 0, + "IMMEDIATE": 1, + "NEXT_AVAILABLE_WINDOW": 2, + "SPECIFIC_TIME": 3 + } + } + } + }, "ApplyParametersRequest": { "fields": { "name": { @@ -1254,6 +1575,12 @@ } } }, + "MemcacheVersion": { + "values": { + "MEMCACHE_VERSION_UNSPECIFIED": 0, + "MEMCACHE_1_5": 1 + } + }, "MemcacheParameters": { "fields": { "id": { @@ -1323,12 +1650,6 @@ } } }, - "MemcacheVersion": { - "values": { - "MEMCACHE_VERSION_UNSPECIFIED": 0, - "MEMCACHE_1_5": 1 - } - }, "LocationMetadata": { "fields": { "availableZones": { @@ -2785,6 +3106,50 @@ } } } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/timeofday;timeofday", + "java_multiple_files": true, + "java_outer_classname": "TimeOfDayProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP", + "cc_enable_arenas": true + }, + "nested": { + "DayOfWeek": { + "values": { + "DAY_OF_WEEK_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7 + } + }, + "TimeOfDay": { + "fields": { + "hours": { + "type": "int32", + "id": 1 + }, + "minutes": { + "type": "int32", + "id": 2 + }, + "seconds": { + "type": "int32", + "id": 3 + }, + "nanos": { + "type": "int32", + "id": 4 + } + } + } + } } } } diff --git a/packages/google-cloud-memcache/samples/README.md b/packages/google-cloud-memcache/samples/README.md index e063dd9547e..4c8917a7fcb 100644 --- a/packages/google-cloud-memcache/samples/README.md +++ b/packages/google-cloud-memcache/samples/README.md @@ -17,6 +17,7 @@ * [Cloud_memcache.delete_instance](#cloud_memcache.delete_instance) * [Cloud_memcache.get_instance](#cloud_memcache.get_instance) * [Cloud_memcache.list_instances](#cloud_memcache.list_instances) + * [Cloud_memcache.reschedule_maintenance](#cloud_memcache.reschedule_maintenance) * [Cloud_memcache.update_instance](#cloud_memcache.update_instance) * [Cloud_memcache.update_parameters](#cloud_memcache.update_parameters) * [Cloud_memcache.apply_parameters](#cloud_memcache.apply_parameters) @@ -25,6 +26,7 @@ * [Cloud_memcache.delete_instance](#cloud_memcache.delete_instance) * [Cloud_memcache.get_instance](#cloud_memcache.get_instance) * [Cloud_memcache.list_instances](#cloud_memcache.list_instances) + * [Cloud_memcache.reschedule_maintenance](#cloud_memcache.reschedule_maintenance) * [Cloud_memcache.update_instance](#cloud_memcache.update_instance) * [Cloud_memcache.update_parameters](#cloud_memcache.update_parameters) * [Quickstart](#quickstart) @@ -130,6 +132,23 @@ __Usage:__ +### Cloud_memcache.reschedule_maintenance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.reschedule_maintenance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.reschedule_maintenance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.reschedule_maintenance.js` + + +----- + + + + ### Cloud_memcache.update_instance View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.update_instance.js). @@ -266,6 +285,23 @@ __Usage:__ +### Cloud_memcache.reschedule_maintenance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.reschedule_maintenance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.reschedule_maintenance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.reschedule_maintenance.js` + + +----- + + + + ### Cloud_memcache.update_instance View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.update_instance.js). diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js index 0ea4aa54a92..f243efd6f4a 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.apply_parameters.js @@ -34,13 +34,13 @@ function main(name) { */ // const name = 'abc123' /** - * Nodes to which we should apply the instance-level parameter group. + * Nodes to which the instance-level parameter group is applied. */ // const nodeIds = 'abc123' /** * Whether to apply instance-level parameter group to all nodes. If set to - * true, will explicitly restrict users from specifying any nodes, and apply - * parameter group updates to all nodes within the instance. + * true, users are restricted from specifying individual nodes, and + * `ApplyParameters` updates all nodes within the instance. */ // const applyAll = true diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js index 86daa874036..c5adf955d5b 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.create_instance.js @@ -41,8 +41,8 @@ function main(parent, instanceId, instance) { * * Must start with a letter. * * Must be between 1-40 characters. * * Must end with a number or a letter. - * * Must be unique within the user project / location - * If any of the above are not met, will raise an invalid argument error. + * * Must be unique within the user project / location. + * If any of the above are not met, the API raises an invalid argument error. */ // const instanceId = 'abc123' /** diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js index c0518a8c2f4..17afcfe122b 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.list_instances.js @@ -37,20 +37,19 @@ function main(parent) { /** * The maximum number of items to return. * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * next_page_token CloudMemcache.ListInstancesResponse.next_page_token + * Regardless of the `page_size` value, the response may include a partial + * list and a caller should only rely on response's + * `next_page_token` google.cloud.memcache.v1.ListInstancesResponse.next_page_token * to determine if there are more instances left to be queried. */ // const pageSize = 1234 /** - * The next_page_token value returned from a previous List request, - * if any. + * The `next_page_token` value returned from a previous List request, if any. */ // const pageToken = 'abc123' /** * List filter. For example, exclude all Memcached instances with name as - * my-instance by specifying "name != my-instance". + * my-instance by specifying `"name != my-instance"`. */ // const filter = 'abc123' /** diff --git a/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.reschedule_maintenance.js b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.reschedule_maintenance.js new file mode 100644 index 00000000000..263281099f8 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1/cloud_memcache.reschedule_maintenance.js @@ -0,0 +1,75 @@ +// 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(instance, rescheduleType) { + // [START memcache_v1_generated_CloudMemcache_RescheduleMaintenance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Memcache instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + */ + // const instance = 'abc123' + /** + * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + */ + // const rescheduleType = {} + /** + * 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 Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callRescheduleMaintenance() { + // Construct request + const request = { + instance, + rescheduleType, + }; + + // Run request + const [operation] = await memcacheClient.rescheduleMaintenance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRescheduleMaintenance(); + // [END memcache_v1_generated_CloudMemcache_RescheduleMaintenance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json index 631bf57b685..dd7d7ab2098 100644 --- a/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json +++ b/packages/google-cloud-memcache/samples/generated/v1/snippet_metadata.google.cloud.memcache.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 80, + "end": 79, "type": "FULL" } ], @@ -203,7 +203,7 @@ "regionTag": "memcache_v1_generated_CloudMemcache_UpdateParameters_async", "title": "CloudMemcache updateParameters Sample", "origin": "API_DEFINITION", - "description": " Updates the defined Memcached Parameters for an existing Instance. This method only stages the parameters, it must be followed by ApplyParameters to apply the parameters to nodes of the Memcached Instance.", + "description": " Updates the defined Memcached parameters for an existing instance. This method only stages the parameters, it must be followed by `ApplyParameters` to apply the parameters to nodes of the Memcached instance.", "canonical": true, "file": "cloud_memcache.update_parameters.js", "language": "JAVASCRIPT", @@ -291,7 +291,7 @@ "regionTag": "memcache_v1_generated_CloudMemcache_ApplyParameters_async", "title": "CloudMemcache applyParameters Sample", "origin": "API_DEFINITION", - "description": " ApplyParameters will restart the set of specified nodes in order to update them to the current set of parameters for the Memcached Instance.", + "description": " `ApplyParameters` restarts the set of specified nodes in order to update them to the current set of parameters for the Memcached Instance.", "canonical": true, "file": "cloud_memcache.apply_parameters.js", "language": "JAVASCRIPT", @@ -334,6 +334,54 @@ } } } + }, + { + "regionTag": "memcache_v1_generated_CloudMemcache_RescheduleMaintenance_async", + "title": "CloudMemcache rescheduleMaintenance Sample", + "origin": "API_DEFINITION", + "description": " Reschedules upcoming maintenance event.", + "canonical": true, + "file": "cloud_memcache.reschedule_maintenance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RescheduleMaintenance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.RescheduleMaintenance", + "async": true, + "parameters": [ + { + "name": "instance", + "type": "TYPE_STRING" + }, + { + "name": "reschedule_type", + "type": ".google.cloud.memcache.v1.RescheduleMaintenanceRequest.RescheduleType" + }, + { + "name": "schedule_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1.CloudMemcacheClient" + }, + "method": { + "shortName": "RescheduleMaintenance", + "fullName": "google.cloud.memcache.v1.CloudMemcache.RescheduleMaintenance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1.CloudMemcache" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.reschedule_maintenance.js b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.reschedule_maintenance.js new file mode 100644 index 00000000000..64ed9dd8729 --- /dev/null +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/cloud_memcache.reschedule_maintenance.js @@ -0,0 +1,75 @@ +// 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(instance, rescheduleType) { + // [START memcache_v1beta2_generated_CloudMemcache_RescheduleMaintenance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Memcache instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * where `location_id` refers to a GCP region. + */ + // const instance = 'abc123' + /** + * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + */ + // const rescheduleType = {} + /** + * 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 Memcache library + const {CloudMemcacheClient} = require('@google-cloud/memcache').v1beta2; + + // Instantiates a client + const memcacheClient = new CloudMemcacheClient(); + + async function callRescheduleMaintenance() { + // Construct request + const request = { + instance, + rescheduleType, + }; + + // Run request + const [operation] = await memcacheClient.rescheduleMaintenance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRescheduleMaintenance(); + // [END memcache_v1beta2_generated_CloudMemcache_RescheduleMaintenance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json index ab1bdd505d6..f8f0622729a 100644 --- a/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json +++ b/packages/google-cloud-memcache/samples/generated/v1beta2/snippet_metadata.google.cloud.memcache.v1beta2.json @@ -382,6 +382,54 @@ } } } + }, + { + "regionTag": "memcache_v1beta2_generated_CloudMemcache_RescheduleMaintenance_async", + "title": "CloudMemcache rescheduleMaintenance Sample", + "origin": "API_DEFINITION", + "description": " Performs the apply phase of the RescheduleMaintenance verb.", + "canonical": true, + "file": "cloud_memcache.reschedule_maintenance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RescheduleMaintenance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.RescheduleMaintenance", + "async": true, + "parameters": [ + { + "name": "instance", + "type": "TYPE_STRING" + }, + { + "name": "reschedule_type", + "type": ".google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType" + }, + { + "name": "schedule_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudMemcacheClient", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcacheClient" + }, + "method": { + "shortName": "RescheduleMaintenance", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache.RescheduleMaintenance", + "service": { + "shortName": "CloudMemcache", + "fullName": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts index 00f877309a4..ddb3b7bde31 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client.ts @@ -27,6 +27,8 @@ import type { LROperation, PaginationCallback, GaxCall, + LocationsClient, + LocationProtos, } from 'google-gax'; import {Transform} from 'stream'; import * as protos from '../../protos/protos'; @@ -75,6 +77,7 @@ export class CloudMemcacheClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; cloudMemcacheStub?: Promise<{[name: string]: Function}>; @@ -137,6 +140,9 @@ export class CloudMemcacheClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -169,6 +175,10 @@ export class CloudMemcacheClient { if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; @@ -221,7 +231,33 @@ export class CloudMemcacheClient { }; if (opts.fallback === 'rest') { lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = []; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; } this.operationsClient = this._gaxModule .lro(lroOptions) @@ -256,6 +292,12 @@ export class CloudMemcacheClient { const applyParametersMetadata = protoFilesRoot.lookup( '.google.cloud.memcache.v1.OperationMetadata' ) as gax.protobuf.Type; + const rescheduleMaintenanceResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.Instance' + ) as gax.protobuf.Type; + const rescheduleMaintenanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createInstance: new this._gaxModule.LongrunningDescriptor( @@ -283,6 +325,13 @@ export class CloudMemcacheClient { applyParametersResponse.decode.bind(applyParametersResponse), applyParametersMetadata.decode.bind(applyParametersMetadata) ), + rescheduleMaintenance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + rescheduleMaintenanceResponse.decode.bind( + rescheduleMaintenanceResponse + ), + rescheduleMaintenanceMetadata.decode.bind(rescheduleMaintenanceMetadata) + ), }; // Put together the default options sent with requests. @@ -342,6 +391,7 @@ export class CloudMemcacheClient { 'updateParameters', 'deleteInstance', 'applyParameters', + 'rescheduleMaintenance', ]; for (const methodName of cloudMemcacheStubMethods) { const callPromise = this.cloudMemcacheStub.then( @@ -533,9 +583,9 @@ export class CloudMemcacheClient { * * Must start with a letter. * * Must be between 1-40 characters. * * Must end with a number or a letter. - * * Must be unique within the user project / location + * * Must be unique within the user project / location. * - * If any of the above are not met, will raise an invalid argument error. + * If any of the above are not met, the API raises an invalid argument error. * @param {google.cloud.memcache.v1.Instance} request.instance * Required. A Memcached Instance * @param {object} [options] @@ -676,6 +726,7 @@ export class CloudMemcacheClient { * The request object that will be sent. * @param {google.protobuf.FieldMask} request.updateMask * Required. Mask of fields to update. + * * * `displayName` * @param {google.cloud.memcache.v1.Instance} request.instance * Required. A Memcached Instance. @@ -812,9 +863,10 @@ export class CloudMemcacheClient { >; } /** - * Updates the defined Memcached Parameters for an existing Instance. + * Updates the defined Memcached parameters for an existing instance. * This method only stages the parameters, it must be followed by - * ApplyParameters to apply the parameters to nodes of the Memcached Instance. + * `ApplyParameters` to apply the parameters to nodes of the Memcached + * instance. * * @param {Object} request * The request object that will be sent. @@ -1097,7 +1149,7 @@ export class CloudMemcacheClient { >; } /** - * ApplyParameters will restart the set of specified nodes in order to update + * `ApplyParameters` restarts the set of specified nodes in order to update * them to the current set of parameters for the Memcached Instance. * * @param {Object} request @@ -1106,11 +1158,11 @@ export class CloudMemcacheClient { * Required. Resource name of the Memcached instance for which parameter group updates * should be applied. * @param {string[]} request.nodeIds - * Nodes to which we should apply the instance-level parameter group. + * Nodes to which the instance-level parameter group is applied. * @param {boolean} request.applyAll * Whether to apply instance-level parameter group to all nodes. If set to - * true, will explicitly restrict users from specifying any nodes, and apply - * parameter group updates to all nodes within the instance. + * true, users are restricted from specifying individual nodes, and + * `ApplyParameters` updates all nodes within the instance. * @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. @@ -1242,6 +1294,152 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1.OperationMetadata >; } + /** + * Reschedules upcoming maintenance event. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Required. Memcache 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.memcache.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 + * 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_memcache.reschedule_maintenance.js + * region_tag:memcache_v1_generated_CloudMemcache_RescheduleMaintenance_async + */ + rescheduleMaintenance( + request?: protos.google.cloud.memcache.v1.IRescheduleMaintenanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + rescheduleMaintenance( + request: protos.google.cloud.memcache.v1.IRescheduleMaintenanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rescheduleMaintenance( + request: protos.google.cloud.memcache.v1.IRescheduleMaintenanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rescheduleMaintenance( + request?: protos.google.cloud.memcache.v1.IRescheduleMaintenanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.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'] = + this._gaxModule.routingHeader.fromParams({ + instance: request.instance ?? '', + }); + 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_memcache.reschedule_maintenance.js + * region_tag:memcache_v1_generated_CloudMemcache_RescheduleMaintenance_async + */ + async checkRescheduleMaintenanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.rescheduleMaintenance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1.Instance, + protos.google.cloud.memcache.v1.OperationMetadata + >; + } /** * Lists Instances in a given location. * @@ -1255,16 +1453,15 @@ export class CloudMemcacheClient { * The maximum number of items to return. * * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * Regardless of the `page_size` value, the response may include a partial + * list and a caller should only rely on response's + * {@link google.cloud.memcache.v1.ListInstancesResponse.next_page_token|`next_page_token`} * to determine if there are more instances left to be queried. * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, - * if any. + * The `next_page_token` value returned from a previous List request, if any. * @param {string} request.filter * List filter. For example, exclude all Memcached instances with name as - * my-instance by specifying "name != my-instance". + * my-instance by specifying `"name != my-instance"`. * @param {string} request.orderBy * Sort results. Supported values are "name", "name desc" or "" (unsorted). * @param {object} [options] @@ -1361,16 +1558,15 @@ export class CloudMemcacheClient { * The maximum number of items to return. * * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * Regardless of the `page_size` value, the response may include a partial + * list and a caller should only rely on response's + * {@link google.cloud.memcache.v1.ListInstancesResponse.next_page_token|`next_page_token`} * to determine if there are more instances left to be queried. * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, - * if any. + * The `next_page_token` value returned from a previous List request, if any. * @param {string} request.filter * List filter. For example, exclude all Memcached instances with name as - * my-instance by specifying "name != my-instance". + * my-instance by specifying `"name != my-instance"`. * @param {string} request.orderBy * Sort results. Supported values are "name", "name desc" or "" (unsorted). * @param {object} [options] @@ -1421,16 +1617,15 @@ export class CloudMemcacheClient { * The maximum number of items to return. * * If not specified, a default value of 1000 will be used by the service. - * Regardless of the page_size value, the response may include a partial list - * and a caller should only rely on response's - * {@link CloudMemcache.ListInstancesResponse.next_page_token|next_page_token} + * Regardless of the `page_size` value, the response may include a partial + * list and a caller should only rely on response's + * {@link google.cloud.memcache.v1.ListInstancesResponse.next_page_token|`next_page_token`} * to determine if there are more instances left to be queried. * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, - * if any. + * The `next_page_token` value returned from a previous List request, if any. * @param {string} request.filter * List filter. For example, exclude all Memcached instances with name as - * my-instance by specifying "name != my-instance". + * my-instance by specifying `"name != my-instance"`. * @param {string} request.orderBy * Sort results. Supported values are "name", "name desc" or "" (unsorted). * @param {object} [options] @@ -1467,6 +1662,263 @@ export class CloudMemcacheClient { callSettings ) as AsyncIterable; } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- @@ -1567,6 +2019,7 @@ export class CloudMemcacheClient { return this.cloudMemcacheStub.then(stub => { this._terminated = true; stub.close(); + this.locationsClient.close(); this.operationsClient.close(); }); } diff --git a/packages/google-cloud-memcache/src/v1/cloud_memcache_client_config.json b/packages/google-cloud-memcache/src/v1/cloud_memcache_client_config.json index 93395ae4fd3..6703aba61f7 100644 --- a/packages/google-cloud-memcache/src/v1/cloud_memcache_client_config.json +++ b/packages/google-cloud-memcache/src/v1/cloud_memcache_client_config.json @@ -54,6 +54,11 @@ "timeout_millis": 1200000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "RescheduleMaintenance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-memcache/src/v1/gapic_metadata.json b/packages/google-cloud-memcache/src/v1/gapic_metadata.json index dba038c2360..9ac5b347836 100644 --- a/packages/google-cloud-memcache/src/v1/gapic_metadata.json +++ b/packages/google-cloud-memcache/src/v1/gapic_metadata.json @@ -40,6 +40,11 @@ "applyParameters" ] }, + "RescheduleMaintenance": { + "methods": [ + "rescheduleMaintenance" + ] + }, "ListInstances": { "methods": [ "listInstances", @@ -82,6 +87,11 @@ "applyParameters" ] }, + "RescheduleMaintenance": { + "methods": [ + "rescheduleMaintenance" + ] + }, "ListInstances": { "methods": [ "listInstances", diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts index 4f1dbf3c923..b7b8abd6e85 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client.ts @@ -27,6 +27,8 @@ import type { LROperation, PaginationCallback, GaxCall, + LocationsClient, + LocationProtos, } from 'google-gax'; import {Transform} from 'stream'; import * as protos from '../../protos/protos'; @@ -75,6 +77,7 @@ export class CloudMemcacheClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; cloudMemcacheStub?: Promise<{[name: string]: Function}>; @@ -137,6 +140,9 @@ export class CloudMemcacheClient { (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { opts['scopes'] = staticMembers.scopes; @@ -169,6 +175,10 @@ export class CloudMemcacheClient { if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; @@ -288,6 +298,12 @@ export class CloudMemcacheClient { const applySoftwareUpdateMetadata = protoFilesRoot.lookup( '.google.cloud.memcache.v1beta2.OperationMetadata' ) as gax.protobuf.Type; + const rescheduleMaintenanceResponse = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.Instance' + ) as gax.protobuf.Type; + const rescheduleMaintenanceMetadata = protoFilesRoot.lookup( + '.google.cloud.memcache.v1beta2.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createInstance: new this._gaxModule.LongrunningDescriptor( @@ -320,6 +336,13 @@ export class CloudMemcacheClient { applySoftwareUpdateResponse.decode.bind(applySoftwareUpdateResponse), applySoftwareUpdateMetadata.decode.bind(applySoftwareUpdateMetadata) ), + rescheduleMaintenance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + rescheduleMaintenanceResponse.decode.bind( + rescheduleMaintenanceResponse + ), + rescheduleMaintenanceMetadata.decode.bind(rescheduleMaintenanceMetadata) + ), }; // Put together the default options sent with requests. @@ -380,6 +403,7 @@ export class CloudMemcacheClient { 'deleteInstance', 'applyParameters', 'applySoftwareUpdate', + 'rescheduleMaintenance', ]; for (const methodName of cloudMemcacheStubMethods) { const callPromise = this.cloudMemcacheStub.then( @@ -720,6 +744,7 @@ export class CloudMemcacheClient { * The request object that will be sent. * @param {google.protobuf.FieldMask} request.updateMask * Required. Mask of fields to update. + * * * `displayName` * @param {google.cloud.memcache.v1beta2.Instance} request.resource * Required. A Memcached [Instance] resource. @@ -1433,6 +1458,152 @@ export class CloudMemcacheClient { protos.google.cloud.memcache.v1beta2.OperationMetadata >; } + /** + * Performs the apply phase of the RescheduleMaintenance verb. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Required. Memcache 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.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType} request.rescheduleType + * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + * @param {google.protobuf.Timestamp} request.scheduleTime + * 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/v1beta2/cloud_memcache.reschedule_maintenance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_RescheduleMaintenance_async + */ + rescheduleMaintenance( + request?: protos.google.cloud.memcache.v1beta2.IRescheduleMaintenanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + rescheduleMaintenance( + request: protos.google.cloud.memcache.v1beta2.IRescheduleMaintenanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rescheduleMaintenance( + request: protos.google.cloud.memcache.v1beta2.IRescheduleMaintenanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + rescheduleMaintenance( + request?: protos.google.cloud.memcache.v1beta2.IRescheduleMaintenanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.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'] = + this._gaxModule.routingHeader.fromParams({ + instance: request.instance ?? '', + }); + 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/v1beta2/cloud_memcache.reschedule_maintenance.js + * region_tag:memcache_v1beta2_generated_CloudMemcache_RescheduleMaintenance_async + */ + async checkRescheduleMaintenanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.rescheduleMaintenance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.memcache.v1beta2.Instance, + protos.google.cloud.memcache.v1beta2.OperationMetadata + >; + } /** * Lists Instances in a given location. * @@ -1661,6 +1832,263 @@ export class CloudMemcacheClient { callSettings ) as AsyncIterable; } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- @@ -1761,6 +2189,7 @@ export class CloudMemcacheClient { return this.cloudMemcacheStub.then(stub => { this._terminated = true; stub.close(); + this.locationsClient.close(); this.operationsClient.close(); }); } diff --git a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json index c3d3b2ae69b..efab044ce2f 100644 --- a/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json +++ b/packages/google-cloud-memcache/src/v1beta2/cloud_memcache_client_config.json @@ -59,6 +59,11 @@ "timeout_millis": 1200000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "RescheduleMaintenance": { + "timeout_millis": 1200000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json b/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json index e6f17d63c4c..a1b142ce36e 100644 --- a/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json +++ b/packages/google-cloud-memcache/src/v1beta2/gapic_metadata.json @@ -45,6 +45,11 @@ "applySoftwareUpdate" ] }, + "RescheduleMaintenance": { + "methods": [ + "rescheduleMaintenance" + ] + }, "ListInstances": { "methods": [ "listInstances", @@ -92,6 +97,11 @@ "applySoftwareUpdate" ] }, + "RescheduleMaintenance": { + "methods": [ + "rescheduleMaintenance" + ] + }, "ListInstances": { "methods": [ "listInstances", diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts index 16220391357..c61efd08275 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1.ts @@ -25,7 +25,12 @@ import * as cloudmemcacheModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation, operationsProtos} from 'google-gax'; +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -1363,6 +1368,203 @@ describe('v1.CloudMemcacheClient', () => { }); }); + describe('rescheduleMaintenance', () => { + it('invokes rescheduleMaintenance without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.RescheduleMaintenanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.RescheduleMaintenanceRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; + 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); + const actualRequest = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rescheduleMaintenance without error using callback', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.RescheduleMaintenanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.RescheduleMaintenanceRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; + 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.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1.IInstance, + protos.google.cloud.memcache.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rescheduleMaintenance with call error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.RescheduleMaintenanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.RescheduleMaintenanceRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rescheduleMaintenance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.rescheduleMaintenance(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rescheduleMaintenance with LRO error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1.RescheduleMaintenanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1.RescheduleMaintenanceRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rescheduleMaintenance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.rescheduleMaintenance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRescheduleMaintenanceProgress without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1.CloudMemcacheClient({ @@ -1663,6 +1865,509 @@ describe('v1.CloudMemcacheClient', () => { ); }); }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new cloudmemcacheModule.v1.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); describe('Path templates', () => { describe('instance', () => { diff --git a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts index d6c1f112fdf..05cd3f8b85c 100644 --- a/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts +++ b/packages/google-cloud-memcache/test/gapic_cloud_memcache_v1beta2.ts @@ -25,7 +25,12 @@ import * as cloudmemcacheModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation, operationsProtos} from 'google-gax'; +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -1557,6 +1562,203 @@ describe('v1beta2.CloudMemcacheClient', () => { }); }); + describe('rescheduleMaintenance', () => { + it('invokes rescheduleMaintenance without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; + 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); + const actualRequest = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rescheduleMaintenance without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; + 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.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.memcache.v1beta2.IInstance, + protos.google.cloud.memcache.v1beta2.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rescheduleMaintenance with call error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rescheduleMaintenance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.rescheduleMaintenance(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rescheduleMaintenance with LRO error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest', + ['instance'] + ); + request.instance = defaultValue1; + const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rescheduleMaintenance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.rescheduleMaintenance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rescheduleMaintenance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRescheduleMaintenanceProgress without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + 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 cloudmemcacheModule.v1beta2.CloudMemcacheClient({ @@ -1881,6 +2083,509 @@ describe('v1beta2.CloudMemcacheClient', () => { ); }); }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new cloudmemcacheModule.v1beta2.CloudMemcacheClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); describe('Path templates', () => { describe('instance', () => {