From 59eca322f7ba8885f314449a0e03be86e8d886af Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 17:07:00 -0400 Subject: [PATCH] docs: [parallelstore] minor documentation formatting fix for Parallelstore (#5729) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: adding v1 version of our api PiperOrigin-RevId: 681144478 Source-Link: https://github.com/googleapis/googleapis/commit/692cc30fdef961552861625f45f097f576679e86 Source-Link: https://github.com/googleapis/googleapis-gen/commit/77b92bf618cc25a1ddce15413b481020d87a43d8 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXBhcmFsbGVsc3RvcmUvLk93bEJvdC55YW1sIiwiaCI6Ijc3YjkyYmY2MThjYzI1YTFkZGNlMTU0MTNiNDgxMDIwZDg3YTQzZDgifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: minor documentation formatting fix for Parallelstore PiperOrigin-RevId: 681538037 Source-Link: https://github.com/googleapis/googleapis/commit/917e347c536bec36446ac434455da0cb2e7ddf46 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ed8a66ee826a7aaa27450e2d533eb325cb31b77f Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXBhcmFsbGVsc3RvcmUvLk93bEJvdC55YW1sIiwiaCI6ImVkOGE2NmVlODI2YTdhYWEyNzQ1MGUyZDUzM2ViMzI1Y2IzMWI3N2YifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- packages/google-cloud-parallelstore/README.md | 7 + .../parallelstore/v1/parallelstore.proto | 764 ++ .../parallelstore/v1beta/parallelstore.proto | 4 +- .../protos/protos.d.ts | 2535 +++++++ .../protos/protos.js | 6360 +++++++++++++++++ .../protos/protos.json | 885 +++ .../samples/README.md | 126 + .../v1/parallelstore.create_instance.js | 93 + .../v1/parallelstore.delete_instance.js | 76 + .../generated/v1/parallelstore.export_data.js | 95 + .../v1/parallelstore.get_instance.js | 62 + .../generated/v1/parallelstore.import_data.js | 95 + .../v1/parallelstore.list_instances.js | 83 + .../v1/parallelstore.update_instance.js | 84 + ...etadata_google.cloud.parallelstore.v1.json | 367 + .../v1beta/parallelstore.export_data.js | 2 +- .../v1beta/parallelstore.import_data.js | 2 +- .../google-cloud-parallelstore/src/index.ts | 5 +- .../src/v1/gapic_metadata.json | 97 + .../src/v1/index.ts | 19 + .../src/v1/parallelstore_client.ts | 2141 ++++++ .../src/v1/parallelstore_client_config.json | 54 + .../src/v1/parallelstore_proto_list.json | 3 + .../src/v1beta/parallelstore_client.ts | 4 +- .../test/gapic_parallelstore_v1.ts | 2590 +++++++ 25 files changed, 16545 insertions(+), 8 deletions(-) create mode 100644 packages/google-cloud-parallelstore/protos/google/cloud/parallelstore/v1/parallelstore.proto create mode 100644 packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.create_instance.js create mode 100644 packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.delete_instance.js create mode 100644 packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.export_data.js create mode 100644 packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.get_instance.js create mode 100644 packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.import_data.js create mode 100644 packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.list_instances.js create mode 100644 packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.update_instance.js create mode 100644 packages/google-cloud-parallelstore/samples/generated/v1/snippet_metadata_google.cloud.parallelstore.v1.json create mode 100644 packages/google-cloud-parallelstore/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-parallelstore/src/v1/index.ts create mode 100644 packages/google-cloud-parallelstore/src/v1/parallelstore_client.ts create mode 100644 packages/google-cloud-parallelstore/src/v1/parallelstore_client_config.json create mode 100644 packages/google-cloud-parallelstore/src/v1/parallelstore_proto_list.json create mode 100644 packages/google-cloud-parallelstore/test/gapic_parallelstore_v1.ts diff --git a/packages/google-cloud-parallelstore/README.md b/packages/google-cloud-parallelstore/README.md index 21909bb72f8..2eb36d3be87 100644 --- a/packages/google-cloud-parallelstore/README.md +++ b/packages/google-cloud-parallelstore/README.md @@ -121,6 +121,13 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Parallelstore.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.create_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-parallelstore/samples/generated/v1/parallelstore.create_instance.js,packages/google-cloud-parallelstore/samples/README.md) | +| Parallelstore.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.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-parallelstore/samples/generated/v1/parallelstore.delete_instance.js,packages/google-cloud-parallelstore/samples/README.md) | +| Parallelstore.export_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.export_data.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-parallelstore/samples/generated/v1/parallelstore.export_data.js,packages/google-cloud-parallelstore/samples/README.md) | +| Parallelstore.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.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-parallelstore/samples/generated/v1/parallelstore.get_instance.js,packages/google-cloud-parallelstore/samples/README.md) | +| Parallelstore.import_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.import_data.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-parallelstore/samples/generated/v1/parallelstore.import_data.js,packages/google-cloud-parallelstore/samples/README.md) | +| Parallelstore.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.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-parallelstore/samples/generated/v1/parallelstore.list_instances.js,packages/google-cloud-parallelstore/samples/README.md) | +| Parallelstore.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.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-parallelstore/samples/generated/v1/parallelstore.update_instance.js,packages/google-cloud-parallelstore/samples/README.md) | | Parallelstore.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1beta/parallelstore.create_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-parallelstore/samples/generated/v1beta/parallelstore.create_instance.js,packages/google-cloud-parallelstore/samples/README.md) | | Parallelstore.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1beta/parallelstore.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-parallelstore/samples/generated/v1beta/parallelstore.delete_instance.js,packages/google-cloud-parallelstore/samples/README.md) | | Parallelstore.export_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1beta/parallelstore.export_data.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-parallelstore/samples/generated/v1beta/parallelstore.export_data.js,packages/google-cloud-parallelstore/samples/README.md) | diff --git a/packages/google-cloud-parallelstore/protos/google/cloud/parallelstore/v1/parallelstore.proto b/packages/google-cloud-parallelstore/protos/google/cloud/parallelstore/v1/parallelstore.proto new file mode 100644 index 00000000000..d64ee625ec7 --- /dev/null +++ b/packages/google-cloud-parallelstore/protos/google/cloud/parallelstore/v1/parallelstore.proto @@ -0,0 +1,764 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.parallelstore.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Parallelstore.V1"; +option go_package = "cloud.google.com/go/parallelstore/apiv1/parallelstorepb;parallelstorepb"; +option java_multiple_files = true; +option java_outer_classname = "ParallelstoreProto"; +option java_package = "com.google.cloud.parallelstore.v1"; +option php_namespace = "Google\\Cloud\\Parallelstore\\V1"; +option ruby_package = "Google::Cloud::Parallelstore::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Address" + pattern: "projects/{project}/regions/{region}/addresses/{address}" +}; +option (google.api.resource_definition) = { + type: "iam.googleapis.com/ServiceAccount" + pattern: "projects/{project}/serviceAccounts/{service_account}" +}; + +// Service describing handlers for resources +// Configures and manages parallelstore resources. +// +// Parallelstore service. +// +// The `parallelstore.googleapis.com` service implements the parallelstore API +// and defines the following resource model for managing instances: +// * The service works with a collection of cloud projects, named: `/projects/*` +// * Each project has a collection of available locations, named: `/locations/*` +// * Each location has a collection of instances named `/instances/*`. +// * Parallelstore instances are resources of the form: +// `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` +// +// Note that location_id must be a Google Cloud `zone`; for example: +// * `projects/12345/locations/us-central1-c/instances/my-parallelstore-share` +service Parallelstore { + option (google.api.default_host) = "parallelstore.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all instances in a given project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a Parallelstore instance in a given project and location. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single instance. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance.name=projects/*/locations/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single instance. + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Copies data from Cloud Storage to Parallelstore. + rpc ImportData(ImportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/instances/*}:importData" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ImportDataResponse" + metadata_type: "ImportDataMetadata" + }; + } + + // Copies data from Parallelstore to Cloud Storage. + rpc ExportData(ExportDataRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/instances/*}:exportData" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ExportDataResponse" + metadata_type: "ExportDataMetadata" + }; + } +} + +// Type of transfer that occurred. +enum TransferType { + // Zero is an illegal value. + TRANSFER_TYPE_UNSPECIFIED = 0; + + // Imports to Parallelstore. + IMPORT = 1; + + // Exports from Parallelstore. + EXPORT = 2; +} + +// Represents the striping options for files. +enum FileStripeLevel { + // If not set, FileStripeLevel will default to FILE_STRIPE_LEVEL_BALANCED + FILE_STRIPE_LEVEL_UNSPECIFIED = 0; + + // Minimum file striping + FILE_STRIPE_LEVEL_MIN = 1; + + // Medium file striping + FILE_STRIPE_LEVEL_BALANCED = 2; + + // Maximum file striping + FILE_STRIPE_LEVEL_MAX = 3; +} + +// Represents the striping options for directories. +enum DirectoryStripeLevel { + // If not set, DirectoryStripeLevel will default to DIRECTORY_STRIPE_LEVEL_MAX + DIRECTORY_STRIPE_LEVEL_UNSPECIFIED = 0; + + // Minimum directory striping + DIRECTORY_STRIPE_LEVEL_MIN = 1; + + // Medium directory striping + DIRECTORY_STRIPE_LEVEL_BALANCED = 2; + + // Maximum directory striping + DIRECTORY_STRIPE_LEVEL_MAX = 3; +} + +// A Parallelstore instance. +message Instance { + option (google.api.resource) = { + type: "parallelstore.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + plural: "instances" + singular: "instance" + }; + + // The possible states of a Parallelstore instance. + enum State { + // Not set. + STATE_UNSPECIFIED = 0; + + // The instance is being created. + CREATING = 1; + + // The instance is available for use. + ACTIVE = 2; + + // The instance is being deleted. + DELETING = 3; + + // The instance is not usable. + FAILED = 4; + + // The instance is being upgraded. + UPGRADING = 5; + } + + // Identifier. The resource name of the instance, in the format + // `projects/{project}/locations/{location}/instances/{instance_id}`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Optional. The description of the instance. 2048 characters or less. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The instance state. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Cloud Labels are a flexible and lightweight mechanism for + // organizing cloud resources into groups that reflect a customer's + // organizational needs and deployment strategies. See + // https://cloud.google.com/resource-manager/docs/labels-overview for details. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. The instance's storage capacity in Gibibytes (GiB). + // Allowed values are between 12000 and 100000, in multiples of 4000; e.g., + // 12000, 16000, 20000, ... + int64 capacity_gib = 8 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Output only. The version of DAOS software running in the instance. + string daos_version = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A list of IPv4 addresses used for client side configuration. + repeated string access_points = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Immutable. The name of the Compute Engine + // [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the + // instance is connected. + string network = 11 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // Optional. Immutable. The ID of the IP address range being used by the + // instance's VPC network. See [Configure a VPC + // network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc). + // If no ID is provided, all ranges are considered. + string reserved_ip_range = 12 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "compute.googleapis.com/Address" } + ]; + + // Output only. Immutable. The ID of the IP address range being used by the + // instance's VPC network. This field is populated by the service and contains + // the value currently used by the service. + string effective_reserved_ip_range = 14 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "compute.googleapis.com/Address" } + ]; + + // Optional. Stripe level for files. Allowed values are: + // + // * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size + // files. + // * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads + // involving a mix of small and large files. + // * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files. + FileStripeLevel file_stripe_level = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Stripe level for directories. Allowed values are: + // + // * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a + // small number of files. + // * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads + // involving a mix of small and large directories. + // * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large + // number of files. + DirectoryStripeLevel directory_stripe_level = 16 + [(google.api.field_behavior) = OPTIONAL]; +} + +// List instances request. +message ListInstancesRequest { + // Required. The project and location for which to retrieve instance + // information, in the format `projects/{project_id}/locations/{location}`. + // + // To retrieve instance information for all locations, use "-" as the value of + // `{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "parallelstore.googleapis.com/Instance" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, the server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from +// [ListInstances][google.cloud.parallelstore.v1.Parallelstore.ListInstances]. +message ListInstancesResponse { + // The list of Parallelstore instances. + repeated Instance instances = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Get an instance's details. +message GetInstanceRequest { + // Required. The instance resource name, in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "parallelstore.googleapis.com/Instance" + } + ]; +} + +// Create a new Parallelstore instance. +message CreateInstanceRequest { + // Required. The instance's project and location, in the format + // `projects/{project}/locations/{location}`. + // Locations map to Google Cloud zones; for example, `us-west1-b`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "parallelstore.googleapis.com/Instance" + } + ]; + + // Required. The name of the Parallelstore instance. + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the customer project / location + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The instance to create. + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Update an instance. +message UpdateInstanceRequest { + // Required. Mask of fields to update. Field mask is used to specify the + // fields to be overwritten in the Instance resource by the update. At least + // one path must be supplied in this field. The fields specified in the + // update_mask are relative to the resource, not the full request. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The instance to update. + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Delete an instance. +message DeleteInstanceRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "parallelstore.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Long-running operation metadata. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have been cancelled successfully + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Cloud Storage as the source of a data transfer. +message SourceGcsBucket { + // Required. URI to a Cloud Storage bucket in the format: + // `gs:///`. The path inside the bucket is + // optional. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Cloud Storage as the destination of a data transfer. +message DestinationGcsBucket { + // Required. URI to a Cloud Storage bucket in the format: + // `gs:///`. The path inside the bucket is + // optional. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Parallelstore as the source of a data transfer. +message SourceParallelstore { + // Optional. Root directory path to the Paralellstore filesystem, starting + // with `/`. Defaults to `/` if unset. + string path = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Parallelstore as the destination of a data transfer. +message DestinationParallelstore { + // Optional. Root directory path to the Paralellstore filesystem, starting + // with `/`. Defaults to `/` if unset. + string path = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Import data from Cloud Storage into a Parallelstore instance. +message ImportDataRequest { + // The source of the data being imported into the Parallelstore instance. + oneof source { + // The Cloud Storage source bucket and, optionally, path inside the bucket. + SourceGcsBucket source_gcs_bucket = 2; + } + + // The Parallelstore instance into which to import data. + oneof destination { + // Parallelstore destination. + DestinationParallelstore destination_parallelstore = 3; + } + + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "parallelstore.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. User-specified service account credentials to be used when + // performing the transfer. + // + // Use one of the following formats: + // + // * {EMAIL_ADDRESS_OR_UNIQUE_ID} + // * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + // * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + // + // If unspecified, the Parallelstore service agent is used: + // `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + string service_account = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "iam.googleapis.com/ServiceAccount" + } + ]; +} + +// Export data from Parallelstore to Cloud Storage. +message ExportDataRequest { + // The Parallelstore instance to export from. + oneof source { + // Parallelstore source. + SourceParallelstore source_parallelstore = 2; + } + + // The Cloud Storage bucket to export to. + oneof destination { + // Cloud Storage destination. + DestinationGcsBucket destination_gcs_bucket = 3; + } + + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "parallelstore.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. User-specified Service Account (SA) credentials to be used when + // performing the transfer. + // Use one of the following formats: + // + // * {EMAIL_ADDRESS_OR_UNIQUE_ID} + // * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + // * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + // + // If unspecified, the Parallelstore service agent is used: + // `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + string service_account = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "iam.googleapis.com/ServiceAccount" + } + ]; +} + +// The response to a request to import data to Parallelstore. +message ImportDataResponse {} + +// Metadata related to the data import operation. +message ImportDataMetadata { + // Data transfer operation metadata. + TransferOperationMetadata operation_metadata = 1; + + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The response to a request to export data from Parallelstore. +message ExportDataResponse {} + +// Metadata related to the data export operation. +message ExportDataMetadata { + // Data transfer operation metadata. + TransferOperationMetadata operation_metadata = 1; + + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Long-running operation metadata related to a data transfer. +message TransferOperationMetadata { + // The source of transfer operation. + oneof source { + // Output only. Parallelstore source. + SourceParallelstore source_parallelstore = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud Storage source. + SourceGcsBucket source_gcs_bucket = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The destination of transfer operation. + oneof destination { + // Output only. Cloud Storage destination. + DestinationGcsBucket destination_gcs_bucket = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Parallelstore destination. + DestinationParallelstore destination_parallelstore = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The progress of the transfer operation. + TransferCounters counters = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of transfer occurring. + TransferType transfer_type = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A collection of counters that report the progress of a transfer operation. +message TransferCounters { + // Objects found in the data source that are scheduled to be transferred, + // excluding any that are filtered based on object conditions or skipped due + // to sync. + int64 objects_found = 1; + + // Bytes found in the data source that are scheduled to be transferred, + // excluding any that are filtered based on object conditions or skipped due + // to sync. + int64 bytes_found = 2; + + // Objects in the data source that are not transferred because they already + // exist in the data destination. + int64 objects_skipped = 3; + + // Bytes in the data source that are not transferred because they already + // exist in the data destination. + int64 bytes_skipped = 4; + + // Objects that are copied to the data destination. + int64 objects_copied = 5; + + // Bytes that are copied to the data destination. + int64 bytes_copied = 6; +} diff --git a/packages/google-cloud-parallelstore/protos/google/cloud/parallelstore/v1beta/parallelstore.proto b/packages/google-cloud-parallelstore/protos/google/cloud/parallelstore/v1beta/parallelstore.proto index f2330a741ba..eea968c1a4e 100644 --- a/packages/google-cloud-parallelstore/protos/google/cloud/parallelstore/v1beta/parallelstore.proto +++ b/packages/google-cloud-parallelstore/protos/google/cloud/parallelstore/v1beta/parallelstore.proto @@ -561,7 +561,7 @@ message ImportDataRequest { // // Use one of the following formats: // - // * {EMAIL_ADDRESS_OR_UNIQUE_ID} + // * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` // * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` // * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} // @@ -619,7 +619,7 @@ message ExportDataRequest { // performing the transfer. // Use one of the following formats: // - // * {EMAIL_ADDRESS_OR_UNIQUE_ID} + // * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` // * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` // * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} // diff --git a/packages/google-cloud-parallelstore/protos/protos.d.ts b/packages/google-cloud-parallelstore/protos/protos.d.ts index 31018b5cb11..8109648cd45 100644 --- a/packages/google-cloud-parallelstore/protos/protos.d.ts +++ b/packages/google-cloud-parallelstore/protos/protos.d.ts @@ -23,6 +23,2541 @@ export namespace google { /** Namespace parallelstore. */ namespace parallelstore { + /** Namespace v1. */ + namespace v1 { + + /** Represents a Parallelstore */ + class Parallelstore extends $protobuf.rpc.Service { + + /** + * Constructs a new Parallelstore service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Parallelstore service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Parallelstore; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.parallelstore.v1.IListInstancesRequest, callback: google.cloud.parallelstore.v1.Parallelstore.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.parallelstore.v1.IListInstancesRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.parallelstore.v1.IGetInstanceRequest, callback: google.cloud.parallelstore.v1.Parallelstore.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.parallelstore.v1.IGetInstanceRequest): Promise; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.cloud.parallelstore.v1.ICreateInstanceRequest, callback: google.cloud.parallelstore.v1.Parallelstore.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.parallelstore.v1.ICreateInstanceRequest): Promise; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstance(request: google.cloud.parallelstore.v1.IUpdateInstanceRequest, callback: google.cloud.parallelstore.v1.Parallelstore.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.parallelstore.v1.IUpdateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.cloud.parallelstore.v1.IDeleteInstanceRequest, callback: google.cloud.parallelstore.v1.Parallelstore.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.parallelstore.v1.IDeleteInstanceRequest): Promise; + + /** + * Calls ImportData. + * @param request ImportDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importData(request: google.cloud.parallelstore.v1.IImportDataRequest, callback: google.cloud.parallelstore.v1.Parallelstore.ImportDataCallback): void; + + /** + * Calls ImportData. + * @param request ImportDataRequest message or plain object + * @returns Promise + */ + public importData(request: google.cloud.parallelstore.v1.IImportDataRequest): Promise; + + /** + * Calls ExportData. + * @param request ExportDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportData(request: google.cloud.parallelstore.v1.IExportDataRequest, callback: google.cloud.parallelstore.v1.Parallelstore.ExportDataCallback): void; + + /** + * Calls ExportData. + * @param request ExportDataRequest message or plain object + * @returns Promise + */ + public exportData(request: google.cloud.parallelstore.v1.IExportDataRequest): Promise; + } + + namespace Parallelstore { + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.parallelstore.v1.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.parallelstore.v1.Instance) => void; + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|updateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|importData}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|exportData}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportDataCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** TransferType enum. */ + enum TransferType { + TRANSFER_TYPE_UNSPECIFIED = 0, + IMPORT = 1, + EXPORT = 2 + } + + /** FileStripeLevel enum. */ + enum FileStripeLevel { + FILE_STRIPE_LEVEL_UNSPECIFIED = 0, + FILE_STRIPE_LEVEL_MIN = 1, + FILE_STRIPE_LEVEL_BALANCED = 2, + FILE_STRIPE_LEVEL_MAX = 3 + } + + /** DirectoryStripeLevel enum. */ + enum DirectoryStripeLevel { + DIRECTORY_STRIPE_LEVEL_UNSPECIFIED = 0, + DIRECTORY_STRIPE_LEVEL_MIN = 1, + DIRECTORY_STRIPE_LEVEL_BALANCED = 2, + DIRECTORY_STRIPE_LEVEL_MAX = 3 + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance description */ + description?: (string|null); + + /** Instance state */ + state?: (google.cloud.parallelstore.v1.Instance.State|keyof typeof google.cloud.parallelstore.v1.Instance.State|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance capacityGib */ + capacityGib?: (number|Long|string|null); + + /** Instance daosVersion */ + daosVersion?: (string|null); + + /** Instance accessPoints */ + accessPoints?: (string[]|null); + + /** Instance network */ + network?: (string|null); + + /** Instance reservedIpRange */ + reservedIpRange?: (string|null); + + /** Instance effectiveReservedIpRange */ + effectiveReservedIpRange?: (string|null); + + /** Instance fileStripeLevel */ + fileStripeLevel?: (google.cloud.parallelstore.v1.FileStripeLevel|keyof typeof google.cloud.parallelstore.v1.FileStripeLevel|null); + + /** Instance directoryStripeLevel */ + directoryStripeLevel?: (google.cloud.parallelstore.v1.DirectoryStripeLevel|keyof typeof google.cloud.parallelstore.v1.DirectoryStripeLevel|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance description. */ + public description: string; + + /** Instance state. */ + public state: (google.cloud.parallelstore.v1.Instance.State|keyof typeof google.cloud.parallelstore.v1.Instance.State); + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance capacityGib. */ + public capacityGib: (number|Long|string); + + /** Instance daosVersion. */ + public daosVersion: string; + + /** Instance accessPoints. */ + public accessPoints: string[]; + + /** Instance network. */ + public network: string; + + /** Instance reservedIpRange. */ + public reservedIpRange: string; + + /** Instance effectiveReservedIpRange. */ + public effectiveReservedIpRange: string; + + /** Instance fileStripeLevel. */ + public fileStripeLevel: (google.cloud.parallelstore.v1.FileStripeLevel|keyof typeof google.cloud.parallelstore.v1.FileStripeLevel); + + /** Instance directoryStripeLevel. */ + public directoryStripeLevel: (google.cloud.parallelstore.v1.DirectoryStripeLevel|keyof typeof google.cloud.parallelstore.v1.DirectoryStripeLevel); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.parallelstore.v1.IInstance): google.cloud.parallelstore.v1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.parallelstore.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @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.parallelstore.v1.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @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.parallelstore.v1.Instance; + + /** + * Verifies an Instance 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 Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + FAILED = 4, + UPGRADING = 5 + } + } + + /** 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 a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** 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.parallelstore.v1.IListInstancesRequest): google.cloud.parallelstore.v1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.parallelstore.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.parallelstore.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.v1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.parallelstore.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.parallelstore.v1.IListInstancesResponse): google.cloud.parallelstore.v1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.parallelstore.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.parallelstore.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.v1.IGetInstanceRequest): google.cloud.parallelstore.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.parallelstore.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.parallelstore.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.v1.IInstance|null); + + /** CreateInstanceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.parallelstore.v1.IInstance|null); + + /** CreateInstanceRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.parallelstore.v1.ICreateInstanceRequest): google.cloud.parallelstore.v1.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.parallelstore.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.parallelstore.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.v1.IInstance|null); + + /** UpdateInstanceRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.IUpdateInstanceRequest); + + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance. */ + public instance?: (google.cloud.parallelstore.v1.IInstance|null); + + /** UpdateInstanceRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceRequest instance + */ + public static create(properties?: google.cloud.parallelstore.v1.IUpdateInstanceRequest): google.cloud.parallelstore.v1.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.parallelstore.v1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceRequest + * @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.parallelstore.v1.UpdateInstanceRequest; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceRequest + * @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.parallelstore.v1.UpdateInstanceRequest; + + /** + * Verifies an UpdateInstanceRequest 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 UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.UpdateInstanceRequest; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + + /** DeleteInstanceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** DeleteInstanceRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.parallelstore.v1.IDeleteInstanceRequest): google.cloud.parallelstore.v1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.parallelstore.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @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.parallelstore.v1.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @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.parallelstore.v1.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest 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 DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.parallelstore.v1.IOperationMetadata): google.cloud.parallelstore.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.parallelstore.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @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.parallelstore.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @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.parallelstore.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata 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 OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.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.parallelstore.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 SourceGcsBucket. */ + interface ISourceGcsBucket { + + /** SourceGcsBucket uri */ + uri?: (string|null); + } + + /** Represents a SourceGcsBucket. */ + class SourceGcsBucket implements ISourceGcsBucket { + + /** + * Constructs a new SourceGcsBucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.ISourceGcsBucket); + + /** SourceGcsBucket uri. */ + public uri: string; + + /** + * Creates a new SourceGcsBucket instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceGcsBucket instance + */ + public static create(properties?: google.cloud.parallelstore.v1.ISourceGcsBucket): google.cloud.parallelstore.v1.SourceGcsBucket; + + /** + * Encodes the specified SourceGcsBucket message. Does not implicitly {@link google.cloud.parallelstore.v1.SourceGcsBucket.verify|verify} messages. + * @param message SourceGcsBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.ISourceGcsBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceGcsBucket message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.SourceGcsBucket.verify|verify} messages. + * @param message SourceGcsBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.ISourceGcsBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceGcsBucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceGcsBucket + * @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.parallelstore.v1.SourceGcsBucket; + + /** + * Decodes a SourceGcsBucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceGcsBucket + * @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.parallelstore.v1.SourceGcsBucket; + + /** + * Verifies a SourceGcsBucket 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 SourceGcsBucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceGcsBucket + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.SourceGcsBucket; + + /** + * Creates a plain object from a SourceGcsBucket message. Also converts values to other types if specified. + * @param message SourceGcsBucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.SourceGcsBucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceGcsBucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceGcsBucket + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DestinationGcsBucket. */ + interface IDestinationGcsBucket { + + /** DestinationGcsBucket uri */ + uri?: (string|null); + } + + /** Represents a DestinationGcsBucket. */ + class DestinationGcsBucket implements IDestinationGcsBucket { + + /** + * Constructs a new DestinationGcsBucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.IDestinationGcsBucket); + + /** DestinationGcsBucket uri. */ + public uri: string; + + /** + * Creates a new DestinationGcsBucket instance using the specified properties. + * @param [properties] Properties to set + * @returns DestinationGcsBucket instance + */ + public static create(properties?: google.cloud.parallelstore.v1.IDestinationGcsBucket): google.cloud.parallelstore.v1.DestinationGcsBucket; + + /** + * Encodes the specified DestinationGcsBucket message. Does not implicitly {@link google.cloud.parallelstore.v1.DestinationGcsBucket.verify|verify} messages. + * @param message DestinationGcsBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.IDestinationGcsBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DestinationGcsBucket message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.DestinationGcsBucket.verify|verify} messages. + * @param message DestinationGcsBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.IDestinationGcsBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DestinationGcsBucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DestinationGcsBucket + * @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.parallelstore.v1.DestinationGcsBucket; + + /** + * Decodes a DestinationGcsBucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DestinationGcsBucket + * @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.parallelstore.v1.DestinationGcsBucket; + + /** + * Verifies a DestinationGcsBucket 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 DestinationGcsBucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DestinationGcsBucket + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.DestinationGcsBucket; + + /** + * Creates a plain object from a DestinationGcsBucket message. Also converts values to other types if specified. + * @param message DestinationGcsBucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.DestinationGcsBucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DestinationGcsBucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DestinationGcsBucket + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SourceParallelstore. */ + interface ISourceParallelstore { + + /** SourceParallelstore path */ + path?: (string|null); + } + + /** Represents a SourceParallelstore. */ + class SourceParallelstore implements ISourceParallelstore { + + /** + * Constructs a new SourceParallelstore. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.ISourceParallelstore); + + /** SourceParallelstore path. */ + public path: string; + + /** + * Creates a new SourceParallelstore instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceParallelstore instance + */ + public static create(properties?: google.cloud.parallelstore.v1.ISourceParallelstore): google.cloud.parallelstore.v1.SourceParallelstore; + + /** + * Encodes the specified SourceParallelstore message. Does not implicitly {@link google.cloud.parallelstore.v1.SourceParallelstore.verify|verify} messages. + * @param message SourceParallelstore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.ISourceParallelstore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceParallelstore message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.SourceParallelstore.verify|verify} messages. + * @param message SourceParallelstore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.ISourceParallelstore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceParallelstore message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceParallelstore + * @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.parallelstore.v1.SourceParallelstore; + + /** + * Decodes a SourceParallelstore message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceParallelstore + * @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.parallelstore.v1.SourceParallelstore; + + /** + * Verifies a SourceParallelstore 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 SourceParallelstore message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceParallelstore + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.SourceParallelstore; + + /** + * Creates a plain object from a SourceParallelstore message. Also converts values to other types if specified. + * @param message SourceParallelstore + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.SourceParallelstore, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceParallelstore to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceParallelstore + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DestinationParallelstore. */ + interface IDestinationParallelstore { + + /** DestinationParallelstore path */ + path?: (string|null); + } + + /** Represents a DestinationParallelstore. */ + class DestinationParallelstore implements IDestinationParallelstore { + + /** + * Constructs a new DestinationParallelstore. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.IDestinationParallelstore); + + /** DestinationParallelstore path. */ + public path: string; + + /** + * Creates a new DestinationParallelstore instance using the specified properties. + * @param [properties] Properties to set + * @returns DestinationParallelstore instance + */ + public static create(properties?: google.cloud.parallelstore.v1.IDestinationParallelstore): google.cloud.parallelstore.v1.DestinationParallelstore; + + /** + * Encodes the specified DestinationParallelstore message. Does not implicitly {@link google.cloud.parallelstore.v1.DestinationParallelstore.verify|verify} messages. + * @param message DestinationParallelstore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.IDestinationParallelstore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DestinationParallelstore message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.DestinationParallelstore.verify|verify} messages. + * @param message DestinationParallelstore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.IDestinationParallelstore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DestinationParallelstore message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DestinationParallelstore + * @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.parallelstore.v1.DestinationParallelstore; + + /** + * Decodes a DestinationParallelstore message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DestinationParallelstore + * @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.parallelstore.v1.DestinationParallelstore; + + /** + * Verifies a DestinationParallelstore 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 DestinationParallelstore message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DestinationParallelstore + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.DestinationParallelstore; + + /** + * Creates a plain object from a DestinationParallelstore message. Also converts values to other types if specified. + * @param message DestinationParallelstore + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.DestinationParallelstore, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DestinationParallelstore to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DestinationParallelstore + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDataRequest. */ + interface IImportDataRequest { + + /** ImportDataRequest sourceGcsBucket */ + sourceGcsBucket?: (google.cloud.parallelstore.v1.ISourceGcsBucket|null); + + /** ImportDataRequest destinationParallelstore */ + destinationParallelstore?: (google.cloud.parallelstore.v1.IDestinationParallelstore|null); + + /** ImportDataRequest name */ + name?: (string|null); + + /** ImportDataRequest requestId */ + requestId?: (string|null); + + /** ImportDataRequest serviceAccount */ + serviceAccount?: (string|null); + } + + /** Represents an ImportDataRequest. */ + class ImportDataRequest implements IImportDataRequest { + + /** + * Constructs a new ImportDataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.IImportDataRequest); + + /** ImportDataRequest sourceGcsBucket. */ + public sourceGcsBucket?: (google.cloud.parallelstore.v1.ISourceGcsBucket|null); + + /** ImportDataRequest destinationParallelstore. */ + public destinationParallelstore?: (google.cloud.parallelstore.v1.IDestinationParallelstore|null); + + /** ImportDataRequest name. */ + public name: string; + + /** ImportDataRequest requestId. */ + public requestId: string; + + /** ImportDataRequest serviceAccount. */ + public serviceAccount: string; + + /** ImportDataRequest source. */ + public source?: "sourceGcsBucket"; + + /** ImportDataRequest destination. */ + public destination?: "destinationParallelstore"; + + /** + * Creates a new ImportDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataRequest instance + */ + public static create(properties?: google.cloud.parallelstore.v1.IImportDataRequest): google.cloud.parallelstore.v1.ImportDataRequest; + + /** + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.parallelstore.v1.ImportDataRequest.verify|verify} messages. + * @param message ImportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ImportDataRequest.verify|verify} messages. + * @param message ImportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.IImportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDataRequest + * @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.parallelstore.v1.ImportDataRequest; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDataRequest + * @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.parallelstore.v1.ImportDataRequest; + + /** + * Verifies an ImportDataRequest 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 ImportDataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDataRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.ImportDataRequest; + + /** + * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. + * @param message ImportDataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.ImportDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportDataRequest. */ + interface IExportDataRequest { + + /** ExportDataRequest sourceParallelstore */ + sourceParallelstore?: (google.cloud.parallelstore.v1.ISourceParallelstore|null); + + /** ExportDataRequest destinationGcsBucket */ + destinationGcsBucket?: (google.cloud.parallelstore.v1.IDestinationGcsBucket|null); + + /** ExportDataRequest name */ + name?: (string|null); + + /** ExportDataRequest requestId */ + requestId?: (string|null); + + /** ExportDataRequest serviceAccount */ + serviceAccount?: (string|null); + } + + /** Represents an ExportDataRequest. */ + class ExportDataRequest implements IExportDataRequest { + + /** + * Constructs a new ExportDataRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.IExportDataRequest); + + /** ExportDataRequest sourceParallelstore. */ + public sourceParallelstore?: (google.cloud.parallelstore.v1.ISourceParallelstore|null); + + /** ExportDataRequest destinationGcsBucket. */ + public destinationGcsBucket?: (google.cloud.parallelstore.v1.IDestinationGcsBucket|null); + + /** ExportDataRequest name. */ + public name: string; + + /** ExportDataRequest requestId. */ + public requestId: string; + + /** ExportDataRequest serviceAccount. */ + public serviceAccount: string; + + /** ExportDataRequest source. */ + public source?: "sourceParallelstore"; + + /** ExportDataRequest destination. */ + public destination?: "destinationGcsBucket"; + + /** + * Creates a new ExportDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataRequest instance + */ + public static create(properties?: google.cloud.parallelstore.v1.IExportDataRequest): google.cloud.parallelstore.v1.ExportDataRequest; + + /** + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.parallelstore.v1.ExportDataRequest.verify|verify} messages. + * @param message ExportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ExportDataRequest.verify|verify} messages. + * @param message ExportDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.IExportDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataRequest + * @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.parallelstore.v1.ExportDataRequest; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataRequest + * @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.parallelstore.v1.ExportDataRequest; + + /** + * Verifies an ExportDataRequest 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 ExportDataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.ExportDataRequest; + + /** + * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. + * @param message ExportDataRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.ExportDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDataResponse. */ + interface IImportDataResponse { + } + + /** Represents an ImportDataResponse. */ + class ImportDataResponse implements IImportDataResponse { + + /** + * Constructs a new ImportDataResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.IImportDataResponse); + + /** + * Creates a new ImportDataResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataResponse instance + */ + public static create(properties?: google.cloud.parallelstore.v1.IImportDataResponse): google.cloud.parallelstore.v1.ImportDataResponse; + + /** + * Encodes the specified ImportDataResponse message. Does not implicitly {@link google.cloud.parallelstore.v1.ImportDataResponse.verify|verify} messages. + * @param message ImportDataResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.IImportDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataResponse message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ImportDataResponse.verify|verify} messages. + * @param message ImportDataResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.IImportDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDataResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDataResponse + * @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.parallelstore.v1.ImportDataResponse; + + /** + * Decodes an ImportDataResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDataResponse + * @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.parallelstore.v1.ImportDataResponse; + + /** + * Verifies an ImportDataResponse 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 ImportDataResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDataResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.ImportDataResponse; + + /** + * Creates a plain object from an ImportDataResponse message. Also converts values to other types if specified. + * @param message ImportDataResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.ImportDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDataResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDataResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ImportDataMetadata. */ + interface IImportDataMetadata { + + /** ImportDataMetadata operationMetadata */ + operationMetadata?: (google.cloud.parallelstore.v1.ITransferOperationMetadata|null); + + /** ImportDataMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ImportDataMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ImportDataMetadata target */ + target?: (string|null); + + /** ImportDataMetadata verb */ + verb?: (string|null); + + /** ImportDataMetadata statusMessage */ + statusMessage?: (string|null); + + /** ImportDataMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** ImportDataMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an ImportDataMetadata. */ + class ImportDataMetadata implements IImportDataMetadata { + + /** + * Constructs a new ImportDataMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.IImportDataMetadata); + + /** ImportDataMetadata operationMetadata. */ + public operationMetadata?: (google.cloud.parallelstore.v1.ITransferOperationMetadata|null); + + /** ImportDataMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ImportDataMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ImportDataMetadata target. */ + public target: string; + + /** ImportDataMetadata verb. */ + public verb: string; + + /** ImportDataMetadata statusMessage. */ + public statusMessage: string; + + /** ImportDataMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** ImportDataMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new ImportDataMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportDataMetadata instance + */ + public static create(properties?: google.cloud.parallelstore.v1.IImportDataMetadata): google.cloud.parallelstore.v1.ImportDataMetadata; + + /** + * Encodes the specified ImportDataMetadata message. Does not implicitly {@link google.cloud.parallelstore.v1.ImportDataMetadata.verify|verify} messages. + * @param message ImportDataMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.IImportDataMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportDataMetadata message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ImportDataMetadata.verify|verify} messages. + * @param message ImportDataMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.IImportDataMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportDataMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportDataMetadata + * @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.parallelstore.v1.ImportDataMetadata; + + /** + * Decodes an ImportDataMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportDataMetadata + * @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.parallelstore.v1.ImportDataMetadata; + + /** + * Verifies an ImportDataMetadata 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 ImportDataMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDataMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.ImportDataMetadata; + + /** + * Creates a plain object from an ImportDataMetadata message. Also converts values to other types if specified. + * @param message ImportDataMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.ImportDataMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDataMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDataMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportDataResponse. */ + interface IExportDataResponse { + } + + /** Represents an ExportDataResponse. */ + class ExportDataResponse implements IExportDataResponse { + + /** + * Constructs a new ExportDataResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.IExportDataResponse); + + /** + * Creates a new ExportDataResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataResponse instance + */ + public static create(properties?: google.cloud.parallelstore.v1.IExportDataResponse): google.cloud.parallelstore.v1.ExportDataResponse; + + /** + * Encodes the specified ExportDataResponse message. Does not implicitly {@link google.cloud.parallelstore.v1.ExportDataResponse.verify|verify} messages. + * @param message ExportDataResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.IExportDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataResponse message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ExportDataResponse.verify|verify} messages. + * @param message ExportDataResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.IExportDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataResponse + * @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.parallelstore.v1.ExportDataResponse; + + /** + * Decodes an ExportDataResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataResponse + * @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.parallelstore.v1.ExportDataResponse; + + /** + * Verifies an ExportDataResponse 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 ExportDataResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.ExportDataResponse; + + /** + * Creates a plain object from an ExportDataResponse message. Also converts values to other types if specified. + * @param message ExportDataResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.ExportDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportDataMetadata. */ + interface IExportDataMetadata { + + /** ExportDataMetadata operationMetadata */ + operationMetadata?: (google.cloud.parallelstore.v1.ITransferOperationMetadata|null); + + /** ExportDataMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ExportDataMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** ExportDataMetadata target */ + target?: (string|null); + + /** ExportDataMetadata verb */ + verb?: (string|null); + + /** ExportDataMetadata statusMessage */ + statusMessage?: (string|null); + + /** ExportDataMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** ExportDataMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an ExportDataMetadata. */ + class ExportDataMetadata implements IExportDataMetadata { + + /** + * Constructs a new ExportDataMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.IExportDataMetadata); + + /** ExportDataMetadata operationMetadata. */ + public operationMetadata?: (google.cloud.parallelstore.v1.ITransferOperationMetadata|null); + + /** ExportDataMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ExportDataMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** ExportDataMetadata target. */ + public target: string; + + /** ExportDataMetadata verb. */ + public verb: string; + + /** ExportDataMetadata statusMessage. */ + public statusMessage: string; + + /** ExportDataMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** ExportDataMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new ExportDataMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportDataMetadata instance + */ + public static create(properties?: google.cloud.parallelstore.v1.IExportDataMetadata): google.cloud.parallelstore.v1.ExportDataMetadata; + + /** + * Encodes the specified ExportDataMetadata message. Does not implicitly {@link google.cloud.parallelstore.v1.ExportDataMetadata.verify|verify} messages. + * @param message ExportDataMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.IExportDataMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportDataMetadata message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ExportDataMetadata.verify|verify} messages. + * @param message ExportDataMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.IExportDataMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportDataMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportDataMetadata + * @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.parallelstore.v1.ExportDataMetadata; + + /** + * Decodes an ExportDataMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportDataMetadata + * @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.parallelstore.v1.ExportDataMetadata; + + /** + * Verifies an ExportDataMetadata 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 ExportDataMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDataMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.ExportDataMetadata; + + /** + * Creates a plain object from an ExportDataMetadata message. Also converts values to other types if specified. + * @param message ExportDataMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.ExportDataMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDataMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDataMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferOperationMetadata. */ + interface ITransferOperationMetadata { + + /** TransferOperationMetadata sourceParallelstore */ + sourceParallelstore?: (google.cloud.parallelstore.v1.ISourceParallelstore|null); + + /** TransferOperationMetadata sourceGcsBucket */ + sourceGcsBucket?: (google.cloud.parallelstore.v1.ISourceGcsBucket|null); + + /** TransferOperationMetadata destinationGcsBucket */ + destinationGcsBucket?: (google.cloud.parallelstore.v1.IDestinationGcsBucket|null); + + /** TransferOperationMetadata destinationParallelstore */ + destinationParallelstore?: (google.cloud.parallelstore.v1.IDestinationParallelstore|null); + + /** TransferOperationMetadata counters */ + counters?: (google.cloud.parallelstore.v1.ITransferCounters|null); + + /** TransferOperationMetadata transferType */ + transferType?: (google.cloud.parallelstore.v1.TransferType|keyof typeof google.cloud.parallelstore.v1.TransferType|null); + } + + /** Represents a TransferOperationMetadata. */ + class TransferOperationMetadata implements ITransferOperationMetadata { + + /** + * Constructs a new TransferOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.ITransferOperationMetadata); + + /** TransferOperationMetadata sourceParallelstore. */ + public sourceParallelstore?: (google.cloud.parallelstore.v1.ISourceParallelstore|null); + + /** TransferOperationMetadata sourceGcsBucket. */ + public sourceGcsBucket?: (google.cloud.parallelstore.v1.ISourceGcsBucket|null); + + /** TransferOperationMetadata destinationGcsBucket. */ + public destinationGcsBucket?: (google.cloud.parallelstore.v1.IDestinationGcsBucket|null); + + /** TransferOperationMetadata destinationParallelstore. */ + public destinationParallelstore?: (google.cloud.parallelstore.v1.IDestinationParallelstore|null); + + /** TransferOperationMetadata counters. */ + public counters?: (google.cloud.parallelstore.v1.ITransferCounters|null); + + /** TransferOperationMetadata transferType. */ + public transferType: (google.cloud.parallelstore.v1.TransferType|keyof typeof google.cloud.parallelstore.v1.TransferType); + + /** TransferOperationMetadata source. */ + public source?: ("sourceParallelstore"|"sourceGcsBucket"); + + /** TransferOperationMetadata destination. */ + public destination?: ("destinationGcsBucket"|"destinationParallelstore"); + + /** + * Creates a new TransferOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferOperationMetadata instance + */ + public static create(properties?: google.cloud.parallelstore.v1.ITransferOperationMetadata): google.cloud.parallelstore.v1.TransferOperationMetadata; + + /** + * Encodes the specified TransferOperationMetadata message. Does not implicitly {@link google.cloud.parallelstore.v1.TransferOperationMetadata.verify|verify} messages. + * @param message TransferOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.ITransferOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.TransferOperationMetadata.verify|verify} messages. + * @param message TransferOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.ITransferOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferOperationMetadata + * @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.parallelstore.v1.TransferOperationMetadata; + + /** + * Decodes a TransferOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferOperationMetadata + * @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.parallelstore.v1.TransferOperationMetadata; + + /** + * Verifies a TransferOperationMetadata 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 TransferOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.TransferOperationMetadata; + + /** + * Creates a plain object from a TransferOperationMetadata message. Also converts values to other types if specified. + * @param message TransferOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.TransferOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferCounters. */ + interface ITransferCounters { + + /** TransferCounters objectsFound */ + objectsFound?: (number|Long|string|null); + + /** TransferCounters bytesFound */ + bytesFound?: (number|Long|string|null); + + /** TransferCounters objectsSkipped */ + objectsSkipped?: (number|Long|string|null); + + /** TransferCounters bytesSkipped */ + bytesSkipped?: (number|Long|string|null); + + /** TransferCounters objectsCopied */ + objectsCopied?: (number|Long|string|null); + + /** TransferCounters bytesCopied */ + bytesCopied?: (number|Long|string|null); + } + + /** Represents a TransferCounters. */ + class TransferCounters implements ITransferCounters { + + /** + * Constructs a new TransferCounters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.parallelstore.v1.ITransferCounters); + + /** TransferCounters objectsFound. */ + public objectsFound: (number|Long|string); + + /** TransferCounters bytesFound. */ + public bytesFound: (number|Long|string); + + /** TransferCounters objectsSkipped. */ + public objectsSkipped: (number|Long|string); + + /** TransferCounters bytesSkipped. */ + public bytesSkipped: (number|Long|string); + + /** TransferCounters objectsCopied. */ + public objectsCopied: (number|Long|string); + + /** TransferCounters bytesCopied. */ + public bytesCopied: (number|Long|string); + + /** + * Creates a new TransferCounters instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferCounters instance + */ + public static create(properties?: google.cloud.parallelstore.v1.ITransferCounters): google.cloud.parallelstore.v1.TransferCounters; + + /** + * Encodes the specified TransferCounters message. Does not implicitly {@link google.cloud.parallelstore.v1.TransferCounters.verify|verify} messages. + * @param message TransferCounters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.parallelstore.v1.ITransferCounters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferCounters message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.TransferCounters.verify|verify} messages. + * @param message TransferCounters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.parallelstore.v1.ITransferCounters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferCounters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferCounters + * @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.parallelstore.v1.TransferCounters; + + /** + * Decodes a TransferCounters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferCounters + * @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.parallelstore.v1.TransferCounters; + + /** + * Verifies a TransferCounters 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 TransferCounters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferCounters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.parallelstore.v1.TransferCounters; + + /** + * Creates a plain object from a TransferCounters message. Also converts values to other types if specified. + * @param message TransferCounters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.parallelstore.v1.TransferCounters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferCounters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferCounters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Namespace v1beta. */ namespace v1beta { diff --git a/packages/google-cloud-parallelstore/protos/protos.js b/packages/google-cloud-parallelstore/protos/protos.js index 3db3ceccee4..d3823b7e563 100644 --- a/packages/google-cloud-parallelstore/protos/protos.js +++ b/packages/google-cloud-parallelstore/protos/protos.js @@ -57,6 +57,6366 @@ */ var parallelstore = {}; + parallelstore.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.parallelstore + * @namespace + */ + var v1 = {}; + + v1.Parallelstore = (function() { + + /** + * Constructs a new Parallelstore service. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents a Parallelstore + * @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 Parallelstore(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Parallelstore.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Parallelstore; + + /** + * Creates new Parallelstore service using the specified rpc implementation. + * @function create + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @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 {Parallelstore} RPC service. Useful where requests and/or responses are streamed. + */ + Parallelstore.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|listInstances}. + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.parallelstore.v1.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.parallelstore.v1.Parallelstore.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Parallelstore.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.parallelstore.v1.ListInstancesRequest, $root.google.cloud.parallelstore.v1.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|getInstance}. + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.parallelstore.v1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.parallelstore.v1.Parallelstore.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Parallelstore.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.parallelstore.v1.GetInstanceRequest, $root.google.cloud.parallelstore.v1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|createInstance}. + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.parallelstore.v1.Parallelstore.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Parallelstore.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.parallelstore.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|updateInstance}. + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.parallelstore.v1.Parallelstore.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Parallelstore.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.parallelstore.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|deleteInstance}. + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.parallelstore.v1.Parallelstore.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Parallelstore.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.parallelstore.v1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|importData}. + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @typedef ImportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.IImportDataRequest} request ImportDataRequest message or plain object + * @param {google.cloud.parallelstore.v1.Parallelstore.ImportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Parallelstore.prototype.importData = function importData(request, callback) { + return this.rpcCall(importData, $root.google.cloud.parallelstore.v1.ImportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportData" }); + + /** + * Calls ImportData. + * @function importData + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.IImportDataRequest} request ImportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.parallelstore.v1.Parallelstore|exportData}. + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @typedef ExportDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.IExportDataRequest} request ExportDataRequest message or plain object + * @param {google.cloud.parallelstore.v1.Parallelstore.ExportDataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Parallelstore.prototype.exportData = function exportData(request, callback) { + return this.rpcCall(exportData, $root.google.cloud.parallelstore.v1.ExportDataRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportData" }); + + /** + * Calls ExportData. + * @function exportData + * @memberof google.cloud.parallelstore.v1.Parallelstore + * @instance + * @param {google.cloud.parallelstore.v1.IExportDataRequest} request ExportDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Parallelstore; + })(); + + /** + * TransferType enum. + * @name google.cloud.parallelstore.v1.TransferType + * @enum {number} + * @property {number} TRANSFER_TYPE_UNSPECIFIED=0 TRANSFER_TYPE_UNSPECIFIED value + * @property {number} IMPORT=1 IMPORT value + * @property {number} EXPORT=2 EXPORT value + */ + v1.TransferType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSFER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMPORT"] = 1; + values[valuesById[2] = "EXPORT"] = 2; + return values; + })(); + + /** + * FileStripeLevel enum. + * @name google.cloud.parallelstore.v1.FileStripeLevel + * @enum {number} + * @property {number} FILE_STRIPE_LEVEL_UNSPECIFIED=0 FILE_STRIPE_LEVEL_UNSPECIFIED value + * @property {number} FILE_STRIPE_LEVEL_MIN=1 FILE_STRIPE_LEVEL_MIN value + * @property {number} FILE_STRIPE_LEVEL_BALANCED=2 FILE_STRIPE_LEVEL_BALANCED value + * @property {number} FILE_STRIPE_LEVEL_MAX=3 FILE_STRIPE_LEVEL_MAX value + */ + v1.FileStripeLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FILE_STRIPE_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "FILE_STRIPE_LEVEL_MIN"] = 1; + values[valuesById[2] = "FILE_STRIPE_LEVEL_BALANCED"] = 2; + values[valuesById[3] = "FILE_STRIPE_LEVEL_MAX"] = 3; + return values; + })(); + + /** + * DirectoryStripeLevel enum. + * @name google.cloud.parallelstore.v1.DirectoryStripeLevel + * @enum {number} + * @property {number} DIRECTORY_STRIPE_LEVEL_UNSPECIFIED=0 DIRECTORY_STRIPE_LEVEL_UNSPECIFIED value + * @property {number} DIRECTORY_STRIPE_LEVEL_MIN=1 DIRECTORY_STRIPE_LEVEL_MIN value + * @property {number} DIRECTORY_STRIPE_LEVEL_BALANCED=2 DIRECTORY_STRIPE_LEVEL_BALANCED value + * @property {number} DIRECTORY_STRIPE_LEVEL_MAX=3 DIRECTORY_STRIPE_LEVEL_MAX value + */ + v1.DirectoryStripeLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIRECTORY_STRIPE_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "DIRECTORY_STRIPE_LEVEL_MIN"] = 1; + values[valuesById[2] = "DIRECTORY_STRIPE_LEVEL_BALANCED"] = 2; + values[valuesById[3] = "DIRECTORY_STRIPE_LEVEL_MAX"] = 3; + return values; + })(); + + v1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.parallelstore.v1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [description] Instance description + * @property {google.cloud.parallelstore.v1.Instance.State|null} [state] Instance state + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {Object.|null} [labels] Instance labels + * @property {number|Long|null} [capacityGib] Instance capacityGib + * @property {string|null} [daosVersion] Instance daosVersion + * @property {Array.|null} [accessPoints] Instance accessPoints + * @property {string|null} [network] Instance network + * @property {string|null} [reservedIpRange] Instance reservedIpRange + * @property {string|null} [effectiveReservedIpRange] Instance effectiveReservedIpRange + * @property {google.cloud.parallelstore.v1.FileStripeLevel|null} [fileStripeLevel] Instance fileStripeLevel + * @property {google.cloud.parallelstore.v1.DirectoryStripeLevel|null} [directoryStripeLevel] Instance directoryStripeLevel + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.parallelstore.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.accessPoints = []; + 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.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance description. + * @member {string} description + * @memberof google.cloud.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.description = ""; + + /** + * Instance state. + * @member {google.cloud.parallelstore.v1.Instance.State} state + * @memberof google.cloud.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance capacityGib. + * @member {number|Long} capacityGib + * @memberof google.cloud.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.capacityGib = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Instance daosVersion. + * @member {string} daosVersion + * @memberof google.cloud.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.daosVersion = ""; + + /** + * Instance accessPoints. + * @member {Array.} accessPoints + * @memberof google.cloud.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.accessPoints = $util.emptyArray; + + /** + * Instance network. + * @member {string} network + * @memberof google.cloud.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.network = ""; + + /** + * Instance reservedIpRange. + * @member {string} reservedIpRange + * @memberof google.cloud.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.reservedIpRange = ""; + + /** + * Instance effectiveReservedIpRange. + * @member {string} effectiveReservedIpRange + * @memberof google.cloud.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.effectiveReservedIpRange = ""; + + /** + * Instance fileStripeLevel. + * @member {google.cloud.parallelstore.v1.FileStripeLevel} fileStripeLevel + * @memberof google.cloud.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.fileStripeLevel = 0; + + /** + * Instance directoryStripeLevel. + * @member {google.cloud.parallelstore.v1.DirectoryStripeLevel} directoryStripeLevel + * @memberof google.cloud.parallelstore.v1.Instance + * @instance + */ + Instance.prototype.directoryStripeLevel = 0; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.Instance + * @static + * @param {google.cloud.parallelstore.v1.IInstance=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.parallelstore.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.Instance + * @static + * @param {google.cloud.parallelstore.v1.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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + 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 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.capacityGib != null && Object.hasOwnProperty.call(message, "capacityGib")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.capacityGib); + if (message.daosVersion != null && Object.hasOwnProperty.call(message, "daosVersion")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.daosVersion); + if (message.accessPoints != null && message.accessPoints.length) + for (var i = 0; i < message.accessPoints.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.accessPoints[i]); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.network); + if (message.reservedIpRange != null && Object.hasOwnProperty.call(message, "reservedIpRange")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.reservedIpRange); + if (message.effectiveReservedIpRange != null && Object.hasOwnProperty.call(message, "effectiveReservedIpRange")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.effectiveReservedIpRange); + if (message.fileStripeLevel != null && Object.hasOwnProperty.call(message, "fileStripeLevel")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.fileStripeLevel); + if (message.directoryStripeLevel != null && Object.hasOwnProperty.call(message, "directoryStripeLevel")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.directoryStripeLevel); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.Instance + * @static + * @param {google.cloud.parallelstore.v1.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.parallelstore.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.parallelstore.v1.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.parallelstore.v1.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + 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 8: { + message.capacityGib = reader.int64(); + break; + } + case 9: { + message.daosVersion = reader.string(); + break; + } + case 10: { + if (!(message.accessPoints && message.accessPoints.length)) + message.accessPoints = []; + message.accessPoints.push(reader.string()); + break; + } + case 11: { + message.network = reader.string(); + break; + } + case 12: { + message.reservedIpRange = reader.string(); + break; + } + case 14: { + message.effectiveReservedIpRange = reader.string(); + break; + } + case 15: { + message.fileStripeLevel = reader.int32(); + break; + } + case 16: { + message.directoryStripeLevel = reader.int32(); + 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.parallelstore.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.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.parallelstore.v1.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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 5: + break; + } + 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.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.capacityGib != null && message.hasOwnProperty("capacityGib")) + if (!$util.isInteger(message.capacityGib) && !(message.capacityGib && $util.isInteger(message.capacityGib.low) && $util.isInteger(message.capacityGib.high))) + return "capacityGib: integer|Long expected"; + if (message.daosVersion != null && message.hasOwnProperty("daosVersion")) + if (!$util.isString(message.daosVersion)) + return "daosVersion: string expected"; + if (message.accessPoints != null && message.hasOwnProperty("accessPoints")) { + if (!Array.isArray(message.accessPoints)) + return "accessPoints: array expected"; + for (var i = 0; i < message.accessPoints.length; ++i) + if (!$util.isString(message.accessPoints[i])) + return "accessPoints: string[] expected"; + } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.reservedIpRange != null && message.hasOwnProperty("reservedIpRange")) + if (!$util.isString(message.reservedIpRange)) + return "reservedIpRange: string expected"; + if (message.effectiveReservedIpRange != null && message.hasOwnProperty("effectiveReservedIpRange")) + if (!$util.isString(message.effectiveReservedIpRange)) + return "effectiveReservedIpRange: string expected"; + if (message.fileStripeLevel != null && message.hasOwnProperty("fileStripeLevel")) + switch (message.fileStripeLevel) { + default: + return "fileStripeLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.directoryStripeLevel != null && message.hasOwnProperty("directoryStripeLevel")) + switch (message.directoryStripeLevel) { + default: + return "directoryStripeLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.Instance) + return object; + var message = new $root.google.cloud.parallelstore.v1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + 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 "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "FAILED": + case 4: + message.state = 4; + break; + case "UPGRADING": + case 5: + message.state = 5; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.parallelstore.v1.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.parallelstore.v1.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.parallelstore.v1.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.capacityGib != null) + if ($util.Long) + (message.capacityGib = $util.Long.fromValue(object.capacityGib)).unsigned = false; + else if (typeof object.capacityGib === "string") + message.capacityGib = parseInt(object.capacityGib, 10); + else if (typeof object.capacityGib === "number") + message.capacityGib = object.capacityGib; + else if (typeof object.capacityGib === "object") + message.capacityGib = new $util.LongBits(object.capacityGib.low >>> 0, object.capacityGib.high >>> 0).toNumber(); + if (object.daosVersion != null) + message.daosVersion = String(object.daosVersion); + if (object.accessPoints) { + if (!Array.isArray(object.accessPoints)) + throw TypeError(".google.cloud.parallelstore.v1.Instance.accessPoints: array expected"); + message.accessPoints = []; + for (var i = 0; i < object.accessPoints.length; ++i) + message.accessPoints[i] = String(object.accessPoints[i]); + } + if (object.network != null) + message.network = String(object.network); + if (object.reservedIpRange != null) + message.reservedIpRange = String(object.reservedIpRange); + if (object.effectiveReservedIpRange != null) + message.effectiveReservedIpRange = String(object.effectiveReservedIpRange); + switch (object.fileStripeLevel) { + default: + if (typeof object.fileStripeLevel === "number") { + message.fileStripeLevel = object.fileStripeLevel; + break; + } + break; + case "FILE_STRIPE_LEVEL_UNSPECIFIED": + case 0: + message.fileStripeLevel = 0; + break; + case "FILE_STRIPE_LEVEL_MIN": + case 1: + message.fileStripeLevel = 1; + break; + case "FILE_STRIPE_LEVEL_BALANCED": + case 2: + message.fileStripeLevel = 2; + break; + case "FILE_STRIPE_LEVEL_MAX": + case 3: + message.fileStripeLevel = 3; + break; + } + switch (object.directoryStripeLevel) { + default: + if (typeof object.directoryStripeLevel === "number") { + message.directoryStripeLevel = object.directoryStripeLevel; + break; + } + break; + case "DIRECTORY_STRIPE_LEVEL_UNSPECIFIED": + case 0: + message.directoryStripeLevel = 0; + break; + case "DIRECTORY_STRIPE_LEVEL_MIN": + case 1: + message.directoryStripeLevel = 1; + break; + case "DIRECTORY_STRIPE_LEVEL_BALANCED": + case 2: + message.directoryStripeLevel = 2; + break; + case "DIRECTORY_STRIPE_LEVEL_MAX": + case 3: + message.directoryStripeLevel = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.Instance + * @static + * @param {google.cloud.parallelstore.v1.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.accessPoints = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.capacityGib = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.capacityGib = options.longs === String ? "0" : 0; + object.daosVersion = ""; + object.network = ""; + object.reservedIpRange = ""; + object.effectiveReservedIpRange = ""; + object.fileStripeLevel = options.enums === String ? "FILE_STRIPE_LEVEL_UNSPECIFIED" : 0; + object.directoryStripeLevel = options.enums === String ? "DIRECTORY_STRIPE_LEVEL_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.parallelstore.v1.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.parallelstore.v1.Instance.State[message.state] : message.state; + 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); + 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.capacityGib != null && message.hasOwnProperty("capacityGib")) + if (typeof message.capacityGib === "number") + object.capacityGib = options.longs === String ? String(message.capacityGib) : message.capacityGib; + else + object.capacityGib = options.longs === String ? $util.Long.prototype.toString.call(message.capacityGib) : options.longs === Number ? new $util.LongBits(message.capacityGib.low >>> 0, message.capacityGib.high >>> 0).toNumber() : message.capacityGib; + if (message.daosVersion != null && message.hasOwnProperty("daosVersion")) + object.daosVersion = message.daosVersion; + if (message.accessPoints && message.accessPoints.length) { + object.accessPoints = []; + for (var j = 0; j < message.accessPoints.length; ++j) + object.accessPoints[j] = message.accessPoints[j]; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.reservedIpRange != null && message.hasOwnProperty("reservedIpRange")) + object.reservedIpRange = message.reservedIpRange; + if (message.effectiveReservedIpRange != null && message.hasOwnProperty("effectiveReservedIpRange")) + object.effectiveReservedIpRange = message.effectiveReservedIpRange; + if (message.fileStripeLevel != null && message.hasOwnProperty("fileStripeLevel")) + object.fileStripeLevel = options.enums === String ? $root.google.cloud.parallelstore.v1.FileStripeLevel[message.fileStripeLevel] === undefined ? message.fileStripeLevel : $root.google.cloud.parallelstore.v1.FileStripeLevel[message.fileStripeLevel] : message.fileStripeLevel; + if (message.directoryStripeLevel != null && message.hasOwnProperty("directoryStripeLevel")) + object.directoryStripeLevel = options.enums === String ? $root.google.cloud.parallelstore.v1.DirectoryStripeLevel[message.directoryStripeLevel] === undefined ? message.directoryStripeLevel : $root.google.cloud.parallelstore.v1.DirectoryStripeLevel[message.directoryStripeLevel] : message.directoryStripeLevel; + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.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.parallelstore.v1.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.parallelstore.v1.Instance"; + }; + + /** + * State enum. + * @name google.cloud.parallelstore.v1.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} FAILED=4 FAILED value + * @property {number} UPGRADING=5 UPGRADING value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "FAILED"] = 4; + values[valuesById[5] = "UPGRADING"] = 5; + return values; + })(); + + return Instance; + })(); + + v1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.parallelstore.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 + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.parallelstore.v1.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @static + * @param {google.cloud.parallelstore.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.parallelstore.v1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @static + * @param {google.cloud.parallelstore.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + 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 ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @static + * @param {google.cloud.parallelstore.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.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.parallelstore.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.parallelstore.v1.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + 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 a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.ListInstancesRequest) + return object; + var message = new $root.google.cloud.parallelstore.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 a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @static + * @param {google.cloud.parallelstore.v1.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + 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. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); + + v1.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.parallelstore.v1 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.parallelstore.v1.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.parallelstore.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.parallelstore.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.parallelstore.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.ListInstancesResponse + * @static + * @param {google.cloud.parallelstore.v1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.parallelstore.v1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.ListInstancesResponse + * @static + * @param {google.cloud.parallelstore.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.parallelstore.v1.Instance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.ListInstancesResponse + * @static + * @param {google.cloud.parallelstore.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.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.parallelstore.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.parallelstore.v1.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.parallelstore.v1.Instance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.cloud.parallelstore.v1.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.parallelstore.v1.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.ListInstancesResponse) + return object; + var message = new $root.google.cloud.parallelstore.v1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.parallelstore.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.parallelstore.v1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.parallelstore.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.parallelstore.v1.ListInstancesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.ListInstancesResponse + * @static + * @param {google.cloud.parallelstore.v1.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.parallelstore.v1.Instance.toObject(message.instances[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.ListInstancesResponse"; + }; + + return ListInstancesResponse; + })(); + + v1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.parallelstore.v1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.parallelstore.v1.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.parallelstore.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.GetInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.parallelstore.v1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.GetInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.GetInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.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.parallelstore.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.parallelstore.v1.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.parallelstore.v1.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.parallelstore.v1.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.GetInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v1.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.parallelstore.v1 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.parallelstore.v1.IInstance|null} [instance] CreateInstanceRequest instance + * @property {string|null} [requestId] CreateInstanceRequest requestId + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.parallelstore.v1.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(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]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.parallelstore.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.parallelstore.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.parallelstore.v1.IInstance|null|undefined} instance + * @memberof google.cloud.parallelstore.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * CreateInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.parallelstore.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.requestId = ""; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.CreateInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.parallelstore.v1.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.CreateInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.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.parallelstore.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.CreateInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.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.parallelstore.v1.CreateInstanceRequest} CreateInstanceRequest + * @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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.parallelstore.v1.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.cloud.parallelstore.v1.Instance.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.CreateInstanceRequest} CreateInstanceRequest + * @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) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.cloud.parallelstore.v1.CreateInstanceRequest + * @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) { + 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.parallelstore.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.parallelstore.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.parallelstore.v1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.parallelstore.v1.Instance.fromObject(object.instance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.CreateInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + object.requestId = ""; + } + 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.parallelstore.v1.Instance.toObject(message.instance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v1.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.cloud.parallelstore.v1 + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.parallelstore.v1.IInstance|null} [instance] UpdateInstanceRequest instance + * @property {string|null} [requestId] UpdateInstanceRequest requestId + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.cloud.parallelstore.v1.IUpdateInstanceRequest=} [properties] Properties to set + */ + function UpdateInstanceRequest(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]]; + } + + /** + * UpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.parallelstore.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.updateMask = null; + + /** + * UpdateInstanceRequest instance. + * @member {google.cloud.parallelstore.v1.IInstance|null|undefined} instance + * @memberof google.cloud.parallelstore.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = null; + + /** + * UpdateInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.parallelstore.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.parallelstore.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.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.parallelstore.v1.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.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.parallelstore.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.parallelstore.v1.UpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instance = $root.google.cloud.parallelstore.v1.Instance.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @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) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceRequest message. + * @function verify + * @memberof google.cloud.parallelstore.v1.UpdateInstanceRequest + * @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) { + 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.parallelstore.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.UpdateInstanceRequest) + return object; + var message = new $root.google.cloud.parallelstore.v1.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.parallelstore.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.parallelstore.v1.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.parallelstore.v1.Instance.fromObject(object.instance); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.instance = null; + object.requestId = ""; + } + 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.parallelstore.v1.Instance.toObject(message.instance, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.UpdateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.UpdateInstanceRequest"; + }; + + return UpdateInstanceRequest; + })(); + + v1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.parallelstore.v1 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + * @property {string|null} [requestId] DeleteInstanceRequest requestId + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.parallelstore.v1.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(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]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.parallelstore.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * DeleteInstanceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.parallelstore.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.parallelstore.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.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.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.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.parallelstore.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.parallelstore.v1.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @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) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.parallelstore.v1.DeleteInstanceRequest + * @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) { + 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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.parallelstore.v1.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.parallelstore.v1.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 = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.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.parallelstore.v1.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.parallelstore.v1.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.parallelstore.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} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.parallelstore.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]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.parallelstore.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.parallelstore.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.parallelstore.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.parallelstore.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.parallelstore.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.parallelstore.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.parallelstore.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.OperationMetadata + * @static + * @param {google.cloud.parallelstore.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.parallelstore.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.OperationMetadata + * @static + * @param {google.cloud.parallelstore.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.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + 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.parallelstore.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.OperationMetadata + * @static + * @param {google.cloud.parallelstore.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.parallelstore.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.parallelstore.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.parallelstore.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.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = 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.parallelstore.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.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.parallelstore.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.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: 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.parallelstore.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.parallelstore.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.parallelstore.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.parallelstore.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.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + 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.parallelstore.v1.OperationMetadata + * @static + * @param {google.cloud.parallelstore.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.statusMessage = ""; + object.requestedCancellation = 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.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.parallelstore.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.parallelstore.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.SourceGcsBucket = (function() { + + /** + * Properties of a SourceGcsBucket. + * @memberof google.cloud.parallelstore.v1 + * @interface ISourceGcsBucket + * @property {string|null} [uri] SourceGcsBucket uri + */ + + /** + * Constructs a new SourceGcsBucket. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents a SourceGcsBucket. + * @implements ISourceGcsBucket + * @constructor + * @param {google.cloud.parallelstore.v1.ISourceGcsBucket=} [properties] Properties to set + */ + function SourceGcsBucket(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]]; + } + + /** + * SourceGcsBucket uri. + * @member {string} uri + * @memberof google.cloud.parallelstore.v1.SourceGcsBucket + * @instance + */ + SourceGcsBucket.prototype.uri = ""; + + /** + * Creates a new SourceGcsBucket instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.SourceGcsBucket + * @static + * @param {google.cloud.parallelstore.v1.ISourceGcsBucket=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.SourceGcsBucket} SourceGcsBucket instance + */ + SourceGcsBucket.create = function create(properties) { + return new SourceGcsBucket(properties); + }; + + /** + * Encodes the specified SourceGcsBucket message. Does not implicitly {@link google.cloud.parallelstore.v1.SourceGcsBucket.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.SourceGcsBucket + * @static + * @param {google.cloud.parallelstore.v1.ISourceGcsBucket} message SourceGcsBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceGcsBucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified SourceGcsBucket message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.SourceGcsBucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.SourceGcsBucket + * @static + * @param {google.cloud.parallelstore.v1.ISourceGcsBucket} message SourceGcsBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceGcsBucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceGcsBucket message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.v1.SourceGcsBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.parallelstore.v1.SourceGcsBucket} SourceGcsBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceGcsBucket.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.parallelstore.v1.SourceGcsBucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceGcsBucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.SourceGcsBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.SourceGcsBucket} SourceGcsBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceGcsBucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceGcsBucket message. + * @function verify + * @memberof google.cloud.parallelstore.v1.SourceGcsBucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceGcsBucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a SourceGcsBucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.SourceGcsBucket + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.SourceGcsBucket} SourceGcsBucket + */ + SourceGcsBucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.SourceGcsBucket) + return object; + var message = new $root.google.cloud.parallelstore.v1.SourceGcsBucket(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a SourceGcsBucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.SourceGcsBucket + * @static + * @param {google.cloud.parallelstore.v1.SourceGcsBucket} message SourceGcsBucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceGcsBucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this SourceGcsBucket to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.SourceGcsBucket + * @instance + * @returns {Object.} JSON object + */ + SourceGcsBucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceGcsBucket + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.SourceGcsBucket + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceGcsBucket.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.SourceGcsBucket"; + }; + + return SourceGcsBucket; + })(); + + v1.DestinationGcsBucket = (function() { + + /** + * Properties of a DestinationGcsBucket. + * @memberof google.cloud.parallelstore.v1 + * @interface IDestinationGcsBucket + * @property {string|null} [uri] DestinationGcsBucket uri + */ + + /** + * Constructs a new DestinationGcsBucket. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents a DestinationGcsBucket. + * @implements IDestinationGcsBucket + * @constructor + * @param {google.cloud.parallelstore.v1.IDestinationGcsBucket=} [properties] Properties to set + */ + function DestinationGcsBucket(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]]; + } + + /** + * DestinationGcsBucket uri. + * @member {string} uri + * @memberof google.cloud.parallelstore.v1.DestinationGcsBucket + * @instance + */ + DestinationGcsBucket.prototype.uri = ""; + + /** + * Creates a new DestinationGcsBucket instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.DestinationGcsBucket + * @static + * @param {google.cloud.parallelstore.v1.IDestinationGcsBucket=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.DestinationGcsBucket} DestinationGcsBucket instance + */ + DestinationGcsBucket.create = function create(properties) { + return new DestinationGcsBucket(properties); + }; + + /** + * Encodes the specified DestinationGcsBucket message. Does not implicitly {@link google.cloud.parallelstore.v1.DestinationGcsBucket.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.DestinationGcsBucket + * @static + * @param {google.cloud.parallelstore.v1.IDestinationGcsBucket} message DestinationGcsBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationGcsBucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified DestinationGcsBucket message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.DestinationGcsBucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.DestinationGcsBucket + * @static + * @param {google.cloud.parallelstore.v1.IDestinationGcsBucket} message DestinationGcsBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationGcsBucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DestinationGcsBucket message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.v1.DestinationGcsBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.parallelstore.v1.DestinationGcsBucket} DestinationGcsBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationGcsBucket.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.parallelstore.v1.DestinationGcsBucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DestinationGcsBucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.DestinationGcsBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.DestinationGcsBucket} DestinationGcsBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationGcsBucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DestinationGcsBucket message. + * @function verify + * @memberof google.cloud.parallelstore.v1.DestinationGcsBucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DestinationGcsBucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a DestinationGcsBucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.DestinationGcsBucket + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.DestinationGcsBucket} DestinationGcsBucket + */ + DestinationGcsBucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.DestinationGcsBucket) + return object; + var message = new $root.google.cloud.parallelstore.v1.DestinationGcsBucket(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a DestinationGcsBucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.DestinationGcsBucket + * @static + * @param {google.cloud.parallelstore.v1.DestinationGcsBucket} message DestinationGcsBucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DestinationGcsBucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this DestinationGcsBucket to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.DestinationGcsBucket + * @instance + * @returns {Object.} JSON object + */ + DestinationGcsBucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DestinationGcsBucket + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.DestinationGcsBucket + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DestinationGcsBucket.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.DestinationGcsBucket"; + }; + + return DestinationGcsBucket; + })(); + + v1.SourceParallelstore = (function() { + + /** + * Properties of a SourceParallelstore. + * @memberof google.cloud.parallelstore.v1 + * @interface ISourceParallelstore + * @property {string|null} [path] SourceParallelstore path + */ + + /** + * Constructs a new SourceParallelstore. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents a SourceParallelstore. + * @implements ISourceParallelstore + * @constructor + * @param {google.cloud.parallelstore.v1.ISourceParallelstore=} [properties] Properties to set + */ + function SourceParallelstore(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]]; + } + + /** + * SourceParallelstore path. + * @member {string} path + * @memberof google.cloud.parallelstore.v1.SourceParallelstore + * @instance + */ + SourceParallelstore.prototype.path = ""; + + /** + * Creates a new SourceParallelstore instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.SourceParallelstore + * @static + * @param {google.cloud.parallelstore.v1.ISourceParallelstore=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.SourceParallelstore} SourceParallelstore instance + */ + SourceParallelstore.create = function create(properties) { + return new SourceParallelstore(properties); + }; + + /** + * Encodes the specified SourceParallelstore message. Does not implicitly {@link google.cloud.parallelstore.v1.SourceParallelstore.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.SourceParallelstore + * @static + * @param {google.cloud.parallelstore.v1.ISourceParallelstore} message SourceParallelstore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceParallelstore.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + return writer; + }; + + /** + * Encodes the specified SourceParallelstore message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.SourceParallelstore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.SourceParallelstore + * @static + * @param {google.cloud.parallelstore.v1.ISourceParallelstore} message SourceParallelstore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceParallelstore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceParallelstore message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.v1.SourceParallelstore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.parallelstore.v1.SourceParallelstore} SourceParallelstore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceParallelstore.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.parallelstore.v1.SourceParallelstore(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceParallelstore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.SourceParallelstore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.SourceParallelstore} SourceParallelstore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceParallelstore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceParallelstore message. + * @function verify + * @memberof google.cloud.parallelstore.v1.SourceParallelstore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceParallelstore.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a SourceParallelstore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.SourceParallelstore + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.SourceParallelstore} SourceParallelstore + */ + SourceParallelstore.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.SourceParallelstore) + return object; + var message = new $root.google.cloud.parallelstore.v1.SourceParallelstore(); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a SourceParallelstore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.SourceParallelstore + * @static + * @param {google.cloud.parallelstore.v1.SourceParallelstore} message SourceParallelstore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceParallelstore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.path = ""; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this SourceParallelstore to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.SourceParallelstore + * @instance + * @returns {Object.} JSON object + */ + SourceParallelstore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceParallelstore + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.SourceParallelstore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceParallelstore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.SourceParallelstore"; + }; + + return SourceParallelstore; + })(); + + v1.DestinationParallelstore = (function() { + + /** + * Properties of a DestinationParallelstore. + * @memberof google.cloud.parallelstore.v1 + * @interface IDestinationParallelstore + * @property {string|null} [path] DestinationParallelstore path + */ + + /** + * Constructs a new DestinationParallelstore. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents a DestinationParallelstore. + * @implements IDestinationParallelstore + * @constructor + * @param {google.cloud.parallelstore.v1.IDestinationParallelstore=} [properties] Properties to set + */ + function DestinationParallelstore(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]]; + } + + /** + * DestinationParallelstore path. + * @member {string} path + * @memberof google.cloud.parallelstore.v1.DestinationParallelstore + * @instance + */ + DestinationParallelstore.prototype.path = ""; + + /** + * Creates a new DestinationParallelstore instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.DestinationParallelstore + * @static + * @param {google.cloud.parallelstore.v1.IDestinationParallelstore=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.DestinationParallelstore} DestinationParallelstore instance + */ + DestinationParallelstore.create = function create(properties) { + return new DestinationParallelstore(properties); + }; + + /** + * Encodes the specified DestinationParallelstore message. Does not implicitly {@link google.cloud.parallelstore.v1.DestinationParallelstore.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.DestinationParallelstore + * @static + * @param {google.cloud.parallelstore.v1.IDestinationParallelstore} message DestinationParallelstore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationParallelstore.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + return writer; + }; + + /** + * Encodes the specified DestinationParallelstore message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.DestinationParallelstore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.DestinationParallelstore + * @static + * @param {google.cloud.parallelstore.v1.IDestinationParallelstore} message DestinationParallelstore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DestinationParallelstore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DestinationParallelstore message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.v1.DestinationParallelstore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.parallelstore.v1.DestinationParallelstore} DestinationParallelstore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationParallelstore.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.parallelstore.v1.DestinationParallelstore(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DestinationParallelstore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.DestinationParallelstore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.DestinationParallelstore} DestinationParallelstore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DestinationParallelstore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DestinationParallelstore message. + * @function verify + * @memberof google.cloud.parallelstore.v1.DestinationParallelstore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DestinationParallelstore.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a DestinationParallelstore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.DestinationParallelstore + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.DestinationParallelstore} DestinationParallelstore + */ + DestinationParallelstore.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.DestinationParallelstore) + return object; + var message = new $root.google.cloud.parallelstore.v1.DestinationParallelstore(); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a DestinationParallelstore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.DestinationParallelstore + * @static + * @param {google.cloud.parallelstore.v1.DestinationParallelstore} message DestinationParallelstore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DestinationParallelstore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.path = ""; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this DestinationParallelstore to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.DestinationParallelstore + * @instance + * @returns {Object.} JSON object + */ + DestinationParallelstore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DestinationParallelstore + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.DestinationParallelstore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DestinationParallelstore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.DestinationParallelstore"; + }; + + return DestinationParallelstore; + })(); + + v1.ImportDataRequest = (function() { + + /** + * Properties of an ImportDataRequest. + * @memberof google.cloud.parallelstore.v1 + * @interface IImportDataRequest + * @property {google.cloud.parallelstore.v1.ISourceGcsBucket|null} [sourceGcsBucket] ImportDataRequest sourceGcsBucket + * @property {google.cloud.parallelstore.v1.IDestinationParallelstore|null} [destinationParallelstore] ImportDataRequest destinationParallelstore + * @property {string|null} [name] ImportDataRequest name + * @property {string|null} [requestId] ImportDataRequest requestId + * @property {string|null} [serviceAccount] ImportDataRequest serviceAccount + */ + + /** + * Constructs a new ImportDataRequest. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents an ImportDataRequest. + * @implements IImportDataRequest + * @constructor + * @param {google.cloud.parallelstore.v1.IImportDataRequest=} [properties] Properties to set + */ + function ImportDataRequest(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]]; + } + + /** + * ImportDataRequest sourceGcsBucket. + * @member {google.cloud.parallelstore.v1.ISourceGcsBucket|null|undefined} sourceGcsBucket + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.sourceGcsBucket = null; + + /** + * ImportDataRequest destinationParallelstore. + * @member {google.cloud.parallelstore.v1.IDestinationParallelstore|null|undefined} destinationParallelstore + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.destinationParallelstore = null; + + /** + * ImportDataRequest name. + * @member {string} name + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.name = ""; + + /** + * ImportDataRequest requestId. + * @member {string} requestId + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.requestId = ""; + + /** + * ImportDataRequest serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @instance + */ + ImportDataRequest.prototype.serviceAccount = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportDataRequest source. + * @member {"sourceGcsBucket"|undefined} source + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @instance + */ + Object.defineProperty(ImportDataRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["sourceGcsBucket"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ImportDataRequest destination. + * @member {"destinationParallelstore"|undefined} destination + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @instance + */ + Object.defineProperty(ImportDataRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["destinationParallelstore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @static + * @param {google.cloud.parallelstore.v1.IImportDataRequest=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.ImportDataRequest} ImportDataRequest instance + */ + ImportDataRequest.create = function create(properties) { + return new ImportDataRequest(properties); + }; + + /** + * Encodes the specified ImportDataRequest message. Does not implicitly {@link google.cloud.parallelstore.v1.ImportDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @static + * @param {google.cloud.parallelstore.v1.IImportDataRequest} message ImportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataRequest.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.sourceGcsBucket != null && Object.hasOwnProperty.call(message, "sourceGcsBucket")) + $root.google.cloud.parallelstore.v1.SourceGcsBucket.encode(message.sourceGcsBucket, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.destinationParallelstore != null && Object.hasOwnProperty.call(message, "destinationParallelstore")) + $root.google.cloud.parallelstore.v1.DestinationParallelstore.encode(message.destinationParallelstore, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); + return writer; + }; + + /** + * Encodes the specified ImportDataRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ImportDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @static + * @param {google.cloud.parallelstore.v1.IImportDataRequest} message ImportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.parallelstore.v1.ImportDataRequest} ImportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataRequest.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.parallelstore.v1.ImportDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.sourceGcsBucket = $root.google.cloud.parallelstore.v1.SourceGcsBucket.decode(reader, reader.uint32()); + break; + } + case 3: { + message.destinationParallelstore = $root.google.cloud.parallelstore.v1.DestinationParallelstore.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.serviceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.ImportDataRequest} ImportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDataRequest message. + * @function verify + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDataRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sourceGcsBucket != null && message.hasOwnProperty("sourceGcsBucket")) { + properties.source = 1; + { + var error = $root.google.cloud.parallelstore.v1.SourceGcsBucket.verify(message.sourceGcsBucket); + if (error) + return "sourceGcsBucket." + error; + } + } + if (message.destinationParallelstore != null && message.hasOwnProperty("destinationParallelstore")) { + properties.destination = 1; + { + var error = $root.google.cloud.parallelstore.v1.DestinationParallelstore.verify(message.destinationParallelstore); + if (error) + return "destinationParallelstore." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + return null; + }; + + /** + * Creates an ImportDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.ImportDataRequest} ImportDataRequest + */ + ImportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.ImportDataRequest) + return object; + var message = new $root.google.cloud.parallelstore.v1.ImportDataRequest(); + if (object.sourceGcsBucket != null) { + if (typeof object.sourceGcsBucket !== "object") + throw TypeError(".google.cloud.parallelstore.v1.ImportDataRequest.sourceGcsBucket: object expected"); + message.sourceGcsBucket = $root.google.cloud.parallelstore.v1.SourceGcsBucket.fromObject(object.sourceGcsBucket); + } + if (object.destinationParallelstore != null) { + if (typeof object.destinationParallelstore !== "object") + throw TypeError(".google.cloud.parallelstore.v1.ImportDataRequest.destinationParallelstore: object expected"); + message.destinationParallelstore = $root.google.cloud.parallelstore.v1.DestinationParallelstore.fromObject(object.destinationParallelstore); + } + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + return message; + }; + + /** + * Creates a plain object from an ImportDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @static + * @param {google.cloud.parallelstore.v1.ImportDataRequest} message ImportDataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.serviceAccount = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceGcsBucket != null && message.hasOwnProperty("sourceGcsBucket")) { + object.sourceGcsBucket = $root.google.cloud.parallelstore.v1.SourceGcsBucket.toObject(message.sourceGcsBucket, options); + if (options.oneofs) + object.source = "sourceGcsBucket"; + } + if (message.destinationParallelstore != null && message.hasOwnProperty("destinationParallelstore")) { + object.destinationParallelstore = $root.google.cloud.parallelstore.v1.DestinationParallelstore.toObject(message.destinationParallelstore, options); + if (options.oneofs) + object.destination = "destinationParallelstore"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + return object; + }; + + /** + * Converts this ImportDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @instance + * @returns {Object.} JSON object + */ + ImportDataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDataRequest + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.ImportDataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.ImportDataRequest"; + }; + + return ImportDataRequest; + })(); + + v1.ExportDataRequest = (function() { + + /** + * Properties of an ExportDataRequest. + * @memberof google.cloud.parallelstore.v1 + * @interface IExportDataRequest + * @property {google.cloud.parallelstore.v1.ISourceParallelstore|null} [sourceParallelstore] ExportDataRequest sourceParallelstore + * @property {google.cloud.parallelstore.v1.IDestinationGcsBucket|null} [destinationGcsBucket] ExportDataRequest destinationGcsBucket + * @property {string|null} [name] ExportDataRequest name + * @property {string|null} [requestId] ExportDataRequest requestId + * @property {string|null} [serviceAccount] ExportDataRequest serviceAccount + */ + + /** + * Constructs a new ExportDataRequest. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents an ExportDataRequest. + * @implements IExportDataRequest + * @constructor + * @param {google.cloud.parallelstore.v1.IExportDataRequest=} [properties] Properties to set + */ + function ExportDataRequest(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]]; + } + + /** + * ExportDataRequest sourceParallelstore. + * @member {google.cloud.parallelstore.v1.ISourceParallelstore|null|undefined} sourceParallelstore + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.sourceParallelstore = null; + + /** + * ExportDataRequest destinationGcsBucket. + * @member {google.cloud.parallelstore.v1.IDestinationGcsBucket|null|undefined} destinationGcsBucket + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.destinationGcsBucket = null; + + /** + * ExportDataRequest name. + * @member {string} name + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.name = ""; + + /** + * ExportDataRequest requestId. + * @member {string} requestId + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.requestId = ""; + + /** + * ExportDataRequest serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @instance + */ + ExportDataRequest.prototype.serviceAccount = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportDataRequest source. + * @member {"sourceParallelstore"|undefined} source + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @instance + */ + Object.defineProperty(ExportDataRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["sourceParallelstore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExportDataRequest destination. + * @member {"destinationGcsBucket"|undefined} destination + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @instance + */ + Object.defineProperty(ExportDataRequest.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["destinationGcsBucket"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @static + * @param {google.cloud.parallelstore.v1.IExportDataRequest=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.ExportDataRequest} ExportDataRequest instance + */ + ExportDataRequest.create = function create(properties) { + return new ExportDataRequest(properties); + }; + + /** + * Encodes the specified ExportDataRequest message. Does not implicitly {@link google.cloud.parallelstore.v1.ExportDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @static + * @param {google.cloud.parallelstore.v1.IExportDataRequest} message ExportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataRequest.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.sourceParallelstore != null && Object.hasOwnProperty.call(message, "sourceParallelstore")) + $root.google.cloud.parallelstore.v1.SourceParallelstore.encode(message.sourceParallelstore, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.destinationGcsBucket != null && Object.hasOwnProperty.call(message, "destinationGcsBucket")) + $root.google.cloud.parallelstore.v1.DestinationGcsBucket.encode(message.destinationGcsBucket, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.serviceAccount); + return writer; + }; + + /** + * Encodes the specified ExportDataRequest message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ExportDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @static + * @param {google.cloud.parallelstore.v1.IExportDataRequest} message ExportDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.parallelstore.v1.ExportDataRequest} ExportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataRequest.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.parallelstore.v1.ExportDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.sourceParallelstore = $root.google.cloud.parallelstore.v1.SourceParallelstore.decode(reader, reader.uint32()); + break; + } + case 3: { + message.destinationGcsBucket = $root.google.cloud.parallelstore.v1.DestinationGcsBucket.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.serviceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.ExportDataRequest} ExportDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataRequest message. + * @function verify + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sourceParallelstore != null && message.hasOwnProperty("sourceParallelstore")) { + properties.source = 1; + { + var error = $root.google.cloud.parallelstore.v1.SourceParallelstore.verify(message.sourceParallelstore); + if (error) + return "sourceParallelstore." + error; + } + } + if (message.destinationGcsBucket != null && message.hasOwnProperty("destinationGcsBucket")) { + properties.destination = 1; + { + var error = $root.google.cloud.parallelstore.v1.DestinationGcsBucket.verify(message.destinationGcsBucket); + if (error) + return "destinationGcsBucket." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + return null; + }; + + /** + * Creates an ExportDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.ExportDataRequest} ExportDataRequest + */ + ExportDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.ExportDataRequest) + return object; + var message = new $root.google.cloud.parallelstore.v1.ExportDataRequest(); + if (object.sourceParallelstore != null) { + if (typeof object.sourceParallelstore !== "object") + throw TypeError(".google.cloud.parallelstore.v1.ExportDataRequest.sourceParallelstore: object expected"); + message.sourceParallelstore = $root.google.cloud.parallelstore.v1.SourceParallelstore.fromObject(object.sourceParallelstore); + } + if (object.destinationGcsBucket != null) { + if (typeof object.destinationGcsBucket !== "object") + throw TypeError(".google.cloud.parallelstore.v1.ExportDataRequest.destinationGcsBucket: object expected"); + message.destinationGcsBucket = $root.google.cloud.parallelstore.v1.DestinationGcsBucket.fromObject(object.destinationGcsBucket); + } + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + return message; + }; + + /** + * Creates a plain object from an ExportDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @static + * @param {google.cloud.parallelstore.v1.ExportDataRequest} message ExportDataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.serviceAccount = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sourceParallelstore != null && message.hasOwnProperty("sourceParallelstore")) { + object.sourceParallelstore = $root.google.cloud.parallelstore.v1.SourceParallelstore.toObject(message.sourceParallelstore, options); + if (options.oneofs) + object.source = "sourceParallelstore"; + } + if (message.destinationGcsBucket != null && message.hasOwnProperty("destinationGcsBucket")) { + object.destinationGcsBucket = $root.google.cloud.parallelstore.v1.DestinationGcsBucket.toObject(message.destinationGcsBucket, options); + if (options.oneofs) + object.destination = "destinationGcsBucket"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + return object; + }; + + /** + * Converts this ExportDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @instance + * @returns {Object.} JSON object + */ + ExportDataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataRequest + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.ExportDataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.ExportDataRequest"; + }; + + return ExportDataRequest; + })(); + + v1.ImportDataResponse = (function() { + + /** + * Properties of an ImportDataResponse. + * @memberof google.cloud.parallelstore.v1 + * @interface IImportDataResponse + */ + + /** + * Constructs a new ImportDataResponse. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents an ImportDataResponse. + * @implements IImportDataResponse + * @constructor + * @param {google.cloud.parallelstore.v1.IImportDataResponse=} [properties] Properties to set + */ + function ImportDataResponse(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 ImportDataResponse instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.ImportDataResponse + * @static + * @param {google.cloud.parallelstore.v1.IImportDataResponse=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.ImportDataResponse} ImportDataResponse instance + */ + ImportDataResponse.create = function create(properties) { + return new ImportDataResponse(properties); + }; + + /** + * Encodes the specified ImportDataResponse message. Does not implicitly {@link google.cloud.parallelstore.v1.ImportDataResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.ImportDataResponse + * @static + * @param {google.cloud.parallelstore.v1.IImportDataResponse} message ImportDataResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ImportDataResponse message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ImportDataResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.ImportDataResponse + * @static + * @param {google.cloud.parallelstore.v1.IImportDataResponse} message ImportDataResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDataResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.v1.ImportDataResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.parallelstore.v1.ImportDataResponse} ImportDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataResponse.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.parallelstore.v1.ImportDataResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDataResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.ImportDataResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.ImportDataResponse} ImportDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDataResponse message. + * @function verify + * @memberof google.cloud.parallelstore.v1.ImportDataResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDataResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ImportDataResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.ImportDataResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.ImportDataResponse} ImportDataResponse + */ + ImportDataResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.ImportDataResponse) + return object; + return new $root.google.cloud.parallelstore.v1.ImportDataResponse(); + }; + + /** + * Creates a plain object from an ImportDataResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.ImportDataResponse + * @static + * @param {google.cloud.parallelstore.v1.ImportDataResponse} message ImportDataResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDataResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ImportDataResponse to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.ImportDataResponse + * @instance + * @returns {Object.} JSON object + */ + ImportDataResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDataResponse + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.ImportDataResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.ImportDataResponse"; + }; + + return ImportDataResponse; + })(); + + v1.ImportDataMetadata = (function() { + + /** + * Properties of an ImportDataMetadata. + * @memberof google.cloud.parallelstore.v1 + * @interface IImportDataMetadata + * @property {google.cloud.parallelstore.v1.ITransferOperationMetadata|null} [operationMetadata] ImportDataMetadata operationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ImportDataMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] ImportDataMetadata endTime + * @property {string|null} [target] ImportDataMetadata target + * @property {string|null} [verb] ImportDataMetadata verb + * @property {string|null} [statusMessage] ImportDataMetadata statusMessage + * @property {boolean|null} [requestedCancellation] ImportDataMetadata requestedCancellation + * @property {string|null} [apiVersion] ImportDataMetadata apiVersion + */ + + /** + * Constructs a new ImportDataMetadata. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents an ImportDataMetadata. + * @implements IImportDataMetadata + * @constructor + * @param {google.cloud.parallelstore.v1.IImportDataMetadata=} [properties] Properties to set + */ + function ImportDataMetadata(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]]; + } + + /** + * ImportDataMetadata operationMetadata. + * @member {google.cloud.parallelstore.v1.ITransferOperationMetadata|null|undefined} operationMetadata + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @instance + */ + ImportDataMetadata.prototype.operationMetadata = null; + + /** + * ImportDataMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @instance + */ + ImportDataMetadata.prototype.createTime = null; + + /** + * ImportDataMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @instance + */ + ImportDataMetadata.prototype.endTime = null; + + /** + * ImportDataMetadata target. + * @member {string} target + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @instance + */ + ImportDataMetadata.prototype.target = ""; + + /** + * ImportDataMetadata verb. + * @member {string} verb + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @instance + */ + ImportDataMetadata.prototype.verb = ""; + + /** + * ImportDataMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @instance + */ + ImportDataMetadata.prototype.statusMessage = ""; + + /** + * ImportDataMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @instance + */ + ImportDataMetadata.prototype.requestedCancellation = false; + + /** + * ImportDataMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @instance + */ + ImportDataMetadata.prototype.apiVersion = ""; + + /** + * Creates a new ImportDataMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @static + * @param {google.cloud.parallelstore.v1.IImportDataMetadata=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.ImportDataMetadata} ImportDataMetadata instance + */ + ImportDataMetadata.create = function create(properties) { + return new ImportDataMetadata(properties); + }; + + /** + * Encodes the specified ImportDataMetadata message. Does not implicitly {@link google.cloud.parallelstore.v1.ImportDataMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @static + * @param {google.cloud.parallelstore.v1.IImportDataMetadata} message ImportDataMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operationMetadata != null && Object.hasOwnProperty.call(message, "operationMetadata")) + $root.google.cloud.parallelstore.v1.TransferOperationMetadata.encode(message.operationMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified ImportDataMetadata message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ImportDataMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @static + * @param {google.cloud.parallelstore.v1.IImportDataMetadata} message ImportDataMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportDataMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportDataMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.parallelstore.v1.ImportDataMetadata} ImportDataMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataMetadata.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.parallelstore.v1.ImportDataMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.operationMetadata = $root.google.cloud.parallelstore.v1.TransferOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.target = reader.string(); + break; + } + case 5: { + message.verb = reader.string(); + break; + } + case 6: { + message.statusMessage = reader.string(); + break; + } + case 7: { + message.requestedCancellation = reader.bool(); + break; + } + case 8: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportDataMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.ImportDataMetadata} ImportDataMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDataMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDataMetadata message. + * @function verify + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDataMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operationMetadata != null && message.hasOwnProperty("operationMetadata")) { + var error = $root.google.cloud.parallelstore.v1.TransferOperationMetadata.verify(message.operationMetadata); + if (error) + return "operationMetadata." + error; + } + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an ImportDataMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.ImportDataMetadata} ImportDataMetadata + */ + ImportDataMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.ImportDataMetadata) + return object; + var message = new $root.google.cloud.parallelstore.v1.ImportDataMetadata(); + if (object.operationMetadata != null) { + if (typeof object.operationMetadata !== "object") + throw TypeError(".google.cloud.parallelstore.v1.ImportDataMetadata.operationMetadata: object expected"); + message.operationMetadata = $root.google.cloud.parallelstore.v1.TransferOperationMetadata.fromObject(object.operationMetadata); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.parallelstore.v1.ImportDataMetadata.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.parallelstore.v1.ImportDataMetadata.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.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an ImportDataMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @static + * @param {google.cloud.parallelstore.v1.ImportDataMetadata} message ImportDataMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDataMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operationMetadata = null; + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.operationMetadata != null && message.hasOwnProperty("operationMetadata")) + object.operationMetadata = $root.google.cloud.parallelstore.v1.TransferOperationMetadata.toObject(message.operationMetadata, options); + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this ImportDataMetadata to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportDataMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDataMetadata + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.ImportDataMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDataMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.ImportDataMetadata"; + }; + + return ImportDataMetadata; + })(); + + v1.ExportDataResponse = (function() { + + /** + * Properties of an ExportDataResponse. + * @memberof google.cloud.parallelstore.v1 + * @interface IExportDataResponse + */ + + /** + * Constructs a new ExportDataResponse. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents an ExportDataResponse. + * @implements IExportDataResponse + * @constructor + * @param {google.cloud.parallelstore.v1.IExportDataResponse=} [properties] Properties to set + */ + function ExportDataResponse(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 ExportDataResponse instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.ExportDataResponse + * @static + * @param {google.cloud.parallelstore.v1.IExportDataResponse=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.ExportDataResponse} ExportDataResponse instance + */ + ExportDataResponse.create = function create(properties) { + return new ExportDataResponse(properties); + }; + + /** + * Encodes the specified ExportDataResponse message. Does not implicitly {@link google.cloud.parallelstore.v1.ExportDataResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.ExportDataResponse + * @static + * @param {google.cloud.parallelstore.v1.IExportDataResponse} message ExportDataResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ExportDataResponse message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ExportDataResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.ExportDataResponse + * @static + * @param {google.cloud.parallelstore.v1.IExportDataResponse} message ExportDataResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.v1.ExportDataResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.parallelstore.v1.ExportDataResponse} ExportDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataResponse.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.parallelstore.v1.ExportDataResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.ExportDataResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.ExportDataResponse} ExportDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataResponse message. + * @function verify + * @memberof google.cloud.parallelstore.v1.ExportDataResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an ExportDataResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.ExportDataResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.ExportDataResponse} ExportDataResponse + */ + ExportDataResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.ExportDataResponse) + return object; + return new $root.google.cloud.parallelstore.v1.ExportDataResponse(); + }; + + /** + * Creates a plain object from an ExportDataResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.ExportDataResponse + * @static + * @param {google.cloud.parallelstore.v1.ExportDataResponse} message ExportDataResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ExportDataResponse to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.ExportDataResponse + * @instance + * @returns {Object.} JSON object + */ + ExportDataResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataResponse + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.ExportDataResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.ExportDataResponse"; + }; + + return ExportDataResponse; + })(); + + v1.ExportDataMetadata = (function() { + + /** + * Properties of an ExportDataMetadata. + * @memberof google.cloud.parallelstore.v1 + * @interface IExportDataMetadata + * @property {google.cloud.parallelstore.v1.ITransferOperationMetadata|null} [operationMetadata] ExportDataMetadata operationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] ExportDataMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] ExportDataMetadata endTime + * @property {string|null} [target] ExportDataMetadata target + * @property {string|null} [verb] ExportDataMetadata verb + * @property {string|null} [statusMessage] ExportDataMetadata statusMessage + * @property {boolean|null} [requestedCancellation] ExportDataMetadata requestedCancellation + * @property {string|null} [apiVersion] ExportDataMetadata apiVersion + */ + + /** + * Constructs a new ExportDataMetadata. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents an ExportDataMetadata. + * @implements IExportDataMetadata + * @constructor + * @param {google.cloud.parallelstore.v1.IExportDataMetadata=} [properties] Properties to set + */ + function ExportDataMetadata(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]]; + } + + /** + * ExportDataMetadata operationMetadata. + * @member {google.cloud.parallelstore.v1.ITransferOperationMetadata|null|undefined} operationMetadata + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @instance + */ + ExportDataMetadata.prototype.operationMetadata = null; + + /** + * ExportDataMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @instance + */ + ExportDataMetadata.prototype.createTime = null; + + /** + * ExportDataMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @instance + */ + ExportDataMetadata.prototype.endTime = null; + + /** + * ExportDataMetadata target. + * @member {string} target + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @instance + */ + ExportDataMetadata.prototype.target = ""; + + /** + * ExportDataMetadata verb. + * @member {string} verb + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @instance + */ + ExportDataMetadata.prototype.verb = ""; + + /** + * ExportDataMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @instance + */ + ExportDataMetadata.prototype.statusMessage = ""; + + /** + * ExportDataMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @instance + */ + ExportDataMetadata.prototype.requestedCancellation = false; + + /** + * ExportDataMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @instance + */ + ExportDataMetadata.prototype.apiVersion = ""; + + /** + * Creates a new ExportDataMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @static + * @param {google.cloud.parallelstore.v1.IExportDataMetadata=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.ExportDataMetadata} ExportDataMetadata instance + */ + ExportDataMetadata.create = function create(properties) { + return new ExportDataMetadata(properties); + }; + + /** + * Encodes the specified ExportDataMetadata message. Does not implicitly {@link google.cloud.parallelstore.v1.ExportDataMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @static + * @param {google.cloud.parallelstore.v1.IExportDataMetadata} message ExportDataMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operationMetadata != null && Object.hasOwnProperty.call(message, "operationMetadata")) + $root.google.cloud.parallelstore.v1.TransferOperationMetadata.encode(message.operationMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified ExportDataMetadata message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.ExportDataMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @static + * @param {google.cloud.parallelstore.v1.IExportDataMetadata} message ExportDataMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportDataMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportDataMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.parallelstore.v1.ExportDataMetadata} ExportDataMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataMetadata.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.parallelstore.v1.ExportDataMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.operationMetadata = $root.google.cloud.parallelstore.v1.TransferOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.target = reader.string(); + break; + } + case 5: { + message.verb = reader.string(); + break; + } + case 6: { + message.statusMessage = reader.string(); + break; + } + case 7: { + message.requestedCancellation = reader.bool(); + break; + } + case 8: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportDataMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.ExportDataMetadata} ExportDataMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportDataMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportDataMetadata message. + * @function verify + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportDataMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operationMetadata != null && message.hasOwnProperty("operationMetadata")) { + var error = $root.google.cloud.parallelstore.v1.TransferOperationMetadata.verify(message.operationMetadata); + if (error) + return "operationMetadata." + error; + } + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an ExportDataMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.ExportDataMetadata} ExportDataMetadata + */ + ExportDataMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.ExportDataMetadata) + return object; + var message = new $root.google.cloud.parallelstore.v1.ExportDataMetadata(); + if (object.operationMetadata != null) { + if (typeof object.operationMetadata !== "object") + throw TypeError(".google.cloud.parallelstore.v1.ExportDataMetadata.operationMetadata: object expected"); + message.operationMetadata = $root.google.cloud.parallelstore.v1.TransferOperationMetadata.fromObject(object.operationMetadata); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.parallelstore.v1.ExportDataMetadata.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.parallelstore.v1.ExportDataMetadata.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.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an ExportDataMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @static + * @param {google.cloud.parallelstore.v1.ExportDataMetadata} message ExportDataMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDataMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operationMetadata = null; + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.operationMetadata != null && message.hasOwnProperty("operationMetadata")) + object.operationMetadata = $root.google.cloud.parallelstore.v1.TransferOperationMetadata.toObject(message.operationMetadata, options); + 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.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this ExportDataMetadata to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportDataMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDataMetadata + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.ExportDataMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDataMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.ExportDataMetadata"; + }; + + return ExportDataMetadata; + })(); + + v1.TransferOperationMetadata = (function() { + + /** + * Properties of a TransferOperationMetadata. + * @memberof google.cloud.parallelstore.v1 + * @interface ITransferOperationMetadata + * @property {google.cloud.parallelstore.v1.ISourceParallelstore|null} [sourceParallelstore] TransferOperationMetadata sourceParallelstore + * @property {google.cloud.parallelstore.v1.ISourceGcsBucket|null} [sourceGcsBucket] TransferOperationMetadata sourceGcsBucket + * @property {google.cloud.parallelstore.v1.IDestinationGcsBucket|null} [destinationGcsBucket] TransferOperationMetadata destinationGcsBucket + * @property {google.cloud.parallelstore.v1.IDestinationParallelstore|null} [destinationParallelstore] TransferOperationMetadata destinationParallelstore + * @property {google.cloud.parallelstore.v1.ITransferCounters|null} [counters] TransferOperationMetadata counters + * @property {google.cloud.parallelstore.v1.TransferType|null} [transferType] TransferOperationMetadata transferType + */ + + /** + * Constructs a new TransferOperationMetadata. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents a TransferOperationMetadata. + * @implements ITransferOperationMetadata + * @constructor + * @param {google.cloud.parallelstore.v1.ITransferOperationMetadata=} [properties] Properties to set + */ + function TransferOperationMetadata(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]]; + } + + /** + * TransferOperationMetadata sourceParallelstore. + * @member {google.cloud.parallelstore.v1.ISourceParallelstore|null|undefined} sourceParallelstore + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @instance + */ + TransferOperationMetadata.prototype.sourceParallelstore = null; + + /** + * TransferOperationMetadata sourceGcsBucket. + * @member {google.cloud.parallelstore.v1.ISourceGcsBucket|null|undefined} sourceGcsBucket + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @instance + */ + TransferOperationMetadata.prototype.sourceGcsBucket = null; + + /** + * TransferOperationMetadata destinationGcsBucket. + * @member {google.cloud.parallelstore.v1.IDestinationGcsBucket|null|undefined} destinationGcsBucket + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @instance + */ + TransferOperationMetadata.prototype.destinationGcsBucket = null; + + /** + * TransferOperationMetadata destinationParallelstore. + * @member {google.cloud.parallelstore.v1.IDestinationParallelstore|null|undefined} destinationParallelstore + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @instance + */ + TransferOperationMetadata.prototype.destinationParallelstore = null; + + /** + * TransferOperationMetadata counters. + * @member {google.cloud.parallelstore.v1.ITransferCounters|null|undefined} counters + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @instance + */ + TransferOperationMetadata.prototype.counters = null; + + /** + * TransferOperationMetadata transferType. + * @member {google.cloud.parallelstore.v1.TransferType} transferType + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @instance + */ + TransferOperationMetadata.prototype.transferType = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransferOperationMetadata source. + * @member {"sourceParallelstore"|"sourceGcsBucket"|undefined} source + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @instance + */ + Object.defineProperty(TransferOperationMetadata.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["sourceParallelstore", "sourceGcsBucket"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TransferOperationMetadata destination. + * @member {"destinationGcsBucket"|"destinationParallelstore"|undefined} destination + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @instance + */ + Object.defineProperty(TransferOperationMetadata.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["destinationGcsBucket", "destinationParallelstore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransferOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @static + * @param {google.cloud.parallelstore.v1.ITransferOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.TransferOperationMetadata} TransferOperationMetadata instance + */ + TransferOperationMetadata.create = function create(properties) { + return new TransferOperationMetadata(properties); + }; + + /** + * Encodes the specified TransferOperationMetadata message. Does not implicitly {@link google.cloud.parallelstore.v1.TransferOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @static + * @param {google.cloud.parallelstore.v1.ITransferOperationMetadata} message TransferOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.counters != null && Object.hasOwnProperty.call(message, "counters")) + $root.google.cloud.parallelstore.v1.TransferCounters.encode(message.counters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.transferType != null && Object.hasOwnProperty.call(message, "transferType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.transferType); + if (message.sourceParallelstore != null && Object.hasOwnProperty.call(message, "sourceParallelstore")) + $root.google.cloud.parallelstore.v1.SourceParallelstore.encode(message.sourceParallelstore, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.sourceGcsBucket != null && Object.hasOwnProperty.call(message, "sourceGcsBucket")) + $root.google.cloud.parallelstore.v1.SourceGcsBucket.encode(message.sourceGcsBucket, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.destinationGcsBucket != null && Object.hasOwnProperty.call(message, "destinationGcsBucket")) + $root.google.cloud.parallelstore.v1.DestinationGcsBucket.encode(message.destinationGcsBucket, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.destinationParallelstore != null && Object.hasOwnProperty.call(message, "destinationParallelstore")) + $root.google.cloud.parallelstore.v1.DestinationParallelstore.encode(message.destinationParallelstore, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransferOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.TransferOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @static + * @param {google.cloud.parallelstore.v1.ITransferOperationMetadata} message TransferOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.parallelstore.v1.TransferOperationMetadata} TransferOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOperationMetadata.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.parallelstore.v1.TransferOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 7: { + message.sourceParallelstore = $root.google.cloud.parallelstore.v1.SourceParallelstore.decode(reader, reader.uint32()); + break; + } + case 8: { + message.sourceGcsBucket = $root.google.cloud.parallelstore.v1.SourceGcsBucket.decode(reader, reader.uint32()); + break; + } + case 9: { + message.destinationGcsBucket = $root.google.cloud.parallelstore.v1.DestinationGcsBucket.decode(reader, reader.uint32()); + break; + } + case 10: { + message.destinationParallelstore = $root.google.cloud.parallelstore.v1.DestinationParallelstore.decode(reader, reader.uint32()); + break; + } + case 3: { + message.counters = $root.google.cloud.parallelstore.v1.TransferCounters.decode(reader, reader.uint32()); + break; + } + case 6: { + message.transferType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.TransferOperationMetadata} TransferOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferOperationMetadata message. + * @function verify + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sourceParallelstore != null && message.hasOwnProperty("sourceParallelstore")) { + properties.source = 1; + { + var error = $root.google.cloud.parallelstore.v1.SourceParallelstore.verify(message.sourceParallelstore); + if (error) + return "sourceParallelstore." + error; + } + } + if (message.sourceGcsBucket != null && message.hasOwnProperty("sourceGcsBucket")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.parallelstore.v1.SourceGcsBucket.verify(message.sourceGcsBucket); + if (error) + return "sourceGcsBucket." + error; + } + } + if (message.destinationGcsBucket != null && message.hasOwnProperty("destinationGcsBucket")) { + properties.destination = 1; + { + var error = $root.google.cloud.parallelstore.v1.DestinationGcsBucket.verify(message.destinationGcsBucket); + if (error) + return "destinationGcsBucket." + error; + } + } + if (message.destinationParallelstore != null && message.hasOwnProperty("destinationParallelstore")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.parallelstore.v1.DestinationParallelstore.verify(message.destinationParallelstore); + if (error) + return "destinationParallelstore." + error; + } + } + if (message.counters != null && message.hasOwnProperty("counters")) { + var error = $root.google.cloud.parallelstore.v1.TransferCounters.verify(message.counters); + if (error) + return "counters." + error; + } + if (message.transferType != null && message.hasOwnProperty("transferType")) + switch (message.transferType) { + default: + return "transferType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TransferOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.TransferOperationMetadata} TransferOperationMetadata + */ + TransferOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.TransferOperationMetadata) + return object; + var message = new $root.google.cloud.parallelstore.v1.TransferOperationMetadata(); + if (object.sourceParallelstore != null) { + if (typeof object.sourceParallelstore !== "object") + throw TypeError(".google.cloud.parallelstore.v1.TransferOperationMetadata.sourceParallelstore: object expected"); + message.sourceParallelstore = $root.google.cloud.parallelstore.v1.SourceParallelstore.fromObject(object.sourceParallelstore); + } + if (object.sourceGcsBucket != null) { + if (typeof object.sourceGcsBucket !== "object") + throw TypeError(".google.cloud.parallelstore.v1.TransferOperationMetadata.sourceGcsBucket: object expected"); + message.sourceGcsBucket = $root.google.cloud.parallelstore.v1.SourceGcsBucket.fromObject(object.sourceGcsBucket); + } + if (object.destinationGcsBucket != null) { + if (typeof object.destinationGcsBucket !== "object") + throw TypeError(".google.cloud.parallelstore.v1.TransferOperationMetadata.destinationGcsBucket: object expected"); + message.destinationGcsBucket = $root.google.cloud.parallelstore.v1.DestinationGcsBucket.fromObject(object.destinationGcsBucket); + } + if (object.destinationParallelstore != null) { + if (typeof object.destinationParallelstore !== "object") + throw TypeError(".google.cloud.parallelstore.v1.TransferOperationMetadata.destinationParallelstore: object expected"); + message.destinationParallelstore = $root.google.cloud.parallelstore.v1.DestinationParallelstore.fromObject(object.destinationParallelstore); + } + if (object.counters != null) { + if (typeof object.counters !== "object") + throw TypeError(".google.cloud.parallelstore.v1.TransferOperationMetadata.counters: object expected"); + message.counters = $root.google.cloud.parallelstore.v1.TransferCounters.fromObject(object.counters); + } + switch (object.transferType) { + default: + if (typeof object.transferType === "number") { + message.transferType = object.transferType; + break; + } + break; + case "TRANSFER_TYPE_UNSPECIFIED": + case 0: + message.transferType = 0; + break; + case "IMPORT": + case 1: + message.transferType = 1; + break; + case "EXPORT": + case 2: + message.transferType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TransferOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @static + * @param {google.cloud.parallelstore.v1.TransferOperationMetadata} message TransferOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.counters = null; + object.transferType = options.enums === String ? "TRANSFER_TYPE_UNSPECIFIED" : 0; + } + if (message.counters != null && message.hasOwnProperty("counters")) + object.counters = $root.google.cloud.parallelstore.v1.TransferCounters.toObject(message.counters, options); + if (message.transferType != null && message.hasOwnProperty("transferType")) + object.transferType = options.enums === String ? $root.google.cloud.parallelstore.v1.TransferType[message.transferType] === undefined ? message.transferType : $root.google.cloud.parallelstore.v1.TransferType[message.transferType] : message.transferType; + if (message.sourceParallelstore != null && message.hasOwnProperty("sourceParallelstore")) { + object.sourceParallelstore = $root.google.cloud.parallelstore.v1.SourceParallelstore.toObject(message.sourceParallelstore, options); + if (options.oneofs) + object.source = "sourceParallelstore"; + } + if (message.sourceGcsBucket != null && message.hasOwnProperty("sourceGcsBucket")) { + object.sourceGcsBucket = $root.google.cloud.parallelstore.v1.SourceGcsBucket.toObject(message.sourceGcsBucket, options); + if (options.oneofs) + object.source = "sourceGcsBucket"; + } + if (message.destinationGcsBucket != null && message.hasOwnProperty("destinationGcsBucket")) { + object.destinationGcsBucket = $root.google.cloud.parallelstore.v1.DestinationGcsBucket.toObject(message.destinationGcsBucket, options); + if (options.oneofs) + object.destination = "destinationGcsBucket"; + } + if (message.destinationParallelstore != null && message.hasOwnProperty("destinationParallelstore")) { + object.destinationParallelstore = $root.google.cloud.parallelstore.v1.DestinationParallelstore.toObject(message.destinationParallelstore, options); + if (options.oneofs) + object.destination = "destinationParallelstore"; + } + return object; + }; + + /** + * Converts this TransferOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + TransferOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.TransferOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.TransferOperationMetadata"; + }; + + return TransferOperationMetadata; + })(); + + v1.TransferCounters = (function() { + + /** + * Properties of a TransferCounters. + * @memberof google.cloud.parallelstore.v1 + * @interface ITransferCounters + * @property {number|Long|null} [objectsFound] TransferCounters objectsFound + * @property {number|Long|null} [bytesFound] TransferCounters bytesFound + * @property {number|Long|null} [objectsSkipped] TransferCounters objectsSkipped + * @property {number|Long|null} [bytesSkipped] TransferCounters bytesSkipped + * @property {number|Long|null} [objectsCopied] TransferCounters objectsCopied + * @property {number|Long|null} [bytesCopied] TransferCounters bytesCopied + */ + + /** + * Constructs a new TransferCounters. + * @memberof google.cloud.parallelstore.v1 + * @classdesc Represents a TransferCounters. + * @implements ITransferCounters + * @constructor + * @param {google.cloud.parallelstore.v1.ITransferCounters=} [properties] Properties to set + */ + function TransferCounters(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]]; + } + + /** + * TransferCounters objectsFound. + * @member {number|Long} objectsFound + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsFound = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesFound. + * @member {number|Long} bytesFound + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesFound = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsSkipped. + * @member {number|Long} objectsSkipped + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsSkipped = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesSkipped. + * @member {number|Long} bytesSkipped + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesSkipped = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters objectsCopied. + * @member {number|Long} objectsCopied + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.objectsCopied = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * TransferCounters bytesCopied. + * @member {number|Long} bytesCopied + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @instance + */ + TransferCounters.prototype.bytesCopied = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new TransferCounters instance using the specified properties. + * @function create + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @static + * @param {google.cloud.parallelstore.v1.ITransferCounters=} [properties] Properties to set + * @returns {google.cloud.parallelstore.v1.TransferCounters} TransferCounters instance + */ + TransferCounters.create = function create(properties) { + return new TransferCounters(properties); + }; + + /** + * Encodes the specified TransferCounters message. Does not implicitly {@link google.cloud.parallelstore.v1.TransferCounters.verify|verify} messages. + * @function encode + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @static + * @param {google.cloud.parallelstore.v1.ITransferCounters} message TransferCounters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferCounters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objectsFound != null && Object.hasOwnProperty.call(message, "objectsFound")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.objectsFound); + if (message.bytesFound != null && Object.hasOwnProperty.call(message, "bytesFound")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.bytesFound); + if (message.objectsSkipped != null && Object.hasOwnProperty.call(message, "objectsSkipped")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.objectsSkipped); + if (message.bytesSkipped != null && Object.hasOwnProperty.call(message, "bytesSkipped")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.bytesSkipped); + if (message.objectsCopied != null && Object.hasOwnProperty.call(message, "objectsCopied")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.objectsCopied); + if (message.bytesCopied != null && Object.hasOwnProperty.call(message, "bytesCopied")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.bytesCopied); + return writer; + }; + + /** + * Encodes the specified TransferCounters message, length delimited. Does not implicitly {@link google.cloud.parallelstore.v1.TransferCounters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @static + * @param {google.cloud.parallelstore.v1.ITransferCounters} message TransferCounters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferCounters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferCounters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.parallelstore.v1.TransferCounters} TransferCounters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferCounters.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.parallelstore.v1.TransferCounters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.objectsFound = reader.int64(); + break; + } + case 2: { + message.bytesFound = reader.int64(); + break; + } + case 3: { + message.objectsSkipped = reader.int64(); + break; + } + case 4: { + message.bytesSkipped = reader.int64(); + break; + } + case 5: { + message.objectsCopied = reader.int64(); + break; + } + case 6: { + message.bytesCopied = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferCounters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.parallelstore.v1.TransferCounters} TransferCounters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferCounters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferCounters message. + * @function verify + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferCounters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objectsFound != null && message.hasOwnProperty("objectsFound")) + if (!$util.isInteger(message.objectsFound) && !(message.objectsFound && $util.isInteger(message.objectsFound.low) && $util.isInteger(message.objectsFound.high))) + return "objectsFound: integer|Long expected"; + if (message.bytesFound != null && message.hasOwnProperty("bytesFound")) + if (!$util.isInteger(message.bytesFound) && !(message.bytesFound && $util.isInteger(message.bytesFound.low) && $util.isInteger(message.bytesFound.high))) + return "bytesFound: integer|Long expected"; + if (message.objectsSkipped != null && message.hasOwnProperty("objectsSkipped")) + if (!$util.isInteger(message.objectsSkipped) && !(message.objectsSkipped && $util.isInteger(message.objectsSkipped.low) && $util.isInteger(message.objectsSkipped.high))) + return "objectsSkipped: integer|Long expected"; + if (message.bytesSkipped != null && message.hasOwnProperty("bytesSkipped")) + if (!$util.isInteger(message.bytesSkipped) && !(message.bytesSkipped && $util.isInteger(message.bytesSkipped.low) && $util.isInteger(message.bytesSkipped.high))) + return "bytesSkipped: integer|Long expected"; + if (message.objectsCopied != null && message.hasOwnProperty("objectsCopied")) + if (!$util.isInteger(message.objectsCopied) && !(message.objectsCopied && $util.isInteger(message.objectsCopied.low) && $util.isInteger(message.objectsCopied.high))) + return "objectsCopied: integer|Long expected"; + if (message.bytesCopied != null && message.hasOwnProperty("bytesCopied")) + if (!$util.isInteger(message.bytesCopied) && !(message.bytesCopied && $util.isInteger(message.bytesCopied.low) && $util.isInteger(message.bytesCopied.high))) + return "bytesCopied: integer|Long expected"; + return null; + }; + + /** + * Creates a TransferCounters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.parallelstore.v1.TransferCounters} TransferCounters + */ + TransferCounters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.parallelstore.v1.TransferCounters) + return object; + var message = new $root.google.cloud.parallelstore.v1.TransferCounters(); + if (object.objectsFound != null) + if ($util.Long) + (message.objectsFound = $util.Long.fromValue(object.objectsFound)).unsigned = false; + else if (typeof object.objectsFound === "string") + message.objectsFound = parseInt(object.objectsFound, 10); + else if (typeof object.objectsFound === "number") + message.objectsFound = object.objectsFound; + else if (typeof object.objectsFound === "object") + message.objectsFound = new $util.LongBits(object.objectsFound.low >>> 0, object.objectsFound.high >>> 0).toNumber(); + if (object.bytesFound != null) + if ($util.Long) + (message.bytesFound = $util.Long.fromValue(object.bytesFound)).unsigned = false; + else if (typeof object.bytesFound === "string") + message.bytesFound = parseInt(object.bytesFound, 10); + else if (typeof object.bytesFound === "number") + message.bytesFound = object.bytesFound; + else if (typeof object.bytesFound === "object") + message.bytesFound = new $util.LongBits(object.bytesFound.low >>> 0, object.bytesFound.high >>> 0).toNumber(); + if (object.objectsSkipped != null) + if ($util.Long) + (message.objectsSkipped = $util.Long.fromValue(object.objectsSkipped)).unsigned = false; + else if (typeof object.objectsSkipped === "string") + message.objectsSkipped = parseInt(object.objectsSkipped, 10); + else if (typeof object.objectsSkipped === "number") + message.objectsSkipped = object.objectsSkipped; + else if (typeof object.objectsSkipped === "object") + message.objectsSkipped = new $util.LongBits(object.objectsSkipped.low >>> 0, object.objectsSkipped.high >>> 0).toNumber(); + if (object.bytesSkipped != null) + if ($util.Long) + (message.bytesSkipped = $util.Long.fromValue(object.bytesSkipped)).unsigned = false; + else if (typeof object.bytesSkipped === "string") + message.bytesSkipped = parseInt(object.bytesSkipped, 10); + else if (typeof object.bytesSkipped === "number") + message.bytesSkipped = object.bytesSkipped; + else if (typeof object.bytesSkipped === "object") + message.bytesSkipped = new $util.LongBits(object.bytesSkipped.low >>> 0, object.bytesSkipped.high >>> 0).toNumber(); + if (object.objectsCopied != null) + if ($util.Long) + (message.objectsCopied = $util.Long.fromValue(object.objectsCopied)).unsigned = false; + else if (typeof object.objectsCopied === "string") + message.objectsCopied = parseInt(object.objectsCopied, 10); + else if (typeof object.objectsCopied === "number") + message.objectsCopied = object.objectsCopied; + else if (typeof object.objectsCopied === "object") + message.objectsCopied = new $util.LongBits(object.objectsCopied.low >>> 0, object.objectsCopied.high >>> 0).toNumber(); + if (object.bytesCopied != null) + if ($util.Long) + (message.bytesCopied = $util.Long.fromValue(object.bytesCopied)).unsigned = false; + else if (typeof object.bytesCopied === "string") + message.bytesCopied = parseInt(object.bytesCopied, 10); + else if (typeof object.bytesCopied === "number") + message.bytesCopied = object.bytesCopied; + else if (typeof object.bytesCopied === "object") + message.bytesCopied = new $util.LongBits(object.bytesCopied.low >>> 0, object.bytesCopied.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TransferCounters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @static + * @param {google.cloud.parallelstore.v1.TransferCounters} message TransferCounters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferCounters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsFound = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsFound = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesFound = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesFound = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsSkipped = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsSkipped = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesSkipped = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesSkipped = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.objectsCopied = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.objectsCopied = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.bytesCopied = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.bytesCopied = options.longs === String ? "0" : 0; + } + if (message.objectsFound != null && message.hasOwnProperty("objectsFound")) + if (typeof message.objectsFound === "number") + object.objectsFound = options.longs === String ? String(message.objectsFound) : message.objectsFound; + else + object.objectsFound = options.longs === String ? $util.Long.prototype.toString.call(message.objectsFound) : options.longs === Number ? new $util.LongBits(message.objectsFound.low >>> 0, message.objectsFound.high >>> 0).toNumber() : message.objectsFound; + if (message.bytesFound != null && message.hasOwnProperty("bytesFound")) + if (typeof message.bytesFound === "number") + object.bytesFound = options.longs === String ? String(message.bytesFound) : message.bytesFound; + else + object.bytesFound = options.longs === String ? $util.Long.prototype.toString.call(message.bytesFound) : options.longs === Number ? new $util.LongBits(message.bytesFound.low >>> 0, message.bytesFound.high >>> 0).toNumber() : message.bytesFound; + if (message.objectsSkipped != null && message.hasOwnProperty("objectsSkipped")) + if (typeof message.objectsSkipped === "number") + object.objectsSkipped = options.longs === String ? String(message.objectsSkipped) : message.objectsSkipped; + else + object.objectsSkipped = options.longs === String ? $util.Long.prototype.toString.call(message.objectsSkipped) : options.longs === Number ? new $util.LongBits(message.objectsSkipped.low >>> 0, message.objectsSkipped.high >>> 0).toNumber() : message.objectsSkipped; + if (message.bytesSkipped != null && message.hasOwnProperty("bytesSkipped")) + if (typeof message.bytesSkipped === "number") + object.bytesSkipped = options.longs === String ? String(message.bytesSkipped) : message.bytesSkipped; + else + object.bytesSkipped = options.longs === String ? $util.Long.prototype.toString.call(message.bytesSkipped) : options.longs === Number ? new $util.LongBits(message.bytesSkipped.low >>> 0, message.bytesSkipped.high >>> 0).toNumber() : message.bytesSkipped; + if (message.objectsCopied != null && message.hasOwnProperty("objectsCopied")) + if (typeof message.objectsCopied === "number") + object.objectsCopied = options.longs === String ? String(message.objectsCopied) : message.objectsCopied; + else + object.objectsCopied = options.longs === String ? $util.Long.prototype.toString.call(message.objectsCopied) : options.longs === Number ? new $util.LongBits(message.objectsCopied.low >>> 0, message.objectsCopied.high >>> 0).toNumber() : message.objectsCopied; + if (message.bytesCopied != null && message.hasOwnProperty("bytesCopied")) + if (typeof message.bytesCopied === "number") + object.bytesCopied = options.longs === String ? String(message.bytesCopied) : message.bytesCopied; + else + object.bytesCopied = options.longs === String ? $util.Long.prototype.toString.call(message.bytesCopied) : options.longs === Number ? new $util.LongBits(message.bytesCopied.low >>> 0, message.bytesCopied.high >>> 0).toNumber() : message.bytesCopied; + return object; + }; + + /** + * Converts this TransferCounters to JSON. + * @function toJSON + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @instance + * @returns {Object.} JSON object + */ + TransferCounters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferCounters + * @function getTypeUrl + * @memberof google.cloud.parallelstore.v1.TransferCounters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferCounters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.parallelstore.v1.TransferCounters"; + }; + + return TransferCounters; + })(); + + return v1; + })(); + parallelstore.v1beta = (function() { /** diff --git a/packages/google-cloud-parallelstore/protos/protos.json b/packages/google-cloud-parallelstore/protos/protos.json index e0f48888bae..45ef388c148 100644 --- a/packages/google-cloud-parallelstore/protos/protos.json +++ b/packages/google-cloud-parallelstore/protos/protos.json @@ -9,6 +9,891 @@ "nested": { "parallelstore": { "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Parallelstore.V1", + "go_package": "cloud.google.com/go/parallelstore/apiv1/parallelstorepb;parallelstorepb", + "java_multiple_files": true, + "java_outer_classname": "ParallelstoreProto", + "java_package": "com.google.cloud.parallelstore.v1", + "php_namespace": "Google\\Cloud\\Parallelstore\\V1", + "ruby_package": "Google::Cloud::Parallelstore::V1", + "(google.api.resource_definition).type": "iam.googleapis.com/ServiceAccount", + "(google.api.resource_definition).pattern": "projects/{project}/serviceAccounts/{service_account}" + }, + "nested": { + "Parallelstore": { + "options": { + "(google.api.default_host)": "parallelstore.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/instances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/instances", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "parent,instance,instance_id", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/instances", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "parent,instance,instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateInstance": { + "requestType": "UpdateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{instance.name=projects/*/locations/*/instances/*}", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "instance,update_mask", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{instance.name=projects/*/locations/*/instances/*}", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "instance,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/instances/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ImportData": { + "requestType": "ImportDataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/instances/*}:importData", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ImportDataResponse", + "(google.longrunning.operation_info).metadata_type": "ImportDataMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/instances/*}:importData", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportDataResponse", + "metadata_type": "ImportDataMetadata" + } + } + ] + }, + "ExportData": { + "requestType": "ExportDataRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/instances/*}:exportData", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "ExportDataResponse", + "(google.longrunning.operation_info).metadata_type": "ExportDataMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/instances/*}:exportData", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ExportDataResponse", + "metadata_type": "ExportDataMetadata" + } + } + ] + } + } + }, + "TransferType": { + "values": { + "TRANSFER_TYPE_UNSPECIFIED": 0, + "IMPORT": 1, + "EXPORT": 2 + } + }, + "FileStripeLevel": { + "values": { + "FILE_STRIPE_LEVEL_UNSPECIFIED": 0, + "FILE_STRIPE_LEVEL_MIN": 1, + "FILE_STRIPE_LEVEL_BALANCED": 2, + "FILE_STRIPE_LEVEL_MAX": 3 + } + }, + "DirectoryStripeLevel": { + "values": { + "DIRECTORY_STRIPE_LEVEL_UNSPECIFIED": 0, + "DIRECTORY_STRIPE_LEVEL_MIN": 1, + "DIRECTORY_STRIPE_LEVEL_BALANCED": 2, + "DIRECTORY_STRIPE_LEVEL_MAX": 3 + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "parallelstore.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}", + "(google.api.resource).plural": "instances", + "(google.api.resource).singular": "instance" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "capacityGib": { + "type": "int64", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "daosVersion": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "accessPoints": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "network": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "reservedIpRange": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "compute.googleapis.com/Address" + } + }, + "effectiveReservedIpRange": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "compute.googleapis.com/Address" + } + }, + "fileStripeLevel": { + "type": "FileStripeLevel", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "directoryStripeLevel": { + "type": "DirectoryStripeLevel", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "FAILED": 4, + "UPGRADING": 5 + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "parallelstore.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "parallelstore.googleapis.com/Instance" + } + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "parallelstore.googleapis.com/Instance" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateInstanceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "parallelstore.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "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" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SourceGcsBucket": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DestinationGcsBucket": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SourceParallelstore": { + "fields": { + "path": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DestinationParallelstore": { + "fields": { + "path": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ImportDataRequest": { + "oneofs": { + "source": { + "oneof": [ + "sourceGcsBucket" + ] + }, + "destination": { + "oneof": [ + "destinationParallelstore" + ] + } + }, + "fields": { + "sourceGcsBucket": { + "type": "SourceGcsBucket", + "id": 2 + }, + "destinationParallelstore": { + "type": "DestinationParallelstore", + "id": 3 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "parallelstore.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "iam.googleapis.com/ServiceAccount" + } + } + } + }, + "ExportDataRequest": { + "oneofs": { + "source": { + "oneof": [ + "sourceParallelstore" + ] + }, + "destination": { + "oneof": [ + "destinationGcsBucket" + ] + } + }, + "fields": { + "sourceParallelstore": { + "type": "SourceParallelstore", + "id": 2 + }, + "destinationGcsBucket": { + "type": "DestinationGcsBucket", + "id": 3 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "parallelstore.googleapis.com/Instance" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "iam.googleapis.com/ServiceAccount" + } + } + } + }, + "ImportDataResponse": { + "fields": {} + }, + "ImportDataMetadata": { + "fields": { + "operationMetadata": { + "type": "TransferOperationMetadata", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ExportDataResponse": { + "fields": {} + }, + "ExportDataMetadata": { + "fields": { + "operationMetadata": { + "type": "TransferOperationMetadata", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TransferOperationMetadata": { + "oneofs": { + "source": { + "oneof": [ + "sourceParallelstore", + "sourceGcsBucket" + ] + }, + "destination": { + "oneof": [ + "destinationGcsBucket", + "destinationParallelstore" + ] + } + }, + "fields": { + "sourceParallelstore": { + "type": "SourceParallelstore", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceGcsBucket": { + "type": "SourceGcsBucket", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "destinationGcsBucket": { + "type": "DestinationGcsBucket", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "destinationParallelstore": { + "type": "DestinationParallelstore", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "counters": { + "type": "TransferCounters", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "transferType": { + "type": "TransferType", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "TransferCounters": { + "fields": { + "objectsFound": { + "type": "int64", + "id": 1 + }, + "bytesFound": { + "type": "int64", + "id": 2 + }, + "objectsSkipped": { + "type": "int64", + "id": 3 + }, + "bytesSkipped": { + "type": "int64", + "id": 4 + }, + "objectsCopied": { + "type": "int64", + "id": 5 + }, + "bytesCopied": { + "type": "int64", + "id": 6 + } + } + } + } + }, "v1beta": { "options": { "csharp_namespace": "Google.Cloud.Parallelstore.V1Beta", diff --git a/packages/google-cloud-parallelstore/samples/README.md b/packages/google-cloud-parallelstore/samples/README.md index c35984bdbdb..9957528494b 100644 --- a/packages/google-cloud-parallelstore/samples/README.md +++ b/packages/google-cloud-parallelstore/samples/README.md @@ -12,6 +12,13 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Parallelstore.create_instance](#parallelstore.create_instance) + * [Parallelstore.delete_instance](#parallelstore.delete_instance) + * [Parallelstore.export_data](#parallelstore.export_data) + * [Parallelstore.get_instance](#parallelstore.get_instance) + * [Parallelstore.import_data](#parallelstore.import_data) + * [Parallelstore.list_instances](#parallelstore.list_instances) + * [Parallelstore.update_instance](#parallelstore.update_instance) * [Parallelstore.create_instance](#parallelstore.create_instance) * [Parallelstore.delete_instance](#parallelstore.delete_instance) * [Parallelstore.export_data](#parallelstore.export_data) @@ -36,6 +43,125 @@ Before running the samples, make sure you've followed the steps outlined in +### Parallelstore.create_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.create_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-parallelstore/samples/generated/v1/parallelstore.create_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.create_instance.js` + + +----- + + + + +### Parallelstore.delete_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.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-parallelstore/samples/generated/v1/parallelstore.delete_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.delete_instance.js` + + +----- + + + + +### Parallelstore.export_data + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.export_data.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-parallelstore/samples/generated/v1/parallelstore.export_data.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.export_data.js` + + +----- + + + + +### Parallelstore.get_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.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-parallelstore/samples/generated/v1/parallelstore.get_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.get_instance.js` + + +----- + + + + +### Parallelstore.import_data + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.import_data.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-parallelstore/samples/generated/v1/parallelstore.import_data.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.import_data.js` + + +----- + + + + +### Parallelstore.list_instances + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.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-parallelstore/samples/generated/v1/parallelstore.list_instances.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.list_instances.js` + + +----- + + + + +### Parallelstore.update_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.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-parallelstore/samples/generated/v1/parallelstore.update_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.update_instance.js` + + +----- + + + + ### Parallelstore.create_instance View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-parallelstore/samples/generated/v1beta/parallelstore.create_instance.js). diff --git a/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.create_instance.js b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.create_instance.js new file mode 100644 index 00000000000..4c63040395f --- /dev/null +++ b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.create_instance.js @@ -0,0 +1,93 @@ +// Copyright 2024 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(parent, instanceId, instance) { + // [START parallelstore_v1_generated_Parallelstore_CreateInstance_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. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + */ + // const parent = 'abc123' + /** + * Required. The name of the Parallelstore instance. + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + */ + // const instanceId = 'abc123' + /** + * Required. The instance to create. + */ + // const instance = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Parallelstore library + const {ParallelstoreClient} = require('@google-cloud/parallelstore').v1; + + // Instantiates a client + const parallelstoreClient = new ParallelstoreClient(); + + async function callCreateInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await parallelstoreClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInstance(); + // [END parallelstore_v1_generated_Parallelstore_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.delete_instance.js b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.delete_instance.js new file mode 100644 index 00000000000..fc26d54a590 --- /dev/null +++ b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.delete_instance.js @@ -0,0 +1,76 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START parallelstore_v1_generated_Parallelstore_DeleteInstance_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. Name of the resource + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Parallelstore library + const {ParallelstoreClient} = require('@google-cloud/parallelstore').v1; + + // Instantiates a client + const parallelstoreClient = new ParallelstoreClient(); + + async function callDeleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await parallelstoreClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInstance(); + // [END parallelstore_v1_generated_Parallelstore_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.export_data.js b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.export_data.js new file mode 100644 index 00000000000..7eeaf685fa9 --- /dev/null +++ b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.export_data.js @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START parallelstore_v1_generated_Parallelstore_ExportData_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. + */ + /** + * Parallelstore source. + */ + // const sourceParallelstore = {} + /** + * Cloud Storage destination. + */ + // const destinationGcsBucket = {} + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + */ + // const serviceAccount = 'abc123' + + // Imports the Parallelstore library + const {ParallelstoreClient} = require('@google-cloud/parallelstore').v1; + + // Instantiates a client + const parallelstoreClient = new ParallelstoreClient(); + + async function callExportData() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await parallelstoreClient.exportData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportData(); + // [END parallelstore_v1_generated_Parallelstore_ExportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.get_instance.js b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.get_instance.js new file mode 100644 index 00000000000..9a0c9381011 --- /dev/null +++ b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.get_instance.js @@ -0,0 +1,62 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START parallelstore_v1_generated_Parallelstore_GetInstance_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. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + */ + // const name = 'abc123' + + // Imports the Parallelstore library + const {ParallelstoreClient} = require('@google-cloud/parallelstore').v1; + + // Instantiates a client + const parallelstoreClient = new ParallelstoreClient(); + + async function callGetInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await parallelstoreClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END parallelstore_v1_generated_Parallelstore_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.import_data.js b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.import_data.js new file mode 100644 index 00000000000..f2032b01cf4 --- /dev/null +++ b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.import_data.js @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START parallelstore_v1_generated_Parallelstore_ImportData_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. + */ + /** + * The Cloud Storage source bucket and, optionally, path inside the bucket. + */ + // const sourceGcsBucket = {} + /** + * Parallelstore destination. + */ + // const destinationParallelstore = {} + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * Use one of the following formats: + * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + */ + // const serviceAccount = 'abc123' + + // Imports the Parallelstore library + const {ParallelstoreClient} = require('@google-cloud/parallelstore').v1; + + // Instantiates a client + const parallelstoreClient = new ParallelstoreClient(); + + async function callImportData() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await parallelstoreClient.importData(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportData(); + // [END parallelstore_v1_generated_Parallelstore_ImportData_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.list_instances.js b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.list_instances.js new file mode 100644 index 00000000000..72a001745c0 --- /dev/null +++ b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.list_instances.js @@ -0,0 +1,83 @@ +// Copyright 2024 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(parent) { + // [START parallelstore_v1_generated_Parallelstore_ListInstances_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. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Parallelstore library + const {ParallelstoreClient} = require('@google-cloud/parallelstore').v1; + + // Instantiates a client + const parallelstoreClient = new ParallelstoreClient(); + + async function callListInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = parallelstoreClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInstances(); + // [END parallelstore_v1_generated_Parallelstore_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.update_instance.js b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.update_instance.js new file mode 100644 index 00000000000..6d99037e1ca --- /dev/null +++ b/packages/google-cloud-parallelstore/samples/generated/v1/parallelstore.update_instance.js @@ -0,0 +1,84 @@ +// Copyright 2024 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(updateMask, instance) { + // [START parallelstore_v1_generated_Parallelstore_UpdateInstance_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. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + */ + // const updateMask = {} + /** + * Required. The instance to update. + */ + // const instance = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Parallelstore library + const {ParallelstoreClient} = require('@google-cloud/parallelstore').v1; + + // Instantiates a client + const parallelstoreClient = new ParallelstoreClient(); + + async function callUpdateInstance() { + // Construct request + const request = { + updateMask, + instance, + }; + + // Run request + const [operation] = await parallelstoreClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInstance(); + // [END parallelstore_v1_generated_Parallelstore_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-parallelstore/samples/generated/v1/snippet_metadata_google.cloud.parallelstore.v1.json b/packages/google-cloud-parallelstore/samples/generated/v1/snippet_metadata_google.cloud.parallelstore.v1.json new file mode 100644 index 00000000000..adf56bdf8a9 --- /dev/null +++ b/packages/google-cloud-parallelstore/samples/generated/v1/snippet_metadata_google.cloud.parallelstore.v1.json @@ -0,0 +1,367 @@ +{ + "clientLibrary": { + "name": "nodejs-parallelstore", + "version": "0.6.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.parallelstore.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "parallelstore_v1_generated_Parallelstore_ListInstances_async", + "title": "Parallelstore listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists all instances in a given project and location.", + "canonical": true, + "file": "parallelstore.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.parallelstore.v1.ListInstancesResponse", + "client": { + "shortName": "ParallelstoreClient", + "fullName": "google.cloud.parallelstore.v1.ParallelstoreClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.ListInstances", + "service": { + "shortName": "Parallelstore", + "fullName": "google.cloud.parallelstore.v1.Parallelstore" + } + } + } + }, + { + "regionTag": "parallelstore_v1_generated_Parallelstore_GetInstance_async", + "title": "Parallelstore getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single instance.", + "canonical": true, + "file": "parallelstore.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.parallelstore.v1.Instance", + "client": { + "shortName": "ParallelstoreClient", + "fullName": "google.cloud.parallelstore.v1.ParallelstoreClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.GetInstance", + "service": { + "shortName": "Parallelstore", + "fullName": "google.cloud.parallelstore.v1.Parallelstore" + } + } + } + }, + { + "regionTag": "parallelstore_v1_generated_Parallelstore_CreateInstance_async", + "title": "Parallelstore createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a Parallelstore instance in a given project and location.", + "canonical": true, + "file": "parallelstore.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.parallelstore.v1.Instance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ParallelstoreClient", + "fullName": "google.cloud.parallelstore.v1.ParallelstoreClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.CreateInstance", + "service": { + "shortName": "Parallelstore", + "fullName": "google.cloud.parallelstore.v1.Parallelstore" + } + } + } + }, + { + "regionTag": "parallelstore_v1_generated_Parallelstore_UpdateInstance_async", + "title": "Parallelstore updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single instance.", + "canonical": true, + "file": "parallelstore.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "instance", + "type": ".google.cloud.parallelstore.v1.Instance" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ParallelstoreClient", + "fullName": "google.cloud.parallelstore.v1.ParallelstoreClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.UpdateInstance", + "service": { + "shortName": "Parallelstore", + "fullName": "google.cloud.parallelstore.v1.Parallelstore" + } + } + } + }, + { + "regionTag": "parallelstore_v1_generated_Parallelstore_DeleteInstance_async", + "title": "Parallelstore deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single instance.", + "canonical": true, + "file": "parallelstore.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ParallelstoreClient", + "fullName": "google.cloud.parallelstore.v1.ParallelstoreClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.DeleteInstance", + "service": { + "shortName": "Parallelstore", + "fullName": "google.cloud.parallelstore.v1.Parallelstore" + } + } + } + }, + { + "regionTag": "parallelstore_v1_generated_Parallelstore_ImportData_async", + "title": "Parallelstore importData Sample", + "origin": "API_DEFINITION", + "description": " Copies data from Cloud Storage to Parallelstore.", + "canonical": true, + "file": "parallelstore.import_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportData", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.ImportData", + "async": true, + "parameters": [ + { + "name": "source_gcs_bucket", + "type": ".google.cloud.parallelstore.v1.SourceGcsBucket" + }, + { + "name": "destination_parallelstore", + "type": ".google.cloud.parallelstore.v1.DestinationParallelstore" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "service_account", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ParallelstoreClient", + "fullName": "google.cloud.parallelstore.v1.ParallelstoreClient" + }, + "method": { + "shortName": "ImportData", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.ImportData", + "service": { + "shortName": "Parallelstore", + "fullName": "google.cloud.parallelstore.v1.Parallelstore" + } + } + } + }, + { + "regionTag": "parallelstore_v1_generated_Parallelstore_ExportData_async", + "title": "Parallelstore exportData Sample", + "origin": "API_DEFINITION", + "description": " Copies data from Parallelstore to Cloud Storage.", + "canonical": true, + "file": "parallelstore.export_data.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportData", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.ExportData", + "async": true, + "parameters": [ + { + "name": "source_parallelstore", + "type": ".google.cloud.parallelstore.v1.SourceParallelstore" + }, + { + "name": "destination_gcs_bucket", + "type": ".google.cloud.parallelstore.v1.DestinationGcsBucket" + }, + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "service_account", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ParallelstoreClient", + "fullName": "google.cloud.parallelstore.v1.ParallelstoreClient" + }, + "method": { + "shortName": "ExportData", + "fullName": "google.cloud.parallelstore.v1.Parallelstore.ExportData", + "service": { + "shortName": "Parallelstore", + "fullName": "google.cloud.parallelstore.v1.Parallelstore" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-parallelstore/samples/generated/v1beta/parallelstore.export_data.js b/packages/google-cloud-parallelstore/samples/generated/v1beta/parallelstore.export_data.js index e38bcfabe6e..a9adf8a0b8b 100644 --- a/packages/google-cloud-parallelstore/samples/generated/v1beta/parallelstore.export_data.js +++ b/packages/google-cloud-parallelstore/samples/generated/v1beta/parallelstore.export_data.js @@ -58,7 +58,7 @@ function main(name) { * Optional. User-specified Service Account (SA) credentials to be used when * performing the transfer. * Use one of the following formats: - * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} * If unspecified, the Parallelstore service agent is used: diff --git a/packages/google-cloud-parallelstore/samples/generated/v1beta/parallelstore.import_data.js b/packages/google-cloud-parallelstore/samples/generated/v1beta/parallelstore.import_data.js index 78f70df4862..5e8a630a18a 100644 --- a/packages/google-cloud-parallelstore/samples/generated/v1beta/parallelstore.import_data.js +++ b/packages/google-cloud-parallelstore/samples/generated/v1beta/parallelstore.import_data.js @@ -58,7 +58,7 @@ function main(name) { * Optional. User-specified service account credentials to be used when * performing the transfer. * Use one of the following formats: - * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} * If unspecified, the Parallelstore service agent is used: diff --git a/packages/google-cloud-parallelstore/src/index.ts b/packages/google-cloud-parallelstore/src/index.ts index 3a4abecd95b..874ab9015d8 100644 --- a/packages/google-cloud-parallelstore/src/index.ts +++ b/packages/google-cloud-parallelstore/src/index.ts @@ -16,12 +16,13 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** +import * as v1 from './v1'; import * as v1beta from './v1beta'; const ParallelstoreClient = v1beta.ParallelstoreClient; type ParallelstoreClient = v1beta.ParallelstoreClient; -export {v1beta, ParallelstoreClient}; -export default {v1beta, ParallelstoreClient}; +export {v1, v1beta, ParallelstoreClient}; +export default {v1, v1beta, ParallelstoreClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-parallelstore/src/v1/gapic_metadata.json b/packages/google-cloud-parallelstore/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..0ecb3bffdbc --- /dev/null +++ b/packages/google-cloud-parallelstore/src/v1/gapic_metadata.json @@ -0,0 +1,97 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.parallelstore.v1", + "libraryPackage": "@google-cloud/parallelstore", + "services": { + "Parallelstore": { + "clients": { + "grpc": { + "libraryClient": "ParallelstoreClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ParallelstoreClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "ImportData": { + "methods": [ + "importData" + ] + }, + "ExportData": { + "methods": [ + "exportData" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-parallelstore/src/v1/index.ts b/packages/google-cloud-parallelstore/src/v1/index.ts new file mode 100644 index 00000000000..8bc96a69eed --- /dev/null +++ b/packages/google-cloud-parallelstore/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 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. ** + +export {ParallelstoreClient} from './parallelstore_client'; diff --git a/packages/google-cloud-parallelstore/src/v1/parallelstore_client.ts b/packages/google-cloud-parallelstore/src/v1/parallelstore_client.ts new file mode 100644 index 00000000000..e40ace0f42a --- /dev/null +++ b/packages/google-cloud-parallelstore/src/v1/parallelstore_client.ts @@ -0,0 +1,2141 @@ +// Copyright 2024 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. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/parallelstore_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './parallelstore_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service describing handlers for resources + * Configures and manages parallelstore resources. + * + * Parallelstore service. + * + * The `parallelstore.googleapis.com` service implements the parallelstore API + * and defines the following resource model for managing instances: + * * The service works with a collection of cloud projects, named: `/projects/*` + * * Each project has a collection of available locations, named: `/locations/*` + * * Each location has a collection of instances named `/instances/*`. + * * Parallelstore instances are resources of the form: + * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * + * Note that location_id must be a Google Cloud `zone`; for example: + * * `projects/12345/locations/us-central1-c/instances/my-parallelstore-share` + * @class + * @memberof v1 + */ +export class ParallelstoreClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + parallelstoreStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ParallelstoreClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ParallelstoreClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ParallelstoreClient; + if ( + opts?.universe_domain && + opts?.universeDomain && + opts?.universe_domain !== opts?.universeDomain + ) { + throw new Error( + 'Please set either universe_domain or universeDomain, but not both.' + ); + } + const universeDomainEnvVar = + typeof process === 'object' && typeof process.env === 'object' + ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] + : undefined; + this._universeDomain = + opts?.universeDomain ?? + opts?.universe_domain ?? + universeDomainEnvVar ?? + 'googleapis.com'; + this._servicePath = 'parallelstore.' + this._universeDomain; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (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 !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._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}`]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + addressPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/addresses/{address}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + networkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/global/networks/{network}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + serviceAccountPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/serviceAccounts/{service_account}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listInstances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'instances' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + 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) + .operationsClient(opts); + const createInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.parallelstore.v1.Instance' + ) as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.parallelstore.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.parallelstore.v1.Instance' + ) as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.parallelstore.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.parallelstore.v1.OperationMetadata' + ) as gax.protobuf.Type; + const importDataResponse = protoFilesRoot.lookup( + '.google.cloud.parallelstore.v1.ImportDataResponse' + ) as gax.protobuf.Type; + const importDataMetadata = protoFilesRoot.lookup( + '.google.cloud.parallelstore.v1.ImportDataMetadata' + ) as gax.protobuf.Type; + const exportDataResponse = protoFilesRoot.lookup( + '.google.cloud.parallelstore.v1.ExportDataResponse' + ) as gax.protobuf.Type; + const exportDataMetadata = protoFilesRoot.lookup( + '.google.cloud.parallelstore.v1.ExportDataMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata) + ), + updateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceResponse.decode.bind(updateInstanceResponse), + updateInstanceMetadata.decode.bind(updateInstanceMetadata) + ), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) + ), + importData: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importDataResponse.decode.bind(importDataResponse), + importDataMetadata.decode.bind(importDataMetadata) + ), + exportData: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportDataResponse.decode.bind(exportDataResponse), + exportDataMetadata.decode.bind(exportDataMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.parallelstore.v1.Parallelstore', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.parallelstoreStub) { + return this.parallelstoreStub; + } + + // Put together the "service stub" for + // google.cloud.parallelstore.v1.Parallelstore. + this.parallelstoreStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.parallelstore.v1.Parallelstore' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.parallelstore.v1.Parallelstore, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const parallelstoreStubMethods = [ + 'listInstances', + 'getInstance', + 'createInstance', + 'updateInstance', + 'deleteInstance', + 'importData', + 'exportData', + ]; + for (const methodName of parallelstoreStubMethods) { + const callPromise = this.parallelstoreStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.parallelstoreStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static servicePath is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'parallelstore.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + process.emitWarning( + 'Static apiEndpoint is deprecated, please use the instance method instead.', + 'DeprecationWarning' + ); + } + return 'parallelstore.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets details of a single instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * @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 {@link protos.google.cloud.parallelstore.v1.Instance|Instance}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/parallelstore.get_instance.js + * region_tag:parallelstore_v1_generated_Parallelstore_GetInstance_async + */ + getInstance( + request?: protos.google.cloud.parallelstore.v1.IGetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IGetInstanceRequest | undefined, + {} | undefined, + ] + >; + getInstance( + request: protos.google.cloud.parallelstore.v1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.parallelstore.v1.IInstance, + | protos.google.cloud.parallelstore.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstance( + request: protos.google.cloud.parallelstore.v1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.parallelstore.v1.IInstance, + | protos.google.cloud.parallelstore.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstance( + request?: protos.google.cloud.parallelstore.v1.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.parallelstore.v1.IInstance, + | protos.google.cloud.parallelstore.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.parallelstore.v1.IInstance, + | protos.google.cloud.parallelstore.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IGetInstanceRequest | 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getInstance(request, options, callback); + } + + /** + * Creates a Parallelstore instance in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance's project and location, in the format + * `projects/{project}/locations/{location}`. + * Locations map to Google Cloud zones; for example, `us-west1-b`. + * @param {string} request.instanceId + * Required. The name of the Parallelstore instance. + * + * * Must contain only lowercase letters, numbers, and hyphens. + * * Must start with a letter. + * * Must be between 1-63 characters. + * * Must end with a number or a letter. + * * Must be unique within the customer project / location + * @param {google.cloud.parallelstore.v1.Instance} request.instance + * Required. The instance to create. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/parallelstore.create_instance.js + * region_tag:parallelstore_v1_generated_Parallelstore_CreateInstance_async + */ + createInstance( + request?: protos.google.cloud.parallelstore.v1.ICreateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createInstance( + request: protos.google.cloud.parallelstore.v1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request: protos.google.cloud.parallelstore.v1.ICreateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request?: protos.google.cloud.parallelstore.v1.ICreateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.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({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createInstance()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/parallelstore.create_instance.js + * region_tag:parallelstore_v1_generated_Parallelstore_CreateInstance_async + */ + async checkCreateInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.parallelstore.v1.Instance, + protos.google.cloud.parallelstore.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.createInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.parallelstore.v1.Instance, + protos.google.cloud.parallelstore.v1.OperationMetadata + >; + } + /** + * Updates the parameters of a single instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. Field mask is used to specify the + * fields to be overwritten in the Instance resource by the update. At least + * one path must be supplied in this field. The fields specified in the + * update_mask are relative to the resource, not the full request. + * @param {google.cloud.parallelstore.v1.Instance} request.instance + * Required. The instance to update. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/parallelstore.update_instance.js + * region_tag:parallelstore_v1_generated_Parallelstore_UpdateInstance_async + */ + updateInstance( + request?: protos.google.cloud.parallelstore.v1.IUpdateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateInstance( + request: protos.google.cloud.parallelstore.v1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateInstance( + request: protos.google.cloud.parallelstore.v1.IUpdateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateInstance( + request?: protos.google.cloud.parallelstore.v1.IUpdateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.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.name': request.instance!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateInstance()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/parallelstore.update_instance.js + * region_tag:parallelstore_v1_generated_Parallelstore_UpdateInstance_async + */ + async checkUpdateInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.parallelstore.v1.Instance, + protos.google.cloud.parallelstore.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.updateInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.parallelstore.v1.Instance, + protos.google.cloud.parallelstore.v1.OperationMetadata + >; + } + /** + * Deletes a single instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/parallelstore.delete_instance.js + * region_tag:parallelstore_v1_generated_Parallelstore_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.cloud.parallelstore.v1.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteInstance( + request: protos.google.cloud.parallelstore.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request: protos.google.cloud.parallelstore.v1.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request?: protos.google.cloud.parallelstore.v1.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.parallelstore.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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteInstance()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/parallelstore.delete_instance.js + * region_tag:parallelstore_v1_generated_Parallelstore_DeleteInstance_async + */ + async checkDeleteInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.parallelstore.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.deleteInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.parallelstore.v1.OperationMetadata + >; + } + /** + * Copies data from Cloud Storage to Parallelstore. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.parallelstore.v1.SourceGcsBucket} request.sourceGcsBucket + * The Cloud Storage source bucket and, optionally, path inside the bucket. + * @param {google.cloud.parallelstore.v1.DestinationParallelstore} request.destinationParallelstore + * Parallelstore destination. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {string} [request.serviceAccount] + * Optional. User-specified service account credentials to be used when + * performing the transfer. + * + * Use one of the following formats: + * + * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + * + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/parallelstore.import_data.js + * region_tag:parallelstore_v1_generated_Parallelstore_ImportData_async + */ + importData( + request?: protos.google.cloud.parallelstore.v1.IImportDataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.parallelstore.v1.IImportDataResponse, + protos.google.cloud.parallelstore.v1.IImportDataMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importData( + request: protos.google.cloud.parallelstore.v1.IImportDataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IImportDataResponse, + protos.google.cloud.parallelstore.v1.IImportDataMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importData( + request: protos.google.cloud.parallelstore.v1.IImportDataRequest, + callback: Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IImportDataResponse, + protos.google.cloud.parallelstore.v1.IImportDataMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importData( + request?: protos.google.cloud.parallelstore.v1.IImportDataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IImportDataResponse, + protos.google.cloud.parallelstore.v1.IImportDataMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IImportDataResponse, + protos.google.cloud.parallelstore.v1.IImportDataMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.parallelstore.v1.IImportDataResponse, + protos.google.cloud.parallelstore.v1.IImportDataMetadata + >, + 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.importData(request, options, callback); + } + /** + * Check the status of the long running operation returned by `importData()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/parallelstore.import_data.js + * region_tag:parallelstore_v1_generated_Parallelstore_ImportData_async + */ + async checkImportDataProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.parallelstore.v1.ImportDataResponse, + protos.google.cloud.parallelstore.v1.ImportDataMetadata + > + > { + 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.importData, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.parallelstore.v1.ImportDataResponse, + protos.google.cloud.parallelstore.v1.ImportDataMetadata + >; + } + /** + * Copies data from Parallelstore to Cloud Storage. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.parallelstore.v1.SourceParallelstore} request.sourceParallelstore + * Parallelstore source. + * @param {google.cloud.parallelstore.v1.DestinationGcsBucket} request.destinationGcsBucket + * Cloud Storage destination. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {string} [request.serviceAccount] + * Optional. User-specified Service Account (SA) credentials to be used when + * performing the transfer. + * Use one of the following formats: + * + * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` + * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} + * + * If unspecified, the Parallelstore service agent is used: + * `service-@gcp-sa-parallelstore.iam.gserviceaccount.com` + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/parallelstore.export_data.js + * region_tag:parallelstore_v1_generated_Parallelstore_ExportData_async + */ + exportData( + request?: protos.google.cloud.parallelstore.v1.IExportDataRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.parallelstore.v1.IExportDataResponse, + protos.google.cloud.parallelstore.v1.IExportDataMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + exportData( + request: protos.google.cloud.parallelstore.v1.IExportDataRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IExportDataResponse, + protos.google.cloud.parallelstore.v1.IExportDataMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportData( + request: protos.google.cloud.parallelstore.v1.IExportDataRequest, + callback: Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IExportDataResponse, + protos.google.cloud.parallelstore.v1.IExportDataMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + exportData( + request?: protos.google.cloud.parallelstore.v1.IExportDataRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IExportDataResponse, + protos.google.cloud.parallelstore.v1.IExportDataMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.parallelstore.v1.IExportDataResponse, + protos.google.cloud.parallelstore.v1.IExportDataMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.parallelstore.v1.IExportDataResponse, + protos.google.cloud.parallelstore.v1.IExportDataMetadata + >, + 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.exportData(request, options, callback); + } + /** + * Check the status of the long running operation returned by `exportData()`. + * @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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/parallelstore.export_data.js + * region_tag:parallelstore_v1_generated_Parallelstore_ExportData_async + */ + async checkExportDataProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.parallelstore.v1.ExportDataResponse, + protos.google.cloud.parallelstore.v1.ExportDataMetadata + > + > { + 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.exportData, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.parallelstore.v1.ExportDataResponse, + protos.google.cloud.parallelstore.v1.ExportDataMetadata + >; + } + /** + * Lists all instances in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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 Array of {@link protos.google.cloud.parallelstore.v1.Instance|Instance}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstances( + request?: protos.google.cloud.parallelstore.v1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.parallelstore.v1.IInstance[], + protos.google.cloud.parallelstore.v1.IListInstancesRequest | null, + protos.google.cloud.parallelstore.v1.IListInstancesResponse, + ] + >; + listInstances( + request: protos.google.cloud.parallelstore.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.parallelstore.v1.IListInstancesRequest, + | protos.google.cloud.parallelstore.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.parallelstore.v1.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.parallelstore.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.parallelstore.v1.IListInstancesRequest, + | protos.google.cloud.parallelstore.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.parallelstore.v1.IInstance + > + ): void; + listInstances( + request?: protos.google.cloud.parallelstore.v1.IListInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.parallelstore.v1.IListInstancesRequest, + | protos.google.cloud.parallelstore.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.parallelstore.v1.IInstance + >, + callback?: PaginationCallback< + protos.google.cloud.parallelstore.v1.IListInstancesRequest, + | protos.google.cloud.parallelstore.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.parallelstore.v1.IInstance + > + ): Promise< + [ + protos.google.cloud.parallelstore.v1.IInstance[], + protos.google.cloud.parallelstore.v1.IListInstancesRequest | null, + protos.google.cloud.parallelstore.v1.IListInstancesResponse, + ] + > | 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({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listInstances(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.parallelstore.v1.Instance|Instance} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInstancesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInstancesStream( + request?: protos.google.cloud.parallelstore.v1.IListInstancesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listInstances`, but 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.parent + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. + * + * To retrieve instance information for all locations, use "-" as the value of + * `{location}`. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, the server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.parallelstore.v1.Instance|Instance}. 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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/parallelstore.list_instances.js + * region_tag:parallelstore_v1_generated_Parallelstore_ListInstances_async + */ + listInstancesAsync( + request?: protos.google.cloud.parallelstore.v1.IListInstancesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as {}, + 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 {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * 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 {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.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 {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 | 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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.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 -- + // -------------------- + + /** + * Return a fully-qualified address resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} address + * @returns {string} Resource name string. + */ + addressPath(project: string, region: string, address: string) { + return this.pathTemplates.addressPathTemplate.render({ + project: project, + region: region, + address: address, + }); + } + + /** + * Parse the project from Address resource. + * + * @param {string} addressName + * A fully-qualified path representing Address resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAddressName(addressName: string) { + return this.pathTemplates.addressPathTemplate.match(addressName).project; + } + + /** + * Parse the region from Address resource. + * + * @param {string} addressName + * A fully-qualified path representing Address resource. + * @returns {string} A string representing the region. + */ + matchRegionFromAddressName(addressName: string) { + return this.pathTemplates.addressPathTemplate.match(addressName).region; + } + + /** + * Parse the address from Address resource. + * + * @param {string} addressName + * A fully-qualified path representing Address resource. + * @returns {string} A string representing the address. + */ + matchAddressFromAddressName(addressName: string) { + return this.pathTemplates.addressPathTemplate.match(addressName).address; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project: string, location: string, instance: string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified network resource name string. + * + * @param {string} project + * @param {string} network + * @returns {string} Resource name string. + */ + networkPath(project: string, network: string) { + return this.pathTemplates.networkPathTemplate.render({ + project: project, + network: network, + }); + } + + /** + * Parse the project from Network resource. + * + * @param {string} networkName + * A fully-qualified path representing Network resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNetworkName(networkName: string) { + return this.pathTemplates.networkPathTemplate.match(networkName).project; + } + + /** + * Parse the network from Network resource. + * + * @param {string} networkName + * A fully-qualified path representing Network resource. + * @returns {string} A string representing the network. + */ + matchNetworkFromNetworkName(networkName: string) { + return this.pathTemplates.networkPathTemplate.match(networkName).network; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified serviceAccount resource name string. + * + * @param {string} project + * @param {string} service_account + * @returns {string} Resource name string. + */ + serviceAccountPath(project: string, serviceAccount: string) { + return this.pathTemplates.serviceAccountPathTemplate.render({ + project: project, + service_account: serviceAccount, + }); + } + + /** + * Parse the project from ServiceAccount resource. + * + * @param {string} serviceAccountName + * A fully-qualified path representing ServiceAccount resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServiceAccountName(serviceAccountName: string) { + return this.pathTemplates.serviceAccountPathTemplate.match( + serviceAccountName + ).project; + } + + /** + * Parse the service_account from ServiceAccount resource. + * + * @param {string} serviceAccountName + * A fully-qualified path representing ServiceAccount resource. + * @returns {string} A string representing the service_account. + */ + matchServiceAccountFromServiceAccountName(serviceAccountName: string) { + return this.pathTemplates.serviceAccountPathTemplate.match( + serviceAccountName + ).service_account; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.parallelstoreStub && !this._terminated) { + return this.parallelstoreStub.then(stub => { + this._terminated = true; + stub.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-parallelstore/src/v1/parallelstore_client_config.json b/packages/google-cloud-parallelstore/src/v1/parallelstore_client_config.json new file mode 100644 index 00000000000..149d1f41bd3 --- /dev/null +++ b/packages/google-cloud-parallelstore/src/v1/parallelstore_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.parallelstore.v1.Parallelstore": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExportData": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-parallelstore/src/v1/parallelstore_proto_list.json b/packages/google-cloud-parallelstore/src/v1/parallelstore_proto_list.json new file mode 100644 index 00000000000..47b5b8d9006 --- /dev/null +++ b/packages/google-cloud-parallelstore/src/v1/parallelstore_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/parallelstore/v1/parallelstore.proto" +] diff --git a/packages/google-cloud-parallelstore/src/v1beta/parallelstore_client.ts b/packages/google-cloud-parallelstore/src/v1beta/parallelstore_client.ts index 777deb7adc0..4fa2a2ecb4b 100644 --- a/packages/google-cloud-parallelstore/src/v1beta/parallelstore_client.ts +++ b/packages/google-cloud-parallelstore/src/v1beta/parallelstore_client.ts @@ -1118,7 +1118,7 @@ export class ParallelstoreClient { * * Use one of the following formats: * - * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} * @@ -1283,7 +1283,7 @@ export class ParallelstoreClient { * performing the transfer. * Use one of the following formats: * - * * {EMAIL_ADDRESS_OR_UNIQUE_ID} + * * `{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}` * * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID} * diff --git a/packages/google-cloud-parallelstore/test/gapic_parallelstore_v1.ts b/packages/google-cloud-parallelstore/test/gapic_parallelstore_v1.ts new file mode 100644 index 00000000000..57f09e649d6 --- /dev/null +++ b/packages/google-cloud-parallelstore/test/gapic_parallelstore_v1.ts @@ -0,0 +1,2590 @@ +// Copyright 2024 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. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as parallelstoreModule from '../src'; + +import {PassThrough} from 'stream'; + +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 +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.ParallelstoreClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new parallelstoreModule.v1.ParallelstoreClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'parallelstore.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new parallelstoreModule.v1.ParallelstoreClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, 'googleapis.com'); + }); + + if ( + typeof process === 'object' && + typeof process.emitWarning === 'function' + ) { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = + parallelstoreModule.v1.ParallelstoreClient.servicePath; + assert.strictEqual(servicePath, 'parallelstore.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + parallelstoreModule.v1.ParallelstoreClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'parallelstore.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'parallelstore.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'parallelstore.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new parallelstoreModule.v1.ParallelstoreClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'parallelstore.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new parallelstoreModule.v1.ParallelstoreClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual( + servicePath, + 'parallelstore.configured.example.com' + ); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { + new parallelstoreModule.v1.ParallelstoreClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = parallelstoreModule.v1.ParallelstoreClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new parallelstoreModule.v1.ParallelstoreClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.parallelstoreStub, undefined); + await client.initialize(); + assert(client.parallelstoreStub); + }); + + it('has close method for the initialized client', done => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.parallelstoreStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.parallelstoreStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.parallelstore.v1.IInstance | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance with closed client', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInstance(request), expectedError); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with call error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + 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.checkCreateInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + 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.checkCreateInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance without error using callback', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.parallelstore.v1.IInstance, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with call error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInstance with LRO error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.UpdateInstanceRequest() + ); + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInstanceProgress without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + 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.checkUpdateInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInstanceProgress with error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + 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.checkUpdateInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.parallelstore.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.parallelstore.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with call error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance with LRO error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + 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.checkDeleteInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + 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.checkDeleteInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importData', () => { + it('invokes importData without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importData = stubLongRunningCall(expectedResponse); + const [operation] = await client.importData(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importData without error using callback', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importData = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importData( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.parallelstore.v1.IImportDataResponse, + protos.google.cloud.parallelstore.v1.IImportDataMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.parallelstore.v1.IImportDataResponse, + protos.google.cloud.parallelstore.v1.IImportDataMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importData with call error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.importData(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importData with LRO error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ImportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ImportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importData = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.importData(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportDataProgress without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + 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.checkImportDataProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportDataProgress with error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + 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.checkImportDataProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('exportData', () => { + it('invokes exportData without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportData = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportData(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportData without error using callback', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportData = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportData( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.parallelstore.v1.IExportDataResponse, + protos.google.cloud.parallelstore.v1.IExportDataMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.parallelstore.v1.IExportDataResponse, + protos.google.cloud.parallelstore.v1.IExportDataMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportData with call error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.exportData(request), expectedError); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportData with LRO error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ExportDataRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ExportDataRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportData = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.exportData(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.exportData as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportDataProgress without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + 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.checkExportDataProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportDataProgress with error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + 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.checkExportDataProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ), + ]; + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.parallelstore.v1.IInstance[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstances with error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listInstances(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ), + ]; + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.parallelstore.v1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.parallelstore.v1.Instance) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request) + ); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.parallelstore.v1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.parallelstore.v1.Instance) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request) + ); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.parallelstore.v1.Instance() + ), + ]; + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.parallelstore.v1.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.parallelstore.v1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.parallelstore.v1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.parallelstore.v1.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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 parallelstoreModule.v1.ParallelstoreClient({ + 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('address', () => { + const fakePath = '/rendered/path/address'; + const expectedParameters = { + project: 'projectValue', + region: 'regionValue', + address: 'addressValue', + }; + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.addressPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.addressPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('addressPath', () => { + const result = client.addressPath( + 'projectValue', + 'regionValue', + 'addressValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.addressPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAddressName', () => { + const result = client.matchProjectFromAddressName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.addressPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRegionFromAddressName', () => { + const result = client.matchRegionFromAddressName(fakePath); + assert.strictEqual(result, 'regionValue'); + assert( + (client.pathTemplates.addressPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAddressFromAddressName', () => { + const result = client.matchAddressFromAddressName(fakePath); + assert.strictEqual(result, 'addressValue'); + assert( + (client.pathTemplates.addressPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('network', () => { + const fakePath = '/rendered/path/network'; + const expectedParameters = { + project: 'projectValue', + network: 'networkValue', + }; + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.networkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.networkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('networkPath', () => { + const result = client.networkPath('projectValue', 'networkValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.networkPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNetworkName', () => { + const result = client.matchProjectFromNetworkName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.networkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNetworkFromNetworkName', () => { + const result = client.matchNetworkFromNetworkName(fakePath); + assert.strictEqual(result, 'networkValue'); + assert( + (client.pathTemplates.networkPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('serviceAccount', () => { + const fakePath = '/rendered/path/serviceAccount'; + const expectedParameters = { + project: 'projectValue', + service_account: 'serviceAccountValue', + }; + const client = new parallelstoreModule.v1.ParallelstoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.serviceAccountPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.serviceAccountPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('serviceAccountPath', () => { + const result = client.serviceAccountPath( + 'projectValue', + 'serviceAccountValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.serviceAccountPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromServiceAccountName', () => { + const result = client.matchProjectFromServiceAccountName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.serviceAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceAccountFromServiceAccountName', () => { + const result = + client.matchServiceAccountFromServiceAccountName(fakePath); + assert.strictEqual(result, 'serviceAccountValue'); + assert( + (client.pathTemplates.serviceAccountPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +});