diff --git a/owl-bot-staging/admin/v2/.eslintignore b/owl-bot-staging/admin/v2/.eslintignore deleted file mode 100644 index cfc348ec4..000000000 --- a/owl-bot-staging/admin/v2/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/admin/v2/.eslintrc.json b/owl-bot-staging/admin/v2/.eslintrc.json deleted file mode 100644 index 782153495..000000000 --- a/owl-bot-staging/admin/v2/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/admin/v2/.gitignore b/owl-bot-staging/admin/v2/.gitignore deleted file mode 100644 index d4f03a0df..000000000 --- a/owl-bot-staging/admin/v2/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/admin/v2/.jsdoc.js b/owl-bot-staging/admin/v2/.jsdoc.js deleted file mode 100644 index 3b3569bb7..000000000 --- a/owl-bot-staging/admin/v2/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 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'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/bigtable', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/admin/v2/.mocharc.js b/owl-bot-staging/admin/v2/.mocharc.js deleted file mode 100644 index 1a38f257d..000000000 --- a/owl-bot-staging/admin/v2/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 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. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/admin/v2/.prettierrc.js b/owl-bot-staging/admin/v2/.prettierrc.js deleted file mode 100644 index 55639e70f..000000000 --- a/owl-bot-staging/admin/v2/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 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. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/admin/v2/README.md b/owl-bot-staging/admin/v2/README.md deleted file mode 100644 index 5d45b74ed..000000000 --- a/owl-bot-staging/admin/v2/README.md +++ /dev/null @@ -1 +0,0 @@ -Admin: Nodejs Client diff --git a/owl-bot-staging/admin/v2/package.json b/owl-bot-staging/admin/v2/package.json deleted file mode 100644 index ab43ad014..000000000 --- a/owl-bot-staging/admin/v2/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "@google-cloud/bigtable", - "version": "0.1.0", - "description": "Admin client for Node.js", - "repository": "googleapis/nodejs-admin", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google admin", - "admin", - "bigtable instance admin", - "bigtable table admin" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^4.0.3" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.16", - "c8": "^8.0.1", - "gapic-tools": "^0.1.8", - "gts": "5.0.1", - "jsdoc": "^4.0.2", - "jsdoc-region-tag": "^3.0.0", - "jsdoc-fresh": "^3.0.0", - "mocha": "^10.2.0", - "pack-n-play": "^1.0.0-2", - "sinon": "^15.2.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">=v14" - } -} diff --git a/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto b/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto deleted file mode 100644 index d7b2ead1c..000000000 --- a/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/bigtable_instance_admin.proto +++ /dev/null @@ -1,739 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.bigtable.admin.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/bigtable/admin/v2/instance.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.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.Bigtable.Admin.V2"; -option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; -option java_multiple_files = true; -option java_outer_classname = "BigtableInstanceAdminProto"; -option java_package = "com.google.bigtable.admin.v2"; -option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; -option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; - -// Service for creating, configuring, and deleting Cloud Bigtable Instances and -// Clusters. Provides access to the Instance and Cluster schemas only, not the -// tables' metadata or data stored in those tables. -service BigtableInstanceAdmin { - option (google.api.default_host) = "bigtableadmin.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/bigtable.admin," - "https://www.googleapis.com/auth/bigtable.admin.cluster," - "https://www.googleapis.com/auth/bigtable.admin.instance," - "https://www.googleapis.com/auth/cloud-bigtable.admin," - "https://www.googleapis.com/auth/cloud-bigtable.admin.cluster," - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/cloud-platform.read-only"; - - // Create an instance within a project. - // - // Note that exactly one of Cluster.serve_nodes and - // Cluster.cluster_config.cluster_autoscaling_config can be set. If - // serve_nodes is set to non-zero, then the cluster is manually scaled. If - // cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is - // enabled. - rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{parent=projects/*}/instances" - body: "*" - }; - option (google.api.method_signature) = "parent,instance_id,instance,clusters"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "CreateInstanceMetadata" - }; - } - - // Gets information about an instance. - rpc GetInstance(GetInstanceRequest) returns (Instance) { - option (google.api.http) = { - get: "/v2/{name=projects/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists information about instances in a project. - rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*}/instances" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates an instance within a project. This method updates only the display - // name and type for an Instance. To update other Instance properties, such as - // labels, use PartialUpdateInstance. - rpc UpdateInstance(Instance) returns (Instance) { - option (google.api.http) = { - put: "/v2/{name=projects/*/instances/*}" - body: "*" - }; - } - - // Partially updates an instance within a project. This method can modify all - // fields of an Instance and is the preferred way to update an Instance. - rpc PartialUpdateInstance(PartialUpdateInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v2/{instance.name=projects/*/instances/*}" - body: "instance" - }; - option (google.api.method_signature) = "instance,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "UpdateInstanceMetadata" - }; - } - - // Delete an instance from a project. - rpc DeleteInstance(DeleteInstanceRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a cluster within an instance. - // - // Note that exactly one of Cluster.serve_nodes and - // Cluster.cluster_config.cluster_autoscaling_config can be set. If - // serve_nodes is set to non-zero, then the cluster is manually scaled. If - // cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is - // enabled. - rpc CreateCluster(CreateClusterRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/instances/*}/clusters" - body: "cluster" - }; - option (google.api.method_signature) = "parent,cluster_id,cluster"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "CreateClusterMetadata" - }; - } - - // Gets information about a cluster. - rpc GetCluster(GetClusterRequest) returns (Cluster) { - option (google.api.http) = { - get: "/v2/{name=projects/*/instances/*/clusters/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists information about clusters in an instance. - rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/instances/*}/clusters" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates a cluster within an instance. - // - // Note that UpdateCluster does not support updating - // cluster_config.cluster_autoscaling_config. In order to update it, you - // must use PartialUpdateCluster. - rpc UpdateCluster(Cluster) returns (google.longrunning.Operation) { - option (google.api.http) = { - put: "/v2/{name=projects/*/instances/*/clusters/*}" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "UpdateClusterMetadata" - }; - } - - // Partially updates a cluster within a project. This method is the preferred - // way to update a Cluster. - // - // To enable and update autoscaling, set - // cluster_config.cluster_autoscaling_config. When autoscaling is enabled, - // serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it - // are ignored. Note that an update cannot simultaneously set serve_nodes to - // non-zero and cluster_config.cluster_autoscaling_config to non-empty, and - // also specify both in the update_mask. - // - // To disable autoscaling, clear cluster_config.cluster_autoscaling_config, - // and explicitly set a serve_node count via the update_mask. - rpc PartialUpdateCluster(PartialUpdateClusterRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v2/{cluster.name=projects/*/instances/*/clusters/*}" - body: "cluster" - }; - option (google.api.method_signature) = "cluster,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "PartialUpdateClusterMetadata" - }; - } - - // Deletes a cluster from an instance. - rpc DeleteCluster(DeleteClusterRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/instances/*/clusters/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates an app profile within an instance. - rpc CreateAppProfile(CreateAppProfileRequest) returns (AppProfile) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/instances/*}/appProfiles" - body: "app_profile" - }; - option (google.api.method_signature) = "parent,app_profile_id,app_profile"; - } - - // Gets information about an app profile. - rpc GetAppProfile(GetAppProfileRequest) returns (AppProfile) { - option (google.api.http) = { - get: "/v2/{name=projects/*/instances/*/appProfiles/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists information about app profiles in an instance. - rpc ListAppProfiles(ListAppProfilesRequest) returns (ListAppProfilesResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/instances/*}/appProfiles" - }; - option (google.api.method_signature) = "parent"; - } - - // Updates an app profile within an instance. - rpc UpdateAppProfile(UpdateAppProfileRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v2/{app_profile.name=projects/*/instances/*/appProfiles/*}" - body: "app_profile" - }; - option (google.api.method_signature) = "app_profile,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "AppProfile" - metadata_type: "UpdateAppProfileMetadata" - }; - } - - // Deletes an app profile from an instance. - rpc DeleteAppProfile(DeleteAppProfileRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/instances/*/appProfiles/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Gets the access control policy for an instance resource. Returns an empty - // policy if an instance exists but does not have a policy set. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/instances/*}:getIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource"; - } - - // Sets the access control policy on an instance resource. Replaces any - // existing policy. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/instances/*}:setIamPolicy" - body: "*" - }; - option (google.api.method_signature) = "resource,policy"; - } - - // Returns permissions that the caller has on the specified instance resource. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/instances/*}:testIamPermissions" - body: "*" - }; - option (google.api.method_signature) = "resource,permissions"; - } - - // Lists hot tablets in a cluster, within the time range provided. Hot - // tablets are ordered based on CPU usage. - rpc ListHotTablets(ListHotTabletsRequest) returns (ListHotTabletsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/instances/*/clusters/*}/hotTablets" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Request message for BigtableInstanceAdmin.CreateInstance. -message CreateInstanceRequest { - // Required. The unique name of the project in which to create the new instance. - // Values are of the form `projects/{project}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The ID to be used when referring to the new instance within its project, - // e.g., just `myinstance` rather than - // `projects/myproject/instances/myinstance`. - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The instance to create. - // Fields marked `OutputOnly` must be left blank. - Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The clusters to be created within the instance, mapped by desired - // cluster ID, e.g., just `mycluster` rather than - // `projects/myproject/instances/myinstance/clusters/mycluster`. - // Fields marked `OutputOnly` must be left blank. - // Currently, at most four clusters can be specified. - map clusters = 4 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for BigtableInstanceAdmin.GetInstance. -message GetInstanceRequest { - // Required. The unique name of the requested instance. Values are of the form - // `projects/{project}/instances/{instance}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Instance" - } - ]; -} - -// Request message for BigtableInstanceAdmin.ListInstances. -message ListInstancesRequest { - // Required. The unique name of the project for which a list of instances is requested. - // Values are of the form `projects/{project}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // DEPRECATED: This field is unused and ignored. - string page_token = 2; -} - -// Response message for BigtableInstanceAdmin.ListInstances. -message ListInstancesResponse { - // The list of requested instances. - repeated Instance instances = 1; - - // Locations from which Instance information could not be retrieved, - // due to an outage or some other transient condition. - // Instances whose Clusters are all in one of the failed locations - // may be missing from `instances`, and Instances with at least one - // Cluster in a failed location may only have partial information returned. - // Values are of the form `projects//locations/` - repeated string failed_locations = 2; - - // DEPRECATED: This field is unused and ignored. - string next_page_token = 3; -} - -// Request message for BigtableInstanceAdmin.PartialUpdateInstance. -message PartialUpdateInstanceRequest { - // Required. The Instance which will (partially) replace the current value. - Instance instance = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The subset of Instance fields which should be replaced. - // Must be explicitly set. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for BigtableInstanceAdmin.DeleteInstance. -message DeleteInstanceRequest { - // Required. The unique name of the instance to be deleted. - // Values are of the form `projects/{project}/instances/{instance}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Instance" - } - ]; -} - -// Request message for BigtableInstanceAdmin.CreateCluster. -message CreateClusterRequest { - // Required. The unique name of the instance in which to create the new cluster. - // Values are of the form - // `projects/{project}/instances/{instance}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Instance" - } - ]; - - // Required. The ID to be used when referring to the new cluster within its instance, - // e.g., just `mycluster` rather than - // `projects/myproject/instances/myinstance/clusters/mycluster`. - string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The cluster to be created. - // Fields marked `OutputOnly` must be left blank. - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for BigtableInstanceAdmin.GetCluster. -message GetClusterRequest { - // Required. The unique name of the requested cluster. Values are of the form - // `projects/{project}/instances/{instance}/clusters/{cluster}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Cluster" - } - ]; -} - -// Request message for BigtableInstanceAdmin.ListClusters. -message ListClustersRequest { - // Required. The unique name of the instance for which a list of clusters is requested. - // Values are of the form `projects/{project}/instances/{instance}`. - // Use `{instance} = '-'` to list Clusters for all Instances in a project, - // e.g., `projects/myproject/instances/-`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Instance" - } - ]; - - // DEPRECATED: This field is unused and ignored. - string page_token = 2; -} - -// Response message for BigtableInstanceAdmin.ListClusters. -message ListClustersResponse { - // The list of requested clusters. - repeated Cluster clusters = 1; - - // Locations from which Cluster information could not be retrieved, - // due to an outage or some other transient condition. - // Clusters from these locations may be missing from `clusters`, - // or may only have partial information returned. - // Values are of the form `projects//locations/` - repeated string failed_locations = 2; - - // DEPRECATED: This field is unused and ignored. - string next_page_token = 3; -} - -// Request message for BigtableInstanceAdmin.DeleteCluster. -message DeleteClusterRequest { - // Required. The unique name of the cluster to be deleted. Values are of the form - // `projects/{project}/instances/{instance}/clusters/{cluster}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Cluster" - } - ]; -} - -// The metadata for the Operation returned by CreateInstance. -message CreateInstanceMetadata { - // The request that prompted the initiation of this CreateInstance operation. - CreateInstanceRequest original_request = 1; - - // The time at which the original request was received. - google.protobuf.Timestamp request_time = 2; - - // The time at which the operation failed or was completed successfully. - google.protobuf.Timestamp finish_time = 3; -} - -// The metadata for the Operation returned by UpdateInstance. -message UpdateInstanceMetadata { - // The request that prompted the initiation of this UpdateInstance operation. - PartialUpdateInstanceRequest original_request = 1; - - // The time at which the original request was received. - google.protobuf.Timestamp request_time = 2; - - // The time at which the operation failed or was completed successfully. - google.protobuf.Timestamp finish_time = 3; -} - -// The metadata for the Operation returned by CreateCluster. -message CreateClusterMetadata { - // Progress info for copying a table's data to the new cluster. - message TableProgress { - enum State { - STATE_UNSPECIFIED = 0; - - // The table has not yet begun copying to the new cluster. - PENDING = 1; - - // The table is actively being copied to the new cluster. - COPYING = 2; - - // The table has been fully copied to the new cluster. - COMPLETED = 3; - - // The table was deleted before it finished copying to the new cluster. - // Note that tables deleted after completion will stay marked as - // COMPLETED, not CANCELLED. - CANCELLED = 4; - } - - // Estimate of the size of the table to be copied. - int64 estimated_size_bytes = 2; - - // Estimate of the number of bytes copied so far for this table. - // This will eventually reach 'estimated_size_bytes' unless the table copy - // is CANCELLED. - int64 estimated_copied_bytes = 3; - - State state = 4; - } - - // The request that prompted the initiation of this CreateCluster operation. - CreateClusterRequest original_request = 1; - - // The time at which the original request was received. - google.protobuf.Timestamp request_time = 2; - - // The time at which the operation failed or was completed successfully. - google.protobuf.Timestamp finish_time = 3; - - // Keys: the full `name` of each table that existed in the instance when - // CreateCluster was first called, i.e. - // `projects//instances//tables/`. Any table added - // to the instance by a later API call will be created in the new cluster by - // that API call, not this one. - // - // Values: information on how much of a table's data has been copied to the - // newly-created cluster so far. - map tables = 4; -} - -// The metadata for the Operation returned by UpdateCluster. -message UpdateClusterMetadata { - // The request that prompted the initiation of this UpdateCluster operation. - Cluster original_request = 1; - - // The time at which the original request was received. - google.protobuf.Timestamp request_time = 2; - - // The time at which the operation failed or was completed successfully. - google.protobuf.Timestamp finish_time = 3; -} - -// The metadata for the Operation returned by PartialUpdateCluster. -message PartialUpdateClusterMetadata { - // The time at which the original request was received. - google.protobuf.Timestamp request_time = 1; - - // The time at which the operation failed or was completed successfully. - google.protobuf.Timestamp finish_time = 2; - - // The original request for PartialUpdateCluster. - PartialUpdateClusterRequest original_request = 3; -} - -// Request message for BigtableInstanceAdmin.PartialUpdateCluster. -message PartialUpdateClusterRequest { - // Required. The Cluster which contains the partial updates to be applied, subject to - // the update_mask. - Cluster cluster = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The subset of Cluster fields which should be replaced. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for BigtableInstanceAdmin.CreateAppProfile. -message CreateAppProfileRequest { - // Required. The unique name of the instance in which to create the new app profile. - // Values are of the form - // `projects/{project}/instances/{instance}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Instance" - } - ]; - - // Required. The ID to be used when referring to the new app profile within its - // instance, e.g., just `myprofile` rather than - // `projects/myproject/instances/myinstance/appProfiles/myprofile`. - string app_profile_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The app profile to be created. - // Fields marked `OutputOnly` will be ignored. - AppProfile app_profile = 3 [(google.api.field_behavior) = REQUIRED]; - - // If true, ignore safety checks when creating the app profile. - bool ignore_warnings = 4; -} - -// Request message for BigtableInstanceAdmin.GetAppProfile. -message GetAppProfileRequest { - // Required. The unique name of the requested app profile. Values are of the form - // `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/AppProfile" - } - ]; -} - -// Request message for BigtableInstanceAdmin.ListAppProfiles. -message ListAppProfilesRequest { - // Required. The unique name of the instance for which a list of app profiles is - // requested. Values are of the form - // `projects/{project}/instances/{instance}`. - // Use `{instance} = '-'` to list AppProfiles for all Instances in a project, - // e.g., `projects/myproject/instances/-`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Instance" - } - ]; - - // Maximum number of results per page. - // - // A page_size of zero lets the server choose the number of items to return. - // A page_size which is strictly positive will return at most that many items. - // A negative page_size will cause an error. - // - // Following the first request, subsequent paginated calls are not required - // to pass a page_size. If a page_size is set in subsequent calls, it must - // match the page_size given in the first request. - int32 page_size = 3; - - // The value of `next_page_token` returned by a previous call. - string page_token = 2; -} - -// Response message for BigtableInstanceAdmin.ListAppProfiles. -message ListAppProfilesResponse { - // The list of requested app profiles. - repeated AppProfile app_profiles = 1; - - // Set if not all app profiles could be returned in a single response. - // Pass this value to `page_token` in another request to get the next - // page of results. - string next_page_token = 2; - - // Locations from which AppProfile information could not be retrieved, - // due to an outage or some other transient condition. - // AppProfiles from these locations may be missing from `app_profiles`. - // Values are of the form `projects//locations/` - repeated string failed_locations = 3; -} - -// Request message for BigtableInstanceAdmin.UpdateAppProfile. -message UpdateAppProfileRequest { - // Required. The app profile which will (partially) replace the current value. - AppProfile app_profile = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The subset of app profile fields which should be replaced. - // If unset, all fields will be replaced. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; - - // If true, ignore safety checks when updating the app profile. - bool ignore_warnings = 3; -} - -// Request message for BigtableInstanceAdmin.DeleteAppProfile. -message DeleteAppProfileRequest { - // Required. The unique name of the app profile to be deleted. Values are of the form - // `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/AppProfile" - } - ]; - - // Required. If true, ignore safety checks when deleting the app profile. - bool ignore_warnings = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The metadata for the Operation returned by UpdateAppProfile. -message UpdateAppProfileMetadata { - -} - -// Request message for BigtableInstanceAdmin.ListHotTablets. -message ListHotTabletsRequest { - // Required. The cluster name to list hot tablets. - // Value is in the following form: - // `projects/{project}/instances/{instance}/clusters/{cluster}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Cluster" - } - ]; - - // The start time to list hot tablets. The hot tablets in the response will - // have start times between the requested start time and end time. Start time - // defaults to Now if it is unset, and end time defaults to Now - 24 hours if - // it is unset. The start time should be less than the end time, and the - // maximum allowed time range between start time and end time is 48 hours. - // Start time and end time should have values between Now and Now - 14 days. - google.protobuf.Timestamp start_time = 2; - - // The end time to list hot tablets. - google.protobuf.Timestamp end_time = 3; - - // Maximum number of results per page. - // - // A page_size that is empty or zero lets the server choose the number of - // items to return. A page_size which is strictly positive will return at most - // that many items. A negative page_size will cause an error. - // - // Following the first request, subsequent paginated calls do not need a - // page_size field. If a page_size is set in subsequent calls, it must match - // the page_size given in the first request. - int32 page_size = 4; - - // The value of `next_page_token` returned by a previous call. - string page_token = 5; -} - -// Response message for BigtableInstanceAdmin.ListHotTablets. -message ListHotTabletsResponse { - // List of hot tablets in the tables of the requested cluster that fall - // within the requested time range. Hot tablets are ordered by node cpu usage - // percent. If there are multiple hot tablets that correspond to the same - // tablet within a 15-minute interval, only the hot tablet with the highest - // node cpu usage will be included in the response. - repeated HotTablet hot_tablets = 1; - - // Set if not all hot tablets could be returned in a single response. - // Pass this value to `page_token` in another request to get the next - // page of results. - string next_page_token = 2; -} diff --git a/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/bigtable_table_admin.proto b/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/bigtable_table_admin.proto deleted file mode 100644 index 8c516abe7..000000000 --- a/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/bigtable_table_admin.proto +++ /dev/null @@ -1,1193 +0,0 @@ -// Copyright 2023 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.bigtable.admin.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/bigtable/admin/v2/common.proto"; -import "google/bigtable/admin/v2/table.proto"; -import "google/iam/v1/iam_policy.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; -option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; -option java_multiple_files = true; -option java_outer_classname = "BigtableTableAdminProto"; -option java_package = "com.google.bigtable.admin.v2"; -option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; -option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; - -// Service for creating, configuring, and deleting Cloud Bigtable tables. -// -// -// Provides access to the table schemas only, not the data stored within -// the tables. -service BigtableTableAdmin { - option (google.api.default_host) = "bigtableadmin.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/bigtable.admin," - "https://www.googleapis.com/auth/bigtable.admin.table," - "https://www.googleapis.com/auth/cloud-bigtable.admin," - "https://www.googleapis.com/auth/cloud-bigtable.admin.table," - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/cloud-platform.read-only"; - - // Creates a new table in the specified instance. - // The table can be created with a full set of initial column families, - // specified in the request. - rpc CreateTable(CreateTableRequest) returns (Table) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/instances/*}/tables" - body: "*" - }; - option (google.api.method_signature) = "parent,table_id,table"; - } - - // Creates a new table from the specified snapshot. The target table must - // not exist. The snapshot and the table must be in the same instance. - // - // Note: This is a private alpha release of Cloud Bigtable snapshots. This - // feature is not currently available to most Cloud Bigtable customers. This - // feature might be changed in backward-incompatible ways and is not - // recommended for production use. It is not subject to any SLA or deprecation - // policy. - rpc CreateTableFromSnapshot(CreateTableFromSnapshotRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/instances/*}/tables:createFromSnapshot" - body: "*" - }; - option (google.api.method_signature) = "parent,table_id,source_snapshot"; - option (google.longrunning.operation_info) = { - response_type: "Table" - metadata_type: "CreateTableFromSnapshotMetadata" - }; - } - - // Lists all tables served from a specified instance. - rpc ListTables(ListTablesRequest) returns (ListTablesResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/instances/*}/tables" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets metadata information about the specified table. - rpc GetTable(GetTableRequest) returns (Table) { - option (google.api.http) = { - get: "/v2/{name=projects/*/instances/*/tables/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a specified table. - rpc UpdateTable(UpdateTableRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v2/{table.name=projects/*/instances/*/tables/*}" - body: "table" - }; - option (google.api.method_signature) = "table,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Table" - metadata_type: "UpdateTableMetadata" - }; - } - - // Permanently deletes a specified table and all of its data. - rpc DeleteTable(DeleteTableRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/instances/*/tables/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Restores a specified table which was accidentally deleted. - rpc UndeleteTable(UndeleteTableRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{name=projects/*/instances/*/tables/*}:undelete" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Table" - metadata_type: "UndeleteTableMetadata" - }; - } - - // Performs a series of column family modifications on the specified table. - // Either all or none of the modifications will occur before this method - // returns, but data requests received prior to that point may see a table - // where only some modifications have taken effect. - rpc ModifyColumnFamilies(ModifyColumnFamiliesRequest) returns (Table) { - option (google.api.http) = { - post: "/v2/{name=projects/*/instances/*/tables/*}:modifyColumnFamilies" - body: "*" - }; - option (google.api.method_signature) = "name,modifications"; - } - - // Permanently drop/delete a row range from a specified table. The request can - // specify whether to delete all rows in a table, or only those that match a - // particular prefix. - rpc DropRowRange(DropRowRangeRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v2/{name=projects/*/instances/*/tables/*}:dropRowRange" - body: "*" - }; - } - - // Generates a consistency token for a Table, which can be used in - // CheckConsistency to check whether mutations to the table that finished - // before this call started have been replicated. The tokens will be available - // for 90 days. - rpc GenerateConsistencyToken(GenerateConsistencyTokenRequest) - returns (GenerateConsistencyTokenResponse) { - option (google.api.http) = { - post: "/v2/{name=projects/*/instances/*/tables/*}:generateConsistencyToken" - body: "*" - }; - option (google.api.method_signature) = "name"; - } - - // Checks replication consistency based on a consistency token, that is, if - // replication has caught up based on the conditions specified in the token - // and the check request. - rpc CheckConsistency(CheckConsistencyRequest) - returns (CheckConsistencyResponse) { - option (google.api.http) = { - post: "/v2/{name=projects/*/instances/*/tables/*}:checkConsistency" - body: "*" - }; - option (google.api.method_signature) = "name,consistency_token"; - } - - // Creates a new snapshot in the specified cluster from the specified - // source table. The cluster and the table must be in the same instance. - // - // Note: This is a private alpha release of Cloud Bigtable snapshots. This - // feature is not currently available to most Cloud Bigtable customers. This - // feature might be changed in backward-incompatible ways and is not - // recommended for production use. It is not subject to any SLA or deprecation - // policy. - rpc SnapshotTable(SnapshotTableRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{name=projects/*/instances/*/tables/*}:snapshot" - body: "*" - }; - option (google.api.method_signature) = - "name,cluster,snapshot_id,description"; - option (google.longrunning.operation_info) = { - response_type: "Snapshot" - metadata_type: "SnapshotTableMetadata" - }; - } - - // Gets metadata information about the specified snapshot. - // - // Note: This is a private alpha release of Cloud Bigtable snapshots. This - // feature is not currently available to most Cloud Bigtable customers. This - // feature might be changed in backward-incompatible ways and is not - // recommended for production use. It is not subject to any SLA or deprecation - // policy. - rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) { - option (google.api.http) = { - get: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all snapshots associated with the specified cluster. - // - // Note: This is a private alpha release of Cloud Bigtable snapshots. This - // feature is not currently available to most Cloud Bigtable customers. This - // feature might be changed in backward-incompatible ways and is not - // recommended for production use. It is not subject to any SLA or deprecation - // policy. - rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/instances/*/clusters/*}/snapshots" - }; - option (google.api.method_signature) = "parent"; - } - - // Permanently deletes the specified snapshot. - // - // Note: This is a private alpha release of Cloud Bigtable snapshots. This - // feature is not currently available to most Cloud Bigtable customers. This - // feature might be changed in backward-incompatible ways and is not - // recommended for production use. It is not subject to any SLA or deprecation - // policy. - rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/instances/*/clusters/*/snapshots/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Starts creating a new Cloud Bigtable Backup. The returned backup - // [long-running operation][google.longrunning.Operation] can be used to - // track creation of the backup. The - // [metadata][google.longrunning.Operation.metadata] field type is - // [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The - // [response][google.longrunning.Operation.response] field type is - // [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the - // returned operation will stop the creation and delete the backup. - rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/instances/*/clusters/*}/backups" - body: "backup" - }; - option (google.api.method_signature) = "parent,backup_id,backup"; - option (google.longrunning.operation_info) = { - response_type: "Backup" - metadata_type: "CreateBackupMetadata" - }; - } - - // Gets metadata on a pending or completed Cloud Bigtable Backup. - rpc GetBackup(GetBackupRequest) returns (Backup) { - option (google.api.http) = { - get: "/v2/{name=projects/*/instances/*/clusters/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates a pending or completed Cloud Bigtable Backup. - rpc UpdateBackup(UpdateBackupRequest) returns (Backup) { - option (google.api.http) = { - patch: "/v2/{backup.name=projects/*/instances/*/clusters/*/backups/*}" - body: "backup" - }; - option (google.api.method_signature) = "backup,update_mask"; - } - - // Deletes a pending or completed Cloud Bigtable backup. - rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v2/{name=projects/*/instances/*/clusters/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists Cloud Bigtable backups. Returns both completed and pending - // backups. - rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { - option (google.api.http) = { - get: "/v2/{parent=projects/*/instances/*/clusters/*}/backups" - }; - option (google.api.method_signature) = "parent"; - } - - // Create a new table by restoring from a completed backup. The - // returned table [long-running operation][google.longrunning.Operation] can - // be used to track the progress of the operation, and to cancel it. The - // [metadata][google.longrunning.Operation.metadata] field type is - // [RestoreTableMetadata][google.bigtable.admin.RestoreTableMetadata]. The - // [response][google.longrunning.Operation.response] type is - // [Table][google.bigtable.admin.v2.Table], if successful. - rpc RestoreTable(RestoreTableRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/instances/*}/tables:restore" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "Table" - metadata_type: "RestoreTableMetadata" - }; - } - - // Copy a Cloud Bigtable backup to a new backup in the destination cluster - // located in the destination instance and project. - rpc CopyBackup(CopyBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v2/{parent=projects/*/instances/*/clusters/*}/backups:copy" - body: "*" - }; - option (google.api.method_signature) = - "parent,backup_id,source_backup,expire_time"; - option (google.longrunning.operation_info) = { - response_type: "Backup" - metadata_type: "CopyBackupMetadata" - }; - } - - // Gets the access control policy for a Table or Backup resource. - // Returns an empty policy if the resource exists but does not have a policy - // set. - rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/instances/*/tables/*}:getIamPolicy" - body: "*" - additional_bindings { - post: "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:getIamPolicy" - body: "*" - } - }; - option (google.api.method_signature) = "resource"; - } - - // Sets the access control policy on a Table or Backup resource. - // Replaces any existing policy. - rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) - returns (google.iam.v1.Policy) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/instances/*/tables/*}:setIamPolicy" - body: "*" - additional_bindings { - post: "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:setIamPolicy" - body: "*" - } - }; - option (google.api.method_signature) = "resource,policy"; - } - - // Returns permissions that the caller has on the specified Table or Backup - // resource. - rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) - returns (google.iam.v1.TestIamPermissionsResponse) { - option (google.api.http) = { - post: "/v2/{resource=projects/*/instances/*/tables/*}:testIamPermissions" - body: "*" - additional_bindings { - post: "/v2/{resource=projects/*/instances/*/clusters/*/backups/*}:testIamPermissions" - body: "*" - } - }; - option (google.api.method_signature) = "resource,permissions"; - } -} - -// The request for -// [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. -message RestoreTableRequest { - // Required. The name of the instance in which to create the restored - // table. Values are of the form `projects//instances/`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Instance" - } - ]; - - // Required. The id of the table to create and restore to. This - // table must not already exist. The `table_id` appended to - // `parent` forms the full table name of the form - // `projects//instances//tables/`. - string table_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The source from which to restore. - oneof source { - // Name of the backup from which to restore. Values are of the form - // `projects//instances//clusters//backups/`. - string backup = 3 [(google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Backup" - }]; - } -} - -// Metadata type for the long-running operation returned by -// [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. -message RestoreTableMetadata { - // Name of the table being created and restored to. - string name = 1; - - // The type of the restore source. - RestoreSourceType source_type = 2; - - // Information about the source used to restore the table, as specified by - // `source` in - // [RestoreTableRequest][google.bigtable.admin.v2.RestoreTableRequest]. - oneof source_info { - BackupInfo backup_info = 3; - } - - // If exists, the name of the long-running operation that will be used to - // track the post-restore optimization process to optimize the performance of - // the restored table. The metadata type of the long-running operation is - // [OptimizeRestoreTableMetadata][]. The response type is - // [Empty][google.protobuf.Empty]. This long-running operation may be - // automatically created by the system if applicable after the - // RestoreTable long-running operation completes successfully. This operation - // may not be created if the table is already optimized or the restore was - // not successful. - string optimize_table_operation_name = 4; - - // The progress of the - // [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable] - // operation. - OperationProgress progress = 5; -} - -// Metadata type for the long-running operation used to track the progress -// of optimizations performed on a newly restored table. This long-running -// operation is automatically created by the system after the successful -// completion of a table restore, and cannot be cancelled. -message OptimizeRestoredTableMetadata { - // Name of the restored table being optimized. - string name = 1; - - // The progress of the post-restore optimizations. - OperationProgress progress = 2; -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable] -message CreateTableRequest { - // An initial split point for a newly created table. - message Split { - // Row key to use as an initial tablet boundary. - bytes key = 1; - } - - // Required. The unique name of the instance in which to create the table. - // Values are of the form `projects/{project}/instances/{instance}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Instance" - } - ]; - - // Required. The name by which the new table should be referred to within the - // parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. - // Maximum 50 characters. - string table_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Table to create. - Table table = 3 [(google.api.field_behavior) = REQUIRED]; - - // The optional list of row keys that will be used to initially split the - // table into several tablets (tablets are similar to HBase regions). - // Given two split keys, `s1` and `s2`, three tablets will be created, - // spanning the key ranges: `[, s1), [s1, s2), [s2, )`. - // - // Example: - // - // * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` - // `"other", "zz"]` - // * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` - // * Key assignment: - // - Tablet 1 `[, apple) => {"a"}.` - // - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` - // - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` - // - Tablet 4 `[customer_2, other) => {"customer_2"}.` - // - Tablet 5 `[other, ) => {"other", "zz"}.` - repeated Split initial_splits = 4; -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot] -// -// Note: This is a private alpha release of Cloud Bigtable snapshots. This -// feature is not currently available to most Cloud Bigtable customers. This -// feature might be changed in backward-incompatible ways and is not recommended -// for production use. It is not subject to any SLA or deprecation policy. -message CreateTableFromSnapshotRequest { - // Required. The unique name of the instance in which to create the table. - // Values are of the form `projects/{project}/instances/{instance}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Instance" - } - ]; - - // Required. The name by which the new table should be referred to within the - // parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. - string table_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The unique name of the snapshot from which to restore the table. - // The snapshot and the table must be in the same instance. Values are of the - // form - // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - string source_snapshot = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Snapshot" - } - ]; -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange] -message DropRowRangeRequest { - // Required. The unique name of the table on which to drop a range of rows. - // Values are of the form - // `projects/{project}/instances/{instance}/tables/{table}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; - - // Delete all rows or by prefix. - oneof target { - // Delete all rows that start with this row key prefix. Prefix cannot be - // zero length. - bytes row_key_prefix = 2; - - // Delete all rows in the table. Setting this to false is a no-op. - bool delete_all_data_from_table = 3; - } -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] -message ListTablesRequest { - // Required. The unique name of the instance for which tables should be - // listed. Values are of the form `projects/{project}/instances/{instance}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Instance" - } - ]; - - // The view to be applied to the returned tables' fields. - // NAME_ONLY view (default) and REPLICATION_VIEW are supported. - Table.View view = 2; - - // Maximum number of results per page. - // - // A page_size of zero lets the server choose the number of items to return. - // A page_size which is strictly positive will return at most that many items. - // A negative page_size will cause an error. - // - // Following the first request, subsequent paginated calls are not required - // to pass a page_size. If a page_size is set in subsequent calls, it must - // match the page_size given in the first request. - int32 page_size = 4; - - // The value of `next_page_token` returned by a previous call. - string page_token = 3; -} - -// Response message for -// [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] -message ListTablesResponse { - // The tables present in the requested instance. - repeated Table tables = 1; - - // Set if not all tables could be returned in a single response. - // Pass this value to `page_token` in another request to get the next - // page of results. - string next_page_token = 2; -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable] -message GetTableRequest { - // Required. The unique name of the requested table. - // Values are of the form - // `projects/{project}/instances/{instance}/tables/{table}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; - - // The view to be applied to the returned table's fields. - // Defaults to `SCHEMA_VIEW` if unspecified. - Table.View view = 2; -} - -// The request for -// [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]. -message UpdateTableRequest { - // Required. The table to update. - // The table's `name` field is used to identify the table to update. - Table table = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to update. - // A mask specifying which fields (e.g. `change_stream_config`) in the `table` - // field should be updated. This mask is relative to the `table` field, not to - // the request message. The wildcard (*) path is currently not supported. - // Currently UpdateTable is only supported for the following fields: - // - // * `change_stream_config` - // * `change_stream_config.retention_period` - // * `deletion_protection` - // - // If `column_families` is set in `update_mask`, it will return an - // UNIMPLEMENTED error. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Metadata type for the operation returned by -// [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]. -message UpdateTableMetadata { - // The name of the table being updated. - string name = 1; - - // The time at which this operation started. - google.protobuf.Timestamp start_time = 2; - - // If set, the time at which this operation finished or was canceled. - google.protobuf.Timestamp end_time = 3; -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable] -message DeleteTableRequest { - // Required. The unique name of the table to be deleted. - // Values are of the form - // `projects/{project}/instances/{instance}/tables/{table}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable] -message UndeleteTableRequest { - // Required. The unique name of the table to be restored. - // Values are of the form - // `projects/{project}/instances/{instance}/tables/{table}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; -} - -// Metadata type for the operation returned by -// [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable]. -message UndeleteTableMetadata { - // The name of the table being restored. - string name = 1; - - // The time at which this operation started. - google.protobuf.Timestamp start_time = 2; - - // If set, the time at which this operation finished or was cancelled. - google.protobuf.Timestamp end_time = 3; -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies] -message ModifyColumnFamiliesRequest { - // A create, update, or delete of a particular column family. - message Modification { - // The ID of the column family to be modified. - string id = 1; - - // Column family modifications. - oneof mod { - // Create a new column family with the specified schema, or fail if - // one already exists with the given ID. - ColumnFamily create = 2; - - // Update an existing column family to the specified schema, or fail - // if no column family exists with the given ID. - ColumnFamily update = 3; - - // Drop (delete) the column family with the given ID, or fail if no such - // family exists. - bool drop = 4; - } - } - - // Required. The unique name of the table whose families should be modified. - // Values are of the form - // `projects/{project}/instances/{instance}/tables/{table}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; - - // Required. Modifications to be atomically applied to the specified table's - // families. Entries are applied in order, meaning that earlier modifications - // can be masked by later ones (in the case of repeated updates to the same - // family, for example). - repeated Modification modifications = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] -message GenerateConsistencyTokenRequest { - // Required. The unique name of the Table for which to create a consistency - // token. Values are of the form - // `projects/{project}/instances/{instance}/tables/{table}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; -} - -// Response message for -// [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] -message GenerateConsistencyTokenResponse { - // The generated consistency token. - string consistency_token = 1; -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] -message CheckConsistencyRequest { - // Required. The unique name of the Table for which to check replication - // consistency. Values are of the form - // `projects/{project}/instances/{instance}/tables/{table}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; - - // Required. The token created using GenerateConsistencyToken for the Table. - string consistency_token = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for -// [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] -message CheckConsistencyResponse { - // True only if the token is consistent. A token is consistent if replication - // has caught up with the restrictions specified in the request. - bool consistent = 1; -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable] -// -// Note: This is a private alpha release of Cloud Bigtable snapshots. This -// feature is not currently available to most Cloud Bigtable customers. This -// feature might be changed in backward-incompatible ways and is not recommended -// for production use. It is not subject to any SLA or deprecation policy. -message SnapshotTableRequest { - // Required. The unique name of the table to have the snapshot taken. - // Values are of the form - // `projects/{project}/instances/{instance}/tables/{table}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; - - // Required. The name of the cluster where the snapshot will be created in. - // Values are of the form - // `projects/{project}/instances/{instance}/clusters/{cluster}`. - string cluster = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Cluster" - } - ]; - - // Required. The ID by which the new snapshot should be referred to within the - // parent cluster, e.g., `mysnapshot` of the form: - // `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than - // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. - string snapshot_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // The amount of time that the new snapshot can stay active after it is - // created. Once 'ttl' expires, the snapshot will get deleted. The maximum - // amount of time a snapshot can stay active is 7 days. If 'ttl' is not - // specified, the default value of 24 hours will be used. - google.protobuf.Duration ttl = 4; - - // Description of the snapshot. - string description = 5; -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot] -// -// Note: This is a private alpha release of Cloud Bigtable snapshots. This -// feature is not currently available to most Cloud Bigtable customers. This -// feature might be changed in backward-incompatible ways and is not recommended -// for production use. It is not subject to any SLA or deprecation policy. -message GetSnapshotRequest { - // Required. The unique name of the requested snapshot. - // Values are of the form - // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Snapshot" - } - ]; -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] -// -// Note: This is a private alpha release of Cloud Bigtable snapshots. This -// feature is not currently available to most Cloud Bigtable customers. This -// feature might be changed in backward-incompatible ways and is not recommended -// for production use. It is not subject to any SLA or deprecation policy. -message ListSnapshotsRequest { - // Required. The unique name of the cluster for which snapshots should be - // listed. Values are of the form - // `projects/{project}/instances/{instance}/clusters/{cluster}`. - // Use `{cluster} = '-'` to list snapshots for all clusters in an instance, - // e.g., `projects/{project}/instances/{instance}/clusters/-`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Cluster" - } - ]; - - // The maximum number of snapshots to return per page. - // CURRENTLY UNIMPLEMENTED AND IGNORED. - int32 page_size = 2; - - // The value of `next_page_token` returned by a previous call. - string page_token = 3; -} - -// Response message for -// [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] -// -// Note: This is a private alpha release of Cloud Bigtable snapshots. This -// feature is not currently available to most Cloud Bigtable customers. This -// feature might be changed in backward-incompatible ways and is not recommended -// for production use. It is not subject to any SLA or deprecation policy. -message ListSnapshotsResponse { - // The snapshots present in the requested cluster. - repeated Snapshot snapshots = 1; - - // Set if not all snapshots could be returned in a single response. - // Pass this value to `page_token` in another request to get the next - // page of results. - string next_page_token = 2; -} - -// Request message for -// [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot] -// -// Note: This is a private alpha release of Cloud Bigtable snapshots. This -// feature is not currently available to most Cloud Bigtable customers. This -// feature might be changed in backward-incompatible ways and is not recommended -// for production use. It is not subject to any SLA or deprecation policy. -message DeleteSnapshotRequest { - // Required. The unique name of the snapshot to be deleted. - // Values are of the form - // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Snapshot" - } - ]; -} - -// The metadata for the Operation returned by SnapshotTable. -// -// Note: This is a private alpha release of Cloud Bigtable snapshots. This -// feature is not currently available to most Cloud Bigtable customers. This -// feature might be changed in backward-incompatible ways and is not recommended -// for production use. It is not subject to any SLA or deprecation policy. -message SnapshotTableMetadata { - // The request that prompted the initiation of this SnapshotTable operation. - SnapshotTableRequest original_request = 1; - - // The time at which the original request was received. - google.protobuf.Timestamp request_time = 2; - - // The time at which the operation failed or was completed successfully. - google.protobuf.Timestamp finish_time = 3; -} - -// The metadata for the Operation returned by CreateTableFromSnapshot. -// -// Note: This is a private alpha release of Cloud Bigtable snapshots. This -// feature is not currently available to most Cloud Bigtable customers. This -// feature might be changed in backward-incompatible ways and is not recommended -// for production use. It is not subject to any SLA or deprecation policy. -message CreateTableFromSnapshotMetadata { - // The request that prompted the initiation of this CreateTableFromSnapshot - // operation. - CreateTableFromSnapshotRequest original_request = 1; - - // The time at which the original request was received. - google.protobuf.Timestamp request_time = 2; - - // The time at which the operation failed or was completed successfully. - google.protobuf.Timestamp finish_time = 3; -} - -// The request for -// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]. -message CreateBackupRequest { - // Required. This must be one of the clusters in the instance in which this - // table is located. The backup will be stored in this cluster. Values are - // of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Cluster" - } - ]; - - // Required. The id of the backup to be created. The `backup_id` along with - // the parent `parent` are combined as {parent}/backups/{backup_id} to create - // the full backup name, of the form: - // `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. - // This string must be between 1 and 50 characters in length and match the - // regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. - string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The backup to create. - Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Metadata type for the operation returned by -// [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]. -message CreateBackupMetadata { - // The name of the backup being created. - string name = 1; - - // The name of the table the backup is created from. - string source_table = 2; - - // The time at which this operation started. - google.protobuf.Timestamp start_time = 3; - - // If set, the time at which this operation finished or was cancelled. - google.protobuf.Timestamp end_time = 4; -} - -// The request for -// [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup]. -message UpdateBackupRequest { - // Required. The backup to update. `backup.name`, and the fields to be updated - // as specified by `update_mask` are required. Other fields are ignored. - // Update is only supported for the following fields: - // - // * `backup.expire_time`. - Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. A mask specifying which fields (e.g. `expire_time`) in the - // Backup resource should be updated. This mask is relative to the Backup - // resource, not to the request message. The field mask must always be - // specified; this prevents any future fields from being erased accidentally - // by clients that do not know about them. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup]. -message GetBackupRequest { - // Required. Name of the backup. - // Values are of the form - // `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Backup" - } - ]; -} - -// The request for -// [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup]. -message DeleteBackupRequest { - // Required. Name of the backup to delete. - // Values are of the form - // `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Backup" - } - ]; -} - -// The request for -// [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. -message ListBackupsRequest { - // Required. The cluster to list backups from. Values are of the - // form `projects/{project}/instances/{instance}/clusters/{cluster}`. - // Use `{cluster} = '-'` to list backups for all clusters in an instance, - // e.g., `projects/{project}/instances/{instance}/clusters/-`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Cluster" - } - ]; - - // A filter expression that filters backups listed in the response. - // The expression must specify the field name, a comparison operator, - // and the value that you want to use for filtering. The value must be a - // string, a number, or a boolean. The comparison operator must be - // <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is - // roughly synonymous with equality. Filter rules are case insensitive. - // - // The fields eligible for filtering are: - // - // * `name` - // * `source_table` - // * `state` - // * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - // * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - // * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - // * `size_bytes` - // - // To filter on multiple expressions, provide each separate expression within - // parentheses. By default, each expression is an AND expression. However, - // you can include AND, OR, and NOT expressions explicitly. - // - // Some examples of using filters are: - // - // * `name:"exact"` --> The backup's name is the string "exact". - // * `name:howl` --> The backup's name contains the string "howl". - // * `source_table:prod` - // --> The source_table's name contains the string "prod". - // * `state:CREATING` --> The backup is pending creation. - // * `state:READY` --> The backup is fully created and ready for use. - // * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` - // --> The backup name contains the string "howl" and start_time - // of the backup is before 2018-03-28T14:50:00Z. - // * `size_bytes > 10000000000` --> The backup's size is greater than 10GB - string filter = 2; - - // An expression for specifying the sort order of the results of the request. - // The string value should specify one or more fields in - // [Backup][google.bigtable.admin.v2.Backup]. The full syntax is described at - // https://aip.dev/132#ordering. - // - // Fields supported are: - // - // * name - // * source_table - // * expire_time - // * start_time - // * end_time - // * size_bytes - // * state - // - // For example, "start_time". The default sorting order is ascending. - // To specify descending order for the field, a suffix " desc" should - // be appended to the field name. For example, "start_time desc". - // Redundant space characters in the syntax are insigificant. - // - // If order_by is empty, results will be sorted by `start_time` in descending - // order starting from the most recently created backup. - string order_by = 3; - - // Number of backups to be returned in the response. If 0 or - // less, defaults to the server's maximum allowed page size. - int32 page_size = 4; - - // If non-empty, `page_token` should contain a - // [next_page_token][google.bigtable.admin.v2.ListBackupsResponse.next_page_token] - // from a previous - // [ListBackupsResponse][google.bigtable.admin.v2.ListBackupsResponse] to the - // same `parent` and with the same `filter`. - string page_token = 5; -} - -// The response for -// [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. -message ListBackupsResponse { - // The list of matching backups. - repeated Backup backups = 1; - - // `next_page_token` can be sent in a subsequent - // [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups] call - // to fetch more of the matching backups. - string next_page_token = 2; -} - -// The request for -// [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]. -message CopyBackupRequest { - // Required. The name of the destination cluster that will contain the backup - // copy. The cluster must already exists. Values are of the form: - // `projects/{project}/instances/{instance}/clusters/{cluster}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Cluster" - } - ]; - - // Required. The id of the new backup. The `backup_id` along with `parent` - // are combined as {parent}/backups/{backup_id} to create the full backup - // name, of the form: - // `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. - // This string must be between 1 and 50 characters in length and match the - // regex [_a-zA-Z0-9][-_.a-zA-Z0-9]*. - string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The source backup to be copied from. - // The source backup needs to be in READY state for it to be copied. - // Copying a copied backup is not allowed. - // Once CopyBackup is in progress, the source backup cannot be deleted or - // cleaned up on expiration until CopyBackup is finished. - // Values are of the form: - // `projects//instances//clusters//backups/`. - string source_backup = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Backup" - } - ]; - - // Required. Required. The expiration time of the copied backup with - // microsecond granularity that must be at least 6 hours and at most 30 days - // from the time the request is received. Once the `expire_time` has - // passed, Cloud Bigtable will delete the backup and free the resources used - // by the backup. - google.protobuf.Timestamp expire_time = 4 - [(google.api.field_behavior) = REQUIRED]; -} - -// Metadata type for the google.longrunning.Operation returned by -// [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]. -message CopyBackupMetadata { - // The name of the backup being created through the copy operation. - // Values are of the form - // `projects//instances//clusters//backups/`. - string name = 1 [(google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Backup" - }]; - - // Information about the source backup that is being copied from. - BackupInfo source_backup_info = 2; - - // The progress of the - // [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup] - // operation. - OperationProgress progress = 3; -} diff --git a/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/common.proto b/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/common.proto deleted file mode 100644 index 0d337e6b5..000000000 --- a/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/common.proto +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.bigtable.admin.v2; - -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; -option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; -option java_multiple_files = true; -option java_outer_classname = "CommonProto"; -option java_package = "com.google.bigtable.admin.v2"; -option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; -option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; - -// Storage media types for persisting Bigtable data. -enum StorageType { - // The user did not specify a storage type. - STORAGE_TYPE_UNSPECIFIED = 0; - - // Flash (SSD) storage should be used. - SSD = 1; - - // Magnetic drive (HDD) storage should be used. - HDD = 2; -} - -// Encapsulates progress related information for a Cloud Bigtable long -// running operation. -message OperationProgress { - // Percent completion of the operation. - // Values are between 0 and 100 inclusive. - int32 progress_percent = 1; - - // Time the request was received. - google.protobuf.Timestamp start_time = 2; - - // If set, the time at which this operation failed or was completed - // successfully. - google.protobuf.Timestamp end_time = 3; -} diff --git a/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/instance.proto b/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/instance.proto deleted file mode 100644 index e7e73e00f..000000000 --- a/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/instance.proto +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.bigtable.admin.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/bigtable/admin/v2/common.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; -option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; -option java_multiple_files = true; -option java_outer_classname = "InstanceProto"; -option java_package = "com.google.bigtable.admin.v2"; -option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; -option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKey" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" -}; - -// A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and -// the resources that serve them. -// All tables in an instance are served from all -// [Clusters][google.bigtable.admin.v2.Cluster] in the instance. -message Instance { - option (google.api.resource) = { - type: "bigtableadmin.googleapis.com/Instance" - pattern: "projects/{project}/instances/{instance}" - }; - - // Possible states of an instance. - enum State { - // The state of the instance could not be determined. - STATE_NOT_KNOWN = 0; - - // The instance has been successfully created and can serve requests - // to its tables. - READY = 1; - - // The instance is currently being created, and may be destroyed - // if the creation process encounters an error. - CREATING = 2; - } - - // The type of the instance. - enum Type { - // The type of the instance is unspecified. If set when creating an - // instance, a `PRODUCTION` instance will be created. If set when updating - // an instance, the type will be left unchanged. - TYPE_UNSPECIFIED = 0; - - // An instance meant for production use. `serve_nodes` must be set - // on the cluster. - PRODUCTION = 1; - - // DEPRECATED: Prefer PRODUCTION for all use cases, as it no longer enforces - // a higher minimum node count than DEVELOPMENT. - DEVELOPMENT = 2; - } - - // The unique name of the instance. Values are of the form - // `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. - string name = 1; - - // Required. The descriptive name for this instance as it appears in UIs. - // Can be changed at any time, but should be kept globally unique - // to avoid confusion. - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // (`OutputOnly`) - // The current state of the instance. - State state = 3; - - // The type of the instance. Defaults to `PRODUCTION`. - Type type = 4; - - // Labels are a flexible and lightweight mechanism for organizing cloud - // resources into groups that reflect a customer's organizational needs and - // deployment strategies. They can be used to filter resources and aggregate - // metrics. - // - // * Label keys must be between 1 and 63 characters long and must conform to - // the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`. - // * Label values must be between 0 and 63 characters long and must conform to - // the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. - // * No more than 64 labels can be associated with a given resource. - // * Keys and values must both be under 128 bytes. - map labels = 5; - - // Output only. A server-assigned timestamp representing when this Instance was created. - // For instances created before this field was added (August 2021), this value - // is `seconds: 0, nanos: 1`. - google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - optional bool satisfies_pzs = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The Autoscaling targets for a Cluster. These determine the recommended nodes. -message AutoscalingTargets { - // The cpu utilization that the Autoscaler should be trying to achieve. - // This number is on a scale from 0 (no utilization) to - // 100 (total utilization), and is limited between 10 and 80, otherwise it - // will return INVALID_ARGUMENT error. - int32 cpu_utilization_percent = 2; - - // The storage utilization that the Autoscaler should be trying to achieve. - // This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD - // cluster and between 8192 (8TiB) and 16384 (16TiB) for an HDD cluster; - // otherwise it will return INVALID_ARGUMENT error. If this value is set to 0, - // it will be treated as if it were set to the default value: 2560 for SSD, - // 8192 for HDD. - int32 storage_utilization_gib_per_node = 3; -} - -// Limits for the number of nodes a Cluster can autoscale up/down to. -message AutoscalingLimits { - // Required. Minimum number of nodes to scale down to. - int32 min_serve_nodes = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Maximum number of nodes to scale up to. - int32 max_serve_nodes = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// A resizable group of nodes in a particular cloud location, capable -// of serving all [Tables][google.bigtable.admin.v2.Table] in the parent -// [Instance][google.bigtable.admin.v2.Instance]. -message Cluster { - option (google.api.resource) = { - type: "bigtableadmin.googleapis.com/Cluster" - pattern: "projects/{project}/instances/{instance}/clusters/{cluster}" - }; - - // Possible states of a cluster. - enum State { - // The state of the cluster could not be determined. - STATE_NOT_KNOWN = 0; - - // The cluster has been successfully created and is ready to serve requests. - READY = 1; - - // The cluster is currently being created, and may be destroyed - // if the creation process encounters an error. - // A cluster may not be able to serve requests while being created. - CREATING = 2; - - // The cluster is currently being resized, and may revert to its previous - // node count if the process encounters an error. - // A cluster is still capable of serving requests while being resized, - // but may exhibit performance as if its number of allocated nodes is - // between the starting and requested states. - RESIZING = 3; - - // The cluster has no backing nodes. The data (tables) still - // exist, but no operations can be performed on the cluster. - DISABLED = 4; - } - - // Autoscaling config for a cluster. - message ClusterAutoscalingConfig { - // Required. Autoscaling limits for this cluster. - AutoscalingLimits autoscaling_limits = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Autoscaling targets for this cluster. - AutoscalingTargets autoscaling_targets = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Configuration for a cluster. - message ClusterConfig { - // Autoscaling configuration for this cluster. - ClusterAutoscalingConfig cluster_autoscaling_config = 1; - } - - // Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected - // cluster. - message EncryptionConfig { - // Describes the Cloud KMS encryption key that will be used to protect the - // destination Bigtable cluster. The requirements for this key are: - // 1) The Cloud Bigtable service account associated with the project that - // contains this cluster must be granted the - // `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key. - // 2) Only regional keys can be used and the region of the CMEK key must - // match the region of the cluster. - // 3) All clusters within an instance must use the same CMEK key. - // Values are of the form - // `projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}` - string kms_key_name = 1 [(google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - }]; - } - - // The unique name of the cluster. Values are of the form - // `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. - string name = 1; - - // Immutable. The location where this cluster's nodes and storage reside. For best - // performance, clients should be located as close as possible to this - // cluster. Currently only zones are supported, so values should be of the - // form `projects/{project}/locations/{zone}`. - string location = 2 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Output only. The current state of the cluster. - State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The number of nodes allocated to this cluster. More nodes enable higher - // throughput and more consistent performance. - int32 serve_nodes = 4; - - oneof config { - // Configuration for this cluster. - ClusterConfig cluster_config = 7; - } - - // Immutable. The type of storage used by this cluster to serve its - // parent instance's tables, unless explicitly overridden. - StorageType default_storage_type = 5 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The encryption configuration for CMEK-protected clusters. - EncryptionConfig encryption_config = 6 [(google.api.field_behavior) = IMMUTABLE]; -} - -// A configuration object describing how Cloud Bigtable should treat traffic -// from a particular end user application. -message AppProfile { - option (google.api.resource) = { - type: "bigtableadmin.googleapis.com/AppProfile" - pattern: "projects/{project}/instances/{instance}/appProfiles/{app_profile}" - }; - - // Read/write requests are routed to the nearest cluster in the instance, and - // will fail over to the nearest cluster that is available in the event of - // transient errors or delays. Clusters in a region are considered - // equidistant. Choosing this option sacrifices read-your-writes consistency - // to improve availability. - message MultiClusterRoutingUseAny { - // The set of clusters to route to. The order is ignored; clusters will be - // tried in order of distance. If left empty, all clusters are eligible. - repeated string cluster_ids = 1; - } - - // Unconditionally routes all read/write requests to a specific cluster. - // This option preserves read-your-writes consistency but does not improve - // availability. - message SingleClusterRouting { - // The cluster to which read/write requests should be routed. - string cluster_id = 1; - - // Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are - // allowed by this app profile. It is unsafe to send these requests to - // the same table/row/column in multiple clusters. - bool allow_transactional_writes = 2; - } - - // The unique name of the app profile. Values are of the form - // `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. - string name = 1; - - // Strongly validated etag for optimistic concurrency control. Preserve the - // value returned from `GetAppProfile` when calling `UpdateAppProfile` to - // fail the request if there has been a modification in the mean time. The - // `update_mask` of the request need not include `etag` for this protection - // to apply. - // See [Wikipedia](https://en.wikipedia.org/wiki/HTTP_ETag) and - // [RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3) for more - // details. - string etag = 2; - - // Long form description of the use case for this AppProfile. - string description = 3; - - // The routing policy for all read/write requests that use this app profile. - // A value must be explicitly set. - oneof routing_policy { - // Use a multi-cluster routing policy. - MultiClusterRoutingUseAny multi_cluster_routing_use_any = 5; - - // Use a single-cluster routing policy. - SingleClusterRouting single_cluster_routing = 6; - } -} - -// A tablet is a defined by a start and end key and is explained in -// https://cloud.google.com/bigtable/docs/overview#architecture and -// https://cloud.google.com/bigtable/docs/performance#optimization. -// A Hot tablet is a tablet that exhibits high average cpu usage during the time -// interval from start time to end time. -message HotTablet { - option (google.api.resource) = { - type: "bigtableadmin.googleapis.com/HotTablet" - pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}" - }; - - // The unique name of the hot tablet. Values are of the form - // `projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/[a-zA-Z0-9_-]*`. - string name = 1; - - // Name of the table that contains the tablet. Values are of the form - // `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. - string table_name = 2 [(google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - }]; - - // Output only. The start time of the hot tablet. - google.protobuf.Timestamp start_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The end time of the hot tablet. - google.protobuf.Timestamp end_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Tablet Start Key (inclusive). - string start_key = 5; - - // Tablet End Key (inclusive). - string end_key = 6; - - // Output only. The average CPU usage spent by a node on this tablet over the start_time to - // end_time time range. The percentage is the amount of CPU used by the node - // to serve the tablet, from 0% (tablet was not interacted with) to 100% (the - // node spent all cycles serving the hot tablet). - float node_cpu_usage_percent = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/table.proto b/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/table.proto deleted file mode 100644 index 4d02d3036..000000000 --- a/owl-bot-staging/admin/v2/protos/google/bigtable/admin/v2/table.proto +++ /dev/null @@ -1,442 +0,0 @@ -// Copyright 2023 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.bigtable.admin.v2; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; -option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; -option java_multiple_files = true; -option java_outer_classname = "TableProto"; -option java_package = "com.google.bigtable.admin.v2"; -option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; -option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" -}; - -// Information about a table restore. -message RestoreInfo { - // The type of the restore source. - RestoreSourceType source_type = 1; - - // Information about the source used to restore the table. - oneof source_info { - // Information about the backup used to restore the table. The backup - // may no longer exist. - BackupInfo backup_info = 2; - } -} - -// Change stream configuration. -message ChangeStreamConfig { - // How long the change stream should be retained. Change stream data older - // than the retention period will not be returned when reading the change - // stream from the table. - // Values must be at least 1 day and at most 7 days, and will be truncated to - // microsecond granularity. - google.protobuf.Duration retention_period = 1; -} - -// A collection of user data indexed by row, column, and timestamp. -// Each table is served using the resources of its parent cluster. -message Table { - option (google.api.resource) = { - type: "bigtableadmin.googleapis.com/Table" - pattern: "projects/{project}/instances/{instance}/tables/{table}" - }; - - // The state of a table's data in a particular cluster. - message ClusterState { - // Table replication states. - enum ReplicationState { - // The replication state of the table is unknown in this cluster. - STATE_NOT_KNOWN = 0; - - // The cluster was recently created, and the table must finish copying - // over pre-existing data from other clusters before it can begin - // receiving live replication updates and serving Data API requests. - INITIALIZING = 1; - - // The table is temporarily unable to serve Data API requests from this - // cluster due to planned internal maintenance. - PLANNED_MAINTENANCE = 2; - - // The table is temporarily unable to serve Data API requests from this - // cluster due to unplanned or emergency maintenance. - UNPLANNED_MAINTENANCE = 3; - - // The table can serve Data API requests from this cluster. Depending on - // replication delay, reads may not immediately reflect the state of the - // table in other clusters. - READY = 4; - - // The table is fully created and ready for use after a restore, and is - // being optimized for performance. When optimizations are complete, the - // table will transition to `READY` state. - READY_OPTIMIZING = 5; - } - - // Output only. The state of replication for the table in this cluster. - ReplicationState replication_state = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The encryption information for the table in this cluster. - // If the encryption key protecting this resource is customer managed, then - // its version can be rotated in Cloud Key Management Service (Cloud KMS). - // The primary version of the key and its status will be reflected here when - // changes propagate from Cloud KMS. - repeated EncryptionInfo encryption_info = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Possible timestamp granularities to use when keeping multiple versions - // of data in a table. - enum TimestampGranularity { - // The user did not specify a granularity. Should not be returned. - // When specified during table creation, MILLIS will be used. - TIMESTAMP_GRANULARITY_UNSPECIFIED = 0; - - // The table keeps data versioned at a granularity of 1ms. - MILLIS = 1; - } - - // Defines a view over a table's fields. - enum View { - // Uses the default view for each method as documented in its request. - VIEW_UNSPECIFIED = 0; - - // Only populates `name`. - NAME_ONLY = 1; - - // Only populates `name` and fields related to the table's schema. - SCHEMA_VIEW = 2; - - // Only populates `name` and fields related to the table's replication - // state. - REPLICATION_VIEW = 3; - - // Only populates `name` and fields related to the table's encryption state. - ENCRYPTION_VIEW = 5; - - // Populates all fields. - FULL = 4; - } - - // The unique name of the table. Values are of the form - // `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. - // Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` - string name = 1; - - // Output only. Map from cluster ID to per-cluster table state. - // If it could not be determined whether or not the table has data in a - // particular cluster (for example, if its zone is unavailable), then - // there will be an entry for the cluster with UNKNOWN `replication_status`. - // Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` - map cluster_states = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The column families configured for this table, mapped by column family ID. - // Views: `SCHEMA_VIEW`, `STATS_VIEW`, `FULL` - map column_families = 3; - - // Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored - // in this table. Timestamps not matching the granularity will be rejected. If - // unspecified at creation time, the value will be set to `MILLIS`. Views: - // `SCHEMA_VIEW`, `FULL`. - TimestampGranularity granularity = 4 - [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. If this table was restored from another data source (e.g. a - // backup), this field will be populated with information about the restore. - RestoreInfo restore_info = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // If specified, enable the change stream on this table. - // Otherwise, the change stream is disabled and the change stream is not - // retained. - ChangeStreamConfig change_stream_config = 8; - - // Set to true to make the table protected against data loss. i.e. deleting - // the following resources through Admin APIs are prohibited: - // - // * The table. - // * The column families in the table. - // * The instance containing the table. - // - // Note one can still delete the data stored in the table through Data APIs. - bool deletion_protection = 9; -} - -// A set of columns within a table which share a common configuration. -message ColumnFamily { - // Garbage collection rule specified as a protobuf. - // Must serialize to at most 500 bytes. - // - // NOTE: Garbage collection executes opportunistically in the background, and - // so it's possible for reads to return a cell even if it matches the active - // GC expression for its family. - GcRule gc_rule = 1; -} - -// Rule for determining which cells to delete during garbage collection. -message GcRule { - // A GcRule which deletes cells matching all of the given rules. - message Intersection { - // Only delete cells which would be deleted by every element of `rules`. - repeated GcRule rules = 1; - } - - // A GcRule which deletes cells matching any of the given rules. - message Union { - // Delete cells which would be deleted by any element of `rules`. - repeated GcRule rules = 1; - } - - // Garbage collection rules. - oneof rule { - // Delete all cells in a column except the most recent N. - int32 max_num_versions = 1; - - // Delete cells in a column older than the given age. - // Values must be at least one millisecond, and will be truncated to - // microsecond granularity. - google.protobuf.Duration max_age = 2; - - // Delete cells that would be deleted by every nested rule. - Intersection intersection = 3; - - // Delete cells that would be deleted by any nested rule. - Union union = 4; - } -} - -// Encryption information for a given resource. -// If this resource is protected with customer managed encryption, the in-use -// Cloud Key Management Service (Cloud KMS) key version is specified along with -// its status. -message EncryptionInfo { - // Possible encryption types for a resource. - enum EncryptionType { - // Encryption type was not specified, though data at rest remains encrypted. - ENCRYPTION_TYPE_UNSPECIFIED = 0; - - // The data backing this resource is encrypted at rest with a key that is - // fully managed by Google. No key version or status will be populated. - // This is the default state. - GOOGLE_DEFAULT_ENCRYPTION = 1; - - // The data backing this resource is encrypted at rest with a key that is - // managed by the customer. - // The in-use version of the key and its status are populated for - // CMEK-protected tables. - // CMEK-protected backups are pinned to the key version that was in use at - // the time the backup was taken. This key version is populated but its - // status is not tracked and is reported as `UNKNOWN`. - CUSTOMER_MANAGED_ENCRYPTION = 2; - } - - // Output only. The type of encryption used to protect this resource. - EncryptionType encryption_type = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The status of encrypt/decrypt calls on underlying data for - // this resource. Regardless of status, the existing data is always encrypted - // at rest. - google.rpc.Status encryption_status = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The version of the Cloud KMS key specified in the parent - // cluster that is in use for the data underlying this table. - string kms_key_version = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - } - ]; -} - -// A snapshot of a table at a particular time. A snapshot can be used as a -// checkpoint for data restoration or a data source for a new table. -// -// Note: This is a private alpha release of Cloud Bigtable snapshots. This -// feature is not currently available to most Cloud Bigtable customers. This -// feature might be changed in backward-incompatible ways and is not recommended -// for production use. It is not subject to any SLA or deprecation policy. -message Snapshot { - option (google.api.resource) = { - type: "bigtableadmin.googleapis.com/Snapshot" - pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}" - }; - - // Possible states of a snapshot. - enum State { - // The state of the snapshot could not be determined. - STATE_NOT_KNOWN = 0; - - // The snapshot has been successfully created and can serve all requests. - READY = 1; - - // The snapshot is currently being created, and may be destroyed if the - // creation process encounters an error. A snapshot may not be restored to a - // table while it is being created. - CREATING = 2; - } - - // The unique name of the snapshot. - // Values are of the form - // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - string name = 1; - - // Output only. The source table at the time the snapshot was taken. - Table source_table = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The size of the data in the source table at the time the - // snapshot was taken. In some cases, this value may be computed - // asynchronously via a background process and a placeholder of 0 will be used - // in the meantime. - int64 data_size_bytes = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the snapshot is created. - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The time when the snapshot will be deleted. The maximum amount of time a - // snapshot can stay active is 365 days. If 'ttl' is not specified, - // the default maximum of 365 days will be used. - google.protobuf.Timestamp delete_time = 5; - - // Output only. The current state of the snapshot. - State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Description of the snapshot. - string description = 7; -} - -// A backup of a Cloud Bigtable table. -message Backup { - option (google.api.resource) = { - type: "bigtableadmin.googleapis.com/Backup" - pattern: "projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}" - }; - - // Indicates the current state of the backup. - enum State { - // Not specified. - STATE_UNSPECIFIED = 0; - - // The pending backup is still being created. Operations on the - // backup may fail with `FAILED_PRECONDITION` in this state. - CREATING = 1; - - // The backup is complete and ready for use. - READY = 2; - } - - // A globally unique identifier for the backup which cannot be - // changed. Values are of the form - // `projects/{project}/instances/{instance}/clusters/{cluster}/ - // backups/[_a-zA-Z0-9][-_.a-zA-Z0-9]*` - // The final segment of the name must be between 1 and 50 characters - // in length. - // - // The backup is stored in the cluster identified by the prefix of the backup - // name of the form - // `projects/{project}/instances/{instance}/clusters/{cluster}`. - string name = 1; - - // Required. Immutable. Name of the table from which this backup was created. - // This needs to be in the same instance as the backup. Values are of the form - // `projects/{project}/instances/{instance}/tables/{source_table}`. - string source_table = 2 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = REQUIRED - ]; - - // Output only. Name of the backup from which this backup was copied. If a - // backup is not created by copying a backup, this field will be empty. Values - // are of the form: projects//instances//backups/. - string source_backup = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The expiration time of the backup, with microseconds - // granularity that must be at least 6 hours and at most 90 days - // from the time the request is received. Once the `expire_time` - // has passed, Cloud Bigtable will delete the backup and free the - // resources used by the backup. - google.protobuf.Timestamp expire_time = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Output only. `start_time` is the time that the backup was started - // (i.e. approximately the time the - // [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup] - // request is received). The row data in this backup will be no older than - // this timestamp. - google.protobuf.Timestamp start_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. `end_time` is the time that the backup was finished. The row - // data in the backup will be no newer than this timestamp. - google.protobuf.Timestamp end_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Size of the backup in bytes. - int64 size_bytes = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current state of the backup. - State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The encryption information for the backup. - EncryptionInfo encryption_info = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Information about a backup. -message BackupInfo { - // Output only. Name of the backup. - string backup = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time that the backup was started. Row data in the backup - // will be no older than this timestamp. - google.protobuf.Timestamp start_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. This time that the backup was finished. Row data in the - // backup will be no newer than this timestamp. - google.protobuf.Timestamp end_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the table the backup was created from. - string source_table = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the backup from which this backup was copied. If a - // backup is not created by copying a backup, this field will be empty. Values - // are of the form: projects//instances//backups/. - string source_backup = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Indicates the type of the restore source. -enum RestoreSourceType { - // No restore associated. - RESTORE_SOURCE_TYPE_UNSPECIFIED = 0; - - // A backup was used as the source of the restore. - BACKUP = 1; -} diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.create_app_profile.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.create_app_profile.js deleted file mode 100644 index c968d21eb..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.create_app_profile.js +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2023 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, appProfileId, appProfile) { - // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_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 unique name of the instance in which to create the new app profile. - * Values are of the form - * `projects/{project}/instances/{instance}`. - */ - // const parent = 'abc123' - /** - * Required. The ID to be used when referring to the new app profile within its - * instance, e.g., just `myprofile` rather than - * `projects/myproject/instances/myinstance/appProfiles/myprofile`. - */ - // const appProfileId = 'abc123' - /** - * Required. The app profile to be created. - * Fields marked `OutputOnly` will be ignored. - */ - // const appProfile = {} - /** - * If true, ignore safety checks when creating the app profile. - */ - // const ignoreWarnings = true - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callCreateAppProfile() { - // Construct request - const request = { - parent, - appProfileId, - appProfile, - }; - - // Run request - const response = await adminClient.createAppProfile(request); - console.log(response); - } - - callCreateAppProfile(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.create_cluster.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.create_cluster.js deleted file mode 100644 index 461e7d1b6..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.create_cluster.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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, clusterId, cluster) { - // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_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 unique name of the instance in which to create the new cluster. - * Values are of the form - * `projects/{project}/instances/{instance}`. - */ - // const parent = 'abc123' - /** - * Required. The ID to be used when referring to the new cluster within its instance, - * e.g., just `mycluster` rather than - * `projects/myproject/instances/myinstance/clusters/mycluster`. - */ - // const clusterId = 'abc123' - /** - * Required. The cluster to be created. - * Fields marked `OutputOnly` must be left blank. - */ - // const cluster = {} - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callCreateCluster() { - // Construct request - const request = { - parent, - clusterId, - cluster, - }; - - // Run request - const [operation] = await adminClient.createCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateCluster(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.create_instance.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.create_instance.js deleted file mode 100644 index 9fe799ee2..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.create_instance.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2023 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, clusters) { - // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_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 unique name of the project in which to create the new instance. - * Values are of the form `projects/{project}`. - */ - // const parent = 'abc123' - /** - * Required. The ID to be used when referring to the new instance within its project, - * e.g., just `myinstance` rather than - * `projects/myproject/instances/myinstance`. - */ - // const instanceId = 'abc123' - /** - * Required. The instance to create. - * Fields marked `OutputOnly` must be left blank. - */ - // const instance = {} - /** - * Required. The clusters to be created within the instance, mapped by desired - * cluster ID, e.g., just `mycluster` rather than - * `projects/myproject/instances/myinstance/clusters/mycluster`. - * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. - */ - // const clusters = [1,2,3,4] - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callCreateInstance() { - // Construct request - const request = { - parent, - instanceId, - instance, - clusters, - }; - - // Run request - const [operation] = await adminClient.createInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateInstance(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.delete_app_profile.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.delete_app_profile.js deleted file mode 100644 index adf73908b..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.delete_app_profile.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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, ignoreWarnings) { - // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_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 unique name of the app profile to be deleted. Values are of the form - * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. - */ - // const name = 'abc123' - /** - * Required. If true, ignore safety checks when deleting the app profile. - */ - // const ignoreWarnings = true - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callDeleteAppProfile() { - // Construct request - const request = { - name, - ignoreWarnings, - }; - - // Run request - const response = await adminClient.deleteAppProfile(request); - console.log(response); - } - - callDeleteAppProfile(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.delete_cluster.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.delete_cluster.js deleted file mode 100644 index 6c983554c..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.delete_cluster.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_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 unique name of the cluster to be deleted. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - */ - // const name = 'abc123' - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callDeleteCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteCluster(request); - console.log(response); - } - - callDeleteCluster(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.delete_instance.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.delete_instance.js deleted file mode 100644 index 5ee9640d3..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.delete_instance.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableInstanceAdmin_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. The unique name of the instance to be deleted. - * Values are of the form `projects/{project}/instances/{instance}`. - */ - // const name = 'abc123' - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callDeleteInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteInstance(request); - console.log(response); - } - - callDeleteInstance(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.get_app_profile.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.get_app_profile.js deleted file mode 100644 index 5af0dc6f6..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.get_app_profile.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_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 unique name of the requested app profile. Values are of the form - * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. - */ - // const name = 'abc123' - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callGetAppProfile() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getAppProfile(request); - console.log(response); - } - - callGetAppProfile(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.get_cluster.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.get_cluster.js deleted file mode 100644 index 19c52b15b..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.get_cluster.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_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 unique name of the requested cluster. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - */ - // const name = 'abc123' - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callGetCluster() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getCluster(request); - console.log(response); - } - - callGetCluster(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.get_iam_policy.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.get_iam_policy.js deleted file mode 100644 index d2548f398..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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(resource) { - // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_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 resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - */ - // const options = {} - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await adminClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.get_instance.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.get_instance.js deleted file mode 100644 index 98d284289..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.get_instance.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableInstanceAdmin_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 unique name of the requested instance. Values are of the form - * `projects/{project}/instances/{instance}`. - */ - // const name = 'abc123' - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callGetInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getInstance(request); - console.log(response); - } - - callGetInstance(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.list_app_profiles.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.list_app_profiles.js deleted file mode 100644 index 3f5c8b191..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.list_app_profiles.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_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 unique name of the instance for which a list of app profiles is - * requested. Values are of the form - * `projects/{project}/instances/{instance}`. - * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, - * e.g., `projects/myproject/instances/-`. - */ - // const parent = 'abc123' - /** - * Maximum number of results per page. - * A page_size of zero lets the server choose the number of items to return. - * A page_size which is strictly positive will return at most that many items. - * A negative page_size will cause an error. - * Following the first request, subsequent paginated calls are not required - * to pass a page_size. If a page_size is set in subsequent calls, it must - * match the page_size given in the first request. - */ - // const pageSize = 1234 - /** - * The value of `next_page_token` returned by a previous call. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callListAppProfiles() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listAppProfilesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAppProfiles(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.list_clusters.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.list_clusters.js deleted file mode 100644 index 6cf1f4686..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.list_clusters.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_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 unique name of the instance for which a list of clusters is requested. - * Values are of the form `projects/{project}/instances/{instance}`. - * Use `{instance} = '-'` to list Clusters for all Instances in a project, - * e.g., `projects/myproject/instances/-`. - */ - // const parent = 'abc123' - /** - * DEPRECATED: This field is unused and ignored. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callListClusters() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await adminClient.listClusters(request); - console.log(response); - } - - callListClusters(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.list_hot_tablets.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.list_hot_tablets.js deleted file mode 100644 index 3407af12d..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.list_hot_tablets.js +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_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 cluster name to list hot tablets. - * Value is in the following form: - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - */ - // const parent = 'abc123' - /** - * The start time to list hot tablets. The hot tablets in the response will - * have start times between the requested start time and end time. Start time - * defaults to Now if it is unset, and end time defaults to Now - 24 hours if - * it is unset. The start time should be less than the end time, and the - * maximum allowed time range between start time and end time is 48 hours. - * Start time and end time should have values between Now and Now - 14 days. - */ - // const startTime = {} - /** - * The end time to list hot tablets. - */ - // const endTime = {} - /** - * Maximum number of results per page. - * A page_size that is empty or zero lets the server choose the number of - * items to return. A page_size which is strictly positive will return at most - * that many items. A negative page_size will cause an error. - * Following the first request, subsequent paginated calls do not need a - * page_size field. If a page_size is set in subsequent calls, it must match - * the page_size given in the first request. - */ - // const pageSize = 1234 - /** - * The value of `next_page_token` returned by a previous call. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callListHotTablets() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listHotTabletsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListHotTablets(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.list_instances.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.list_instances.js deleted file mode 100644 index da16ace38..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.list_instances.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableInstanceAdmin_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 unique name of the project for which a list of instances is requested. - * Values are of the form `projects/{project}`. - */ - // const parent = 'abc123' - /** - * DEPRECATED: This field is unused and ignored. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callListInstances() { - // Construct request - const request = { - parent, - }; - - // Run request - const response = await adminClient.listInstances(request); - console.log(response); - } - - callListInstances(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.partial_update_cluster.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.partial_update_cluster.js deleted file mode 100644 index a903d1783..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.partial_update_cluster.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 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(cluster, updateMask) { - // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_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 Cluster which contains the partial updates to be applied, subject to - * the update_mask. - */ - // const cluster = {} - /** - * Required. The subset of Cluster fields which should be replaced. - */ - // const updateMask = {} - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callPartialUpdateCluster() { - // Construct request - const request = { - cluster, - updateMask, - }; - - // Run request - const [operation] = await adminClient.partialUpdateCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callPartialUpdateCluster(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.partial_update_instance.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.partial_update_instance.js deleted file mode 100644 index aee3c78b3..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.partial_update_instance.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(instance, updateMask) { - // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_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 which will (partially) replace the current value. - */ - // const instance = {} - /** - * Required. The subset of Instance fields which should be replaced. - * Must be explicitly set. - */ - // const updateMask = {} - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callPartialUpdateInstance() { - // Construct request - const request = { - instance, - updateMask, - }; - - // Run request - const [operation] = await adminClient.partialUpdateInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callPartialUpdateInstance(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.set_iam_policy.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.set_iam_policy.js deleted file mode 100644 index ad7877428..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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(resource, policy) { - // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_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 resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - */ - // const policy = {} - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * `paths: "bindings, etag"` - */ - // const updateMask = {} - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await adminClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.test_iam_permissions.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.test_iam_permissions.js deleted file mode 100644 index 3c89317ab..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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(resource, permissions) { - // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_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 resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). - */ - // const permissions = ['abc','def'] - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await adminClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.update_app_profile.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.update_app_profile.js deleted file mode 100644 index 849e5a898..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.update_app_profile.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2023 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(appProfile, updateMask) { - // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_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 app profile which will (partially) replace the current value. - */ - // const appProfile = {} - /** - * Required. The subset of app profile fields which should be replaced. - * If unset, all fields will be replaced. - */ - // const updateMask = {} - /** - * If true, ignore safety checks when updating the app profile. - */ - // const ignoreWarnings = true - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callUpdateAppProfile() { - // Construct request - const request = { - appProfile, - updateMask, - }; - - // Run request - const [operation] = await adminClient.updateAppProfile(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateAppProfile(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.update_cluster.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.update_cluster.js deleted file mode 100644 index 58a229e30..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.update_cluster.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2023 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(location, state, defaultStorageType, encryptionConfig) { - // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_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 unique name of the cluster. Values are of the form - * `projects/{project}/instances/{instance}/clusters/[a-z][-a-z0-9]*`. - */ - // const name = 'abc123' - /** - * Immutable. The location where this cluster's nodes and storage reside. For best - * performance, clients should be located as close as possible to this - * cluster. Currently only zones are supported, so values should be of the - * form `projects/{project}/locations/{zone}`. - */ - // const location = 'abc123' - /** - * Output only. The current state of the cluster. - */ - // const state = {} - /** - * The number of nodes allocated to this cluster. More nodes enable higher - * throughput and more consistent performance. - */ - // const serveNodes = 1234 - /** - * Configuration for this cluster. - */ - // const clusterConfig = {} - /** - * Immutable. The type of storage used by this cluster to serve its - * parent instance's tables, unless explicitly overridden. - */ - // const defaultStorageType = {} - /** - * Immutable. The encryption configuration for CMEK-protected clusters. - */ - // const encryptionConfig = {} - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callUpdateCluster() { - // Construct request - const request = { - location, - state, - defaultStorageType, - encryptionConfig, - }; - - // Run request - const [operation] = await adminClient.updateCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateCluster(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.update_instance.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.update_instance.js deleted file mode 100644 index 17c8661dd..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_instance_admin.update_instance.js +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2023 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(displayName, createTime, satisfiesPzs) { - // [START bigtableadmin_v2_generated_BigtableInstanceAdmin_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. - */ - /** - * The unique name of the instance. Values are of the form - * `projects/{project}/instances/[a-z][a-z0-9\\-]+[a-z0-9]`. - */ - // const name = 'abc123' - /** - * Required. The descriptive name for this instance as it appears in UIs. - * Can be changed at any time, but should be kept globally unique - * to avoid confusion. - */ - // const displayName = 'abc123' - /** - * (`OutputOnly`) - * The current state of the instance. - */ - // const state = {} - /** - * The type of the instance. Defaults to `PRODUCTION`. - */ - // const type = {} - /** - * Labels are a flexible and lightweight mechanism for organizing cloud - * resources into groups that reflect a customer's organizational needs and - * deployment strategies. They can be used to filter resources and aggregate - * metrics. - * * Label keys must be between 1 and 63 characters long and must conform to - * the regular expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}`. - * * Label values must be between 0 and 63 characters long and must conform to - * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. - * * No more than 64 labels can be associated with a given resource. - * * Keys and values must both be under 128 bytes. - */ - // const labels = [1,2,3,4] - /** - * Output only. A server-assigned timestamp representing when this Instance was created. - * For instances created before this field was added (August 2021), this value - * is `seconds: 0, nanos: 1`. - */ - // const createTime = {} - /** - * Output only. Reserved for future use. - */ - // const satisfiesPzs = true - - // Imports the Admin library - const {BigtableInstanceAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableInstanceAdminClient(); - - async function callUpdateInstance() { - // Construct request - const request = { - displayName, - createTime, - satisfiesPzs, - }; - - // Run request - const response = await adminClient.updateInstance(request); - console.log(response); - } - - callUpdateInstance(); - // [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.check_consistency.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.check_consistency.js deleted file mode 100644 index 41f8e2e00..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.check_consistency.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 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, consistencyToken) { - // [START bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_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 unique name of the Table for which to check replication - * consistency. Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - */ - // const name = 'abc123' - /** - * Required. The token created using GenerateConsistencyToken for the Table. - */ - // const consistencyToken = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callCheckConsistency() { - // Construct request - const request = { - name, - consistencyToken, - }; - - // Run request - const response = await adminClient.checkConsistency(request); - console.log(response); - } - - callCheckConsistency(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.copy_backup.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.copy_backup.js deleted file mode 100644 index 8ce27f6a4..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.copy_backup.js +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2023 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, backupId, sourceBackup, expireTime) { - // [START bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_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 name of the destination cluster that will contain the backup - * copy. The cluster must already exists. Values are of the form: - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - */ - // const parent = 'abc123' - /** - * Required. The id of the new backup. The `backup_id` along with `parent` - * are combined as {parent}/backups/{backup_id} to create the full backup - * name, of the form: - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. - * This string must be between 1 and 50 characters in length and match the - * regex _a-zA-Z0-9 -_.a-zA-Z0-9 *. - */ - // const backupId = 'abc123' - /** - * Required. The source backup to be copied from. - * The source backup needs to be in READY state for it to be copied. - * Copying a copied backup is not allowed. - * Once CopyBackup is in progress, the source backup cannot be deleted or - * cleaned up on expiration until CopyBackup is finished. - * Values are of the form: - * `projects//instances//clusters//backups/`. - */ - // const sourceBackup = 'abc123' - /** - * Required. Required. The expiration time of the copied backup with - * microsecond granularity that must be at least 6 hours and at most 30 days - * from the time the request is received. Once the `expire_time` has - * passed, Cloud Bigtable will delete the backup and free the resources used - * by the backup. - */ - // const expireTime = {} - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callCopyBackup() { - // Construct request - const request = { - parent, - backupId, - sourceBackup, - expireTime, - }; - - // Run request - const [operation] = await adminClient.copyBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCopyBackup(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.create_backup.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.create_backup.js deleted file mode 100644 index 85add49ae..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.create_backup.js +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2023 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, backupId, backup) { - // [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_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. This must be one of the clusters in the instance in which this - * table is located. The backup will be stored in this cluster. Values are - * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. - */ - // const parent = 'abc123' - /** - * Required. The id of the backup to be created. The `backup_id` along with - * the parent `parent` are combined as {parent}/backups/{backup_id} to create - * the full backup name, of the form: - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. - * This string must be between 1 and 50 characters in length and match the - * regex _a-zA-Z0-9 -_.a-zA-Z0-9 *. - */ - // const backupId = 'abc123' - /** - * Required. The backup to create. - */ - // const backup = {} - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callCreateBackup() { - // Construct request - const request = { - parent, - backupId, - backup, - }; - - // Run request - const [operation] = await adminClient.createBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateBackup(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.create_table.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.create_table.js deleted file mode 100644 index d9a807bd8..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.create_table.js +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2023 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, tableId, table) { - // [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_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 unique name of the instance in which to create the table. - * Values are of the form `projects/{project}/instances/{instance}`. - */ - // const parent = 'abc123' - /** - * Required. The name by which the new table should be referred to within the - * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. - * Maximum 50 characters. - */ - // const tableId = 'abc123' - /** - * Required. The Table to create. - */ - // const table = {} - /** - * The optional list of row keys that will be used to initially split the - * table into several tablets (tablets are similar to HBase regions). - * Given two split keys, `s1` and `s2`, three tablets will be created, - * spanning the key ranges: `[, s1), [s1, s2), [s2, )`. - * Example: - * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` - * `"other", "zz"` - * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` - * * Key assignment: - * - Tablet 1 `[, apple) => {"a"}.` - * - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` - * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` - * - Tablet 4 `[customer_2, other) => {"customer_2"}.` - * - Tablet 5 `[other, ) => {"other", "zz"}.` - */ - // const initialSplits = [1,2,3,4] - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callCreateTable() { - // Construct request - const request = { - parent, - tableId, - table, - }; - - // Run request - const response = await adminClient.createTable(request); - console.log(response); - } - - callCreateTable(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.create_table_from_snapshot.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.create_table_from_snapshot.js deleted file mode 100644 index acfdecbc7..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.create_table_from_snapshot.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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, tableId, sourceSnapshot) { - // [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_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 unique name of the instance in which to create the table. - * Values are of the form `projects/{project}/instances/{instance}`. - */ - // const parent = 'abc123' - /** - * Required. The name by which the new table should be referred to within the - * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. - */ - // const tableId = 'abc123' - /** - * Required. The unique name of the snapshot from which to restore the table. - * The snapshot and the table must be in the same instance. Values are of the - * form - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - */ - // const sourceSnapshot = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callCreateTableFromSnapshot() { - // Construct request - const request = { - parent, - tableId, - sourceSnapshot, - }; - - // Run request - const [operation] = await adminClient.createTableFromSnapshot(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateTableFromSnapshot(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.delete_backup.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.delete_backup.js deleted file mode 100644 index 1e04d1943..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.delete_backup.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_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 backup to delete. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. - */ - // const name = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callDeleteBackup() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteBackup(request); - console.log(response); - } - - callDeleteBackup(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.delete_snapshot.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.delete_snapshot.js deleted file mode 100644 index 0c798e390..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.delete_snapshot.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_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 unique name of the snapshot to be deleted. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - */ - // const name = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callDeleteSnapshot() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteSnapshot(request); - console.log(response); - } - - callDeleteSnapshot(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.delete_table.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.delete_table.js deleted file mode 100644 index 44093e3e1..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.delete_table.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_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 unique name of the table to be deleted. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - */ - // const name = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callDeleteTable() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.deleteTable(request); - console.log(response); - } - - callDeleteTable(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.drop_row_range.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.drop_row_range.js deleted file mode 100644 index 6641e3a2a..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.drop_row_range.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_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 unique name of the table on which to drop a range of rows. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - */ - // const name = 'abc123' - /** - * Delete all rows that start with this row key prefix. Prefix cannot be - * zero length. - */ - // const rowKeyPrefix = Buffer.from('string') - /** - * Delete all rows in the table. Setting this to false is a no-op. - */ - // const deleteAllDataFromTable = true - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callDropRowRange() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.dropRowRange(request); - console.log(response); - } - - callDropRowRange(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.generate_consistency_token.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.generate_consistency_token.js deleted file mode 100644 index c30512da1..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.generate_consistency_token.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_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 unique name of the Table for which to create a consistency - * token. Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - */ - // const name = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callGenerateConsistencyToken() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.generateConsistencyToken(request); - console.log(response); - } - - callGenerateConsistencyToken(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.get_backup.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.get_backup.js deleted file mode 100644 index df0a4927e..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.get_backup.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_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 backup. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. - */ - // const name = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callGetBackup() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getBackup(request); - console.log(response); - } - - callGetBackup(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.get_iam_policy.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.get_iam_policy.js deleted file mode 100644 index 7d51e04a9..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.get_iam_policy.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2023 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(resource) { - // [START bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_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 resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - */ - // const options = {} - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callGetIamPolicy() { - // Construct request - const request = { - resource, - }; - - // Run request - const response = await adminClient.getIamPolicy(request); - console.log(response); - } - - callGetIamPolicy(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.get_snapshot.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.get_snapshot.js deleted file mode 100644 index 4d8177d32..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.get_snapshot.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_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 unique name of the requested snapshot. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - */ - // const name = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callGetSnapshot() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getSnapshot(request); - console.log(response); - } - - callGetSnapshot(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.get_table.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.get_table.js deleted file mode 100644 index b28576cd0..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.get_table.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_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 unique name of the requested table. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - */ - // const name = 'abc123' - /** - * The view to be applied to the returned table's fields. - * Defaults to `SCHEMA_VIEW` if unspecified. - */ - // const view = {} - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callGetTable() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await adminClient.getTable(request); - console.log(response); - } - - callGetTable(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.list_backups.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.list_backups.js deleted file mode 100644 index 786d9b5bb..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.list_backups.js +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_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 cluster to list backups from. Values are of the - * form `projects/{project}/instances/{instance}/clusters/{cluster}`. - * Use `{cluster} = '-'` to list backups for all clusters in an instance, - * e.g., `projects/{project}/instances/{instance}/clusters/-`. - */ - // const parent = 'abc123' - /** - * A filter expression that filters backups listed in the response. - * The expression must specify the field name, a comparison operator, - * and the value that you want to use for filtering. The value must be a - * string, a number, or a boolean. The comparison operator must be - * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is - * roughly synonymous with equality. Filter rules are case insensitive. - * The fields eligible for filtering are: - * * `name` - * * `source_table` - * * `state` - * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `size_bytes` - * To filter on multiple expressions, provide each separate expression within - * parentheses. By default, each expression is an AND expression. However, - * you can include AND, OR, and NOT expressions explicitly. - * Some examples of using filters are: - * * `name:"exact"` --> The backup's name is the string "exact". - * * `name:howl` --> The backup's name contains the string "howl". - * * `source_table:prod` - * --> The source_table's name contains the string "prod". - * * `state:CREATING` --> The backup is pending creation. - * * `state:READY` --> The backup is fully created and ready for use. - * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` - * --> The backup name contains the string "howl" and start_time - * of the backup is before 2018-03-28T14:50:00Z. - * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB - */ - // const filter = 'abc123' - /** - * An expression for specifying the sort order of the results of the request. - * The string value should specify one or more fields in - * Backup google.bigtable.admin.v2.Backup. The full syntax is described at - * https://aip.dev/132#ordering. - * Fields supported are: - * * name - * * source_table - * * expire_time - * * start_time - * * end_time - * * size_bytes - * * state - * For example, "start_time". The default sorting order is ascending. - * To specify descending order for the field, a suffix " desc" should - * be appended to the field name. For example, "start_time desc". - * Redundant space characters in the syntax are insigificant. - * If order_by is empty, results will be sorted by `start_time` in descending - * order starting from the most recently created backup. - */ - // const orderBy = 'abc123' - /** - * Number of backups to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - */ - // const pageSize = 1234 - /** - * If non-empty, `page_token` should contain a - * next_page_token google.bigtable.admin.v2.ListBackupsResponse.next_page_token - * from a previous - * ListBackupsResponse google.bigtable.admin.v2.ListBackupsResponse to the - * same `parent` and with the same `filter`. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callListBackups() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listBackupsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListBackups(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.list_snapshots.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.list_snapshots.js deleted file mode 100644 index 31ce95da1..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.list_snapshots.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_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 unique name of the cluster for which snapshots should be - * listed. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, - * e.g., `projects/{project}/instances/{instance}/clusters/-`. - */ - // const parent = 'abc123' - /** - * The maximum number of snapshots to return per page. - * CURRENTLY UNIMPLEMENTED AND IGNORED. - */ - // const pageSize = 1234 - /** - * The value of `next_page_token` returned by a previous call. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callListSnapshots() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listSnapshotsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSnapshots(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.list_tables.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.list_tables.js deleted file mode 100644 index 523dfee00..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.list_tables.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_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 unique name of the instance for which tables should be - * listed. Values are of the form `projects/{project}/instances/{instance}`. - */ - // const parent = 'abc123' - /** - * The view to be applied to the returned tables' fields. - * NAME_ONLY view (default) and REPLICATION_VIEW are supported. - */ - // const view = {} - /** - * Maximum number of results per page. - * A page_size of zero lets the server choose the number of items to return. - * A page_size which is strictly positive will return at most that many items. - * A negative page_size will cause an error. - * Following the first request, subsequent paginated calls are not required - * to pass a page_size. If a page_size is set in subsequent calls, it must - * match the page_size given in the first request. - */ - // const pageSize = 1234 - /** - * The value of `next_page_token` returned by a previous call. - */ - // const pageToken = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callListTables() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await adminClient.listTablesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListTables(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.modify_column_families.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.modify_column_families.js deleted file mode 100644 index da4c7de2b..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.modify_column_families.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2023 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, modifications) { - // [START bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_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 unique name of the table whose families should be modified. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - */ - // const name = 'abc123' - /** - * Required. Modifications to be atomically applied to the specified table's - * families. Entries are applied in order, meaning that earlier modifications - * can be masked by later ones (in the case of repeated updates to the same - * family, for example). - */ - // const modifications = [1,2,3,4] - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callModifyColumnFamilies() { - // Construct request - const request = { - name, - modifications, - }; - - // Run request - const response = await adminClient.modifyColumnFamilies(request); - console.log(response); - } - - callModifyColumnFamilies(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.restore_table.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.restore_table.js deleted file mode 100644 index 3a28e1904..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.restore_table.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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, tableId) { - // [START bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_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 name of the instance in which to create the restored - * table. Values are of the form `projects//instances/`. - */ - // const parent = 'abc123' - /** - * Required. The id of the table to create and restore to. This - * table must not already exist. The `table_id` appended to - * `parent` forms the full table name of the form - * `projects//instances//tables/`. - */ - // const tableId = 'abc123' - /** - * Name of the backup from which to restore. Values are of the form - * `projects//instances//clusters//backups/`. - */ - // const backup = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callRestoreTable() { - // Construct request - const request = { - parent, - tableId, - }; - - // Run request - const [operation] = await adminClient.restoreTable(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestoreTable(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.set_iam_policy.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.set_iam_policy.js deleted file mode 100644 index c803905e1..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.set_iam_policy.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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(resource, policy) { - // [START bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_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 resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - */ - // const policy = {} - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * `paths: "bindings, etag"` - */ - // const updateMask = {} - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callSetIamPolicy() { - // Construct request - const request = { - resource, - policy, - }; - - // Run request - const response = await adminClient.setIamPolicy(request); - console.log(response); - } - - callSetIamPolicy(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.snapshot_table.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.snapshot_table.js deleted file mode 100644 index c4836fede..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.snapshot_table.js +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2023 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, cluster, snapshotId) { - // [START bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_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 unique name of the table to have the snapshot taken. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - */ - // const name = 'abc123' - /** - * Required. The name of the cluster where the snapshot will be created in. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - */ - // const cluster = 'abc123' - /** - * Required. The ID by which the new snapshot should be referred to within the - * parent cluster, e.g., `mysnapshot` of the form: - * `[_a-zA-Z0-9][-_.a-zA-Z0-9]*` rather than - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. - */ - // const snapshotId = 'abc123' - /** - * The amount of time that the new snapshot can stay active after it is - * created. Once 'ttl' expires, the snapshot will get deleted. The maximum - * amount of time a snapshot can stay active is 7 days. If 'ttl' is not - * specified, the default value of 24 hours will be used. - */ - // const ttl = {} - /** - * Description of the snapshot. - */ - // const description = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callSnapshotTable() { - // Construct request - const request = { - name, - cluster, - snapshotId, - }; - - // Run request - const [operation] = await adminClient.snapshotTable(request); - const [response] = await operation.promise(); - console.log(response); - } - - callSnapshotTable(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.test_iam_permissions.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.test_iam_permissions.js deleted file mode 100644 index 79593bada..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.test_iam_permissions.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2023 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(resource, permissions) { - // [START bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_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 resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - */ - // const resource = 'abc123' - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). - */ - // const permissions = ['abc','def'] - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callTestIamPermissions() { - // Construct request - const request = { - resource, - permissions, - }; - - // Run request - const response = await adminClient.testIamPermissions(request); - console.log(response); - } - - callTestIamPermissions(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.undelete_table.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.undelete_table.js deleted file mode 100644 index 5e6af4f05..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.undelete_table.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2023 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 bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_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 unique name of the table to be restored. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - */ - // const name = 'abc123' - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callUndeleteTable() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await adminClient.undeleteTable(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUndeleteTable(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.update_backup.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.update_backup.js deleted file mode 100644 index 323547683..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.update_backup.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2023 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(backup, updateMask) { - // [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_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 backup to update. `backup.name`, and the fields to be updated - * as specified by `update_mask` are required. Other fields are ignored. - * Update is only supported for the following fields: - * * `backup.expire_time`. - */ - // const backup = {} - /** - * Required. A mask specifying which fields (e.g. `expire_time`) in the - * Backup resource should be updated. This mask is relative to the Backup - * resource, not to the request message. The field mask must always be - * specified; this prevents any future fields from being erased accidentally - * by clients that do not know about them. - */ - // const updateMask = {} - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callUpdateBackup() { - // Construct request - const request = { - backup, - updateMask, - }; - - // Run request - const response = await adminClient.updateBackup(request); - console.log(response); - } - - callUpdateBackup(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.update_table.js b/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.update_table.js deleted file mode 100644 index add98fbc3..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/bigtable_table_admin.update_table.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2023 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(table, updateMask) { - // [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_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 table to update. - * The table's `name` field is used to identify the table to update. - */ - // const table = {} - /** - * Required. The list of fields to update. - * A mask specifying which fields (e.g. `change_stream_config`) in the `table` - * field should be updated. This mask is relative to the `table` field, not to - * the request message. The wildcard (*) path is currently not supported. - * Currently UpdateTable is only supported for the following fields: - * * `change_stream_config` - * * `change_stream_config.retention_period` - * * `deletion_protection` - * If `column_families` is set in `update_mask`, it will return an - * UNIMPLEMENTED error. - */ - // const updateMask = {} - - // Imports the Admin library - const {BigtableTableAdminClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const adminClient = new BigtableTableAdminClient(); - - async function callUpdateTable() { - // Construct request - const request = { - table, - updateMask, - }; - - // Run request - const [operation] = await adminClient.updateTable(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateTable(); - // [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/admin/v2/samples/generated/v2/snippet_metadata_google.bigtable.admin.v2.json b/owl-bot-staging/admin/v2/samples/generated/v2/snippet_metadata_google.bigtable.admin.v2.json deleted file mode 100644 index 66059449a..000000000 --- a/owl-bot-staging/admin/v2/samples/generated/v2/snippet_metadata_google.bigtable.admin.v2.json +++ /dev/null @@ -1,2147 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-admin", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.bigtable.admin.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_async", - "title": "bigtable createInstance Sample", - "origin": "API_DEFINITION", - "description": " Create an instance within a project. Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.", - "canonical": true, - "file": "bigtable_instance_admin.create_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInstance", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.bigtable.admin.v2.Instance" - }, - { - "name": "clusters", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "CreateInstance", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateInstance", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_async", - "title": "bigtable getInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets information about an instance.", - "canonical": true, - "file": "bigtable_instance_admin.get_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInstance", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.Instance", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "GetInstance", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetInstance", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_async", - "title": "bigtable listInstances Sample", - "origin": "API_DEFINITION", - "description": " Lists information about instances in a project.", - "canonical": true, - "file": "bigtable_instance_admin.list_instances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInstances", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListInstances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.ListInstancesResponse", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "ListInstances", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListInstances", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_async", - "title": "bigtable updateInstance Sample", - "origin": "API_DEFINITION", - "description": " Updates an instance within a project. This method updates only the display name and type for an Instance. To update other Instance properties, such as labels, use PartialUpdateInstance.", - "canonical": true, - "file": "bigtable_instance_admin.update_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 94, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateInstance", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "display_name", - "type": "TYPE_STRING" - }, - { - "name": "state", - "type": ".google.bigtable.admin.v2.Instance.State" - }, - { - "name": "type", - "type": ".google.bigtable.admin.v2.Instance.Type" - }, - { - "name": "labels", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "create_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "satisfies_pzs", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.bigtable.admin.v2.Instance", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "UpdateInstance", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateInstance", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_async", - "title": "bigtable partialUpdateInstance Sample", - "origin": "API_DEFINITION", - "description": " Partially updates an instance within a project. This method can modify all fields of an Instance and is the preferred way to update an Instance.", - "canonical": true, - "file": "bigtable_instance_admin.partial_update_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PartialUpdateInstance", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateInstance", - "async": true, - "parameters": [ - { - "name": "instance", - "type": ".google.bigtable.admin.v2.Instance" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "PartialUpdateInstance", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateInstance", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_async", - "title": "bigtable deleteInstance Sample", - "origin": "API_DEFINITION", - "description": " Delete an instance from a project.", - "canonical": true, - "file": "bigtable_instance_admin.delete_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInstance", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "DeleteInstance", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteInstance", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_async", - "title": "bigtable createCluster Sample", - "origin": "API_DEFINITION", - "description": " Creates a cluster within an instance. Note that exactly one of Cluster.serve_nodes and Cluster.cluster_config.cluster_autoscaling_config can be set. If serve_nodes is set to non-zero, then the cluster is manually scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled.", - "canonical": true, - "file": "bigtable_instance_admin.create_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCluster", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateCluster", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "cluster_id", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.bigtable.admin.v2.Cluster" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "CreateCluster", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateCluster", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_async", - "title": "bigtable getCluster Sample", - "origin": "API_DEFINITION", - "description": " Gets information about a cluster.", - "canonical": true, - "file": "bigtable_instance_admin.get_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCluster", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.Cluster", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "GetCluster", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetCluster", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_async", - "title": "bigtable listClusters Sample", - "origin": "API_DEFINITION", - "description": " Lists information about clusters in an instance.", - "canonical": true, - "file": "bigtable_instance_admin.list_clusters.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListClusters", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListClusters", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.ListClustersResponse", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "ListClusters", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListClusters", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async", - "title": "bigtable updateCluster Sample", - "origin": "API_DEFINITION", - "description": " Updates a cluster within an instance. Note that UpdateCluster does not support updating cluster_config.cluster_autoscaling_config. In order to update it, you must use PartialUpdateCluster.", - "canonical": true, - "file": "bigtable_instance_admin.update_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCluster", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "location", - "type": "TYPE_STRING" - }, - { - "name": "state", - "type": ".google.bigtable.admin.v2.Cluster.State" - }, - { - "name": "serve_nodes", - "type": "TYPE_INT32" - }, - { - "name": "cluster_config", - "type": ".google.bigtable.admin.v2.Cluster.ClusterConfig" - }, - { - "name": "default_storage_type", - "type": ".google.bigtable.admin.v2.StorageType" - }, - { - "name": "encryption_config", - "type": ".google.bigtable.admin.v2.Cluster.EncryptionConfig" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "UpdateCluster", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateCluster", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_async", - "title": "bigtable partialUpdateCluster Sample", - "origin": "API_DEFINITION", - "description": " Partially updates a cluster within a project. This method is the preferred way to update a Cluster. To enable and update autoscaling, set cluster_config.cluster_autoscaling_config. When autoscaling is enabled, serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it are ignored. Note that an update cannot simultaneously set serve_nodes to non-zero and cluster_config.cluster_autoscaling_config to non-empty, and also specify both in the update_mask. To disable autoscaling, clear cluster_config.cluster_autoscaling_config, and explicitly set a serve_node count via the update_mask.", - "canonical": true, - "file": "bigtable_instance_admin.partial_update_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PartialUpdateCluster", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateCluster", - "async": true, - "parameters": [ - { - "name": "cluster", - "type": ".google.bigtable.admin.v2.Cluster" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "PartialUpdateCluster", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateCluster", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_async", - "title": "bigtable deleteCluster Sample", - "origin": "API_DEFINITION", - "description": " Deletes a cluster from an instance.", - "canonical": true, - "file": "bigtable_instance_admin.delete_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteCluster", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteCluster", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "DeleteCluster", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteCluster", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_async", - "title": "bigtable createAppProfile Sample", - "origin": "API_DEFINITION", - "description": " Creates an app profile within an instance.", - "canonical": true, - "file": "bigtable_instance_admin.create_app_profile.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAppProfile", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateAppProfile", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "app_profile_id", - "type": "TYPE_STRING" - }, - { - "name": "app_profile", - "type": ".google.bigtable.admin.v2.AppProfile" - }, - { - "name": "ignore_warnings", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.bigtable.admin.v2.AppProfile", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "CreateAppProfile", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateAppProfile", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_async", - "title": "bigtable getAppProfile Sample", - "origin": "API_DEFINITION", - "description": " Gets information about an app profile.", - "canonical": true, - "file": "bigtable_instance_admin.get_app_profile.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAppProfile", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetAppProfile", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.AppProfile", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "GetAppProfile", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetAppProfile", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_async", - "title": "bigtable listAppProfiles Sample", - "origin": "API_DEFINITION", - "description": " Lists information about app profiles in an instance.", - "canonical": true, - "file": "bigtable_instance_admin.list_app_profiles.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAppProfiles", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListAppProfiles", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.ListAppProfilesResponse", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "ListAppProfiles", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListAppProfiles", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_async", - "title": "bigtable updateAppProfile Sample", - "origin": "API_DEFINITION", - "description": " Updates an app profile within an instance.", - "canonical": true, - "file": "bigtable_instance_admin.update_app_profile.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAppProfile", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateAppProfile", - "async": true, - "parameters": [ - { - "name": "app_profile", - "type": ".google.bigtable.admin.v2.AppProfile" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "ignore_warnings", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "UpdateAppProfile", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateAppProfile", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_async", - "title": "bigtable deleteAppProfile Sample", - "origin": "API_DEFINITION", - "description": " Deletes an app profile from an instance.", - "canonical": true, - "file": "bigtable_instance_admin.delete_app_profile.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteAppProfile", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteAppProfile", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "ignore_warnings", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "DeleteAppProfile", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteAppProfile", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_async", - "title": "bigtable getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the access control policy for an instance resource. Returns an empty policy if an instance exists but does not have a policy set.", - "canonical": true, - "file": "bigtable_instance_admin.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetIamPolicy", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_async", - "title": "bigtable setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the access control policy on an instance resource. Replaces any existing policy.", - "canonical": true, - "file": "bigtable_instance_admin.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.SetIamPolicy", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_async", - "title": "bigtable testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns permissions that the caller has on the specified instance resource.", - "canonical": true, - "file": "bigtable_instance_admin.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.TestIamPermissions", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_async", - "title": "bigtable listHotTablets Sample", - "origin": "API_DEFINITION", - "description": " Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based on CPU usage.", - "canonical": true, - "file": "bigtable_instance_admin.list_hot_tablets.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListHotTablets", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListHotTablets", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "start_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "end_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.ListHotTabletsResponse", - "client": { - "shortName": "BigtableInstanceAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdminClient" - }, - "method": { - "shortName": "ListHotTablets", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListHotTablets", - "service": { - "shortName": "BigtableInstanceAdmin", - "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_async", - "title": "bigtable createTable Sample", - "origin": "API_DEFINITION", - "description": " Creates a new table in the specified instance. The table can be created with a full set of initial column families, specified in the request.", - "canonical": true, - "file": "bigtable_table_admin.create_table.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateTable", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "table_id", - "type": "TYPE_STRING" - }, - { - "name": "table", - "type": ".google.bigtable.admin.v2.Table" - }, - { - "name": "initial_splits", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.bigtable.admin.v2.Table", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "CreateTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateTable", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_async", - "title": "bigtable createTableFromSnapshot Sample", - "origin": "API_DEFINITION", - "description": " Creates a new table from the specified snapshot. The target table must not exist. The snapshot and the table must be in the same instance. Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.", - "canonical": true, - "file": "bigtable_table_admin.create_table_from_snapshot.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateTableFromSnapshot", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "table_id", - "type": "TYPE_STRING" - }, - { - "name": "source_snapshot", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "CreateTableFromSnapshot", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_async", - "title": "bigtable listTables Sample", - "origin": "API_DEFINITION", - "description": " Lists all tables served from a specified instance.", - "canonical": true, - "file": "bigtable_table_admin.list_tables.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListTables", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListTables", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.bigtable.admin.v2.Table.View" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.ListTablesResponse", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "ListTables", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListTables", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_async", - "title": "bigtable getTable Sample", - "origin": "API_DEFINITION", - "description": " Gets metadata information about the specified table.", - "canonical": true, - "file": "bigtable_table_admin.get_table.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetTable", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.bigtable.admin.v2.Table.View" - } - ], - "resultType": ".google.bigtable.admin.v2.Table", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "GetTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetTable", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_async", - "title": "bigtable updateTable Sample", - "origin": "API_DEFINITION", - "description": " Updates a specified table.", - "canonical": true, - "file": "bigtable_table_admin.update_table.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable", - "async": true, - "parameters": [ - { - "name": "table", - "type": ".google.bigtable.admin.v2.Table" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "UpdateTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_async", - "title": "bigtable deleteTable Sample", - "origin": "API_DEFINITION", - "description": " Permanently deletes a specified table and all of its data.", - "canonical": true, - "file": "bigtable_table_admin.delete_table.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "DeleteTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_async", - "title": "bigtable undeleteTable Sample", - "origin": "API_DEFINITION", - "description": " Restores a specified table which was accidentally deleted.", - "canonical": true, - "file": "bigtable_table_admin.undelete_table.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UndeleteTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "UndeleteTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_async", - "title": "bigtable modifyColumnFamilies Sample", - "origin": "API_DEFINITION", - "description": " Performs a series of column family modifications on the specified table. Either all or none of the modifications will occur before this method returns, but data requests received prior to that point may see a table where only some modifications have taken effect.", - "canonical": true, - "file": "bigtable_table_admin.modify_column_families.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ModifyColumnFamilies", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "modifications", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.bigtable.admin.v2.Table", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "ModifyColumnFamilies", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_async", - "title": "bigtable dropRowRange Sample", - "origin": "API_DEFINITION", - "description": " Permanently drop/delete a row range from a specified table. The request can specify whether to delete all rows in a table, or only those that match a particular prefix.", - "canonical": true, - "file": "bigtable_table_admin.drop_row_range.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DropRowRange", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "row_key_prefix", - "type": "TYPE_BYTES" - }, - { - "name": "delete_all_data_from_table", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "DropRowRange", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_async", - "title": "bigtable generateConsistencyToken Sample", - "origin": "API_DEFINITION", - "description": " Generates a consistency token for a Table, which can be used in CheckConsistency to check whether mutations to the table that finished before this call started have been replicated. The tokens will be available for 90 days.", - "canonical": true, - "file": "bigtable_table_admin.generate_consistency_token.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GenerateConsistencyToken", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.GenerateConsistencyTokenResponse", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "GenerateConsistencyToken", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async", - "title": "bigtable checkConsistency Sample", - "origin": "API_DEFINITION", - "description": " Checks replication consistency based on a consistency token, that is, if replication has caught up based on the conditions specified in the token and the check request.", - "canonical": true, - "file": "bigtable_table_admin.check_consistency.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CheckConsistency", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "consistency_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.CheckConsistencyResponse", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "CheckConsistency", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_async", - "title": "bigtable snapshotTable Sample", - "origin": "API_DEFINITION", - "description": " Creates a new snapshot in the specified cluster from the specified source table. The cluster and the table must be in the same instance. Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.", - "canonical": true, - "file": "bigtable_table_admin.snapshot_table.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SnapshotTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": "TYPE_STRING" - }, - { - "name": "snapshot_id", - "type": "TYPE_STRING" - }, - { - "name": "ttl", - "type": ".google.protobuf.Duration" - }, - { - "name": "description", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "SnapshotTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_async", - "title": "bigtable getSnapshot Sample", - "origin": "API_DEFINITION", - "description": " Gets metadata information about the specified snapshot. Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.", - "canonical": true, - "file": "bigtable_table_admin.get_snapshot.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSnapshot", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.Snapshot", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "GetSnapshot", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_async", - "title": "bigtable listSnapshots Sample", - "origin": "API_DEFINITION", - "description": " Lists all snapshots associated with the specified cluster. Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.", - "canonical": true, - "file": "bigtable_table_admin.list_snapshots.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSnapshots", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.ListSnapshotsResponse", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "ListSnapshots", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_async", - "title": "bigtable deleteSnapshot Sample", - "origin": "API_DEFINITION", - "description": " Permanently deletes the specified snapshot. Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy.", - "canonical": true, - "file": "bigtable_table_admin.delete_snapshot.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteSnapshot", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "DeleteSnapshot", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_async", - "title": "bigtable createBackup Sample", - "origin": "API_DEFINITION", - "description": " Starts creating a new Cloud Bigtable Backup. The returned backup [long-running operation][google.longrunning.Operation] can be used to track creation of the backup. The [metadata][google.longrunning.Operation.metadata] field type is [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata]. The [response][google.longrunning.Operation.response] field type is [Backup][google.bigtable.admin.v2.Backup], if successful. Cancelling the returned operation will stop the creation and delete the backup.", - "canonical": true, - "file": "bigtable_table_admin.create_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateBackup", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "backup_id", - "type": "TYPE_STRING" - }, - { - "name": "backup", - "type": ".google.bigtable.admin.v2.Backup" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "CreateBackup", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_async", - "title": "bigtable getBackup Sample", - "origin": "API_DEFINITION", - "description": " Gets metadata on a pending or completed Cloud Bigtable Backup.", - "canonical": true, - "file": "bigtable_table_admin.get_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBackup", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.Backup", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "GetBackup", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetBackup", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_async", - "title": "bigtable updateBackup Sample", - "origin": "API_DEFINITION", - "description": " Updates a pending or completed Cloud Bigtable Backup.", - "canonical": true, - "file": "bigtable_table_admin.update_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBackup", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup", - "async": true, - "parameters": [ - { - "name": "backup", - "type": ".google.bigtable.admin.v2.Backup" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.bigtable.admin.v2.Backup", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "UpdateBackup", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_async", - "title": "bigtable deleteBackup Sample", - "origin": "API_DEFINITION", - "description": " Deletes a pending or completed Cloud Bigtable backup.", - "canonical": true, - "file": "bigtable_table_admin.delete_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteBackup", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "DeleteBackup", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_async", - "title": "bigtable listBackups Sample", - "origin": "API_DEFINITION", - "description": " Lists Cloud Bigtable backups. Returns both completed and pending backups.", - "canonical": true, - "file": "bigtable_table_admin.list_backups.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 123, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBackups", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListBackups", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.admin.v2.ListBackupsResponse", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "ListBackups", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListBackups", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async", - "title": "bigtable restoreTable Sample", - "origin": "API_DEFINITION", - "description": " Create a new table by restoring from a completed backup. The returned table [long-running operation][google.longrunning.Operation] can be used to track the progress of the operation, and to cancel it. The [metadata][google.longrunning.Operation.metadata] field type is [RestoreTableMetadata][google.bigtable.admin.RestoreTableMetadata]. The [response][google.longrunning.Operation.response] type is [Table][google.bigtable.admin.v2.Table], if successful.", - "canonical": true, - "file": "bigtable_table_admin.restore_table.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestoreTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "table_id", - "type": "TYPE_STRING" - }, - { - "name": "backup", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "RestoreTable", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_async", - "title": "bigtable copyBackup Sample", - "origin": "API_DEFINITION", - "description": " Copy a Cloud Bigtable backup to a new backup in the destination cluster located in the destination instance and project.", - "canonical": true, - "file": "bigtable_table_admin.copy_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 86, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CopyBackup", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "backup_id", - "type": "TYPE_STRING" - }, - { - "name": "source_backup", - "type": "TYPE_STRING" - }, - { - "name": "expire_time", - "type": ".google.protobuf.Timestamp" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "CopyBackup", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_async", - "title": "bigtable getIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Gets the access control policy for a Table or Backup resource. Returns an empty policy if the resource exists but does not have a policy set.", - "canonical": true, - "file": "bigtable_table_admin.get_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetIamPolicy", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "options", - "type": ".google.iam.v1.GetPolicyOptions" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "GetIamPolicy", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetIamPolicy", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_async", - "title": "bigtable setIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Sets the access control policy on a Table or Backup resource. Replaces any existing policy.", - "canonical": true, - "file": "bigtable_table_admin.set_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SetIamPolicy", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.SetIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.iam.v1.Policy" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.iam.v1.Policy", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "SetIamPolicy", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.SetIamPolicy", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - }, - { - "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_async", - "title": "bigtable testIamPermissions Sample", - "origin": "API_DEFINITION", - "description": " Returns permissions that the caller has on the specified Table or Backup resource.", - "canonical": true, - "file": "bigtable_table_admin.test_iam_permissions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TestIamPermissions", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.TestIamPermissions", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - }, - { - "name": "permissions", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.iam.v1.TestIamPermissionsResponse", - "client": { - "shortName": "BigtableTableAdminClient", - "fullName": "google.bigtable.admin.v2.BigtableTableAdminClient" - }, - "method": { - "shortName": "TestIamPermissions", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.TestIamPermissions", - "service": { - "shortName": "BigtableTableAdmin", - "fullName": "google.bigtable.admin.v2.BigtableTableAdmin" - } - } - } - } - ] -} diff --git a/owl-bot-staging/admin/v2/src/index.ts b/owl-bot-staging/admin/v2/src/index.ts deleted file mode 100644 index 059150f62..000000000 --- a/owl-bot-staging/admin/v2/src/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 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 v2 from './v2'; -const BigtableInstanceAdminClient = v2.BigtableInstanceAdminClient; -type BigtableInstanceAdminClient = v2.BigtableInstanceAdminClient; -const BigtableTableAdminClient = v2.BigtableTableAdminClient; -type BigtableTableAdminClient = v2.BigtableTableAdminClient; -export {v2, BigtableInstanceAdminClient, BigtableTableAdminClient}; -export default {v2, BigtableInstanceAdminClient, BigtableTableAdminClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/admin/v2/src/v2/bigtable_instance_admin_client.ts b/owl-bot-staging/admin/v2/src/v2/bigtable_instance_admin_client.ts deleted file mode 100644 index 90c5b06d7..000000000 --- a/owl-bot-staging/admin/v2/src/v2/bigtable_instance_admin_client.ts +++ /dev/null @@ -1,2858 +0,0 @@ -// Copyright 2023 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} 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/v2/bigtable_instance_admin_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './bigtable_instance_admin_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service for creating, configuring, and deleting Cloud Bigtable Instances and - * Clusters. Provides access to the Instance and Cluster schemas only, not the - * tables' metadata or data stored in those tables. - * @class - * @memberof v2 - */ -export class BigtableInstanceAdminClient { - 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}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - bigtableInstanceAdminStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BigtableInstanceAdminClient. - * - * @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 BigtableInstanceAdminClient({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 BigtableInstanceAdminClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && '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 = { - appProfilePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/appProfiles/{app_profile}' - ), - backupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}' - ), - clusterPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/clusters/{cluster}' - ), - hotTabletPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - snapshotPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}' - ), - tablePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/tables/{table}' - ), - }; - - // 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 = { - listAppProfiles: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'appProfiles'), - listHotTablets: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'hotTablets') - }; - - 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.longrunning.Operations.CancelOperation',post: '/v2/{name=operations/**}:cancel',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=operations/**}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=operations/**}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=operations/projects/**}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createInstanceResponse = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.Instance') as gax.protobuf.Type; - const createInstanceMetadata = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.CreateInstanceMetadata') as gax.protobuf.Type; - const partialUpdateInstanceResponse = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.Instance') as gax.protobuf.Type; - const partialUpdateInstanceMetadata = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.UpdateInstanceMetadata') as gax.protobuf.Type; - const createClusterResponse = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.Cluster') as gax.protobuf.Type; - const createClusterMetadata = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.CreateClusterMetadata') as gax.protobuf.Type; - const updateClusterResponse = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.Cluster') as gax.protobuf.Type; - const updateClusterMetadata = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.UpdateClusterMetadata') as gax.protobuf.Type; - const partialUpdateClusterResponse = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.Cluster') as gax.protobuf.Type; - const partialUpdateClusterMetadata = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.PartialUpdateClusterMetadata') as gax.protobuf.Type; - const updateAppProfileResponse = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.AppProfile') as gax.protobuf.Type; - const updateAppProfileMetadata = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.UpdateAppProfileMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createInstanceResponse.decode.bind(createInstanceResponse), - createInstanceMetadata.decode.bind(createInstanceMetadata)), - partialUpdateInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - partialUpdateInstanceResponse.decode.bind(partialUpdateInstanceResponse), - partialUpdateInstanceMetadata.decode.bind(partialUpdateInstanceMetadata)), - createCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createClusterResponse.decode.bind(createClusterResponse), - createClusterMetadata.decode.bind(createClusterMetadata)), - updateCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateClusterResponse.decode.bind(updateClusterResponse), - updateClusterMetadata.decode.bind(updateClusterMetadata)), - partialUpdateCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - partialUpdateClusterResponse.decode.bind(partialUpdateClusterResponse), - partialUpdateClusterMetadata.decode.bind(partialUpdateClusterMetadata)), - updateAppProfile: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateAppProfileResponse.decode.bind(updateAppProfileResponse), - updateAppProfileMetadata.decode.bind(updateAppProfileMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.bigtable.admin.v2.BigtableInstanceAdmin', 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.bigtableInstanceAdminStub) { - return this.bigtableInstanceAdminStub; - } - - // Put together the "service stub" for - // google.bigtable.admin.v2.BigtableInstanceAdmin. - this.bigtableInstanceAdminStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.bigtable.admin.v2.BigtableInstanceAdmin') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.bigtable.admin.v2.BigtableInstanceAdmin, - 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 bigtableInstanceAdminStubMethods = - ['createInstance', 'getInstance', 'listInstances', 'updateInstance', 'partialUpdateInstance', 'deleteInstance', 'createCluster', 'getCluster', 'listClusters', 'updateCluster', 'partialUpdateCluster', 'deleteCluster', 'createAppProfile', 'getAppProfile', 'listAppProfiles', 'updateAppProfile', 'deleteAppProfile', 'getIamPolicy', 'setIamPolicy', 'testIamPermissions', 'listHotTablets']; - for (const methodName of bigtableInstanceAdminStubMethods) { - const callPromise = this.bigtableInstanceAdminStub.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.bigtableInstanceAdminStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'bigtableadmin.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'bigtableadmin.googleapis.com'; - } - - /** - * 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/bigtable.admin', - 'https://www.googleapis.com/auth/bigtable.admin.cluster', - 'https://www.googleapis.com/auth/bigtable.admin.instance', - 'https://www.googleapis.com/auth/cloud-bigtable.admin', - 'https://www.googleapis.com/auth/cloud-bigtable.admin.cluster', - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only' - ]; - } - - 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 information about an instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the requested instance. Values are of the form - * `projects/{project}/instances/{instance}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.bigtable.admin.v2.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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_async - */ - getInstance( - request?: protos.google.bigtable.admin.v2.IGetInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.IInstance, - protos.google.bigtable.admin.v2.IGetInstanceRequest|undefined, {}|undefined - ]>; - getInstance( - request: protos.google.bigtable.admin.v2.IGetInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.IInstance, - protos.google.bigtable.admin.v2.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request: protos.google.bigtable.admin.v2.IGetInstanceRequest, - callback: Callback< - protos.google.bigtable.admin.v2.IInstance, - protos.google.bigtable.admin.v2.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request?: protos.google.bigtable.admin.v2.IGetInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.IInstance, - protos.google.bigtable.admin.v2.IGetInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.IInstance, - protos.google.bigtable.admin.v2.IGetInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.IInstance, - protos.google.bigtable.admin.v2.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); - } -/** - * Lists information about instances in a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The unique name of the project for which a list of instances is requested. - * Values are of the form `projects/{project}`. - * @param {string} request.pageToken - * DEPRECATED: This field is unused and ignored. - * @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.bigtable.admin.v2.ListInstancesResponse|ListInstancesResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_async - */ - listInstances( - request?: protos.google.bigtable.admin.v2.IListInstancesRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.IListInstancesResponse, - protos.google.bigtable.admin.v2.IListInstancesRequest|undefined, {}|undefined - ]>; - listInstances( - request: protos.google.bigtable.admin.v2.IListInstancesRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.IListInstancesResponse, - protos.google.bigtable.admin.v2.IListInstancesRequest|null|undefined, - {}|null|undefined>): void; - listInstances( - request: protos.google.bigtable.admin.v2.IListInstancesRequest, - callback: Callback< - protos.google.bigtable.admin.v2.IListInstancesResponse, - protos.google.bigtable.admin.v2.IListInstancesRequest|null|undefined, - {}|null|undefined>): void; - listInstances( - request?: protos.google.bigtable.admin.v2.IListInstancesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.IListInstancesResponse, - protos.google.bigtable.admin.v2.IListInstancesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.IListInstancesResponse, - protos.google.bigtable.admin.v2.IListInstancesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.IListInstancesResponse, - protos.google.bigtable.admin.v2.IListInstancesRequest|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.listInstances(request, options, callback); - } -/** - * Updates an instance within a project. This method updates only the display - * name and type for an Instance. To update other Instance properties, such as - * labels, use PartialUpdateInstance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The unique name of the instance. Values are of the form - * `projects/{project}/instances/{@link protos.a-z0-9\\-|a-z}+[a-z0-9]`. - * @param {string} request.displayName - * Required. The descriptive name for this instance as it appears in UIs. - * Can be changed at any time, but should be kept globally unique - * to avoid confusion. - * @param {google.bigtable.admin.v2.Instance.State} request.state - * (`OutputOnly`) - * The current state of the instance. - * @param {google.bigtable.admin.v2.Instance.Type} request.type - * The type of the instance. Defaults to `PRODUCTION`. - * @param {number[]} request.labels - * Labels are a flexible and lightweight mechanism for organizing cloud - * resources into groups that reflect a customer's organizational needs and - * deployment strategies. They can be used to filter resources and aggregate - * metrics. - * - * * Label keys must be between 1 and 63 characters long and must conform to - * the regular expression: `{@link protos.\p{Ll}\p{Lo}\p{N}_-|\p{Ll}\p{Lo}}{0,62}`. - * * Label values must be between 0 and 63 characters long and must conform to - * the regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}`. - * * No more than 64 labels can be associated with a given resource. - * * Keys and values must both be under 128 bytes. - * @param {google.protobuf.Timestamp} request.createTime - * Output only. A server-assigned timestamp representing when this Instance was created. - * For instances created before this field was added (August 2021), this value - * is `seconds: 0, nanos: 1`. - * @param {boolean} request.satisfiesPzs - * Output only. Reserved for future use. - * @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.bigtable.admin.v2.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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_async - */ - updateInstance( - request?: protos.google.bigtable.admin.v2.IInstance, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.IInstance, - protos.google.bigtable.admin.v2.IInstance|undefined, {}|undefined - ]>; - updateInstance( - request: protos.google.bigtable.admin.v2.IInstance, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.IInstance, - protos.google.bigtable.admin.v2.IInstance|null|undefined, - {}|null|undefined>): void; - updateInstance( - request: protos.google.bigtable.admin.v2.IInstance, - callback: Callback< - protos.google.bigtable.admin.v2.IInstance, - protos.google.bigtable.admin.v2.IInstance|null|undefined, - {}|null|undefined>): void; - updateInstance( - request?: protos.google.bigtable.admin.v2.IInstance, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.IInstance, - protos.google.bigtable.admin.v2.IInstance|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.IInstance, - protos.google.bigtable.admin.v2.IInstance|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.IInstance, - protos.google.bigtable.admin.v2.IInstance|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.updateInstance(request, options, callback); - } -/** - * Delete an instance from a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the instance to be deleted. - * Values are of the form `projects/{project}/instances/{instance}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_async - */ - deleteInstance( - request?: protos.google.bigtable.admin.v2.IDeleteInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteInstanceRequest|undefined, {}|undefined - ]>; - deleteInstance( - request: protos.google.bigtable.admin.v2.IDeleteInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteInstanceRequest|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request: protos.google.bigtable.admin.v2.IDeleteInstanceRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteInstanceRequest|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request?: protos.google.bigtable.admin.v2.IDeleteInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteInstanceRequest|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); - } -/** - * Gets information about a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the requested cluster. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @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.bigtable.admin.v2.Cluster|Cluster}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_async - */ - getCluster( - request?: protos.google.bigtable.admin.v2.IGetClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.ICluster, - protos.google.bigtable.admin.v2.IGetClusterRequest|undefined, {}|undefined - ]>; - getCluster( - request: protos.google.bigtable.admin.v2.IGetClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.ICluster, - protos.google.bigtable.admin.v2.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request: protos.google.bigtable.admin.v2.IGetClusterRequest, - callback: Callback< - protos.google.bigtable.admin.v2.ICluster, - protos.google.bigtable.admin.v2.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request?: protos.google.bigtable.admin.v2.IGetClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.ICluster, - protos.google.bigtable.admin.v2.IGetClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.ICluster, - protos.google.bigtable.admin.v2.IGetClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.ICluster, - protos.google.bigtable.admin.v2.IGetClusterRequest|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.getCluster(request, options, callback); - } -/** - * Lists information about clusters in an instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The unique name of the instance for which a list of clusters is requested. - * Values are of the form `projects/{project}/instances/{instance}`. - * Use `{instance} = '-'` to list Clusters for all Instances in a project, - * e.g., `projects/myproject/instances/-`. - * @param {string} request.pageToken - * DEPRECATED: This field is unused and ignored. - * @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.bigtable.admin.v2.ListClustersResponse|ListClustersResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_async - */ - listClusters( - request?: protos.google.bigtable.admin.v2.IListClustersRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.IListClustersResponse, - protos.google.bigtable.admin.v2.IListClustersRequest|undefined, {}|undefined - ]>; - listClusters( - request: protos.google.bigtable.admin.v2.IListClustersRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.IListClustersResponse, - protos.google.bigtable.admin.v2.IListClustersRequest|null|undefined, - {}|null|undefined>): void; - listClusters( - request: protos.google.bigtable.admin.v2.IListClustersRequest, - callback: Callback< - protos.google.bigtable.admin.v2.IListClustersResponse, - protos.google.bigtable.admin.v2.IListClustersRequest|null|undefined, - {}|null|undefined>): void; - listClusters( - request?: protos.google.bigtable.admin.v2.IListClustersRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.IListClustersResponse, - protos.google.bigtable.admin.v2.IListClustersRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.IListClustersResponse, - protos.google.bigtable.admin.v2.IListClustersRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.IListClustersResponse, - protos.google.bigtable.admin.v2.IListClustersRequest|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.listClusters(request, options, callback); - } -/** - * Deletes a cluster from an instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the cluster to be deleted. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @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.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_async - */ - deleteCluster( - request?: protos.google.bigtable.admin.v2.IDeleteClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteClusterRequest|undefined, {}|undefined - ]>; - deleteCluster( - request: protos.google.bigtable.admin.v2.IDeleteClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request: protos.google.bigtable.admin.v2.IDeleteClusterRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request?: protos.google.bigtable.admin.v2.IDeleteClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteClusterRequest|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.deleteCluster(request, options, callback); - } -/** - * Creates an app profile within an instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The unique name of the instance in which to create the new app profile. - * Values are of the form - * `projects/{project}/instances/{instance}`. - * @param {string} request.appProfileId - * Required. The ID to be used when referring to the new app profile within its - * instance, e.g., just `myprofile` rather than - * `projects/myproject/instances/myinstance/appProfiles/myprofile`. - * @param {google.bigtable.admin.v2.AppProfile} request.appProfile - * Required. The app profile to be created. - * Fields marked `OutputOnly` will be ignored. - * @param {boolean} request.ignoreWarnings - * If true, ignore safety checks when creating the app profile. - * @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.bigtable.admin.v2.AppProfile|AppProfile}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_async - */ - createAppProfile( - request?: protos.google.bigtable.admin.v2.ICreateAppProfileRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.IAppProfile, - protos.google.bigtable.admin.v2.ICreateAppProfileRequest|undefined, {}|undefined - ]>; - createAppProfile( - request: protos.google.bigtable.admin.v2.ICreateAppProfileRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.IAppProfile, - protos.google.bigtable.admin.v2.ICreateAppProfileRequest|null|undefined, - {}|null|undefined>): void; - createAppProfile( - request: protos.google.bigtable.admin.v2.ICreateAppProfileRequest, - callback: Callback< - protos.google.bigtable.admin.v2.IAppProfile, - protos.google.bigtable.admin.v2.ICreateAppProfileRequest|null|undefined, - {}|null|undefined>): void; - createAppProfile( - request?: protos.google.bigtable.admin.v2.ICreateAppProfileRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.IAppProfile, - protos.google.bigtable.admin.v2.ICreateAppProfileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.IAppProfile, - protos.google.bigtable.admin.v2.ICreateAppProfileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.IAppProfile, - protos.google.bigtable.admin.v2.ICreateAppProfileRequest|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.createAppProfile(request, options, callback); - } -/** - * Gets information about an app profile. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the requested app profile. Values are of the form - * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. - * @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.bigtable.admin.v2.AppProfile|AppProfile}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_async - */ - getAppProfile( - request?: protos.google.bigtable.admin.v2.IGetAppProfileRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.IAppProfile, - protos.google.bigtable.admin.v2.IGetAppProfileRequest|undefined, {}|undefined - ]>; - getAppProfile( - request: protos.google.bigtable.admin.v2.IGetAppProfileRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.IAppProfile, - protos.google.bigtable.admin.v2.IGetAppProfileRequest|null|undefined, - {}|null|undefined>): void; - getAppProfile( - request: protos.google.bigtable.admin.v2.IGetAppProfileRequest, - callback: Callback< - protos.google.bigtable.admin.v2.IAppProfile, - protos.google.bigtable.admin.v2.IGetAppProfileRequest|null|undefined, - {}|null|undefined>): void; - getAppProfile( - request?: protos.google.bigtable.admin.v2.IGetAppProfileRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.IAppProfile, - protos.google.bigtable.admin.v2.IGetAppProfileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.IAppProfile, - protos.google.bigtable.admin.v2.IGetAppProfileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.IAppProfile, - protos.google.bigtable.admin.v2.IGetAppProfileRequest|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.getAppProfile(request, options, callback); - } -/** - * Deletes an app profile from an instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the app profile to be deleted. Values are of the form - * `projects/{project}/instances/{instance}/appProfiles/{app_profile}`. - * @param {boolean} request.ignoreWarnings - * Required. If true, ignore safety checks when deleting the app profile. - * @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.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_async - */ - deleteAppProfile( - request?: protos.google.bigtable.admin.v2.IDeleteAppProfileRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteAppProfileRequest|undefined, {}|undefined - ]>; - deleteAppProfile( - request: protos.google.bigtable.admin.v2.IDeleteAppProfileRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteAppProfileRequest|null|undefined, - {}|null|undefined>): void; - deleteAppProfile( - request: protos.google.bigtable.admin.v2.IDeleteAppProfileRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteAppProfileRequest|null|undefined, - {}|null|undefined>): void; - deleteAppProfile( - request?: protos.google.bigtable.admin.v2.IDeleteAppProfileRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteAppProfileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteAppProfileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteAppProfileRequest|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.deleteAppProfile(request, options, callback); - } -/** - * Gets the access control policy for an instance resource. Returns an empty - * policy if an instance exists but does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @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.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_async - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|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({ - 'resource': request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.getIamPolicy(request, options, callback); - } -/** - * Sets the access control policy on an instance resource. Replaces any - * existing policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {google.protobuf.FieldMask} request.updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @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.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_async - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|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({ - 'resource': request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.setIamPolicy(request, options, callback); - } -/** - * Returns permissions that the caller has on the specified instance resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @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.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_async - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|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({ - 'resource': request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.testIamPermissions(request, options, callback); - } - -/** - * Create an instance within a project. - * - * Note that exactly one of Cluster.serve_nodes and - * Cluster.cluster_config.cluster_autoscaling_config can be set. If - * serve_nodes is set to non-zero, then the cluster is manually scaled. If - * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is - * enabled. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The unique name of the project in which to create the new instance. - * Values are of the form `projects/{project}`. - * @param {string} request.instanceId - * Required. The ID to be used when referring to the new instance within its project, - * e.g., just `myinstance` rather than - * `projects/myproject/instances/myinstance`. - * @param {google.bigtable.admin.v2.Instance} request.instance - * Required. The instance to create. - * Fields marked `OutputOnly` must be left blank. - * @param {number[]} request.clusters - * Required. The clusters to be created within the instance, mapped by desired - * cluster ID, e.g., just `mycluster` rather than - * `projects/myproject/instances/myinstance/clusters/mycluster`. - * Fields marked `OutputOnly` must be left blank. - * Currently, at most four clusters can be specified. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_async - */ - createInstance( - request?: protos.google.bigtable.admin.v2.ICreateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createInstance( - request: protos.google.bigtable.admin.v2.ICreateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request: protos.google.bigtable.admin.v2.ICreateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request?: protos.google.bigtable.admin.v2.ICreateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_async - */ - async checkCreateInstanceProgress(name: string): Promise>{ - 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; - } -/** - * Partially updates an instance within a project. This method can modify all - * fields of an Instance and is the preferred way to update an Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.bigtable.admin.v2.Instance} request.instance - * Required. The Instance which will (partially) replace the current value. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The subset of Instance fields which should be replaced. - * Must be explicitly set. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_async - */ - partialUpdateInstance( - request?: protos.google.bigtable.admin.v2.IPartialUpdateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - partialUpdateInstance( - request: protos.google.bigtable.admin.v2.IPartialUpdateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - partialUpdateInstance( - request: protos.google.bigtable.admin.v2.IPartialUpdateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - partialUpdateInstance( - request?: protos.google.bigtable.admin.v2.IPartialUpdateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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.partialUpdateInstance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `partialUpdateInstance()`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_async - */ - async checkPartialUpdateInstanceProgress(name: string): Promise>{ - 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.partialUpdateInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a cluster within an instance. - * - * Note that exactly one of Cluster.serve_nodes and - * Cluster.cluster_config.cluster_autoscaling_config can be set. If - * serve_nodes is set to non-zero, then the cluster is manually scaled. If - * cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is - * enabled. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The unique name of the instance in which to create the new cluster. - * Values are of the form - * `projects/{project}/instances/{instance}`. - * @param {string} request.clusterId - * Required. The ID to be used when referring to the new cluster within its instance, - * e.g., just `mycluster` rather than - * `projects/myproject/instances/myinstance/clusters/mycluster`. - * @param {google.bigtable.admin.v2.Cluster} request.cluster - * Required. The cluster to be created. - * Fields marked `OutputOnly` must be left blank. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_async - */ - createCluster( - request?: protos.google.bigtable.admin.v2.ICreateClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createCluster( - request: protos.google.bigtable.admin.v2.ICreateClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createCluster( - request: protos.google.bigtable.admin.v2.ICreateClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createCluster( - request?: protos.google.bigtable.admin.v2.ICreateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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.createCluster(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createCluster()`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_async - */ - async checkCreateClusterProgress(name: string): Promise>{ - 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.createCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a cluster within an instance. - * - * Note that UpdateCluster does not support updating - * cluster_config.cluster_autoscaling_config. In order to update it, you - * must use PartialUpdateCluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The unique name of the cluster. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{@link protos.-a-z0-9|a-z}*`. - * @param {string} request.location - * Immutable. The location where this cluster's nodes and storage reside. For best - * performance, clients should be located as close as possible to this - * cluster. Currently only zones are supported, so values should be of the - * form `projects/{project}/locations/{zone}`. - * @param {google.bigtable.admin.v2.Cluster.State} request.state - * Output only. The current state of the cluster. - * @param {number} request.serveNodes - * The number of nodes allocated to this cluster. More nodes enable higher - * throughput and more consistent performance. - * @param {google.bigtable.admin.v2.Cluster.ClusterConfig} request.clusterConfig - * Configuration for this cluster. - * @param {google.bigtable.admin.v2.StorageType} request.defaultStorageType - * Immutable. The type of storage used by this cluster to serve its - * parent instance's tables, unless explicitly overridden. - * @param {google.bigtable.admin.v2.Cluster.EncryptionConfig} request.encryptionConfig - * Immutable. The encryption configuration for CMEK-protected clusters. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async - */ - updateCluster( - request?: protos.google.bigtable.admin.v2.ICluster, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateCluster( - request: protos.google.bigtable.admin.v2.ICluster, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateCluster( - request: protos.google.bigtable.admin.v2.ICluster, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateCluster( - request?: protos.google.bigtable.admin.v2.ICluster, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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.updateCluster(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateCluster()`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async - */ - async checkUpdateClusterProgress(name: string): Promise>{ - 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.updateCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Partially updates a cluster within a project. This method is the preferred - * way to update a Cluster. - * - * To enable and update autoscaling, set - * cluster_config.cluster_autoscaling_config. When autoscaling is enabled, - * serve_nodes is treated as an OUTPUT_ONLY field, meaning that updates to it - * are ignored. Note that an update cannot simultaneously set serve_nodes to - * non-zero and cluster_config.cluster_autoscaling_config to non-empty, and - * also specify both in the update_mask. - * - * To disable autoscaling, clear cluster_config.cluster_autoscaling_config, - * and explicitly set a serve_node count via the update_mask. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.bigtable.admin.v2.Cluster} request.cluster - * Required. The Cluster which contains the partial updates to be applied, subject to - * the update_mask. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The subset of Cluster fields which should be replaced. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_async - */ - partialUpdateCluster( - request?: protos.google.bigtable.admin.v2.IPartialUpdateClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - partialUpdateCluster( - request: protos.google.bigtable.admin.v2.IPartialUpdateClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - partialUpdateCluster( - request: protos.google.bigtable.admin.v2.IPartialUpdateClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - partialUpdateCluster( - request?: protos.google.bigtable.admin.v2.IPartialUpdateClusterRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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({ - 'cluster.name': request.cluster!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.partialUpdateCluster(request, options, callback); - } -/** - * Check the status of the long running operation returned by `partialUpdateCluster()`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_async - */ - async checkPartialUpdateClusterProgress(name: string): Promise>{ - 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.partialUpdateCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates an app profile within an instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.bigtable.admin.v2.AppProfile} request.appProfile - * Required. The app profile which will (partially) replace the current value. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The subset of app profile fields which should be replaced. - * If unset, all fields will be replaced. - * @param {boolean} request.ignoreWarnings - * If true, ignore safety checks when updating the app profile. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_async - */ - updateAppProfile( - request?: protos.google.bigtable.admin.v2.IUpdateAppProfileRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateAppProfile( - request: protos.google.bigtable.admin.v2.IUpdateAppProfileRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateAppProfile( - request: protos.google.bigtable.admin.v2.IUpdateAppProfileRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateAppProfile( - request?: protos.google.bigtable.admin.v2.IUpdateAppProfileRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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({ - 'app_profile.name': request.appProfile!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateAppProfile(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateAppProfile()`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_async - */ - async checkUpdateAppProfileProgress(name: string): Promise>{ - 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.updateAppProfile, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists information about app profiles in an instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The unique name of the instance for which a list of app profiles is - * requested. Values are of the form - * `projects/{project}/instances/{instance}`. - * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, - * e.g., `projects/myproject/instances/-`. - * @param {number} request.pageSize - * Maximum number of results per page. - * - * A page_size of zero lets the server choose the number of items to return. - * A page_size which is strictly positive will return at most that many items. - * A negative page_size will cause an error. - * - * Following the first request, subsequent paginated calls are not required - * to pass a page_size. If a page_size is set in subsequent calls, it must - * match the page_size given in the first request. - * @param {string} request.pageToken - * The value of `next_page_token` returned by a previous call. - * @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.bigtable.admin.v2.AppProfile|AppProfile}. - * 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 `listAppProfilesAsync()` - * 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. - */ - listAppProfiles( - request?: protos.google.bigtable.admin.v2.IListAppProfilesRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.IAppProfile[], - protos.google.bigtable.admin.v2.IListAppProfilesRequest|null, - protos.google.bigtable.admin.v2.IListAppProfilesResponse - ]>; - listAppProfiles( - request: protos.google.bigtable.admin.v2.IListAppProfilesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.bigtable.admin.v2.IListAppProfilesRequest, - protos.google.bigtable.admin.v2.IListAppProfilesResponse|null|undefined, - protos.google.bigtable.admin.v2.IAppProfile>): void; - listAppProfiles( - request: protos.google.bigtable.admin.v2.IListAppProfilesRequest, - callback: PaginationCallback< - protos.google.bigtable.admin.v2.IListAppProfilesRequest, - protos.google.bigtable.admin.v2.IListAppProfilesResponse|null|undefined, - protos.google.bigtable.admin.v2.IAppProfile>): void; - listAppProfiles( - request?: protos.google.bigtable.admin.v2.IListAppProfilesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.bigtable.admin.v2.IListAppProfilesRequest, - protos.google.bigtable.admin.v2.IListAppProfilesResponse|null|undefined, - protos.google.bigtable.admin.v2.IAppProfile>, - callback?: PaginationCallback< - protos.google.bigtable.admin.v2.IListAppProfilesRequest, - protos.google.bigtable.admin.v2.IListAppProfilesResponse|null|undefined, - protos.google.bigtable.admin.v2.IAppProfile>): - Promise<[ - protos.google.bigtable.admin.v2.IAppProfile[], - protos.google.bigtable.admin.v2.IListAppProfilesRequest|null, - protos.google.bigtable.admin.v2.IListAppProfilesResponse - ]>|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.listAppProfiles(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 unique name of the instance for which a list of app profiles is - * requested. Values are of the form - * `projects/{project}/instances/{instance}`. - * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, - * e.g., `projects/myproject/instances/-`. - * @param {number} request.pageSize - * Maximum number of results per page. - * - * A page_size of zero lets the server choose the number of items to return. - * A page_size which is strictly positive will return at most that many items. - * A negative page_size will cause an error. - * - * Following the first request, subsequent paginated calls are not required - * to pass a page_size. If a page_size is set in subsequent calls, it must - * match the page_size given in the first request. - * @param {string} request.pageToken - * The value of `next_page_token` returned by a previous call. - * @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.bigtable.admin.v2.AppProfile|AppProfile} 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 `listAppProfilesAsync()` - * 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. - */ - listAppProfilesStream( - request?: protos.google.bigtable.admin.v2.IListAppProfilesRequest, - 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['listAppProfiles']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAppProfiles.createStream( - this.innerApiCalls.listAppProfiles as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAppProfiles`, 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 unique name of the instance for which a list of app profiles is - * requested. Values are of the form - * `projects/{project}/instances/{instance}`. - * Use `{instance} = '-'` to list AppProfiles for all Instances in a project, - * e.g., `projects/myproject/instances/-`. - * @param {number} request.pageSize - * Maximum number of results per page. - * - * A page_size of zero lets the server choose the number of items to return. - * A page_size which is strictly positive will return at most that many items. - * A negative page_size will cause an error. - * - * Following the first request, subsequent paginated calls are not required - * to pass a page_size. If a page_size is set in subsequent calls, it must - * match the page_size given in the first request. - * @param {string} request.pageToken - * The value of `next_page_token` returned by a previous call. - * @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.bigtable.admin.v2.AppProfile|AppProfile}. 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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_async - */ - listAppProfilesAsync( - request?: protos.google.bigtable.admin.v2.IListAppProfilesRequest, - 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['listAppProfiles']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAppProfiles.asyncIterate( - this.innerApiCalls['listAppProfiles'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists hot tablets in a cluster, within the time range provided. Hot - * tablets are ordered based on CPU usage. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The cluster name to list hot tablets. - * Value is in the following form: - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @param {google.protobuf.Timestamp} request.startTime - * The start time to list hot tablets. The hot tablets in the response will - * have start times between the requested start time and end time. Start time - * defaults to Now if it is unset, and end time defaults to Now - 24 hours if - * it is unset. The start time should be less than the end time, and the - * maximum allowed time range between start time and end time is 48 hours. - * Start time and end time should have values between Now and Now - 14 days. - * @param {google.protobuf.Timestamp} request.endTime - * The end time to list hot tablets. - * @param {number} request.pageSize - * Maximum number of results per page. - * - * A page_size that is empty or zero lets the server choose the number of - * items to return. A page_size which is strictly positive will return at most - * that many items. A negative page_size will cause an error. - * - * Following the first request, subsequent paginated calls do not need a - * page_size field. If a page_size is set in subsequent calls, it must match - * the page_size given in the first request. - * @param {string} request.pageToken - * The value of `next_page_token` returned by a previous call. - * @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.bigtable.admin.v2.HotTablet|HotTablet}. - * 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 `listHotTabletsAsync()` - * 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. - */ - listHotTablets( - request?: protos.google.bigtable.admin.v2.IListHotTabletsRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.IHotTablet[], - protos.google.bigtable.admin.v2.IListHotTabletsRequest|null, - protos.google.bigtable.admin.v2.IListHotTabletsResponse - ]>; - listHotTablets( - request: protos.google.bigtable.admin.v2.IListHotTabletsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.bigtable.admin.v2.IListHotTabletsRequest, - protos.google.bigtable.admin.v2.IListHotTabletsResponse|null|undefined, - protos.google.bigtable.admin.v2.IHotTablet>): void; - listHotTablets( - request: protos.google.bigtable.admin.v2.IListHotTabletsRequest, - callback: PaginationCallback< - protos.google.bigtable.admin.v2.IListHotTabletsRequest, - protos.google.bigtable.admin.v2.IListHotTabletsResponse|null|undefined, - protos.google.bigtable.admin.v2.IHotTablet>): void; - listHotTablets( - request?: protos.google.bigtable.admin.v2.IListHotTabletsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.bigtable.admin.v2.IListHotTabletsRequest, - protos.google.bigtable.admin.v2.IListHotTabletsResponse|null|undefined, - protos.google.bigtable.admin.v2.IHotTablet>, - callback?: PaginationCallback< - protos.google.bigtable.admin.v2.IListHotTabletsRequest, - protos.google.bigtable.admin.v2.IListHotTabletsResponse|null|undefined, - protos.google.bigtable.admin.v2.IHotTablet>): - Promise<[ - protos.google.bigtable.admin.v2.IHotTablet[], - protos.google.bigtable.admin.v2.IListHotTabletsRequest|null, - protos.google.bigtable.admin.v2.IListHotTabletsResponse - ]>|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.listHotTablets(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 cluster name to list hot tablets. - * Value is in the following form: - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @param {google.protobuf.Timestamp} request.startTime - * The start time to list hot tablets. The hot tablets in the response will - * have start times between the requested start time and end time. Start time - * defaults to Now if it is unset, and end time defaults to Now - 24 hours if - * it is unset. The start time should be less than the end time, and the - * maximum allowed time range between start time and end time is 48 hours. - * Start time and end time should have values between Now and Now - 14 days. - * @param {google.protobuf.Timestamp} request.endTime - * The end time to list hot tablets. - * @param {number} request.pageSize - * Maximum number of results per page. - * - * A page_size that is empty or zero lets the server choose the number of - * items to return. A page_size which is strictly positive will return at most - * that many items. A negative page_size will cause an error. - * - * Following the first request, subsequent paginated calls do not need a - * page_size field. If a page_size is set in subsequent calls, it must match - * the page_size given in the first request. - * @param {string} request.pageToken - * The value of `next_page_token` returned by a previous call. - * @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.bigtable.admin.v2.HotTablet|HotTablet} 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 `listHotTabletsAsync()` - * 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. - */ - listHotTabletsStream( - request?: protos.google.bigtable.admin.v2.IListHotTabletsRequest, - 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['listHotTablets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listHotTablets.createStream( - this.innerApiCalls.listHotTablets as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listHotTablets`, 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 cluster name to list hot tablets. - * Value is in the following form: - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @param {google.protobuf.Timestamp} request.startTime - * The start time to list hot tablets. The hot tablets in the response will - * have start times between the requested start time and end time. Start time - * defaults to Now if it is unset, and end time defaults to Now - 24 hours if - * it is unset. The start time should be less than the end time, and the - * maximum allowed time range between start time and end time is 48 hours. - * Start time and end time should have values between Now and Now - 14 days. - * @param {google.protobuf.Timestamp} request.endTime - * The end time to list hot tablets. - * @param {number} request.pageSize - * Maximum number of results per page. - * - * A page_size that is empty or zero lets the server choose the number of - * items to return. A page_size which is strictly positive will return at most - * that many items. A negative page_size will cause an error. - * - * Following the first request, subsequent paginated calls do not need a - * page_size field. If a page_size is set in subsequent calls, it must match - * the page_size given in the first request. - * @param {string} request.pageToken - * The value of `next_page_token` returned by a previous call. - * @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.bigtable.admin.v2.HotTablet|HotTablet}. 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 - * region_tag:bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_async - */ - listHotTabletsAsync( - request?: protos.google.bigtable.admin.v2.IListHotTabletsRequest, - 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['listHotTablets']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listHotTablets.asyncIterate( - this.innerApiCalls['listHotTablets'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified appProfile resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} app_profile - * @returns {string} Resource name string. - */ - appProfilePath(project:string,instance:string,appProfile:string) { - return this.pathTemplates.appProfilePathTemplate.render({ - project: project, - instance: instance, - app_profile: appProfile, - }); - } - - /** - * Parse the project from AppProfile resource. - * - * @param {string} appProfileName - * A fully-qualified path representing AppProfile resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAppProfileName(appProfileName: string) { - return this.pathTemplates.appProfilePathTemplate.match(appProfileName).project; - } - - /** - * Parse the instance from AppProfile resource. - * - * @param {string} appProfileName - * A fully-qualified path representing AppProfile resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromAppProfileName(appProfileName: string) { - return this.pathTemplates.appProfilePathTemplate.match(appProfileName).instance; - } - - /** - * Parse the app_profile from AppProfile resource. - * - * @param {string} appProfileName - * A fully-qualified path representing AppProfile resource. - * @returns {string} A string representing the app_profile. - */ - matchAppProfileFromAppProfileName(appProfileName: string) { - return this.pathTemplates.appProfilePathTemplate.match(appProfileName).app_profile; - } - - /** - * Return a fully-qualified backup resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} cluster - * @param {string} backup - * @returns {string} Resource name string. - */ - backupPath(project:string,instance:string,cluster:string,backup:string) { - return this.pathTemplates.backupPathTemplate.render({ - project: project, - instance: instance, - cluster: cluster, - backup: backup, - }); - } - - /** - * Parse the project from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).project; - } - - /** - * Parse the instance from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).instance; - } - - /** - * Parse the cluster from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).cluster; - } - - /** - * Parse the backup from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the backup. - */ - matchBackupFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).backup; - } - - /** - * Return a fully-qualified cluster resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} cluster - * @returns {string} Resource name string. - */ - clusterPath(project:string,instance:string,cluster:string) { - return this.pathTemplates.clusterPathTemplate.render({ - project: project, - instance: instance, - cluster: cluster, - }); - } - - /** - * Parse the project from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the project. - */ - matchProjectFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).project; - } - - /** - * Parse the instance from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).instance; - } - - /** - * Parse the cluster from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; - } - - /** - * Return a fully-qualified hotTablet resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} cluster - * @param {string} hot_tablet - * @returns {string} Resource name string. - */ - hotTabletPath(project:string,instance:string,cluster:string,hotTablet:string) { - return this.pathTemplates.hotTabletPathTemplate.render({ - project: project, - instance: instance, - cluster: cluster, - hot_tablet: hotTablet, - }); - } - - /** - * Parse the project from HotTablet resource. - * - * @param {string} hotTabletName - * A fully-qualified path representing HotTablet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHotTabletName(hotTabletName: string) { - return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName).project; - } - - /** - * Parse the instance from HotTablet resource. - * - * @param {string} hotTabletName - * A fully-qualified path representing HotTablet resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromHotTabletName(hotTabletName: string) { - return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName).instance; - } - - /** - * Parse the cluster from HotTablet resource. - * - * @param {string} hotTabletName - * A fully-qualified path representing HotTablet resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromHotTabletName(hotTabletName: string) { - return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName).cluster; - } - - /** - * Parse the hot_tablet from HotTablet resource. - * - * @param {string} hotTabletName - * A fully-qualified path representing HotTablet resource. - * @returns {string} A string representing the hot_tablet. - */ - matchHotTabletFromHotTabletName(hotTabletName: string) { - return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName).hot_tablet; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - 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 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 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 snapshot resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} cluster - * @param {string} snapshot - * @returns {string} Resource name string. - */ - snapshotPath(project:string,instance:string,cluster:string,snapshot:string) { - return this.pathTemplates.snapshotPathTemplate.render({ - project: project, - instance: instance, - cluster: cluster, - snapshot: snapshot, - }); - } - - /** - * Parse the project from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; - } - - /** - * Parse the instance from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).instance; - } - - /** - * Parse the cluster from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).cluster; - } - - /** - * Parse the snapshot from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the snapshot. - */ - matchSnapshotFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; - } - - /** - * Return a fully-qualified table resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} table - * @returns {string} Resource name string. - */ - tablePath(project:string,instance:string,table:string) { - return this.pathTemplates.tablePathTemplate.render({ - project: project, - instance: instance, - table: table, - }); - } - - /** - * Parse the project from Table resource. - * - * @param {string} tableName - * A fully-qualified path representing Table resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTableName(tableName: string) { - return this.pathTemplates.tablePathTemplate.match(tableName).project; - } - - /** - * Parse the instance from Table resource. - * - * @param {string} tableName - * A fully-qualified path representing Table resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromTableName(tableName: string) { - return this.pathTemplates.tablePathTemplate.match(tableName).instance; - } - - /** - * Parse the table from Table resource. - * - * @param {string} tableName - * A fully-qualified path representing Table resource. - * @returns {string} A string representing the table. - */ - matchTableFromTableName(tableName: string) { - return this.pathTemplates.tablePathTemplate.match(tableName).table; - } - - /** - * 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.bigtableInstanceAdminStub && !this._terminated) { - return this.bigtableInstanceAdminStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/admin/v2/src/v2/bigtable_instance_admin_client_config.json b/owl-bot-staging/admin/v2/src/v2/bigtable_instance_admin_client_config.json deleted file mode 100644 index 5080d33ee..000000000 --- a/owl-bot-staging/admin/v2/src/v2/bigtable_instance_admin_client_config.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "interfaces": { - "google.bigtable.admin.v2.BigtableInstanceAdmin": { - "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 - }, - "264268458a9e88347dbacbd9398202ff5885a40b": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 2, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateInstance": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "UpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "PartialUpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetCluster": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "ListClusters": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "UpdateCluster": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "PartialUpdateCluster": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteCluster": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateAppProfile": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetAppProfile": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "ListAppProfiles": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "UpdateAppProfile": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "DeleteAppProfile": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "ListHotTablets": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - } - } - } - } -} diff --git a/owl-bot-staging/admin/v2/src/v2/bigtable_instance_admin_proto_list.json b/owl-bot-staging/admin/v2/src/v2/bigtable_instance_admin_proto_list.json deleted file mode 100644 index 1f7e1af50..000000000 --- a/owl-bot-staging/admin/v2/src/v2/bigtable_instance_admin_proto_list.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "../../protos/google/bigtable/admin/v2/bigtable_instance_admin.proto", - "../../protos/google/bigtable/admin/v2/bigtable_table_admin.proto", - "../../protos/google/bigtable/admin/v2/common.proto", - "../../protos/google/bigtable/admin/v2/instance.proto", - "../../protos/google/bigtable/admin/v2/table.proto" -] diff --git a/owl-bot-staging/admin/v2/src/v2/bigtable_table_admin_client.ts b/owl-bot-staging/admin/v2/src/v2/bigtable_table_admin_client.ts deleted file mode 100644 index 5e180e5a4..000000000 --- a/owl-bot-staging/admin/v2/src/v2/bigtable_table_admin_client.ts +++ /dev/null @@ -1,3473 +0,0 @@ -// Copyright 2023 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} 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/v2/bigtable_table_admin_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './bigtable_table_admin_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service for creating, configuring, and deleting Cloud Bigtable tables. - * - * - * Provides access to the table schemas only, not the data stored within - * the tables. - * @class - * @memberof v2 - */ -export class BigtableTableAdminClient { - 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}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - bigtableTableAdminStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BigtableTableAdminClient. - * - * @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 BigtableTableAdminClient({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 BigtableTableAdminClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && '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 = { - appProfilePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/appProfiles/{app_profile}' - ), - backupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}' - ), - clusterPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/clusters/{cluster}' - ), - hotTabletPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/clusters/{cluster}/hotTablets/{hot_tablet}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}' - ), - snapshotPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}' - ), - tablePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/tables/{table}' - ), - }; - - // 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 = { - listTables: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tables'), - listSnapshots: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'snapshots'), - listBackups: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups') - }; - - 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.longrunning.Operations.CancelOperation',post: '/v2/{name=operations/**}:cancel',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v2/{name=operations/**}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v2/{name=operations/**}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v2/{name=operations/projects/**}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createTableFromSnapshotResponse = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.Table') as gax.protobuf.Type; - const createTableFromSnapshotMetadata = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.CreateTableFromSnapshotMetadata') as gax.protobuf.Type; - const updateTableResponse = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.Table') as gax.protobuf.Type; - const updateTableMetadata = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.UpdateTableMetadata') as gax.protobuf.Type; - const undeleteTableResponse = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.Table') as gax.protobuf.Type; - const undeleteTableMetadata = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.UndeleteTableMetadata') as gax.protobuf.Type; - const snapshotTableResponse = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.Snapshot') as gax.protobuf.Type; - const snapshotTableMetadata = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.SnapshotTableMetadata') as gax.protobuf.Type; - const createBackupResponse = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.Backup') as gax.protobuf.Type; - const createBackupMetadata = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.CreateBackupMetadata') as gax.protobuf.Type; - const restoreTableResponse = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.Table') as gax.protobuf.Type; - const restoreTableMetadata = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.RestoreTableMetadata') as gax.protobuf.Type; - const copyBackupResponse = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.Backup') as gax.protobuf.Type; - const copyBackupMetadata = protoFilesRoot.lookup( - '.google.bigtable.admin.v2.CopyBackupMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createTableFromSnapshot: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createTableFromSnapshotResponse.decode.bind(createTableFromSnapshotResponse), - createTableFromSnapshotMetadata.decode.bind(createTableFromSnapshotMetadata)), - updateTable: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateTableResponse.decode.bind(updateTableResponse), - updateTableMetadata.decode.bind(updateTableMetadata)), - undeleteTable: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - undeleteTableResponse.decode.bind(undeleteTableResponse), - undeleteTableMetadata.decode.bind(undeleteTableMetadata)), - snapshotTable: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - snapshotTableResponse.decode.bind(snapshotTableResponse), - snapshotTableMetadata.decode.bind(snapshotTableMetadata)), - createBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createBackupResponse.decode.bind(createBackupResponse), - createBackupMetadata.decode.bind(createBackupMetadata)), - restoreTable: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restoreTableResponse.decode.bind(restoreTableResponse), - restoreTableMetadata.decode.bind(restoreTableMetadata)), - copyBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - copyBackupResponse.decode.bind(copyBackupResponse), - copyBackupMetadata.decode.bind(copyBackupMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.bigtable.admin.v2.BigtableTableAdmin', 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.bigtableTableAdminStub) { - return this.bigtableTableAdminStub; - } - - // Put together the "service stub" for - // google.bigtable.admin.v2.BigtableTableAdmin. - this.bigtableTableAdminStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.bigtable.admin.v2.BigtableTableAdmin') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.bigtable.admin.v2.BigtableTableAdmin, - 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 bigtableTableAdminStubMethods = - ['createTable', 'createTableFromSnapshot', 'listTables', 'getTable', 'updateTable', 'deleteTable', 'undeleteTable', 'modifyColumnFamilies', 'dropRowRange', 'generateConsistencyToken', 'checkConsistency', 'snapshotTable', 'getSnapshot', 'listSnapshots', 'deleteSnapshot', 'createBackup', 'getBackup', 'updateBackup', 'deleteBackup', 'listBackups', 'restoreTable', 'copyBackup', 'getIamPolicy', 'setIamPolicy', 'testIamPermissions']; - for (const methodName of bigtableTableAdminStubMethods) { - const callPromise = this.bigtableTableAdminStub.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.bigtableTableAdminStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'bigtableadmin.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'bigtableadmin.googleapis.com'; - } - - /** - * 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/bigtable.admin', - 'https://www.googleapis.com/auth/bigtable.admin.table', - 'https://www.googleapis.com/auth/cloud-bigtable.admin', - 'https://www.googleapis.com/auth/cloud-bigtable.admin.table', - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only' - ]; - } - - 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 -- - // ------------------- -/** - * Creates a new table in the specified instance. - * The table can be created with a full set of initial column families, - * specified in the request. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The unique name of the instance in which to create the table. - * Values are of the form `projects/{project}/instances/{instance}`. - * @param {string} request.tableId - * Required. The name by which the new table should be referred to within the - * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. - * Maximum 50 characters. - * @param {google.bigtable.admin.v2.Table} request.table - * Required. The Table to create. - * @param {number[]} request.initialSplits - * The optional list of row keys that will be used to initially split the - * table into several tablets (tablets are similar to HBase regions). - * Given two split keys, `s1` and `s2`, three tablets will be created, - * spanning the key ranges: `[, s1), [s1, s2), [s2, )`. - * - * Example: - * - * * Row keys := `["a", "apple", "custom", "customer_1", "customer_2",` - * `"other", "zz"]` - * * initial_split_keys := `["apple", "customer_1", "customer_2", "other"]` - * * Key assignment: - * - Tablet 1 `[, apple) => {"a"}.` - * - Tablet 2 `[apple, customer_1) => {"apple", "custom"}.` - * - Tablet 3 `[customer_1, customer_2) => {"customer_1"}.` - * - Tablet 4 `[customer_2, other) => {"customer_2"}.` - * - Tablet 5 `[other, ) => {"other", "zz"}.` - * @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.bigtable.admin.v2.Table|Table}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_async - */ - createTable( - request?: protos.google.bigtable.admin.v2.ICreateTableRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.ICreateTableRequest|undefined, {}|undefined - ]>; - createTable( - request: protos.google.bigtable.admin.v2.ICreateTableRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.ICreateTableRequest|null|undefined, - {}|null|undefined>): void; - createTable( - request: protos.google.bigtable.admin.v2.ICreateTableRequest, - callback: Callback< - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.ICreateTableRequest|null|undefined, - {}|null|undefined>): void; - createTable( - request?: protos.google.bigtable.admin.v2.ICreateTableRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.ICreateTableRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.ICreateTableRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.ICreateTableRequest|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.createTable(request, options, callback); - } -/** - * Gets metadata information about the specified table. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the requested table. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param {google.bigtable.admin.v2.Table.View} request.view - * The view to be applied to the returned table's fields. - * Defaults to `SCHEMA_VIEW` if unspecified. - * @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.bigtable.admin.v2.Table|Table}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_async - */ - getTable( - request?: protos.google.bigtable.admin.v2.IGetTableRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.IGetTableRequest|undefined, {}|undefined - ]>; - getTable( - request: protos.google.bigtable.admin.v2.IGetTableRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.IGetTableRequest|null|undefined, - {}|null|undefined>): void; - getTable( - request: protos.google.bigtable.admin.v2.IGetTableRequest, - callback: Callback< - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.IGetTableRequest|null|undefined, - {}|null|undefined>): void; - getTable( - request?: protos.google.bigtable.admin.v2.IGetTableRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.IGetTableRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.IGetTableRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.IGetTableRequest|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.getTable(request, options, callback); - } -/** - * Permanently deletes a specified table and all of its data. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the table to be deleted. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @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.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_async - */ - deleteTable( - request?: protos.google.bigtable.admin.v2.IDeleteTableRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteTableRequest|undefined, {}|undefined - ]>; - deleteTable( - request: protos.google.bigtable.admin.v2.IDeleteTableRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteTableRequest|null|undefined, - {}|null|undefined>): void; - deleteTable( - request: protos.google.bigtable.admin.v2.IDeleteTableRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteTableRequest|null|undefined, - {}|null|undefined>): void; - deleteTable( - request?: protos.google.bigtable.admin.v2.IDeleteTableRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteTableRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteTableRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteTableRequest|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.deleteTable(request, options, callback); - } -/** - * Performs a series of column family modifications on the specified table. - * Either all or none of the modifications will occur before this method - * returns, but data requests received prior to that point may see a table - * where only some modifications have taken effect. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the table whose families should be modified. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param {number[]} request.modifications - * Required. Modifications to be atomically applied to the specified table's - * families. Entries are applied in order, meaning that earlier modifications - * can be masked by later ones (in the case of repeated updates to the same - * family, for example). - * @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.bigtable.admin.v2.Table|Table}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_async - */ - modifyColumnFamilies( - request?: protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest|undefined, {}|undefined - ]>; - modifyColumnFamilies( - request: protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest|null|undefined, - {}|null|undefined>): void; - modifyColumnFamilies( - request: protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest, - callback: Callback< - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest|null|undefined, - {}|null|undefined>): void; - modifyColumnFamilies( - request?: protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.ITable, - protos.google.bigtable.admin.v2.IModifyColumnFamiliesRequest|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.modifyColumnFamilies(request, options, callback); - } -/** - * Permanently drop/delete a row range from a specified table. The request can - * specify whether to delete all rows in a table, or only those that match a - * particular prefix. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the table on which to drop a range of rows. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param {Buffer} request.rowKeyPrefix - * Delete all rows that start with this row key prefix. Prefix cannot be - * zero length. - * @param {boolean} request.deleteAllDataFromTable - * Delete all rows in the table. Setting this to false is a no-op. - * @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.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_async - */ - dropRowRange( - request?: protos.google.bigtable.admin.v2.IDropRowRangeRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDropRowRangeRequest|undefined, {}|undefined - ]>; - dropRowRange( - request: protos.google.bigtable.admin.v2.IDropRowRangeRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDropRowRangeRequest|null|undefined, - {}|null|undefined>): void; - dropRowRange( - request: protos.google.bigtable.admin.v2.IDropRowRangeRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDropRowRangeRequest|null|undefined, - {}|null|undefined>): void; - dropRowRange( - request?: protos.google.bigtable.admin.v2.IDropRowRangeRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDropRowRangeRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDropRowRangeRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDropRowRangeRequest|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.dropRowRange(request, options, callback); - } -/** - * Generates a consistency token for a Table, which can be used in - * CheckConsistency to check whether mutations to the table that finished - * before this call started have been replicated. The tokens will be available - * for 90 days. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the Table for which to create a consistency - * token. Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @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.bigtable.admin.v2.GenerateConsistencyTokenResponse|GenerateConsistencyTokenResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_async - */ - generateConsistencyToken( - request?: protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, - protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest|undefined, {}|undefined - ]>; - generateConsistencyToken( - request: protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, - protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest|null|undefined, - {}|null|undefined>): void; - generateConsistencyToken( - request: protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, - callback: Callback< - protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, - protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest|null|undefined, - {}|null|undefined>): void; - generateConsistencyToken( - request?: protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, - protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, - protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse, - protos.google.bigtable.admin.v2.IGenerateConsistencyTokenRequest|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.generateConsistencyToken(request, options, callback); - } -/** - * Checks replication consistency based on a consistency token, that is, if - * replication has caught up based on the conditions specified in the token - * and the check request. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the Table for which to check replication - * consistency. Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param {string} request.consistencyToken - * Required. The token created using GenerateConsistencyToken for the Table. - * @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.bigtable.admin.v2.CheckConsistencyResponse|CheckConsistencyResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async - */ - checkConsistency( - request?: protos.google.bigtable.admin.v2.ICheckConsistencyRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.ICheckConsistencyResponse, - protos.google.bigtable.admin.v2.ICheckConsistencyRequest|undefined, {}|undefined - ]>; - checkConsistency( - request: protos.google.bigtable.admin.v2.ICheckConsistencyRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.ICheckConsistencyResponse, - protos.google.bigtable.admin.v2.ICheckConsistencyRequest|null|undefined, - {}|null|undefined>): void; - checkConsistency( - request: protos.google.bigtable.admin.v2.ICheckConsistencyRequest, - callback: Callback< - protos.google.bigtable.admin.v2.ICheckConsistencyResponse, - protos.google.bigtable.admin.v2.ICheckConsistencyRequest|null|undefined, - {}|null|undefined>): void; - checkConsistency( - request?: protos.google.bigtable.admin.v2.ICheckConsistencyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.ICheckConsistencyResponse, - protos.google.bigtable.admin.v2.ICheckConsistencyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.ICheckConsistencyResponse, - protos.google.bigtable.admin.v2.ICheckConsistencyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.ICheckConsistencyResponse, - protos.google.bigtable.admin.v2.ICheckConsistencyRequest|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.checkConsistency(request, options, callback); - } -/** - * Gets metadata information about the specified snapshot. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the requested snapshot. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - * @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.bigtable.admin.v2.Snapshot|Snapshot}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_async - */ - getSnapshot( - request?: protos.google.bigtable.admin.v2.IGetSnapshotRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.ISnapshot, - protos.google.bigtable.admin.v2.IGetSnapshotRequest|undefined, {}|undefined - ]>; - getSnapshot( - request: protos.google.bigtable.admin.v2.IGetSnapshotRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.ISnapshot, - protos.google.bigtable.admin.v2.IGetSnapshotRequest|null|undefined, - {}|null|undefined>): void; - getSnapshot( - request: protos.google.bigtable.admin.v2.IGetSnapshotRequest, - callback: Callback< - protos.google.bigtable.admin.v2.ISnapshot, - protos.google.bigtable.admin.v2.IGetSnapshotRequest|null|undefined, - {}|null|undefined>): void; - getSnapshot( - request?: protos.google.bigtable.admin.v2.IGetSnapshotRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.ISnapshot, - protos.google.bigtable.admin.v2.IGetSnapshotRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.ISnapshot, - protos.google.bigtable.admin.v2.IGetSnapshotRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.ISnapshot, - protos.google.bigtable.admin.v2.IGetSnapshotRequest|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.getSnapshot(request, options, callback); - } -/** - * Permanently deletes the specified snapshot. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the snapshot to be deleted. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - * @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.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_async - */ - deleteSnapshot( - request?: protos.google.bigtable.admin.v2.IDeleteSnapshotRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteSnapshotRequest|undefined, {}|undefined - ]>; - deleteSnapshot( - request: protos.google.bigtable.admin.v2.IDeleteSnapshotRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteSnapshotRequest|null|undefined, - {}|null|undefined>): void; - deleteSnapshot( - request: protos.google.bigtable.admin.v2.IDeleteSnapshotRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteSnapshotRequest|null|undefined, - {}|null|undefined>): void; - deleteSnapshot( - request?: protos.google.bigtable.admin.v2.IDeleteSnapshotRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteSnapshotRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteSnapshotRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteSnapshotRequest|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.deleteSnapshot(request, options, callback); - } -/** - * Gets metadata on a pending or completed Cloud Bigtable Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the backup. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. - * @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.bigtable.admin.v2.Backup|Backup}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_async - */ - getBackup( - request?: protos.google.bigtable.admin.v2.IGetBackupRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.IBackup, - protos.google.bigtable.admin.v2.IGetBackupRequest|undefined, {}|undefined - ]>; - getBackup( - request: protos.google.bigtable.admin.v2.IGetBackupRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.IBackup, - protos.google.bigtable.admin.v2.IGetBackupRequest|null|undefined, - {}|null|undefined>): void; - getBackup( - request: protos.google.bigtable.admin.v2.IGetBackupRequest, - callback: Callback< - protos.google.bigtable.admin.v2.IBackup, - protos.google.bigtable.admin.v2.IGetBackupRequest|null|undefined, - {}|null|undefined>): void; - getBackup( - request?: protos.google.bigtable.admin.v2.IGetBackupRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.IBackup, - protos.google.bigtable.admin.v2.IGetBackupRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.IBackup, - protos.google.bigtable.admin.v2.IGetBackupRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.IBackup, - protos.google.bigtable.admin.v2.IGetBackupRequest|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.getBackup(request, options, callback); - } -/** - * Updates a pending or completed Cloud Bigtable Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.bigtable.admin.v2.Backup} request.backup - * Required. The backup to update. `backup.name`, and the fields to be updated - * as specified by `update_mask` are required. Other fields are ignored. - * Update is only supported for the following fields: - * - * * `backup.expire_time`. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. A mask specifying which fields (e.g. `expire_time`) in the - * Backup resource should be updated. This mask is relative to the Backup - * resource, not to the request message. The field mask must always be - * specified; this prevents any future fields from being erased accidentally - * by clients that do not know about them. - * @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.bigtable.admin.v2.Backup|Backup}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_async - */ - updateBackup( - request?: protos.google.bigtable.admin.v2.IUpdateBackupRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.IBackup, - protos.google.bigtable.admin.v2.IUpdateBackupRequest|undefined, {}|undefined - ]>; - updateBackup( - request: protos.google.bigtable.admin.v2.IUpdateBackupRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.admin.v2.IBackup, - protos.google.bigtable.admin.v2.IUpdateBackupRequest|null|undefined, - {}|null|undefined>): void; - updateBackup( - request: protos.google.bigtable.admin.v2.IUpdateBackupRequest, - callback: Callback< - protos.google.bigtable.admin.v2.IBackup, - protos.google.bigtable.admin.v2.IUpdateBackupRequest|null|undefined, - {}|null|undefined>): void; - updateBackup( - request?: protos.google.bigtable.admin.v2.IUpdateBackupRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.admin.v2.IBackup, - protos.google.bigtable.admin.v2.IUpdateBackupRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.admin.v2.IBackup, - protos.google.bigtable.admin.v2.IUpdateBackupRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.admin.v2.IBackup, - protos.google.bigtable.admin.v2.IUpdateBackupRequest|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({ - 'backup.name': request.backup!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateBackup(request, options, callback); - } -/** - * Deletes a pending or completed Cloud Bigtable backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the backup to delete. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`. - * @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.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_async - */ - deleteBackup( - request?: protos.google.bigtable.admin.v2.IDeleteBackupRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteBackupRequest|undefined, {}|undefined - ]>; - deleteBackup( - request: protos.google.bigtable.admin.v2.IDeleteBackupRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteBackupRequest|null|undefined, - {}|null|undefined>): void; - deleteBackup( - request: protos.google.bigtable.admin.v2.IDeleteBackupRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteBackupRequest|null|undefined, - {}|null|undefined>): void; - deleteBackup( - request?: protos.google.bigtable.admin.v2.IDeleteBackupRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteBackupRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteBackupRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.bigtable.admin.v2.IDeleteBackupRequest|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.deleteBackup(request, options, callback); - } -/** - * Gets the access control policy for a Table or Backup resource. - * Returns an empty policy if the resource exists but does not have a policy - * set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.GetPolicyOptions} request.options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @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.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_async - */ - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|undefined, {}|undefined - ]>; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request: protos.google.iam.v1.IGetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - getIamPolicy( - request?: protos.google.iam.v1.IGetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.IGetIamPolicyRequest|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({ - 'resource': request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.getIamPolicy(request, options, callback); - } -/** - * Sets the access control policy on a Table or Backup resource. - * Replaces any existing policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param {google.iam.v1.Policy} request.policy - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param {google.protobuf.FieldMask} request.updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @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.iam.v1.Policy|Policy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_async - */ - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|undefined, {}|undefined - ]>; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request: protos.google.iam.v1.ISetIamPolicyRequest, - callback: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - setIamPolicy( - request?: protos.google.iam.v1.ISetIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.IPolicy, - protos.google.iam.v1.ISetIamPolicyRequest|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({ - 'resource': request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.setIamPolicy(request, options, callback); - } -/** - * Returns permissions that the caller has on the specified Table or Backup - * resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @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.iam.v1.TestIamPermissionsResponse|TestIamPermissionsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_async - */ - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - options?: CallOptions): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|undefined, {}|undefined - ]>; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - options: CallOptions, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request: protos.google.iam.v1.ITestIamPermissionsRequest, - callback: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): void; - testIamPermissions( - request?: protos.google.iam.v1.ITestIamPermissionsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.iam.v1.ITestIamPermissionsResponse, - protos.google.iam.v1.ITestIamPermissionsRequest|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({ - 'resource': request.resource ?? '', - }); - this.initialize(); - return this.innerApiCalls.testIamPermissions(request, options, callback); - } - -/** - * Creates a new table from the specified snapshot. The target table must - * not exist. The snapshot and the table must be in the same instance. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The unique name of the instance in which to create the table. - * Values are of the form `projects/{project}/instances/{instance}`. - * @param {string} request.tableId - * Required. The name by which the new table should be referred to within the - * parent instance, e.g., `foobar` rather than `{parent}/tables/foobar`. - * @param {string} request.sourceSnapshot - * Required. The unique name of the snapshot from which to restore the table. - * The snapshot and the table must be in the same instance. Values are of the - * form - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_async - */ - createTableFromSnapshot( - request?: protos.google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createTableFromSnapshot( - request: protos.google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createTableFromSnapshot( - request: protos.google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createTableFromSnapshot( - request?: protos.google.bigtable.admin.v2.ICreateTableFromSnapshotRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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.createTableFromSnapshot(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createTableFromSnapshot()`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_async - */ - async checkCreateTableFromSnapshotProgress(name: string): Promise>{ - 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.createTableFromSnapshot, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a specified table. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.bigtable.admin.v2.Table} request.table - * Required. The table to update. - * The table's `name` field is used to identify the table to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * A mask specifying which fields (e.g. `change_stream_config`) in the `table` - * field should be updated. This mask is relative to the `table` field, not to - * the request message. The wildcard (*) path is currently not supported. - * Currently UpdateTable is only supported for the following fields: - * - * * `change_stream_config` - * * `change_stream_config.retention_period` - * * `deletion_protection` - * - * If `column_families` is set in `update_mask`, it will return an - * UNIMPLEMENTED error. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_async - */ - updateTable( - request?: protos.google.bigtable.admin.v2.IUpdateTableRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateTable( - request: protos.google.bigtable.admin.v2.IUpdateTableRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateTable( - request: protos.google.bigtable.admin.v2.IUpdateTableRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateTable( - request?: protos.google.bigtable.admin.v2.IUpdateTableRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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({ - 'table.name': request.table!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateTable(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateTable()`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_async - */ - async checkUpdateTableProgress(name: string): Promise>{ - 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.updateTable, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Restores a specified table which was accidentally deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the table to be restored. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_async - */ - undeleteTable( - request?: protos.google.bigtable.admin.v2.IUndeleteTableRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - undeleteTable( - request: protos.google.bigtable.admin.v2.IUndeleteTableRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeleteTable( - request: protos.google.bigtable.admin.v2.IUndeleteTableRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - undeleteTable( - request?: protos.google.bigtable.admin.v2.IUndeleteTableRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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.undeleteTable(request, options, callback); - } -/** - * Check the status of the long running operation returned by `undeleteTable()`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_async - */ - async checkUndeleteTableProgress(name: string): Promise>{ - 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.undeleteTable, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new snapshot in the specified cluster from the specified - * source table. The cluster and the table must be in the same instance. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the table to have the snapshot taken. - * Values are of the form - * `projects/{project}/instances/{instance}/tables/{table}`. - * @param {string} request.cluster - * Required. The name of the cluster where the snapshot will be created in. - * Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @param {string} request.snapshotId - * Required. The ID by which the new snapshot should be referred to within the - * parent cluster, e.g., `mysnapshot` of the form: - * `{@link protos.-_.a-zA-Z0-9|_a-zA-Z0-9}*` rather than - * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot`. - * @param {google.protobuf.Duration} request.ttl - * The amount of time that the new snapshot can stay active after it is - * created. Once 'ttl' expires, the snapshot will get deleted. The maximum - * amount of time a snapshot can stay active is 7 days. If 'ttl' is not - * specified, the default value of 24 hours will be used. - * @param {string} request.description - * Description of the snapshot. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_async - */ - snapshotTable( - request?: protos.google.bigtable.admin.v2.ISnapshotTableRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - snapshotTable( - request: protos.google.bigtable.admin.v2.ISnapshotTableRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - snapshotTable( - request: protos.google.bigtable.admin.v2.ISnapshotTableRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - snapshotTable( - request?: protos.google.bigtable.admin.v2.ISnapshotTableRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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.snapshotTable(request, options, callback); - } -/** - * Check the status of the long running operation returned by `snapshotTable()`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_async - */ - async checkSnapshotTableProgress(name: string): Promise>{ - 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.snapshotTable, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Starts creating a new Cloud Bigtable Backup. The returned backup - * {@link protos.google.longrunning.Operation|long-running operation} can be used to - * track creation of the backup. The - * {@link protos.google.longrunning.Operation.metadata|metadata} field type is - * {@link protos.google.bigtable.admin.v2.CreateBackupMetadata|CreateBackupMetadata}. The - * {@link protos.google.longrunning.Operation.response|response} field type is - * {@link protos.google.bigtable.admin.v2.Backup|Backup}, if successful. Cancelling the - * returned operation will stop the creation and delete the backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. This must be one of the clusters in the instance in which this - * table is located. The backup will be stored in this cluster. Values are - * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @param {string} request.backupId - * Required. The id of the backup to be created. The `backup_id` along with - * the parent `parent` are combined as {parent}/backups/{backup_id} to create - * the full backup name, of the form: - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. - * This string must be between 1 and 50 characters in length and match the - * regex {@link protos.-_.a-zA-Z0-9|_a-zA-Z0-9}*. - * @param {google.bigtable.admin.v2.Backup} request.backup - * Required. The backup to create. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_async - */ - createBackup( - request?: protos.google.bigtable.admin.v2.ICreateBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createBackup( - request: protos.google.bigtable.admin.v2.ICreateBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackup( - request: protos.google.bigtable.admin.v2.ICreateBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackup( - request?: protos.google.bigtable.admin.v2.ICreateBackupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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.createBackup(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createBackup()`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_async - */ - async checkCreateBackupProgress(name: string): Promise>{ - 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.createBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Create a new table by restoring from a completed backup. The - * returned table {@link protos.google.longrunning.Operation|long-running operation} can - * be used to track the progress of the operation, and to cancel it. The - * {@link protos.google.longrunning.Operation.metadata|metadata} field type is - * {@link protos.google.bigtable.admin.RestoreTableMetadata|RestoreTableMetadata}. The - * {@link protos.google.longrunning.Operation.response|response} type is - * {@link protos.google.bigtable.admin.v2.Table|Table}, if successful. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the instance in which to create the restored - * table. Values are of the form `projects//instances/`. - * @param {string} request.tableId - * Required. The id of the table to create and restore to. This - * table must not already exist. The `table_id` appended to - * `parent` forms the full table name of the form - * `projects//instances//tables/`. - * @param {string} request.backup - * Name of the backup from which to restore. Values are of the form - * `projects//instances//clusters//backups/`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async - */ - restoreTable( - request?: protos.google.bigtable.admin.v2.IRestoreTableRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restoreTable( - request: protos.google.bigtable.admin.v2.IRestoreTableRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreTable( - request: protos.google.bigtable.admin.v2.IRestoreTableRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreTable( - request?: protos.google.bigtable.admin.v2.IRestoreTableRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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.restoreTable(request, options, callback); - } -/** - * Check the status of the long running operation returned by `restoreTable()`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async - */ - async checkRestoreTableProgress(name: string): Promise>{ - 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.restoreTable, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Copy a Cloud Bigtable backup to a new backup in the destination cluster - * located in the destination instance and project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the destination cluster that will contain the backup - * copy. The cluster must already exists. Values are of the form: - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * @param {string} request.backupId - * Required. The id of the new backup. The `backup_id` along with `parent` - * are combined as {parent}/backups/{backup_id} to create the full backup - * name, of the form: - * `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`. - * This string must be between 1 and 50 characters in length and match the - * regex {@link protos.-_.a-zA-Z0-9|_a-zA-Z0-9}*. - * @param {string} request.sourceBackup - * Required. The source backup to be copied from. - * The source backup needs to be in READY state for it to be copied. - * Copying a copied backup is not allowed. - * Once CopyBackup is in progress, the source backup cannot be deleted or - * cleaned up on expiration until CopyBackup is finished. - * Values are of the form: - * `projects//instances//clusters//backups/`. - * @param {google.protobuf.Timestamp} request.expireTime - * Required. Required. The expiration time of the copied backup with - * microsecond granularity that must be at least 6 hours and at most 30 days - * from the time the request is received. Once the `expire_time` has - * passed, Cloud Bigtable will delete the backup and free the resources used - * by the backup. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_async - */ - copyBackup( - request?: protos.google.bigtable.admin.v2.ICopyBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - copyBackup( - request: protos.google.bigtable.admin.v2.ICopyBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - copyBackup( - request: protos.google.bigtable.admin.v2.ICopyBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - copyBackup( - request?: protos.google.bigtable.admin.v2.ICopyBackupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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.copyBackup(request, options, callback); - } -/** - * Check the status of the long running operation returned by `copyBackup()`. - * @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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_async - */ - async checkCopyBackupProgress(name: string): Promise>{ - 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.copyBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists all tables served from a specified instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The unique name of the instance for which tables should be - * listed. Values are of the form `projects/{project}/instances/{instance}`. - * @param {google.bigtable.admin.v2.Table.View} request.view - * The view to be applied to the returned tables' fields. - * NAME_ONLY view (default) and REPLICATION_VIEW are supported. - * @param {number} request.pageSize - * Maximum number of results per page. - * - * A page_size of zero lets the server choose the number of items to return. - * A page_size which is strictly positive will return at most that many items. - * A negative page_size will cause an error. - * - * Following the first request, subsequent paginated calls are not required - * to pass a page_size. If a page_size is set in subsequent calls, it must - * match the page_size given in the first request. - * @param {string} request.pageToken - * The value of `next_page_token` returned by a previous call. - * @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.bigtable.admin.v2.Table|Table}. - * 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 `listTablesAsync()` - * 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. - */ - listTables( - request?: protos.google.bigtable.admin.v2.IListTablesRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.ITable[], - protos.google.bigtable.admin.v2.IListTablesRequest|null, - protos.google.bigtable.admin.v2.IListTablesResponse - ]>; - listTables( - request: protos.google.bigtable.admin.v2.IListTablesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.bigtable.admin.v2.IListTablesRequest, - protos.google.bigtable.admin.v2.IListTablesResponse|null|undefined, - protos.google.bigtable.admin.v2.ITable>): void; - listTables( - request: protos.google.bigtable.admin.v2.IListTablesRequest, - callback: PaginationCallback< - protos.google.bigtable.admin.v2.IListTablesRequest, - protos.google.bigtable.admin.v2.IListTablesResponse|null|undefined, - protos.google.bigtable.admin.v2.ITable>): void; - listTables( - request?: protos.google.bigtable.admin.v2.IListTablesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.bigtable.admin.v2.IListTablesRequest, - protos.google.bigtable.admin.v2.IListTablesResponse|null|undefined, - protos.google.bigtable.admin.v2.ITable>, - callback?: PaginationCallback< - protos.google.bigtable.admin.v2.IListTablesRequest, - protos.google.bigtable.admin.v2.IListTablesResponse|null|undefined, - protos.google.bigtable.admin.v2.ITable>): - Promise<[ - protos.google.bigtable.admin.v2.ITable[], - protos.google.bigtable.admin.v2.IListTablesRequest|null, - protos.google.bigtable.admin.v2.IListTablesResponse - ]>|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.listTables(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 unique name of the instance for which tables should be - * listed. Values are of the form `projects/{project}/instances/{instance}`. - * @param {google.bigtable.admin.v2.Table.View} request.view - * The view to be applied to the returned tables' fields. - * NAME_ONLY view (default) and REPLICATION_VIEW are supported. - * @param {number} request.pageSize - * Maximum number of results per page. - * - * A page_size of zero lets the server choose the number of items to return. - * A page_size which is strictly positive will return at most that many items. - * A negative page_size will cause an error. - * - * Following the first request, subsequent paginated calls are not required - * to pass a page_size. If a page_size is set in subsequent calls, it must - * match the page_size given in the first request. - * @param {string} request.pageToken - * The value of `next_page_token` returned by a previous call. - * @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.bigtable.admin.v2.Table|Table} 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 `listTablesAsync()` - * 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. - */ - listTablesStream( - request?: protos.google.bigtable.admin.v2.IListTablesRequest, - 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['listTables']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTables.createStream( - this.innerApiCalls.listTables as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listTables`, 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 unique name of the instance for which tables should be - * listed. Values are of the form `projects/{project}/instances/{instance}`. - * @param {google.bigtable.admin.v2.Table.View} request.view - * The view to be applied to the returned tables' fields. - * NAME_ONLY view (default) and REPLICATION_VIEW are supported. - * @param {number} request.pageSize - * Maximum number of results per page. - * - * A page_size of zero lets the server choose the number of items to return. - * A page_size which is strictly positive will return at most that many items. - * A negative page_size will cause an error. - * - * Following the first request, subsequent paginated calls are not required - * to pass a page_size. If a page_size is set in subsequent calls, it must - * match the page_size given in the first request. - * @param {string} request.pageToken - * The value of `next_page_token` returned by a previous call. - * @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.bigtable.admin.v2.Table|Table}. 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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_async - */ - listTablesAsync( - request?: protos.google.bigtable.admin.v2.IListTablesRequest, - 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['listTables']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listTables.asyncIterate( - this.innerApiCalls['listTables'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all snapshots associated with the specified cluster. - * - * Note: This is a private alpha release of Cloud Bigtable snapshots. This - * feature is not currently available to most Cloud Bigtable customers. This - * feature might be changed in backward-incompatible ways and is not - * recommended for production use. It is not subject to any SLA or deprecation - * policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The unique name of the cluster for which snapshots should be - * listed. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, - * e.g., `projects/{project}/instances/{instance}/clusters/-`. - * @param {number} request.pageSize - * The maximum number of snapshots to return per page. - * CURRENTLY UNIMPLEMENTED AND IGNORED. - * @param {string} request.pageToken - * The value of `next_page_token` returned by a previous call. - * @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.bigtable.admin.v2.Snapshot|Snapshot}. - * 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 `listSnapshotsAsync()` - * 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. - */ - listSnapshots( - request?: protos.google.bigtable.admin.v2.IListSnapshotsRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.ISnapshot[], - protos.google.bigtable.admin.v2.IListSnapshotsRequest|null, - protos.google.bigtable.admin.v2.IListSnapshotsResponse - ]>; - listSnapshots( - request: protos.google.bigtable.admin.v2.IListSnapshotsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.bigtable.admin.v2.IListSnapshotsRequest, - protos.google.bigtable.admin.v2.IListSnapshotsResponse|null|undefined, - protos.google.bigtable.admin.v2.ISnapshot>): void; - listSnapshots( - request: protos.google.bigtable.admin.v2.IListSnapshotsRequest, - callback: PaginationCallback< - protos.google.bigtable.admin.v2.IListSnapshotsRequest, - protos.google.bigtable.admin.v2.IListSnapshotsResponse|null|undefined, - protos.google.bigtable.admin.v2.ISnapshot>): void; - listSnapshots( - request?: protos.google.bigtable.admin.v2.IListSnapshotsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.bigtable.admin.v2.IListSnapshotsRequest, - protos.google.bigtable.admin.v2.IListSnapshotsResponse|null|undefined, - protos.google.bigtable.admin.v2.ISnapshot>, - callback?: PaginationCallback< - protos.google.bigtable.admin.v2.IListSnapshotsRequest, - protos.google.bigtable.admin.v2.IListSnapshotsResponse|null|undefined, - protos.google.bigtable.admin.v2.ISnapshot>): - Promise<[ - protos.google.bigtable.admin.v2.ISnapshot[], - protos.google.bigtable.admin.v2.IListSnapshotsRequest|null, - protos.google.bigtable.admin.v2.IListSnapshotsResponse - ]>|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.listSnapshots(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 unique name of the cluster for which snapshots should be - * listed. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, - * e.g., `projects/{project}/instances/{instance}/clusters/-`. - * @param {number} request.pageSize - * The maximum number of snapshots to return per page. - * CURRENTLY UNIMPLEMENTED AND IGNORED. - * @param {string} request.pageToken - * The value of `next_page_token` returned by a previous call. - * @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.bigtable.admin.v2.Snapshot|Snapshot} 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 `listSnapshotsAsync()` - * 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. - */ - listSnapshotsStream( - request?: protos.google.bigtable.admin.v2.IListSnapshotsRequest, - 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['listSnapshots']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSnapshots.createStream( - this.innerApiCalls.listSnapshots as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSnapshots`, 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 unique name of the cluster for which snapshots should be - * listed. Values are of the form - * `projects/{project}/instances/{instance}/clusters/{cluster}`. - * Use `{cluster} = '-'` to list snapshots for all clusters in an instance, - * e.g., `projects/{project}/instances/{instance}/clusters/-`. - * @param {number} request.pageSize - * The maximum number of snapshots to return per page. - * CURRENTLY UNIMPLEMENTED AND IGNORED. - * @param {string} request.pageToken - * The value of `next_page_token` returned by a previous call. - * @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.bigtable.admin.v2.Snapshot|Snapshot}. 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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_async - */ - listSnapshotsAsync( - request?: protos.google.bigtable.admin.v2.IListSnapshotsRequest, - 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['listSnapshots']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listSnapshots.asyncIterate( - this.innerApiCalls['listSnapshots'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Cloud Bigtable backups. Returns both completed and pending - * backups. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The cluster to list backups from. Values are of the - * form `projects/{project}/instances/{instance}/clusters/{cluster}`. - * Use `{cluster} = '-'` to list backups for all clusters in an instance, - * e.g., `projects/{project}/instances/{instance}/clusters/-`. - * @param {string} request.filter - * A filter expression that filters backups listed in the response. - * The expression must specify the field name, a comparison operator, - * and the value that you want to use for filtering. The value must be a - * string, a number, or a boolean. The comparison operator must be - * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is - * roughly synonymous with equality. Filter rules are case insensitive. - * - * The fields eligible for filtering are: - * - * * `name` - * * `source_table` - * * `state` - * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `size_bytes` - * - * To filter on multiple expressions, provide each separate expression within - * parentheses. By default, each expression is an AND expression. However, - * you can include AND, OR, and NOT expressions explicitly. - * - * Some examples of using filters are: - * - * * `name:"exact"` --> The backup's name is the string "exact". - * * `name:howl` --> The backup's name contains the string "howl". - * * `source_table:prod` - * --> The source_table's name contains the string "prod". - * * `state:CREATING` --> The backup is pending creation. - * * `state:READY` --> The backup is fully created and ready for use. - * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` - * --> The backup name contains the string "howl" and start_time - * of the backup is before 2018-03-28T14:50:00Z. - * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB - * @param {string} request.orderBy - * An expression for specifying the sort order of the results of the request. - * The string value should specify one or more fields in - * {@link protos.google.bigtable.admin.v2.Backup|Backup}. The full syntax is described at - * https://aip.dev/132#ordering. - * - * Fields supported are: - * - * * name - * * source_table - * * expire_time - * * start_time - * * end_time - * * size_bytes - * * state - * - * For example, "start_time". The default sorting order is ascending. - * To specify descending order for the field, a suffix " desc" should - * be appended to the field name. For example, "start_time desc". - * Redundant space characters in the syntax are insigificant. - * - * If order_by is empty, results will be sorted by `start_time` in descending - * order starting from the most recently created backup. - * @param {number} request.pageSize - * Number of backups to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.bigtable.admin.v2.ListBackupsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.bigtable.admin.v2.ListBackupsResponse|ListBackupsResponse} to the - * same `parent` and with the same `filter`. - * @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.bigtable.admin.v2.Backup|Backup}. - * 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 `listBackupsAsync()` - * 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. - */ - listBackups( - request?: protos.google.bigtable.admin.v2.IListBackupsRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.admin.v2.IBackup[], - protos.google.bigtable.admin.v2.IListBackupsRequest|null, - protos.google.bigtable.admin.v2.IListBackupsResponse - ]>; - listBackups( - request: protos.google.bigtable.admin.v2.IListBackupsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.bigtable.admin.v2.IListBackupsRequest, - protos.google.bigtable.admin.v2.IListBackupsResponse|null|undefined, - protos.google.bigtable.admin.v2.IBackup>): void; - listBackups( - request: protos.google.bigtable.admin.v2.IListBackupsRequest, - callback: PaginationCallback< - protos.google.bigtable.admin.v2.IListBackupsRequest, - protos.google.bigtable.admin.v2.IListBackupsResponse|null|undefined, - protos.google.bigtable.admin.v2.IBackup>): void; - listBackups( - request?: protos.google.bigtable.admin.v2.IListBackupsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.bigtable.admin.v2.IListBackupsRequest, - protos.google.bigtable.admin.v2.IListBackupsResponse|null|undefined, - protos.google.bigtable.admin.v2.IBackup>, - callback?: PaginationCallback< - protos.google.bigtable.admin.v2.IListBackupsRequest, - protos.google.bigtable.admin.v2.IListBackupsResponse|null|undefined, - protos.google.bigtable.admin.v2.IBackup>): - Promise<[ - protos.google.bigtable.admin.v2.IBackup[], - protos.google.bigtable.admin.v2.IListBackupsRequest|null, - protos.google.bigtable.admin.v2.IListBackupsResponse - ]>|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.listBackups(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 cluster to list backups from. Values are of the - * form `projects/{project}/instances/{instance}/clusters/{cluster}`. - * Use `{cluster} = '-'` to list backups for all clusters in an instance, - * e.g., `projects/{project}/instances/{instance}/clusters/-`. - * @param {string} request.filter - * A filter expression that filters backups listed in the response. - * The expression must specify the field name, a comparison operator, - * and the value that you want to use for filtering. The value must be a - * string, a number, or a boolean. The comparison operator must be - * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is - * roughly synonymous with equality. Filter rules are case insensitive. - * - * The fields eligible for filtering are: - * - * * `name` - * * `source_table` - * * `state` - * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `size_bytes` - * - * To filter on multiple expressions, provide each separate expression within - * parentheses. By default, each expression is an AND expression. However, - * you can include AND, OR, and NOT expressions explicitly. - * - * Some examples of using filters are: - * - * * `name:"exact"` --> The backup's name is the string "exact". - * * `name:howl` --> The backup's name contains the string "howl". - * * `source_table:prod` - * --> The source_table's name contains the string "prod". - * * `state:CREATING` --> The backup is pending creation. - * * `state:READY` --> The backup is fully created and ready for use. - * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` - * --> The backup name contains the string "howl" and start_time - * of the backup is before 2018-03-28T14:50:00Z. - * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB - * @param {string} request.orderBy - * An expression for specifying the sort order of the results of the request. - * The string value should specify one or more fields in - * {@link protos.google.bigtable.admin.v2.Backup|Backup}. The full syntax is described at - * https://aip.dev/132#ordering. - * - * Fields supported are: - * - * * name - * * source_table - * * expire_time - * * start_time - * * end_time - * * size_bytes - * * state - * - * For example, "start_time". The default sorting order is ascending. - * To specify descending order for the field, a suffix " desc" should - * be appended to the field name. For example, "start_time desc". - * Redundant space characters in the syntax are insigificant. - * - * If order_by is empty, results will be sorted by `start_time` in descending - * order starting from the most recently created backup. - * @param {number} request.pageSize - * Number of backups to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.bigtable.admin.v2.ListBackupsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.bigtable.admin.v2.ListBackupsResponse|ListBackupsResponse} to the - * same `parent` and with the same `filter`. - * @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.bigtable.admin.v2.Backup|Backup} 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 `listBackupsAsync()` - * 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. - */ - listBackupsStream( - request?: protos.google.bigtable.admin.v2.IListBackupsRequest, - 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['listBackups']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listBackups.createStream( - this.innerApiCalls.listBackups as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBackups`, 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 cluster to list backups from. Values are of the - * form `projects/{project}/instances/{instance}/clusters/{cluster}`. - * Use `{cluster} = '-'` to list backups for all clusters in an instance, - * e.g., `projects/{project}/instances/{instance}/clusters/-`. - * @param {string} request.filter - * A filter expression that filters backups listed in the response. - * The expression must specify the field name, a comparison operator, - * and the value that you want to use for filtering. The value must be a - * string, a number, or a boolean. The comparison operator must be - * <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator which is - * roughly synonymous with equality. Filter rules are case insensitive. - * - * The fields eligible for filtering are: - * - * * `name` - * * `source_table` - * * `state` - * * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `end_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) - * * `size_bytes` - * - * To filter on multiple expressions, provide each separate expression within - * parentheses. By default, each expression is an AND expression. However, - * you can include AND, OR, and NOT expressions explicitly. - * - * Some examples of using filters are: - * - * * `name:"exact"` --> The backup's name is the string "exact". - * * `name:howl` --> The backup's name contains the string "howl". - * * `source_table:prod` - * --> The source_table's name contains the string "prod". - * * `state:CREATING` --> The backup is pending creation. - * * `state:READY` --> The backup is fully created and ready for use. - * * `(name:howl) AND (start_time < \"2018-03-28T14:50:00Z\")` - * --> The backup name contains the string "howl" and start_time - * of the backup is before 2018-03-28T14:50:00Z. - * * `size_bytes > 10000000000` --> The backup's size is greater than 10GB - * @param {string} request.orderBy - * An expression for specifying the sort order of the results of the request. - * The string value should specify one or more fields in - * {@link protos.google.bigtable.admin.v2.Backup|Backup}. The full syntax is described at - * https://aip.dev/132#ordering. - * - * Fields supported are: - * - * * name - * * source_table - * * expire_time - * * start_time - * * end_time - * * size_bytes - * * state - * - * For example, "start_time". The default sorting order is ascending. - * To specify descending order for the field, a suffix " desc" should - * be appended to the field name. For example, "start_time desc". - * Redundant space characters in the syntax are insigificant. - * - * If order_by is empty, results will be sorted by `start_time` in descending - * order starting from the most recently created backup. - * @param {number} request.pageSize - * Number of backups to be returned in the response. If 0 or - * less, defaults to the server's maximum allowed page size. - * @param {string} request.pageToken - * If non-empty, `page_token` should contain a - * {@link protos.google.bigtable.admin.v2.ListBackupsResponse.next_page_token|next_page_token} - * from a previous - * {@link protos.google.bigtable.admin.v2.ListBackupsResponse|ListBackupsResponse} to the - * same `parent` and with the same `filter`. - * @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.bigtable.admin.v2.Backup|Backup}. 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 - * region_tag:bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_async - */ - listBackupsAsync( - request?: protos.google.bigtable.admin.v2.IListBackupsRequest, - 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['listBackups']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listBackups.asyncIterate( - this.innerApiCalls['listBackups'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified appProfile resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} app_profile - * @returns {string} Resource name string. - */ - appProfilePath(project:string,instance:string,appProfile:string) { - return this.pathTemplates.appProfilePathTemplate.render({ - project: project, - instance: instance, - app_profile: appProfile, - }); - } - - /** - * Parse the project from AppProfile resource. - * - * @param {string} appProfileName - * A fully-qualified path representing AppProfile resource. - * @returns {string} A string representing the project. - */ - matchProjectFromAppProfileName(appProfileName: string) { - return this.pathTemplates.appProfilePathTemplate.match(appProfileName).project; - } - - /** - * Parse the instance from AppProfile resource. - * - * @param {string} appProfileName - * A fully-qualified path representing AppProfile resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromAppProfileName(appProfileName: string) { - return this.pathTemplates.appProfilePathTemplate.match(appProfileName).instance; - } - - /** - * Parse the app_profile from AppProfile resource. - * - * @param {string} appProfileName - * A fully-qualified path representing AppProfile resource. - * @returns {string} A string representing the app_profile. - */ - matchAppProfileFromAppProfileName(appProfileName: string) { - return this.pathTemplates.appProfilePathTemplate.match(appProfileName).app_profile; - } - - /** - * Return a fully-qualified backup resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} cluster - * @param {string} backup - * @returns {string} Resource name string. - */ - backupPath(project:string,instance:string,cluster:string,backup:string) { - return this.pathTemplates.backupPathTemplate.render({ - project: project, - instance: instance, - cluster: cluster, - backup: backup, - }); - } - - /** - * Parse the project from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).project; - } - - /** - * Parse the instance from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).instance; - } - - /** - * Parse the cluster from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).cluster; - } - - /** - * Parse the backup from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the backup. - */ - matchBackupFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).backup; - } - - /** - * Return a fully-qualified cluster resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} cluster - * @returns {string} Resource name string. - */ - clusterPath(project:string,instance:string,cluster:string) { - return this.pathTemplates.clusterPathTemplate.render({ - project: project, - instance: instance, - cluster: cluster, - }); - } - - /** - * Parse the project from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the project. - */ - matchProjectFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).project; - } - - /** - * Parse the instance from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).instance; - } - - /** - * Parse the cluster from Cluster resource. - * - * @param {string} clusterName - * A fully-qualified path representing Cluster resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromClusterName(clusterName: string) { - return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; - } - - /** - * Return a fully-qualified hotTablet resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} cluster - * @param {string} hot_tablet - * @returns {string} Resource name string. - */ - hotTabletPath(project:string,instance:string,cluster:string,hotTablet:string) { - return this.pathTemplates.hotTabletPathTemplate.render({ - project: project, - instance: instance, - cluster: cluster, - hot_tablet: hotTablet, - }); - } - - /** - * Parse the project from HotTablet resource. - * - * @param {string} hotTabletName - * A fully-qualified path representing HotTablet resource. - * @returns {string} A string representing the project. - */ - matchProjectFromHotTabletName(hotTabletName: string) { - return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName).project; - } - - /** - * Parse the instance from HotTablet resource. - * - * @param {string} hotTabletName - * A fully-qualified path representing HotTablet resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromHotTabletName(hotTabletName: string) { - return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName).instance; - } - - /** - * Parse the cluster from HotTablet resource. - * - * @param {string} hotTabletName - * A fully-qualified path representing HotTablet resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromHotTabletName(hotTabletName: string) { - return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName).cluster; - } - - /** - * Parse the hot_tablet from HotTablet resource. - * - * @param {string} hotTabletName - * A fully-qualified path representing HotTablet resource. - * @returns {string} A string representing the hot_tablet. - */ - matchHotTabletFromHotTabletName(hotTabletName: string) { - return this.pathTemplates.hotTabletPathTemplate.match(hotTabletName).hot_tablet; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - 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 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 snapshot resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} cluster - * @param {string} snapshot - * @returns {string} Resource name string. - */ - snapshotPath(project:string,instance:string,cluster:string,snapshot:string) { - return this.pathTemplates.snapshotPathTemplate.render({ - project: project, - instance: instance, - cluster: cluster, - snapshot: snapshot, - }); - } - - /** - * Parse the project from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; - } - - /** - * Parse the instance from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).instance; - } - - /** - * Parse the cluster from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).cluster; - } - - /** - * Parse the snapshot from Snapshot resource. - * - * @param {string} snapshotName - * A fully-qualified path representing Snapshot resource. - * @returns {string} A string representing the snapshot. - */ - matchSnapshotFromSnapshotName(snapshotName: string) { - return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; - } - - /** - * Return a fully-qualified table resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} table - * @returns {string} Resource name string. - */ - tablePath(project:string,instance:string,table:string) { - return this.pathTemplates.tablePathTemplate.render({ - project: project, - instance: instance, - table: table, - }); - } - - /** - * Parse the project from Table resource. - * - * @param {string} tableName - * A fully-qualified path representing Table resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTableName(tableName: string) { - return this.pathTemplates.tablePathTemplate.match(tableName).project; - } - - /** - * Parse the instance from Table resource. - * - * @param {string} tableName - * A fully-qualified path representing Table resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromTableName(tableName: string) { - return this.pathTemplates.tablePathTemplate.match(tableName).instance; - } - - /** - * Parse the table from Table resource. - * - * @param {string} tableName - * A fully-qualified path representing Table resource. - * @returns {string} A string representing the table. - */ - matchTableFromTableName(tableName: string) { - return this.pathTemplates.tablePathTemplate.match(tableName).table; - } - - /** - * 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.bigtableTableAdminStub && !this._terminated) { - return this.bigtableTableAdminStub.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/admin/v2/src/v2/bigtable_table_admin_client_config.json b/owl-bot-staging/admin/v2/src/v2/bigtable_table_admin_client_config.json deleted file mode 100644 index 5ed77e65a..000000000 --- a/owl-bot-staging/admin/v2/src/v2/bigtable_table_admin_client_config.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "interfaces": { - "google.bigtable.admin.v2.BigtableTableAdmin": { - "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 - }, - "264268458a9e88347dbacbd9398202ff5885a40b": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 2, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateTable": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateTableFromSnapshot": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListTables": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "GetTable": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "UpdateTable": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteTable": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UndeleteTable": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ModifyColumnFamilies": { - "timeout_millis": 300000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DropRowRange": { - "timeout_millis": 3600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GenerateConsistencyToken": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "CheckConsistency": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "SnapshotTable": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "ListSnapshots": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "DeleteSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetBackup": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "UpdateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "RestoreTable": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CopyBackup": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "264268458a9e88347dbacbd9398202ff5885a40b" - } - } - } - } -} diff --git a/owl-bot-staging/admin/v2/src/v2/bigtable_table_admin_proto_list.json b/owl-bot-staging/admin/v2/src/v2/bigtable_table_admin_proto_list.json deleted file mode 100644 index 1f7e1af50..000000000 --- a/owl-bot-staging/admin/v2/src/v2/bigtable_table_admin_proto_list.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "../../protos/google/bigtable/admin/v2/bigtable_instance_admin.proto", - "../../protos/google/bigtable/admin/v2/bigtable_table_admin.proto", - "../../protos/google/bigtable/admin/v2/common.proto", - "../../protos/google/bigtable/admin/v2/instance.proto", - "../../protos/google/bigtable/admin/v2/table.proto" -] diff --git a/owl-bot-staging/admin/v2/src/v2/gapic_metadata.json b/owl-bot-staging/admin/v2/src/v2/gapic_metadata.json deleted file mode 100644 index fc5e137af..000000000 --- a/owl-bot-staging/admin/v2/src/v2/gapic_metadata.json +++ /dev/null @@ -1,517 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.bigtable.admin.v2", - "libraryPackage": "@google-cloud/bigtable", - "services": { - "BigtableInstanceAdmin": { - "clients": { - "grpc": { - "libraryClient": "BigtableInstanceAdminClient", - "rpcs": { - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "ListInstances": { - "methods": [ - "listInstances" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "CreateAppProfile": { - "methods": [ - "createAppProfile" - ] - }, - "GetAppProfile": { - "methods": [ - "getAppProfile" - ] - }, - "DeleteAppProfile": { - "methods": [ - "deleteAppProfile" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "PartialUpdateInstance": { - "methods": [ - "partialUpdateInstance" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "PartialUpdateCluster": { - "methods": [ - "partialUpdateCluster" - ] - }, - "UpdateAppProfile": { - "methods": [ - "updateAppProfile" - ] - }, - "ListAppProfiles": { - "methods": [ - "listAppProfiles", - "listAppProfilesStream", - "listAppProfilesAsync" - ] - }, - "ListHotTablets": { - "methods": [ - "listHotTablets", - "listHotTabletsStream", - "listHotTabletsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BigtableInstanceAdminClient", - "rpcs": { - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "ListInstances": { - "methods": [ - "listInstances" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "ListClusters": { - "methods": [ - "listClusters" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "CreateAppProfile": { - "methods": [ - "createAppProfile" - ] - }, - "GetAppProfile": { - "methods": [ - "getAppProfile" - ] - }, - "DeleteAppProfile": { - "methods": [ - "deleteAppProfile" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "PartialUpdateInstance": { - "methods": [ - "partialUpdateInstance" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "PartialUpdateCluster": { - "methods": [ - "partialUpdateCluster" - ] - }, - "UpdateAppProfile": { - "methods": [ - "updateAppProfile" - ] - }, - "ListAppProfiles": { - "methods": [ - "listAppProfiles", - "listAppProfilesStream", - "listAppProfilesAsync" - ] - }, - "ListHotTablets": { - "methods": [ - "listHotTablets", - "listHotTabletsStream", - "listHotTabletsAsync" - ] - } - } - } - } - }, - "BigtableTableAdmin": { - "clients": { - "grpc": { - "libraryClient": "BigtableTableAdminClient", - "rpcs": { - "CreateTable": { - "methods": [ - "createTable" - ] - }, - "GetTable": { - "methods": [ - "getTable" - ] - }, - "DeleteTable": { - "methods": [ - "deleteTable" - ] - }, - "ModifyColumnFamilies": { - "methods": [ - "modifyColumnFamilies" - ] - }, - "DropRowRange": { - "methods": [ - "dropRowRange" - ] - }, - "GenerateConsistencyToken": { - "methods": [ - "generateConsistencyToken" - ] - }, - "CheckConsistency": { - "methods": [ - "checkConsistency" - ] - }, - "GetSnapshot": { - "methods": [ - "getSnapshot" - ] - }, - "DeleteSnapshot": { - "methods": [ - "deleteSnapshot" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateTableFromSnapshot": { - "methods": [ - "createTableFromSnapshot" - ] - }, - "UpdateTable": { - "methods": [ - "updateTable" - ] - }, - "UndeleteTable": { - "methods": [ - "undeleteTable" - ] - }, - "SnapshotTable": { - "methods": [ - "snapshotTable" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "RestoreTable": { - "methods": [ - "restoreTable" - ] - }, - "CopyBackup": { - "methods": [ - "copyBackup" - ] - }, - "ListTables": { - "methods": [ - "listTables", - "listTablesStream", - "listTablesAsync" - ] - }, - "ListSnapshots": { - "methods": [ - "listSnapshots", - "listSnapshotsStream", - "listSnapshotsAsync" - ] - }, - "ListBackups": { - "methods": [ - "listBackups", - "listBackupsStream", - "listBackupsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BigtableTableAdminClient", - "rpcs": { - "CreateTable": { - "methods": [ - "createTable" - ] - }, - "GetTable": { - "methods": [ - "getTable" - ] - }, - "DeleteTable": { - "methods": [ - "deleteTable" - ] - }, - "ModifyColumnFamilies": { - "methods": [ - "modifyColumnFamilies" - ] - }, - "DropRowRange": { - "methods": [ - "dropRowRange" - ] - }, - "GenerateConsistencyToken": { - "methods": [ - "generateConsistencyToken" - ] - }, - "CheckConsistency": { - "methods": [ - "checkConsistency" - ] - }, - "GetSnapshot": { - "methods": [ - "getSnapshot" - ] - }, - "DeleteSnapshot": { - "methods": [ - "deleteSnapshot" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "GetIamPolicy": { - "methods": [ - "getIamPolicy" - ] - }, - "SetIamPolicy": { - "methods": [ - "setIamPolicy" - ] - }, - "TestIamPermissions": { - "methods": [ - "testIamPermissions" - ] - }, - "CreateTableFromSnapshot": { - "methods": [ - "createTableFromSnapshot" - ] - }, - "UpdateTable": { - "methods": [ - "updateTable" - ] - }, - "UndeleteTable": { - "methods": [ - "undeleteTable" - ] - }, - "SnapshotTable": { - "methods": [ - "snapshotTable" - ] - }, - "CreateBackup": { - "methods": [ - "createBackup" - ] - }, - "RestoreTable": { - "methods": [ - "restoreTable" - ] - }, - "CopyBackup": { - "methods": [ - "copyBackup" - ] - }, - "ListTables": { - "methods": [ - "listTables", - "listTablesStream", - "listTablesAsync" - ] - }, - "ListSnapshots": { - "methods": [ - "listSnapshots", - "listSnapshotsStream", - "listSnapshotsAsync" - ] - }, - "ListBackups": { - "methods": [ - "listBackups", - "listBackupsStream", - "listBackupsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/admin/v2/src/v2/index.ts b/owl-bot-staging/admin/v2/src/v2/index.ts deleted file mode 100644 index 92130134b..000000000 --- a/owl-bot-staging/admin/v2/src/v2/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2023 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 {BigtableInstanceAdminClient} from './bigtable_instance_admin_client'; -export {BigtableTableAdminClient} from './bigtable_table_admin_client'; diff --git a/owl-bot-staging/admin/v2/system-test/fixtures/sample/src/index.js b/owl-bot-staging/admin/v2/system-test/fixtures/sample/src/index.js deleted file mode 100644 index a1b3f0a6b..000000000 --- a/owl-bot-staging/admin/v2/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2023 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. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const admin = require('@google-cloud/bigtable'); - -function main() { - const bigtableInstanceAdminClient = new admin.BigtableInstanceAdminClient(); - const bigtableTableAdminClient = new admin.BigtableTableAdminClient(); -} - -main(); diff --git a/owl-bot-staging/admin/v2/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/admin/v2/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 51e60010d..000000000 --- a/owl-bot-staging/admin/v2/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2023 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 {BigtableInstanceAdminClient, BigtableTableAdminClient} from '@google-cloud/bigtable'; - -// check that the client class type name can be used -function doStuffWithBigtableInstanceAdminClient(client: BigtableInstanceAdminClient) { - client.close(); -} -function doStuffWithBigtableTableAdminClient(client: BigtableTableAdminClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const bigtableInstanceAdminClient = new BigtableInstanceAdminClient(); - doStuffWithBigtableInstanceAdminClient(bigtableInstanceAdminClient); - // check that the client instance can be created - const bigtableTableAdminClient = new BigtableTableAdminClient(); - doStuffWithBigtableTableAdminClient(bigtableTableAdminClient); -} - -main(); diff --git a/owl-bot-staging/admin/v2/system-test/install.ts b/owl-bot-staging/admin/v2/system-test/install.ts deleted file mode 100644 index c8f81b25a..000000000 --- a/owl-bot-staging/admin/v2/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 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 {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/admin/v2/test/gapic_bigtable_instance_admin_v2.ts b/owl-bot-staging/admin/v2/test/gapic_bigtable_instance_admin_v2.ts deleted file mode 100644 index 41465e749..000000000 --- a/owl-bot-staging/admin/v2/test/gapic_bigtable_instance_admin_v2.ts +++ /dev/null @@ -1,3414 +0,0 @@ -// Copyright 2023 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 bigtableinstanceadminModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} 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('v2.BigtableInstanceAdminClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = bigtableinstanceadminModule.v2.BigtableInstanceAdminClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = bigtableinstanceadminModule.v2.BigtableInstanceAdminClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = bigtableinstanceadminModule.v2.BigtableInstanceAdminClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.bigtableInstanceAdminStub, undefined); - await client.initialize(); - assert(client.bigtableInstanceAdminStub); - }); - - it('has close method for the initialized client', done => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.bigtableInstanceAdminStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.bigtableInstanceAdminStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Instance() - ); - client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInstance( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.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('listInstances', () => { - it('invokes listInstances without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListInstancesResponse() - ); - 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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListInstancesResponse() - ); - client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInstances( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.IListInstancesResponse|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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.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 listInstances with closed client', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListInstancesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListInstancesRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listInstances(request), expectedError); - }); - }); - - describe('updateInstance', () => { - it('invokes updateInstance without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.Instance() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.Instance', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Instance() - ); - client.innerApiCalls.updateInstance = stubSimpleCall(expectedResponse); - const [response] = await client.updateInstance(request); - 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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.Instance() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.Instance', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Instance() - ); - client.innerApiCalls.updateInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateInstance( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.IInstance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await 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 error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.Instance() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.Instance', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubSimpleCall(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 closed client', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.Instance() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.Instance', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateInstance(request), expectedError); - }); - }); - - describe('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteInstance = stubSimpleCall(expectedResponse); - const [response] = await client.deleteInstance(request); - 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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInstance( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await 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 error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubSimpleCall(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 closed client', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteInstance(request), expectedError); - }); - }); - - describe('getCluster', () => { - it('invokes getCluster without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); - const [response] = await client.getCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCluster( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.ICluster|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with closed client', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetClusterRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getCluster(request), expectedError); - }); - }); - - describe('listClusters', () => { - it('invokes listClusters without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListClustersResponse() - ); - client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); - const [response] = await client.listClusters(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListClustersResponse() - ); - client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listClusters( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.IListClustersResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listClusters(request), expectedError); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with closed client', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListClustersRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.listClusters(request), expectedError); - }); - }); - - describe('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteCluster = stubSimpleCall(expectedResponse); - const [response] = await client.deleteCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCluster( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with closed client', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteClusterRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteCluster(request), expectedError); - }); - }); - - describe('createAppProfile', () => { - it('invokes createAppProfile without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateAppProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateAppProfileRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.AppProfile() - ); - client.innerApiCalls.createAppProfile = stubSimpleCall(expectedResponse); - const [response] = await client.createAppProfile(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAppProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAppProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAppProfile without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateAppProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateAppProfileRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.AppProfile() - ); - client.innerApiCalls.createAppProfile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createAppProfile( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.IAppProfile|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAppProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAppProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAppProfile with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateAppProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateAppProfileRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createAppProfile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createAppProfile(request), expectedError); - const actualRequest = (client.innerApiCalls.createAppProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAppProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAppProfile with closed client', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateAppProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateAppProfileRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createAppProfile(request), expectedError); - }); - }); - - describe('getAppProfile', () => { - it('invokes getAppProfile without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetAppProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetAppProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.AppProfile() - ); - client.innerApiCalls.getAppProfile = stubSimpleCall(expectedResponse); - const [response] = await client.getAppProfile(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAppProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAppProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAppProfile without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetAppProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetAppProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.AppProfile() - ); - client.innerApiCalls.getAppProfile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAppProfile( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.IAppProfile|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAppProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAppProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAppProfile with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetAppProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetAppProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAppProfile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAppProfile(request), expectedError); - const actualRequest = (client.innerApiCalls.getAppProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAppProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAppProfile with closed client', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetAppProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetAppProfileRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getAppProfile(request), expectedError); - }); - }); - - describe('deleteAppProfile', () => { - it('invokes deleteAppProfile without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteAppProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteAppProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAppProfile = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAppProfile(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAppProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAppProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAppProfile without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteAppProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteAppProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAppProfile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteAppProfile( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAppProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAppProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAppProfile with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteAppProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteAppProfileRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAppProfile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAppProfile(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteAppProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAppProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAppProfile with closed client', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteAppProfileRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteAppProfileRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteAppProfile(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with closed client', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with closed client', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request), expectedError); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with closed client', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('createInstance', () => { - it('invokes createInstance without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.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|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - 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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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 bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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('partialUpdateInstance', () => { - it('invokes partialUpdateInstance without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.PartialUpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.PartialUpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.partialUpdateInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.partialUpdateInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.partialUpdateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partialUpdateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes partialUpdateInstance without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.PartialUpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.PartialUpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.partialUpdateInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.partialUpdateInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.partialUpdateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partialUpdateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes partialUpdateInstance with call error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.PartialUpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.PartialUpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.partialUpdateInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.partialUpdateInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.partialUpdateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partialUpdateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes partialUpdateInstance with LRO error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.PartialUpdateInstanceRequest() - ); - request.instance ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.PartialUpdateInstanceRequest', ['instance', 'name']); - request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.partialUpdateInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.partialUpdateInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.partialUpdateInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partialUpdateInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkPartialUpdateInstanceProgress without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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.checkPartialUpdateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkPartialUpdateInstanceProgress with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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.checkPartialUpdateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createCluster', () => { - it('invokes createCluster without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with call error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with LRO error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateClusterRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateClusterProgress without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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.checkCreateClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateClusterProgress with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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.checkCreateClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateCluster', () => { - it('invokes updateCluster without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.Cluster() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.Cluster', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.Cluster() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.Cluster', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with call error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.Cluster() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.Cluster', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with LRO error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.Cluster() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.Cluster', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateClusterProgress without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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.checkUpdateClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateClusterProgress with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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.checkUpdateClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('partialUpdateCluster', () => { - it('invokes partialUpdateCluster without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.PartialUpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.PartialUpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.partialUpdateCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.partialUpdateCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.partialUpdateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partialUpdateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes partialUpdateCluster without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.PartialUpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.PartialUpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.partialUpdateCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.partialUpdateCluster( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.partialUpdateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partialUpdateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes partialUpdateCluster with call error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.PartialUpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.PartialUpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.partialUpdateCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.partialUpdateCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.partialUpdateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partialUpdateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes partialUpdateCluster with LRO error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.PartialUpdateClusterRequest() - ); - request.cluster ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.PartialUpdateClusterRequest', ['cluster', 'name']); - request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.partialUpdateCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.partialUpdateCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.partialUpdateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.partialUpdateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkPartialUpdateClusterProgress without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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.checkPartialUpdateClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkPartialUpdateClusterProgress with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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.checkPartialUpdateClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateAppProfile', () => { - it('invokes updateAppProfile without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UpdateAppProfileRequest() - ); - request.appProfile ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UpdateAppProfileRequest', ['appProfile', 'name']); - request.appProfile.name = defaultValue1; - const expectedHeaderRequestParams = `app_profile.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateAppProfile = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateAppProfile(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAppProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAppProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAppProfile without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UpdateAppProfileRequest() - ); - request.appProfile ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UpdateAppProfileRequest', ['appProfile', 'name']); - request.appProfile.name = defaultValue1; - const expectedHeaderRequestParams = `app_profile.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateAppProfile = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateAppProfile( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAppProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAppProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAppProfile with call error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UpdateAppProfileRequest() - ); - request.appProfile ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UpdateAppProfileRequest', ['appProfile', 'name']); - request.appProfile.name = defaultValue1; - const expectedHeaderRequestParams = `app_profile.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAppProfile = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateAppProfile(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAppProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAppProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAppProfile with LRO error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UpdateAppProfileRequest() - ); - request.appProfile ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UpdateAppProfileRequest', ['appProfile', 'name']); - request.appProfile.name = defaultValue1; - const expectedHeaderRequestParams = `app_profile.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAppProfile = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateAppProfile(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateAppProfile as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAppProfile as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateAppProfileProgress without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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.checkUpdateAppProfileProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateAppProfileProgress with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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.checkUpdateAppProfileProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listAppProfiles', () => { - it('invokes listAppProfiles without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListAppProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListAppProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), - generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), - generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), - ]; - client.innerApiCalls.listAppProfiles = stubSimpleCall(expectedResponse); - const [response] = await client.listAppProfiles(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAppProfiles as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAppProfiles as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAppProfiles without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListAppProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListAppProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), - generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), - generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), - ]; - client.innerApiCalls.listAppProfiles = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAppProfiles( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.IAppProfile[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAppProfiles as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAppProfiles as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAppProfiles with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListAppProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListAppProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAppProfiles = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAppProfiles(request), expectedError); - const actualRequest = (client.innerApiCalls.listAppProfiles as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAppProfiles as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAppProfilesStream without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListAppProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListAppProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), - generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), - generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), - ]; - client.descriptors.page.listAppProfiles.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAppProfilesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.bigtable.admin.v2.AppProfile[] = []; - stream.on('data', (response: protos.google.bigtable.admin.v2.AppProfile) => { - 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.listAppProfiles.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAppProfiles, request)); - assert( - (client.descriptors.page.listAppProfiles.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAppProfilesStream with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListAppProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListAppProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAppProfiles.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAppProfilesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.bigtable.admin.v2.AppProfile[] = []; - stream.on('data', (response: protos.google.bigtable.admin.v2.AppProfile) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAppProfiles.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAppProfiles, request)); - assert( - (client.descriptors.page.listAppProfiles.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAppProfiles without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListAppProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListAppProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), - generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), - generateSampleMessage(new protos.google.bigtable.admin.v2.AppProfile()), - ]; - client.descriptors.page.listAppProfiles.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.bigtable.admin.v2.IAppProfile[] = []; - const iterable = client.listAppProfilesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAppProfiles.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAppProfiles.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAppProfiles with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListAppProfilesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListAppProfilesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listAppProfiles.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAppProfilesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.bigtable.admin.v2.IAppProfile[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAppProfiles.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAppProfiles.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listHotTablets', () => { - it('invokes listHotTablets without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListHotTabletsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListHotTabletsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), - generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), - generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), - ]; - client.innerApiCalls.listHotTablets = stubSimpleCall(expectedResponse); - const [response] = await client.listHotTablets(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listHotTablets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHotTablets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listHotTablets without error using callback', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListHotTabletsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListHotTabletsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), - generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), - generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), - ]; - client.innerApiCalls.listHotTablets = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listHotTablets( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.IHotTablet[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listHotTablets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHotTablets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listHotTablets with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListHotTabletsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListHotTabletsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listHotTablets = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listHotTablets(request), expectedError); - const actualRequest = (client.innerApiCalls.listHotTablets as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listHotTablets as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listHotTabletsStream without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListHotTabletsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListHotTabletsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), - generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), - generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), - ]; - client.descriptors.page.listHotTablets.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listHotTabletsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.bigtable.admin.v2.HotTablet[] = []; - stream.on('data', (response: protos.google.bigtable.admin.v2.HotTablet) => { - 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.listHotTablets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listHotTablets, request)); - assert( - (client.descriptors.page.listHotTablets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listHotTabletsStream with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListHotTabletsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListHotTabletsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listHotTablets.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listHotTabletsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.bigtable.admin.v2.HotTablet[] = []; - stream.on('data', (response: protos.google.bigtable.admin.v2.HotTablet) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listHotTablets.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listHotTablets, request)); - assert( - (client.descriptors.page.listHotTablets.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listHotTablets without error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListHotTabletsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListHotTabletsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), - generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), - generateSampleMessage(new protos.google.bigtable.admin.v2.HotTablet()), - ]; - client.descriptors.page.listHotTablets.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.bigtable.admin.v2.IHotTablet[] = []; - const iterable = client.listHotTabletsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listHotTablets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listHotTablets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listHotTablets with error', async () => { - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListHotTabletsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListHotTabletsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listHotTablets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listHotTabletsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.bigtable.admin.v2.IHotTablet[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listHotTablets.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listHotTablets.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('appProfile', () => { - const fakePath = "/rendered/path/appProfile"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - app_profile: "appProfileValue", - }; - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.appProfilePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.appProfilePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('appProfilePath', () => { - const result = client.appProfilePath("projectValue", "instanceValue", "appProfileValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.appProfilePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAppProfileName', () => { - const result = client.matchProjectFromAppProfileName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.appProfilePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromAppProfileName', () => { - const result = client.matchInstanceFromAppProfileName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.appProfilePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppProfileFromAppProfileName', () => { - const result = client.matchAppProfileFromAppProfileName(fakePath); - assert.strictEqual(result, "appProfileValue"); - assert((client.pathTemplates.appProfilePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('backup', () => { - const fakePath = "/rendered/path/backup"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - cluster: "clusterValue", - backup: "backupValue", - }; - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.backupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPath', () => { - const result = client.backupPath("projectValue", "instanceValue", "clusterValue", "backupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupName', () => { - const result = client.matchProjectFromBackupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromBackupName', () => { - const result = client.matchInstanceFromBackupName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromBackupName', () => { - const result = client.matchClusterFromBackupName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupFromBackupName', () => { - const result = client.matchBackupFromBackupName(fakePath); - assert.strictEqual(result, "backupValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('cluster', () => { - const fakePath = "/rendered/path/cluster"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - cluster: "clusterValue", - }; - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.clusterPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.clusterPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('clusterPath', () => { - const result = client.clusterPath("projectValue", "instanceValue", "clusterValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromClusterName', () => { - const result = client.matchProjectFromClusterName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromClusterName', () => { - const result = client.matchInstanceFromClusterName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromClusterName', () => { - const result = client.matchClusterFromClusterName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hotTablet', () => { - const fakePath = "/rendered/path/hotTablet"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - cluster: "clusterValue", - hot_tablet: "hotTabletValue", - }; - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hotTabletPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hotTabletPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hotTabletPath', () => { - const result = client.hotTabletPath("projectValue", "instanceValue", "clusterValue", "hotTabletValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hotTabletPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHotTabletName', () => { - const result = client.matchProjectFromHotTabletName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hotTabletPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromHotTabletName', () => { - const result = client.matchInstanceFromHotTabletName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.hotTabletPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromHotTabletName', () => { - const result = client.matchClusterFromHotTabletName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.hotTabletPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHotTabletFromHotTabletName', () => { - const result = client.matchHotTabletFromHotTabletName(fakePath); - assert.strictEqual(result, "hotTabletValue"); - assert((client.pathTemplates.hotTabletPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - }; - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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", "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('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - 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('snapshot', () => { - const fakePath = "/rendered/path/snapshot"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - cluster: "clusterValue", - snapshot: "snapshotValue", - }; - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.snapshotPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.snapshotPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('snapshotPath', () => { - const result = client.snapshotPath("projectValue", "instanceValue", "clusterValue", "snapshotValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.snapshotPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSnapshotName', () => { - const result = client.matchProjectFromSnapshotName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromSnapshotName', () => { - const result = client.matchInstanceFromSnapshotName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromSnapshotName', () => { - const result = client.matchClusterFromSnapshotName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSnapshotFromSnapshotName', () => { - const result = client.matchSnapshotFromSnapshotName(fakePath); - assert.strictEqual(result, "snapshotValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('table', () => { - const fakePath = "/rendered/path/table"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - table: "tableValue", - }; - const client = new bigtableinstanceadminModule.v2.BigtableInstanceAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tablePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tablePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tablePath', () => { - const result = client.tablePath("projectValue", "instanceValue", "tableValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tablePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTableName', () => { - const result = client.matchProjectFromTableName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tablePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromTableName', () => { - const result = client.matchInstanceFromTableName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.tablePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTableFromTableName', () => { - const result = client.matchTableFromTableName(fakePath); - assert.strictEqual(result, "tableValue"); - assert((client.pathTemplates.tablePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/admin/v2/test/gapic_bigtable_table_admin_v2.ts b/owl-bot-staging/admin/v2/test/gapic_bigtable_table_admin_v2.ts deleted file mode 100644 index ee3f7664b..000000000 --- a/owl-bot-staging/admin/v2/test/gapic_bigtable_table_admin_v2.ts +++ /dev/null @@ -1,3995 +0,0 @@ -// Copyright 2023 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 bigtabletableadminModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} 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('v2.BigtableTableAdminClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = bigtabletableadminModule.v2.BigtableTableAdminClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = bigtabletableadminModule.v2.BigtableTableAdminClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = bigtabletableadminModule.v2.BigtableTableAdminClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.bigtableTableAdminStub, undefined); - await client.initialize(); - assert(client.bigtableTableAdminStub); - }); - - it('has close method for the initialized client', done => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.bigtableTableAdminStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.bigtableTableAdminStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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 bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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('createTable', () => { - it('invokes createTable without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateTableRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Table() - ); - client.innerApiCalls.createTable = stubSimpleCall(expectedResponse); - const [response] = await client.createTable(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTable without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateTableRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Table() - ); - client.innerApiCalls.createTable = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTable( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.ITable|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTable with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateTableRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTable = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createTable(request), expectedError); - const actualRequest = (client.innerApiCalls.createTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTable with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateTableRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createTable(request), expectedError); - }); - }); - - describe('getTable', () => { - it('invokes getTable without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Table() - ); - client.innerApiCalls.getTable = stubSimpleCall(expectedResponse); - const [response] = await client.getTable(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTable without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Table() - ); - client.innerApiCalls.getTable = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getTable( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.ITable|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTable with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getTable = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getTable(request), expectedError); - const actualRequest = (client.innerApiCalls.getTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getTable with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetTableRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getTable(request), expectedError); - }); - }); - - describe('deleteTable', () => { - it('invokes deleteTable without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTable = stubSimpleCall(expectedResponse); - const [response] = await client.deleteTable(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTable without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteTable = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteTable( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTable with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteTable = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteTable(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteTable with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteTableRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteTable(request), expectedError); - }); - }); - - describe('modifyColumnFamilies', () => { - it('invokes modifyColumnFamilies without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ModifyColumnFamiliesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ModifyColumnFamiliesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Table() - ); - client.innerApiCalls.modifyColumnFamilies = stubSimpleCall(expectedResponse); - const [response] = await client.modifyColumnFamilies(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.modifyColumnFamilies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.modifyColumnFamilies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes modifyColumnFamilies without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ModifyColumnFamiliesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ModifyColumnFamiliesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Table() - ); - client.innerApiCalls.modifyColumnFamilies = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.modifyColumnFamilies( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.ITable|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.modifyColumnFamilies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.modifyColumnFamilies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes modifyColumnFamilies with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ModifyColumnFamiliesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ModifyColumnFamiliesRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.modifyColumnFamilies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.modifyColumnFamilies(request), expectedError); - const actualRequest = (client.innerApiCalls.modifyColumnFamilies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.modifyColumnFamilies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes modifyColumnFamilies with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ModifyColumnFamiliesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ModifyColumnFamiliesRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.modifyColumnFamilies(request), expectedError); - }); - }); - - describe('dropRowRange', () => { - it('invokes dropRowRange without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DropRowRangeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DropRowRangeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.dropRowRange = stubSimpleCall(expectedResponse); - const [response] = await client.dropRowRange(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.dropRowRange as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.dropRowRange as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes dropRowRange without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DropRowRangeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DropRowRangeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.dropRowRange = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.dropRowRange( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.dropRowRange as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.dropRowRange as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes dropRowRange with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DropRowRangeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DropRowRangeRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.dropRowRange = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.dropRowRange(request), expectedError); - const actualRequest = (client.innerApiCalls.dropRowRange as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.dropRowRange as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes dropRowRange with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DropRowRangeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DropRowRangeRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.dropRowRange(request), expectedError); - }); - }); - - describe('generateConsistencyToken', () => { - it('invokes generateConsistencyToken without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GenerateConsistencyTokenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GenerateConsistencyTokenRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.GenerateConsistencyTokenResponse() - ); - client.innerApiCalls.generateConsistencyToken = stubSimpleCall(expectedResponse); - const [response] = await client.generateConsistencyToken(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.generateConsistencyToken as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateConsistencyToken as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateConsistencyToken without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GenerateConsistencyTokenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GenerateConsistencyTokenRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.GenerateConsistencyTokenResponse() - ); - client.innerApiCalls.generateConsistencyToken = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.generateConsistencyToken( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.IGenerateConsistencyTokenResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.generateConsistencyToken as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateConsistencyToken as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateConsistencyToken with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GenerateConsistencyTokenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GenerateConsistencyTokenRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.generateConsistencyToken = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.generateConsistencyToken(request), expectedError); - const actualRequest = (client.innerApiCalls.generateConsistencyToken as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateConsistencyToken as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateConsistencyToken with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GenerateConsistencyTokenRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GenerateConsistencyTokenRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.generateConsistencyToken(request), expectedError); - }); - }); - - describe('checkConsistency', () => { - it('invokes checkConsistency without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CheckConsistencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CheckConsistencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.CheckConsistencyResponse() - ); - client.innerApiCalls.checkConsistency = stubSimpleCall(expectedResponse); - const [response] = await client.checkConsistency(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.checkConsistency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkConsistency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkConsistency without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CheckConsistencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CheckConsistencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.CheckConsistencyResponse() - ); - client.innerApiCalls.checkConsistency = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.checkConsistency( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.ICheckConsistencyResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.checkConsistency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkConsistency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkConsistency with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CheckConsistencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CheckConsistencyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.checkConsistency = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkConsistency(request), expectedError); - const actualRequest = (client.innerApiCalls.checkConsistency as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkConsistency as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkConsistency with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CheckConsistencyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CheckConsistencyRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.checkConsistency(request), expectedError); - }); - }); - - describe('getSnapshot', () => { - it('invokes getSnapshot without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetSnapshotRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Snapshot() - ); - client.innerApiCalls.getSnapshot = stubSimpleCall(expectedResponse); - const [response] = await client.getSnapshot(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSnapshot without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetSnapshotRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Snapshot() - ); - client.innerApiCalls.getSnapshot = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSnapshot( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.ISnapshot|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSnapshot with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetSnapshotRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSnapshot = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSnapshot(request), expectedError); - const actualRequest = (client.innerApiCalls.getSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSnapshot with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetSnapshotRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getSnapshot(request), expectedError); - }); - }); - - describe('deleteSnapshot', () => { - it('invokes deleteSnapshot without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteSnapshotRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSnapshot = stubSimpleCall(expectedResponse); - const [response] = await client.deleteSnapshot(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSnapshot without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteSnapshotRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSnapshot = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSnapshot( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSnapshot with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteSnapshotRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSnapshot = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteSnapshot(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSnapshot with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteSnapshotRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteSnapshot(request), expectedError); - }); - }); - - describe('getBackup', () => { - it('invokes getBackup without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Backup() - ); - client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); - const [response] = await client.getBackup(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Backup() - ); - client.innerApiCalls.getBackup = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBackup( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.IBackup|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getBackup(request), expectedError); - }); - }); - - describe('updateBackup', () => { - it('invokes updateBackup without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Backup() - ); - client.innerApiCalls.updateBackup = stubSimpleCall(expectedResponse); - const [response] = await client.updateBackup(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.admin.v2.Backup() - ); - client.innerApiCalls.updateBackup = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateBackup( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.IBackup|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateBackup(request), expectedError); - }); - }); - - describe('deleteBackup', () => { - it('invokes deleteBackup without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteBackup = stubSimpleCall(expectedResponse); - const [response] = await client.deleteBackup(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteBackup = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBackup( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteBackup(request), expectedError); - }); - }); - - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.getIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIamPolicy with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.GetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.GetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getIamPolicy(request), expectedError); - }); - }); - - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.setIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.Policy() - ); - client.innerApiCalls.setIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - (err?: Error|null, result?: protos.google.iam.v1.IPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.setIamPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes setIamPolicy with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.SetIamPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.SetIamPolicyRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.setIamPolicy(request), expectedError); - }); - }); - - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCall(expectedResponse); - const [response] = await client.testIamPermissions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsResponse() - ); - client.innerApiCalls.testIamPermissions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - (err?: Error|null, result?: protos.google.iam.v1.ITestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request), expectedError); - const actualRequest = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.testIamPermissions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes testIamPermissions with closed client', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.iam.v1.TestIamPermissionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.iam.v1.TestIamPermissionsRequest', ['resource']); - request.resource = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.testIamPermissions(request), expectedError); - }); - }); - - describe('createTableFromSnapshot', () => { - it('invokes createTableFromSnapshot without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateTableFromSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateTableFromSnapshotRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createTableFromSnapshot = stubLongRunningCall(expectedResponse); - const [operation] = await client.createTableFromSnapshot(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createTableFromSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTableFromSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTableFromSnapshot without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateTableFromSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateTableFromSnapshotRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createTableFromSnapshot = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createTableFromSnapshot( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createTableFromSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTableFromSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTableFromSnapshot with call error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateTableFromSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateTableFromSnapshotRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTableFromSnapshot = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createTableFromSnapshot(request), expectedError); - const actualRequest = (client.innerApiCalls.createTableFromSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTableFromSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createTableFromSnapshot with LRO error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateTableFromSnapshotRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateTableFromSnapshotRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createTableFromSnapshot = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createTableFromSnapshot(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createTableFromSnapshot as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createTableFromSnapshot as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateTableFromSnapshotProgress without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkCreateTableFromSnapshotProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateTableFromSnapshotProgress with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkCreateTableFromSnapshotProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateTable', () => { - it('invokes updateTable without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UpdateTableRequest() - ); - request.table ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UpdateTableRequest', ['table', 'name']); - request.table.name = defaultValue1; - const expectedHeaderRequestParams = `table.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateTable = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateTable(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateTable without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UpdateTableRequest() - ); - request.table ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UpdateTableRequest', ['table', 'name']); - request.table.name = defaultValue1; - const expectedHeaderRequestParams = `table.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateTable = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateTable( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateTable with call error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UpdateTableRequest() - ); - request.table ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UpdateTableRequest', ['table', 'name']); - request.table.name = defaultValue1; - const expectedHeaderRequestParams = `table.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTable = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateTable(request), expectedError); - const actualRequest = (client.innerApiCalls.updateTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateTable with LRO error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UpdateTableRequest() - ); - request.table ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UpdateTableRequest', ['table', 'name']); - request.table.name = defaultValue1; - const expectedHeaderRequestParams = `table.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateTable = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateTable(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateTableProgress without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkUpdateTableProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateTableProgress with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkUpdateTableProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('undeleteTable', () => { - it('invokes undeleteTable without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UndeleteTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UndeleteTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.undeleteTable = stubLongRunningCall(expectedResponse); - const [operation] = await client.undeleteTable(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.undeleteTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeleteTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeleteTable without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UndeleteTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UndeleteTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.undeleteTable = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.undeleteTable( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.undeleteTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeleteTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeleteTable with call error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UndeleteTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UndeleteTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeleteTable = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.undeleteTable(request), expectedError); - const actualRequest = (client.innerApiCalls.undeleteTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeleteTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes undeleteTable with LRO error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.UndeleteTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.UndeleteTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.undeleteTable = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.undeleteTable(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.undeleteTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.undeleteTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUndeleteTableProgress without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkUndeleteTableProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUndeleteTableProgress with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkUndeleteTableProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('snapshotTable', () => { - it('invokes snapshotTable without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.SnapshotTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.SnapshotTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.snapshotTable = stubLongRunningCall(expectedResponse); - const [operation] = await client.snapshotTable(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.snapshotTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.snapshotTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes snapshotTable without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.SnapshotTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.SnapshotTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.snapshotTable = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.snapshotTable( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.snapshotTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.snapshotTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes snapshotTable with call error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.SnapshotTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.SnapshotTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.snapshotTable = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.snapshotTable(request), expectedError); - const actualRequest = (client.innerApiCalls.snapshotTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.snapshotTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes snapshotTable with LRO error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.SnapshotTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.SnapshotTableRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.snapshotTable = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.snapshotTable(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.snapshotTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.snapshotTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkSnapshotTableProgress without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkSnapshotTableProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkSnapshotTableProgress with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkSnapshotTableProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createBackup', () => { - it('invokes createBackup without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBackup( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup with call error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackup with LRO error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CreateBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CreateBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateBackupProgress without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkCreateBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateBackupProgress with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkCreateBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restoreTable', () => { - it('invokes restoreTable without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.RestoreTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.RestoreTableRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreTable = stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreTable(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreTable without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.RestoreTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.RestoreTableRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreTable = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restoreTable( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreTable with call error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.RestoreTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.RestoreTableRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreTable = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restoreTable(request), expectedError); - const actualRequest = (client.innerApiCalls.restoreTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreTable with LRO error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.RestoreTableRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.RestoreTableRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreTable = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restoreTable(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restoreTable as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreTable as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestoreTableProgress without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkRestoreTableProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestoreTableProgress with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkRestoreTableProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('copyBackup', () => { - it('invokes copyBackup without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CopyBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CopyBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.copyBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.copyBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes copyBackup without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CopyBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CopyBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.copyBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.copyBackup( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes copyBackup with call error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CopyBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CopyBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.copyBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.copyBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes copyBackup with LRO error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.CopyBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.CopyBackupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.copyBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.copyBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.copyBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCopyBackupProgress without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkCopyBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCopyBackupProgress with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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.checkCopyBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listTables', () => { - it('invokes listTables without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListTablesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListTablesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), - ]; - client.innerApiCalls.listTables = stubSimpleCall(expectedResponse); - const [response] = await client.listTables(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTables as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTables as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTables without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListTablesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListTablesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), - ]; - client.innerApiCalls.listTables = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listTables( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.ITable[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listTables as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTables as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTables with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListTablesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListTablesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listTables = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listTables(request), expectedError); - const actualRequest = (client.innerApiCalls.listTables as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listTables as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listTablesStream without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListTablesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListTablesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), - ]; - client.descriptors.page.listTables.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listTablesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.bigtable.admin.v2.Table[] = []; - stream.on('data', (response: protos.google.bigtable.admin.v2.Table) => { - 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.listTables.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTables, request)); - assert( - (client.descriptors.page.listTables.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listTablesStream with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListTablesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListTablesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTables.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listTablesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.bigtable.admin.v2.Table[] = []; - stream.on('data', (response: protos.google.bigtable.admin.v2.Table) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listTables.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listTables, request)); - assert( - (client.descriptors.page.listTables.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTables without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListTablesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListTablesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Table()), - ]; - client.descriptors.page.listTables.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.bigtable.admin.v2.ITable[] = []; - const iterable = client.listTablesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listTables.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTables.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listTables with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListTablesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListTablesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listTables.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listTablesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.bigtable.admin.v2.ITable[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listTables.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listTables.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listSnapshots', () => { - it('invokes listSnapshots without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListSnapshotsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), - ]; - client.innerApiCalls.listSnapshots = stubSimpleCall(expectedResponse); - const [response] = await client.listSnapshots(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSnapshots as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSnapshots as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSnapshots without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListSnapshotsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), - ]; - client.innerApiCalls.listSnapshots = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSnapshots( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.ISnapshot[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSnapshots as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSnapshots as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSnapshots with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListSnapshotsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSnapshots = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSnapshots(request), expectedError); - const actualRequest = (client.innerApiCalls.listSnapshots as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSnapshots as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSnapshotsStream without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListSnapshotsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), - ]; - client.descriptors.page.listSnapshots.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSnapshotsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.bigtable.admin.v2.Snapshot[] = []; - stream.on('data', (response: protos.google.bigtable.admin.v2.Snapshot) => { - 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.listSnapshots.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSnapshots, request)); - assert( - (client.descriptors.page.listSnapshots.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSnapshotsStream with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListSnapshotsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSnapshots.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSnapshotsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.bigtable.admin.v2.Snapshot[] = []; - stream.on('data', (response: protos.google.bigtable.admin.v2.Snapshot) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSnapshots.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSnapshots, request)); - assert( - (client.descriptors.page.listSnapshots.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSnapshots without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListSnapshotsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Snapshot()), - ]; - client.descriptors.page.listSnapshots.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.bigtable.admin.v2.ISnapshot[] = []; - const iterable = client.listSnapshotsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSnapshots with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListSnapshotsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListSnapshotsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listSnapshots.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSnapshotsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.bigtable.admin.v2.ISnapshot[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBackups', () => { - it('invokes listBackups without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), - ]; - client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); - const [response] = await client.listBackups(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackups without error using callback', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), - ]; - client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBackups( - request, - (err?: Error|null, result?: protos.google.bigtable.admin.v2.IBackup[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackups with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBackups = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBackups(request), expectedError); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupsStream without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), - ]; - client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.bigtable.admin.v2.Backup[] = []; - stream.on('data', (response: protos.google.bigtable.admin.v2.Backup) => { - 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.listBackups.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); - assert( - (client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBackupsStream with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackups.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBackupsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.bigtable.admin.v2.Backup[] = []; - stream.on('data', (response: protos.google.bigtable.admin.v2.Backup) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); - assert( - (client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackups without error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), - generateSampleMessage(new protos.google.bigtable.admin.v2.Backup()), - ]; - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.bigtable.admin.v2.IBackup[] = []; - const iterable = client.listBackupsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackups with error', async () => { - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.admin.v2.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.admin.v2.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBackupsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.bigtable.admin.v2.IBackup[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('appProfile', () => { - const fakePath = "/rendered/path/appProfile"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - app_profile: "appProfileValue", - }; - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.appProfilePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.appProfilePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('appProfilePath', () => { - const result = client.appProfilePath("projectValue", "instanceValue", "appProfileValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.appProfilePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromAppProfileName', () => { - const result = client.matchProjectFromAppProfileName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.appProfilePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromAppProfileName', () => { - const result = client.matchInstanceFromAppProfileName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.appProfilePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAppProfileFromAppProfileName', () => { - const result = client.matchAppProfileFromAppProfileName(fakePath); - assert.strictEqual(result, "appProfileValue"); - assert((client.pathTemplates.appProfilePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('backup', () => { - const fakePath = "/rendered/path/backup"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - cluster: "clusterValue", - backup: "backupValue", - }; - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.backupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPath', () => { - const result = client.backupPath("projectValue", "instanceValue", "clusterValue", "backupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupName', () => { - const result = client.matchProjectFromBackupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromBackupName', () => { - const result = client.matchInstanceFromBackupName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromBackupName', () => { - const result = client.matchClusterFromBackupName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupFromBackupName', () => { - const result = client.matchBackupFromBackupName(fakePath); - assert.strictEqual(result, "backupValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('cluster', () => { - const fakePath = "/rendered/path/cluster"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - cluster: "clusterValue", - }; - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.clusterPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.clusterPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('clusterPath', () => { - const result = client.clusterPath("projectValue", "instanceValue", "clusterValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.clusterPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromClusterName', () => { - const result = client.matchProjectFromClusterName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromClusterName', () => { - const result = client.matchInstanceFromClusterName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromClusterName', () => { - const result = client.matchClusterFromClusterName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.clusterPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('hotTablet', () => { - const fakePath = "/rendered/path/hotTablet"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - cluster: "clusterValue", - hot_tablet: "hotTabletValue", - }; - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.hotTabletPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.hotTabletPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('hotTabletPath', () => { - const result = client.hotTabletPath("projectValue", "instanceValue", "clusterValue", "hotTabletValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.hotTabletPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromHotTabletName', () => { - const result = client.matchProjectFromHotTabletName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.hotTabletPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromHotTabletName', () => { - const result = client.matchInstanceFromHotTabletName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.hotTabletPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromHotTabletName', () => { - const result = client.matchClusterFromHotTabletName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.hotTabletPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchHotTabletFromHotTabletName', () => { - const result = client.matchHotTabletFromHotTabletName(fakePath); - assert.strictEqual(result, "hotTabletValue"); - assert((client.pathTemplates.hotTabletPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - }; - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - 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", "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('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('snapshot', () => { - const fakePath = "/rendered/path/snapshot"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - cluster: "clusterValue", - snapshot: "snapshotValue", - }; - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.snapshotPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.snapshotPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('snapshotPath', () => { - const result = client.snapshotPath("projectValue", "instanceValue", "clusterValue", "snapshotValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.snapshotPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSnapshotName', () => { - const result = client.matchProjectFromSnapshotName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromSnapshotName', () => { - const result = client.matchInstanceFromSnapshotName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromSnapshotName', () => { - const result = client.matchClusterFromSnapshotName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSnapshotFromSnapshotName', () => { - const result = client.matchSnapshotFromSnapshotName(fakePath); - assert.strictEqual(result, "snapshotValue"); - assert((client.pathTemplates.snapshotPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('table', () => { - const fakePath = "/rendered/path/table"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - table: "tableValue", - }; - const client = new bigtabletableadminModule.v2.BigtableTableAdminClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tablePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tablePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tablePath', () => { - const result = client.tablePath("projectValue", "instanceValue", "tableValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tablePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTableName', () => { - const result = client.matchProjectFromTableName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tablePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromTableName', () => { - const result = client.matchInstanceFromTableName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.tablePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTableFromTableName', () => { - const result = client.matchTableFromTableName(fakePath); - assert.strictEqual(result, "tableValue"); - assert((client.pathTemplates.tablePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/admin/v2/tsconfig.json b/owl-bot-staging/admin/v2/tsconfig.json deleted file mode 100644 index c78f1c884..000000000 --- a/owl-bot-staging/admin/v2/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/admin/v2/webpack.config.js b/owl-bot-staging/admin/v2/webpack.config.js deleted file mode 100644 index 9b488aad8..000000000 --- a/owl-bot-staging/admin/v2/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'bigtable', - filename: './bigtable.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/v2/.eslintignore b/owl-bot-staging/v2/.eslintignore deleted file mode 100644 index cfc348ec4..000000000 --- a/owl-bot-staging/v2/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/v2/.eslintrc.json b/owl-bot-staging/v2/.eslintrc.json deleted file mode 100644 index 782153495..000000000 --- a/owl-bot-staging/v2/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v2/.gitignore b/owl-bot-staging/v2/.gitignore deleted file mode 100644 index d4f03a0df..000000000 --- a/owl-bot-staging/v2/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -/.coverage -/coverage -/.nyc_output -/docs/ -/out/ -/build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/v2/.jsdoc.js b/owl-bot-staging/v2/.jsdoc.js deleted file mode 100644 index 3b3569bb7..000000000 --- a/owl-bot-staging/v2/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2023 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'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2023 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/bigtable', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v2/.mocharc.js b/owl-bot-staging/v2/.mocharc.js deleted file mode 100644 index 1a38f257d..000000000 --- a/owl-bot-staging/v2/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2023 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. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/v2/.prettierrc.js b/owl-bot-staging/v2/.prettierrc.js deleted file mode 100644 index 55639e70f..000000000 --- a/owl-bot-staging/v2/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 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. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/v2/README.md b/owl-bot-staging/v2/README.md deleted file mode 100644 index c464f1223..000000000 --- a/owl-bot-staging/v2/README.md +++ /dev/null @@ -1 +0,0 @@ -Bigtable: Nodejs Client diff --git a/owl-bot-staging/v2/package.json b/owl-bot-staging/v2/package.json deleted file mode 100644 index b066e4c54..000000000 --- a/owl-bot-staging/v2/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@google-cloud/bigtable", - "version": "0.1.0", - "description": "Bigtable client for Node.js", - "repository": "googleapis/nodejs-bigtable", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google bigtable", - "bigtable", - "bigtable" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^4.0.3" - }, - "devDependencies": { - "@types/mocha": "^10.0.1", - "@types/node": "^18.11.18", - "@types/sinon": "^10.0.16", - "c8": "^8.0.1", - "gapic-tools": "^0.1.8", - "gts": "5.0.1", - "jsdoc": "^4.0.2", - "jsdoc-region-tag": "^3.0.0", - "jsdoc-fresh": "^3.0.0", - "mocha": "^10.2.0", - "pack-n-play": "^1.0.0-2", - "sinon": "^15.2.0", - "typescript": "5.1.6" - }, - "engines": { - "node": ">=v14" - } -} diff --git a/owl-bot-staging/v2/protos/google/bigtable/v2/bigtable.proto b/owl-bot-staging/v2/protos/google/bigtable/v2/bigtable.proto deleted file mode 100644 index aca13f586..000000000 --- a/owl-bot-staging/v2/protos/google/bigtable/v2/bigtable.proto +++ /dev/null @@ -1,875 +0,0 @@ -// Copyright 2023 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.bigtable.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/api/routing.proto"; -import "google/bigtable/v2/data.proto"; -import "google/bigtable/v2/request_stats.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.Bigtable.V2"; -option go_package = "google.golang.org/genproto/googleapis/bigtable/v2;bigtable"; -option java_multiple_files = true; -option java_outer_classname = "BigtableProto"; -option java_package = "com.google.bigtable.v2"; -option php_namespace = "Google\\Cloud\\Bigtable\\V2"; -option ruby_package = "Google::Cloud::Bigtable::V2"; -option (google.api.resource_definition) = { - type: "bigtableadmin.googleapis.com/Instance" - pattern: "projects/{project}/instances/{instance}" -}; -option (google.api.resource_definition) = { - type: "bigtableadmin.googleapis.com/Table" - pattern: "projects/{project}/instances/{instance}/tables/{table}" -}; - -// Service for reading from and writing to existing Bigtable tables. -service Bigtable { - option (google.api.default_host) = "bigtable.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/bigtable.data," - "https://www.googleapis.com/auth/bigtable.data.readonly," - "https://www.googleapis.com/auth/cloud-bigtable.data," - "https://www.googleapis.com/auth/cloud-bigtable.data.readonly," - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/cloud-platform.read-only"; - - // Streams back the contents of all requested rows in key order, optionally - // applying the same Reader filter to each. Depending on their size, - // rows and cells may be broken up across multiple responses, but - // atomicity of each row will still be preserved. See the - // ReadRowsResponse documentation for details. - rpc ReadRows(ReadRowsRequest) returns (stream ReadRowsResponse) { - option (google.api.http) = { - post: "/v2/{table_name=projects/*/instances/*/tables/*}:readRows" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { - field: "table_name" - path_template: "{table_name=projects/*/instances/*/tables/*}" - } - routing_parameters { field: "app_profile_id" } - }; - option (google.api.method_signature) = "table_name"; - option (google.api.method_signature) = "table_name,app_profile_id"; - } - - // Returns a sample of row keys in the table. The returned row keys will - // delimit contiguous sections of the table of approximately equal size, - // which can be used to break up the data for distributed tasks like - // mapreduces. - rpc SampleRowKeys(SampleRowKeysRequest) - returns (stream SampleRowKeysResponse) { - option (google.api.http) = { - get: "/v2/{table_name=projects/*/instances/*/tables/*}:sampleRowKeys" - }; - option (google.api.routing) = { - routing_parameters { - field: "table_name" - path_template: "{table_name=projects/*/instances/*/tables/*}" - } - routing_parameters { field: "app_profile_id" } - }; - option (google.api.method_signature) = "table_name"; - option (google.api.method_signature) = "table_name,app_profile_id"; - } - - // Mutates a row atomically. Cells already present in the row are left - // unchanged unless explicitly changed by `mutation`. - rpc MutateRow(MutateRowRequest) returns (MutateRowResponse) { - option (google.api.http) = { - post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRow" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { - field: "table_name" - path_template: "{table_name=projects/*/instances/*/tables/*}" - } - routing_parameters { field: "app_profile_id" } - }; - option (google.api.method_signature) = "table_name,row_key,mutations"; - option (google.api.method_signature) = - "table_name,row_key,mutations,app_profile_id"; - } - - // Mutates multiple rows in a batch. Each individual row is mutated - // atomically as in MutateRow, but the entire batch is not executed - // atomically. - rpc MutateRows(MutateRowsRequest) returns (stream MutateRowsResponse) { - option (google.api.http) = { - post: "/v2/{table_name=projects/*/instances/*/tables/*}:mutateRows" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { - field: "table_name" - path_template: "{table_name=projects/*/instances/*/tables/*}" - } - routing_parameters { field: "app_profile_id" } - }; - option (google.api.method_signature) = "table_name,entries"; - option (google.api.method_signature) = "table_name,entries,app_profile_id"; - } - - // Mutates a row atomically based on the output of a predicate Reader filter. - rpc CheckAndMutateRow(CheckAndMutateRowRequest) - returns (CheckAndMutateRowResponse) { - option (google.api.http) = { - post: "/v2/{table_name=projects/*/instances/*/tables/*}:checkAndMutateRow" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { - field: "table_name" - path_template: "{table_name=projects/*/instances/*/tables/*}" - } - routing_parameters { field: "app_profile_id" } - }; - option (google.api.method_signature) = - "table_name,row_key,predicate_filter,true_mutations,false_mutations"; - option (google.api.method_signature) = - "table_name,row_key,predicate_filter,true_mutations,false_mutations,app_profile_id"; - } - - // Warm up associated instance metadata for this connection. - // This call is not required but may be useful for connection keep-alive. - rpc PingAndWarm(PingAndWarmRequest) returns (PingAndWarmResponse) { - option (google.api.http) = { - post: "/v2/{name=projects/*/instances/*}:ping" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { - field: "name" - path_template: "{name=projects/*/instances/*}" - } - routing_parameters { field: "app_profile_id" } - }; - option (google.api.method_signature) = "name"; - option (google.api.method_signature) = "name,app_profile_id"; - } - - // Modifies a row atomically on the server. The method reads the latest - // existing timestamp and value from the specified columns and writes a new - // entry based on pre-defined read/modify/write rules. The new value for the - // timestamp is the greater of the existing timestamp or the current server - // time. The method returns the new contents of all modified cells. - rpc ReadModifyWriteRow(ReadModifyWriteRowRequest) - returns (ReadModifyWriteRowResponse) { - option (google.api.http) = { - post: "/v2/{table_name=projects/*/instances/*/tables/*}:readModifyWriteRow" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { - field: "table_name" - path_template: "{table_name=projects/*/instances/*/tables/*}" - } - routing_parameters { field: "app_profile_id" } - }; - option (google.api.method_signature) = "table_name,row_key,rules"; - option (google.api.method_signature) = - "table_name,row_key,rules,app_profile_id"; - } - - // NOTE: This API is intended to be used by Apache Beam BigtableIO. - // Returns the current list of partitions that make up the table's - // change stream. The union of partitions will cover the entire keyspace. - // Partitions can be read with `ReadChangeStream`. - rpc GenerateInitialChangeStreamPartitions( - GenerateInitialChangeStreamPartitionsRequest) - returns (stream GenerateInitialChangeStreamPartitionsResponse) { - option (google.api.http) = { - post: "/v2/{table_name=projects/*/instances/*/tables/*}:generateInitialChangeStreamPartitions" - body: "*" - }; - option (google.api.method_signature) = "table_name"; - option (google.api.method_signature) = "table_name,app_profile_id"; - } - - // NOTE: This API is intended to be used by Apache Beam BigtableIO. - // Reads changes from a table's change stream. Changes will - // reflect both user-initiated mutations and mutations that are caused by - // garbage collection. - rpc ReadChangeStream(ReadChangeStreamRequest) - returns (stream ReadChangeStreamResponse) { - option (google.api.http) = { - post: "/v2/{table_name=projects/*/instances/*/tables/*}:readChangeStream" - body: "*" - }; - option (google.api.method_signature) = "table_name"; - option (google.api.method_signature) = "table_name,app_profile_id"; - } -} - -// Request message for Bigtable.ReadRows. -message ReadRowsRequest { - // The desired view into RequestStats that should be returned in the response. - // - // See also: RequestStats message. - enum RequestStatsView { - // The default / unset value. The API will default to the NONE option below. - REQUEST_STATS_VIEW_UNSPECIFIED = 0; - - // Do not include any RequestStats in the response. This will leave the - // RequestStats embedded message unset in the response. - REQUEST_STATS_NONE = 1; - - // Include the full set of available RequestStats in the response, - // applicable to this read. - REQUEST_STATS_FULL = 2; - } - - // Required. The unique name of the table from which to read. - // Values are of the form - // `projects//instances//tables/
include:samples/generated/v2/bigtable_instance_admin.get_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.list_instances.jsinclude:samples/generated/v2/bigtable_instance_admin.update_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.delete_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.get_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.list_clusters.jsinclude:samples/generated/v2/bigtable_instance_admin.delete_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.create_app_profile.jsinclude:samples/generated/v2/bigtable_instance_admin.get_app_profile.jsinclude:samples/generated/v2/bigtable_instance_admin.delete_app_profile.jsinclude:samples/generated/v2/bigtable_instance_admin.get_iam_policy.jsinclude:samples/generated/v2/bigtable_instance_admin.set_iam_policy.jsinclude:samples/generated/v2/bigtable_instance_admin.test_iam_permissions.jsinclude:samples/generated/v2/bigtable_instance_admin.create_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.create_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.partial_update_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.partial_update_instance.jsinclude:samples/generated/v2/bigtable_instance_admin.create_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.create_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.update_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.update_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.partial_update_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.partial_update_cluster.jsinclude:samples/generated/v2/bigtable_instance_admin.update_app_profile.jsinclude:samples/generated/v2/bigtable_instance_admin.update_app_profile.jsinclude:samples/generated/v2/bigtable_instance_admin.list_app_profiles.jsinclude:samples/generated/v2/bigtable_instance_admin.list_hot_tablets.jsinclude:samples/generated/v2/bigtable_table_admin.create_table.jsinclude:samples/generated/v2/bigtable_table_admin.get_table.jsinclude:samples/generated/v2/bigtable_table_admin.delete_table.jsinclude:samples/generated/v2/bigtable_table_admin.modify_column_families.jsinclude:samples/generated/v2/bigtable_table_admin.drop_row_range.jsinclude:samples/generated/v2/bigtable_table_admin.generate_consistency_token.jsinclude:samples/generated/v2/bigtable_table_admin.check_consistency.jsinclude:samples/generated/v2/bigtable_table_admin.get_snapshot.jsinclude:samples/generated/v2/bigtable_table_admin.delete_snapshot.jsinclude:samples/generated/v2/bigtable_table_admin.get_backup.jsinclude:samples/generated/v2/bigtable_table_admin.update_backup.jsinclude:samples/generated/v2/bigtable_table_admin.delete_backup.jsinclude:samples/generated/v2/bigtable_table_admin.get_iam_policy.jsinclude:samples/generated/v2/bigtable_table_admin.set_iam_policy.jsinclude:samples/generated/v2/bigtable_table_admin.test_iam_permissions.jsinclude:samples/generated/v2/bigtable_table_admin.create_table_from_snapshot.jsinclude:samples/generated/v2/bigtable_table_admin.create_table_from_snapshot.jsinclude:samples/generated/v2/bigtable_table_admin.update_table.jsinclude:samples/generated/v2/bigtable_table_admin.update_table.jsinclude:samples/generated/v2/bigtable_table_admin.undelete_table.jsinclude:samples/generated/v2/bigtable_table_admin.undelete_table.jsinclude:samples/generated/v2/bigtable_table_admin.snapshot_table.jsinclude:samples/generated/v2/bigtable_table_admin.snapshot_table.jsinclude:samples/generated/v2/bigtable_table_admin.create_backup.jsinclude:samples/generated/v2/bigtable_table_admin.create_backup.jsinclude:samples/generated/v2/bigtable_table_admin.restore_table.jsinclude:samples/generated/v2/bigtable_table_admin.restore_table.jsinclude:samples/generated/v2/bigtable_table_admin.copy_backup.jsinclude:samples/generated/v2/bigtable_table_admin.copy_backup.jsinclude:samples/generated/v2/bigtable_table_admin.list_tables.jsinclude:samples/generated/v2/bigtable_table_admin.list_snapshots.jsinclude:samples/generated/v2/bigtable_table_admin.list_backups.js
`. - string table_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; - - // This value specifies routing for replication. If not specified, the - // "default" application profile will be used. - string app_profile_id = 5; - - // The row keys and/or ranges to read sequentially. If not specified, reads - // from all rows. - RowSet rows = 2; - - // The filter to apply to the contents of the specified row(s). If unset, - // reads the entirety of each row. - RowFilter filter = 3; - - // The read will stop after committing to N rows' worth of results. The - // default (zero) is to return all results. - int64 rows_limit = 4; - - // The view into RequestStats, as described above. - RequestStatsView request_stats_view = 6; - - // Experimental API - Please note that this API is currently experimental - // and can change in the future. - // - // Return rows in lexiographical descending order of the row keys. The row - // contents will not be affected by this flag. - // - // Example result set: - // - // [ - // {key: "k2", "f:col1": "v1", "f:col2": "v1"}, - // {key: "k1", "f:col1": "v2", "f:col2": "v2"} - // ] - bool reversed = 7; -} - -// Response message for Bigtable.ReadRows. -message ReadRowsResponse { - // Specifies a piece of a row's contents returned as part of the read - // response stream. - message CellChunk { - // The row key for this chunk of data. If the row key is empty, - // this CellChunk is a continuation of the same row as the previous - // CellChunk in the response stream, even if that CellChunk was in a - // previous ReadRowsResponse message. - bytes row_key = 1; - - // The column family name for this chunk of data. If this message - // is not present this CellChunk is a continuation of the same column - // family as the previous CellChunk. The empty string can occur as a - // column family name in a response so clients must check - // explicitly for the presence of this message, not just for - // `family_name.value` being non-empty. - google.protobuf.StringValue family_name = 2; - - // The column qualifier for this chunk of data. If this message - // is not present, this CellChunk is a continuation of the same column - // as the previous CellChunk. Column qualifiers may be empty so - // clients must check for the presence of this message, not just - // for `qualifier.value` being non-empty. - google.protobuf.BytesValue qualifier = 3; - - // The cell's stored timestamp, which also uniquely identifies it - // within its column. Values are always expressed in - // microseconds, but individual tables may set a coarser - // granularity to further restrict the allowed values. For - // example, a table which specifies millisecond granularity will - // only allow values of `timestamp_micros` which are multiples of - // 1000. Timestamps are only set in the first CellChunk per cell - // (for cells split into multiple chunks). - int64 timestamp_micros = 4; - - // Labels applied to the cell by a - // [RowFilter][google.bigtable.v2.RowFilter]. Labels are only set - // on the first CellChunk per cell. - repeated string labels = 5; - - // The value stored in the cell. Cell values can be split across - // multiple CellChunks. In that case only the value field will be - // set in CellChunks after the first: the timestamp and labels - // will only be present in the first CellChunk, even if the first - // CellChunk came in a previous ReadRowsResponse. - bytes value = 6; - - // If this CellChunk is part of a chunked cell value and this is - // not the final chunk of that cell, value_size will be set to the - // total length of the cell value. The client can use this size - // to pre-allocate memory to hold the full cell value. - int32 value_size = 7; - - // Signals to the client concerning previous CellChunks received. - oneof row_status { - // Indicates that the client should drop all previous chunks for - // `row_key`, as it will be re-read from the beginning. - bool reset_row = 8; - - // Indicates that the client can safely process all previous chunks for - // `row_key`, as its data has been fully read. - bool commit_row = 9; - } - } - - // A collection of a row's contents as part of the read request. - repeated CellChunk chunks = 1; - - // Optionally the server might return the row key of the last row it - // has scanned. The client can use this to construct a more - // efficient retry request if needed: any row keys or portions of - // ranges less than this row key can be dropped from the request. - // This is primarily useful for cases where the server has read a - // lot of data that was filtered out since the last committed row - // key, allowing the client to skip that work on a retry. - bytes last_scanned_row_key = 2; - - // - // If requested, provide enhanced query performance statistics. The semantics - // dictate: - // * request_stats is empty on every (streamed) response, except - // * request_stats has non-empty information after all chunks have been - // streamed, where the ReadRowsResponse message only contains - // request_stats. - // * For example, if a read request would have returned an empty - // response instead a single ReadRowsResponse is streamed with empty - // chunks and request_stats filled. - // - // Visually, response messages will stream as follows: - // ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}} - // \______________________/ \________________________________/ - // Primary response Trailer of RequestStats info - // - // Or if the read did not return any values: - // {chunks: [], request_stats: {...}} - // \________________________________/ - // Trailer of RequestStats info - RequestStats request_stats = 3; -} - -// Request message for Bigtable.SampleRowKeys. -message SampleRowKeysRequest { - // Required. The unique name of the table from which to sample row keys. - // Values are of the form - // `projects//instances//tables/
`. - string table_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; - - // This value specifies routing for replication. If not specified, the - // "default" application profile will be used. - string app_profile_id = 2; -} - -// Response message for Bigtable.SampleRowKeys. -message SampleRowKeysResponse { - // Sorted streamed sequence of sample row keys in the table. The table might - // have contents before the first row key in the list and after the last one, - // but a key containing the empty string indicates "end of table" and will be - // the last response given, if present. - // Note that row keys in this list may not have ever been written to or read - // from, and users should therefore not make any assumptions about the row key - // structure that are specific to their use case. - bytes row_key = 1; - - // Approximate total storage space used by all rows in the table which precede - // `row_key`. Buffering the contents of all rows between two subsequent - // samples would require space roughly equal to the difference in their - // `offset_bytes` fields. - int64 offset_bytes = 2; -} - -// Request message for Bigtable.MutateRow. -message MutateRowRequest { - // Required. The unique name of the table to which the mutation should be - // applied. Values are of the form - // `projects//instances//tables/
`. - string table_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; - - // This value specifies routing for replication. If not specified, the - // "default" application profile will be used. - string app_profile_id = 4; - - // Required. The key of the row to which the mutation should be applied. - bytes row_key = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Changes to be atomically applied to the specified row. Entries - // are applied in order, meaning that earlier mutations can be masked by later - // ones. Must contain at least one entry and at most 100000. - repeated Mutation mutations = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for Bigtable.MutateRow. -message MutateRowResponse {} - -// Request message for BigtableService.MutateRows. -message MutateRowsRequest { - // A mutation for a given row. - message Entry { - // The key of the row to which the `mutations` should be applied. - bytes row_key = 1; - - // Required. Changes to be atomically applied to the specified row. - // Mutations are applied in order, meaning that earlier mutations can be - // masked by later ones. You must specify at least one mutation. - repeated Mutation mutations = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Required. The unique name of the table to which the mutations should be - // applied. - string table_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; - - // This value specifies routing for replication. If not specified, the - // "default" application profile will be used. - string app_profile_id = 3; - - // Required. The row keys and corresponding mutations to be applied in bulk. - // Each entry is applied as an atomic mutation, but the entries may be - // applied in arbitrary order (even between entries for the same row). - // At least one entry must be specified, and in total the entries can - // contain at most 100000 mutations. - repeated Entry entries = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for BigtableService.MutateRows. -message MutateRowsResponse { - // The result of applying a passed mutation in the original request. - message Entry { - // The index into the original request's `entries` list of the Entry - // for which a result is being reported. - int64 index = 1; - - // The result of the request Entry identified by `index`. - // Depending on how requests are batched during execution, it is possible - // for one Entry to fail due to an error with another Entry. In the event - // that this occurs, the same error will be reported for both entries. - google.rpc.Status status = 2; - } - - // One or more results for Entries from the batch request. - repeated Entry entries = 1; - - // Information about how client should limit the rate (QPS). Primirily used by - // supported official Cloud Bigtable clients. If unset, the rate limit info is - // not provided by the server. - optional RateLimitInfo rate_limit_info = 3; -} - -// Information about how client should adjust the load to Bigtable. -message RateLimitInfo { - // Time that clients should wait before adjusting the target rate again. - // If clients adjust rate too frequently, the impact of the previous - // adjustment may not have been taken into account and may - // over-throttle or under-throttle. If clients adjust rate too slowly, they - // will not be responsive to load changes on server side, and may - // over-throttle or under-throttle. - google.protobuf.Duration period = 1; - - // If it has been at least one `period` since the last load adjustment, the - // client should multiply the current load by this value to get the new target - // load. For example, if the current load is 100 and `factor` is 0.8, the new - // target load should be 80. After adjusting, the client should ignore - // `factor` until another `period` has passed. - // - // The client can measure its load using any unit that's comparable over time - // For example, QPS can be used as long as each request involves a similar - // amount of work. - double factor = 2; -} - -// Request message for Bigtable.CheckAndMutateRow. -message CheckAndMutateRowRequest { - // Required. The unique name of the table to which the conditional mutation - // should be applied. Values are of the form - // `projects//instances//tables/
`. - string table_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; - - // This value specifies routing for replication. If not specified, the - // "default" application profile will be used. - string app_profile_id = 7; - - // Required. The key of the row to which the conditional mutation should be - // applied. - bytes row_key = 2 [(google.api.field_behavior) = REQUIRED]; - - // The filter to be applied to the contents of the specified row. Depending - // on whether or not any results are yielded, either `true_mutations` or - // `false_mutations` will be executed. If unset, checks that the row contains - // any values at all. - RowFilter predicate_filter = 6; - - // Changes to be atomically applied to the specified row if `predicate_filter` - // yields at least one cell when applied to `row_key`. Entries are applied in - // order, meaning that earlier mutations can be masked by later ones. - // Must contain at least one entry if `false_mutations` is empty, and at most - // 100000. - repeated Mutation true_mutations = 4; - - // Changes to be atomically applied to the specified row if `predicate_filter` - // does not yield any cells when applied to `row_key`. Entries are applied in - // order, meaning that earlier mutations can be masked by later ones. - // Must contain at least one entry if `true_mutations` is empty, and at most - // 100000. - repeated Mutation false_mutations = 5; -} - -// Response message for Bigtable.CheckAndMutateRow. -message CheckAndMutateRowResponse { - // Whether or not the request's `predicate_filter` yielded any results for - // the specified row. - bool predicate_matched = 1; -} - -// Request message for client connection keep-alive and warming. -message PingAndWarmRequest { - // Required. The unique name of the instance to check permissions for as well - // as respond. Values are of the form - // `projects//instances/`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Instance" - } - ]; - - // This value specifies routing for replication. If not specified, the - // "default" application profile will be used. - string app_profile_id = 2; -} - -// Response message for Bigtable.PingAndWarm connection keepalive and warming. -message PingAndWarmResponse {} - -// Request message for Bigtable.ReadModifyWriteRow. -message ReadModifyWriteRowRequest { - // Required. The unique name of the table to which the read/modify/write rules - // should be applied. Values are of the form - // `projects//instances//tables/
`. - string table_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; - - // This value specifies routing for replication. If not specified, the - // "default" application profile will be used. - string app_profile_id = 4; - - // Required. The key of the row to which the read/modify/write rules should be - // applied. - bytes row_key = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Rules specifying how the specified row's contents are to be - // transformed into writes. Entries are applied in order, meaning that earlier - // rules will affect the results of later ones. - repeated ReadModifyWriteRule rules = 3 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for Bigtable.ReadModifyWriteRow. -message ReadModifyWriteRowResponse { - // A Row containing the new contents of all cells modified by the request. - Row row = 1; -} - -// NOTE: This API is intended to be used by Apache Beam BigtableIO. -// Request message for Bigtable.GenerateInitialChangeStreamPartitions. -message GenerateInitialChangeStreamPartitionsRequest { - // Required. The unique name of the table from which to get change stream - // partitions. Values are of the form - // `projects//instances//tables/
`. - // Change streaming must be enabled on the table. - string table_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; - - // This value specifies routing for replication. If not specified, the - // "default" application profile will be used. - // Single cluster routing must be configured on the profile. - string app_profile_id = 2; -} - -// NOTE: This API is intended to be used by Apache Beam BigtableIO. -// Response message for Bigtable.GenerateInitialChangeStreamPartitions. -message GenerateInitialChangeStreamPartitionsResponse { - // A partition of the change stream. - StreamPartition partition = 1; -} - -// NOTE: This API is intended to be used by Apache Beam BigtableIO. -// Request message for Bigtable.ReadChangeStream. -message ReadChangeStreamRequest { - // Required. The unique name of the table from which to read a change stream. - // Values are of the form - // `projects//instances//tables/
`. - // Change streaming must be enabled on the table. - string table_name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "bigtableadmin.googleapis.com/Table" - } - ]; - - // This value specifies routing for replication. If not specified, the - // "default" application profile will be used. - // Single cluster routing must be configured on the profile. - string app_profile_id = 2; - - // The partition to read changes from. - StreamPartition partition = 3; - - // Options for describing where we want to start reading from the stream. - oneof start_from { - // Start reading the stream at the specified timestamp. This timestamp must - // be within the change stream retention period, less than or equal to the - // current time, and after change stream creation, whichever is greater. - // This value is inclusive and will be truncated to microsecond granularity. - google.protobuf.Timestamp start_time = 4; - - // Tokens that describe how to resume reading a stream where reading - // previously left off. If specified, changes will be read starting at the - // the position. Tokens are delivered on the stream as part of `Heartbeat` - // and `CloseStream` messages. - // - // If a single token is provided, the token’s partition must exactly match - // the request’s partition. If multiple tokens are provided, as in the case - // of a partition merge, the union of the token partitions must exactly - // cover the request’s partition. Otherwise, INVALID_ARGUMENT will be - // returned. - StreamContinuationTokens continuation_tokens = 6; - } - - // If specified, OK will be returned when the stream advances beyond - // this time. Otherwise, changes will be continuously delivered on the stream. - // This value is inclusive and will be truncated to microsecond granularity. - google.protobuf.Timestamp end_time = 5; - - // If specified, the duration between `Heartbeat` messages on the stream. - // Otherwise, defaults to 5 seconds. - google.protobuf.Duration heartbeat_duration = 7; -} - -// NOTE: This API is intended to be used by Apache Beam BigtableIO. -// Response message for Bigtable.ReadChangeStream. -message ReadChangeStreamResponse { - // A partial or complete mutation. - message MutationChunk { - // Information about the chunking of this mutation. - // Only `SetCell` mutations can be chunked, and all chunks for a `SetCell` - // will be delivered contiguously with no other mutation types interleaved. - message ChunkInfo { - // The total value size of all the chunks that make up the `SetCell`. - int32 chunked_value_size = 1; - - // The byte offset of this chunk into the total value size of the - // mutation. - int32 chunked_value_offset = 2; - - // When true, this is the last chunk of a chunked `SetCell`. - bool last_chunk = 3; - } - - // If set, then the mutation is a `SetCell` with a chunked value across - // multiple messages. - ChunkInfo chunk_info = 1; - - // If this is a continuation of a chunked message (`chunked_value_offset` > - // 0), ignore all fields except the `SetCell`'s value and merge it with - // the previous message by concatenating the value fields. - Mutation mutation = 2; - } - - // A message corresponding to one or more mutations to the partition - // being streamed. A single logical `DataChange` message may also be split - // across a sequence of multiple individual messages. Messages other than - // the first in a sequence will only have the `type` and `chunks` fields - // populated, with the final message in the sequence also containing `done` - // set to true. - message DataChange { - // The type of mutation. - enum Type { - // The type is unspecified. - TYPE_UNSPECIFIED = 0; - - // A user-initiated mutation. - USER = 1; - - // A system-initiated mutation as part of garbage collection. - // https://cloud.google.com/bigtable/docs/garbage-collection - GARBAGE_COLLECTION = 2; - - // This is a continuation of a multi-message change. - CONTINUATION = 3; - } - - // The type of the mutation. - Type type = 1; - - // The cluster where the mutation was applied. - // Not set when `type` is `GARBAGE_COLLECTION`. - string source_cluster_id = 2; - - // The row key for all mutations that are part of this `DataChange`. - // If the `DataChange` is chunked across multiple messages, then this field - // will only be set for the first message. - bytes row_key = 3; - - // The timestamp at which the mutation was applied on the Bigtable server. - google.protobuf.Timestamp commit_timestamp = 4; - - // A value that lets stream consumers reconstruct Bigtable's - // conflict resolution semantics. - // https://cloud.google.com/bigtable/docs/writes#conflict-resolution - // In the event that the same row key, column family, column qualifier, - // timestamp are modified on different clusters at the same - // `commit_timestamp`, the mutation with the larger `tiebreaker` will be the - // one chosen for the eventually consistent state of the system. - int32 tiebreaker = 5; - - // The mutations associated with this change to the partition. - // May contain complete mutations or chunks of a multi-message chunked - // `DataChange` record. - repeated MutationChunk chunks = 6; - - // When true, indicates that the entire `DataChange` has been read - // and the client can safely process the message. - bool done = 8; - - // An encoded position for this stream's partition to restart reading from. - // This token is for the StreamPartition from the request. - string token = 9; - - // An estimate of the commit timestamp that is usually lower than or equal - // to any timestamp for a record that will be delivered in the future on the - // stream. It is possible that, under particular circumstances that a future - // record has a timestamp is is lower than a previously seen timestamp. For - // an example usage see - // https://beam.apache.org/documentation/basics/#watermarks - google.protobuf.Timestamp estimated_low_watermark = 10; - } - - // A periodic message with information that can be used to checkpoint - // the state of a stream. - message Heartbeat { - // A token that can be provided to a subsequent `ReadChangeStream` call - // to pick up reading at the current stream position. - StreamContinuationToken continuation_token = 1; - - // An estimate of the commit timestamp that is usually lower than or equal - // to any timestamp for a record that will be delivered in the future on the - // stream. It is possible that, under particular circumstances that a future - // record has a timestamp is is lower than a previously seen timestamp. For - // an example usage see - // https://beam.apache.org/documentation/basics/#watermarks - google.protobuf.Timestamp estimated_low_watermark = 2; - } - - // A message indicating that the client should stop reading from the stream. - // If status is OK and `continuation_tokens` & `new_partitions` are empty, the - // stream has finished (for example if there was an `end_time` specified). - // If `continuation_tokens` & `new_partitions` are present, then a change in - // partitioning requires the client to open a new stream for each token to - // resume reading. Example: - // [B, D) ends - // | - // v - // new_partitions: [A, C) [C, E) - // continuation_tokens.partitions: [B,C) [C,D) - // ^---^ ^---^ - // ^ ^ - // | | - // | StreamContinuationToken 2 - // | - // StreamContinuationToken 1 - // To read the new partition [A,C), supply the continuation tokens whose - // ranges cover the new partition, for example ContinuationToken[A,B) & - // ContinuationToken[B,C). - message CloseStream { - // The status of the stream. - google.rpc.Status status = 1; - - // If non-empty, contains the information needed to resume reading their - // associated partitions. - repeated StreamContinuationToken continuation_tokens = 2; - - // If non-empty, contains the new partitions to start reading from, which - // are related to but not necessarily identical to the partitions for the - // above `continuation_tokens`. - repeated StreamPartition new_partitions = 3; - } - - // The data or control message on the stream. - oneof stream_record { - // A mutation to the partition. - DataChange data_change = 1; - - // A periodic heartbeat message. - Heartbeat heartbeat = 2; - - // An indication that the stream should be closed. - CloseStream close_stream = 3; - } -} diff --git a/owl-bot-staging/v2/protos/google/bigtable/v2/data.proto b/owl-bot-staging/v2/protos/google/bigtable/v2/data.proto deleted file mode 100644 index 1e7d463c7..000000000 --- a/owl-bot-staging/v2/protos/google/bigtable/v2/data.proto +++ /dev/null @@ -1,560 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.bigtable.v2; - -option csharp_namespace = "Google.Cloud.Bigtable.V2"; -option go_package = "google.golang.org/genproto/googleapis/bigtable/v2;bigtable"; -option java_multiple_files = true; -option java_outer_classname = "DataProto"; -option java_package = "com.google.bigtable.v2"; -option php_namespace = "Google\\Cloud\\Bigtable\\V2"; -option ruby_package = "Google::Cloud::Bigtable::V2"; - -// Specifies the complete (requested) contents of a single row of a table. -// Rows which exceed 256MiB in size cannot be read in full. -message Row { - // The unique key which identifies this row within its table. This is the same - // key that's used to identify the row in, for example, a MutateRowRequest. - // May contain any non-empty byte string up to 4KiB in length. - bytes key = 1; - - // May be empty, but only if the entire row is empty. - // The mutual ordering of column families is not specified. - repeated Family families = 2; -} - -// Specifies (some of) the contents of a single row/column family intersection -// of a table. -message Family { - // The unique key which identifies this family within its row. This is the - // same key that's used to identify the family in, for example, a RowFilter - // which sets its "family_name_regex_filter" field. - // Must match `[-_.a-zA-Z0-9]+`, except that AggregatingRowProcessors may - // produce cells in a sentinel family with an empty name. - // Must be no greater than 64 characters in length. - string name = 1; - - // Must not be empty. Sorted in order of increasing "qualifier". - repeated Column columns = 2; -} - -// Specifies (some of) the contents of a single row/column intersection of a -// table. -message Column { - // The unique key which identifies this column within its family. This is the - // same key that's used to identify the column in, for example, a RowFilter - // which sets its `column_qualifier_regex_filter` field. - // May contain any byte string, including the empty string, up to 16kiB in - // length. - bytes qualifier = 1; - - // Must not be empty. Sorted in order of decreasing "timestamp_micros". - repeated Cell cells = 2; -} - -// Specifies (some of) the contents of a single row/column/timestamp of a table. -message Cell { - // The cell's stored timestamp, which also uniquely identifies it within - // its column. - // Values are always expressed in microseconds, but individual tables may set - // a coarser granularity to further restrict the allowed values. For - // example, a table which specifies millisecond granularity will only allow - // values of `timestamp_micros` which are multiples of 1000. - int64 timestamp_micros = 1; - - // The value stored in the cell. - // May contain any byte string, including the empty string, up to 100MiB in - // length. - bytes value = 2; - - // Labels applied to the cell by a [RowFilter][google.bigtable.v2.RowFilter]. - repeated string labels = 3; -} - -// Specifies a contiguous range of rows. -message RowRange { - // The row key at which to start the range. - // If neither field is set, interpreted as the empty string, inclusive. - oneof start_key { - // Used when giving an inclusive lower bound for the range. - bytes start_key_closed = 1; - - // Used when giving an exclusive lower bound for the range. - bytes start_key_open = 2; - } - - // The row key at which to end the range. - // If neither field is set, interpreted as the infinite row key, exclusive. - oneof end_key { - // Used when giving an exclusive upper bound for the range. - bytes end_key_open = 3; - - // Used when giving an inclusive upper bound for the range. - bytes end_key_closed = 4; - } -} - -// Specifies a non-contiguous set of rows. -message RowSet { - // Single rows included in the set. - repeated bytes row_keys = 1; - - // Contiguous row ranges included in the set. - repeated RowRange row_ranges = 2; -} - -// Specifies a contiguous range of columns within a single column family. -// The range spans from <column_family>:<start_qualifier> to -// <column_family>:<end_qualifier>, where both bounds can be either -// inclusive or exclusive. -message ColumnRange { - // The name of the column family within which this range falls. - string family_name = 1; - - // The column qualifier at which to start the range (within `column_family`). - // If neither field is set, interpreted as the empty string, inclusive. - oneof start_qualifier { - // Used when giving an inclusive lower bound for the range. - bytes start_qualifier_closed = 2; - - // Used when giving an exclusive lower bound for the range. - bytes start_qualifier_open = 3; - } - - // The column qualifier at which to end the range (within `column_family`). - // If neither field is set, interpreted as the infinite string, exclusive. - oneof end_qualifier { - // Used when giving an inclusive upper bound for the range. - bytes end_qualifier_closed = 4; - - // Used when giving an exclusive upper bound for the range. - bytes end_qualifier_open = 5; - } -} - -// Specified a contiguous range of microsecond timestamps. -message TimestampRange { - // Inclusive lower bound. If left empty, interpreted as 0. - int64 start_timestamp_micros = 1; - - // Exclusive upper bound. If left empty, interpreted as infinity. - int64 end_timestamp_micros = 2; -} - -// Specifies a contiguous range of raw byte values. -message ValueRange { - // The value at which to start the range. - // If neither field is set, interpreted as the empty string, inclusive. - oneof start_value { - // Used when giving an inclusive lower bound for the range. - bytes start_value_closed = 1; - - // Used when giving an exclusive lower bound for the range. - bytes start_value_open = 2; - } - - // The value at which to end the range. - // If neither field is set, interpreted as the infinite string, exclusive. - oneof end_value { - // Used when giving an inclusive upper bound for the range. - bytes end_value_closed = 3; - - // Used when giving an exclusive upper bound for the range. - bytes end_value_open = 4; - } -} - -// Takes a row as input and produces an alternate view of the row based on -// specified rules. For example, a RowFilter might trim down a row to include -// just the cells from columns matching a given regular expression, or might -// return all the cells of a row but not their values. More complicated filters -// can be composed out of these components to express requests such as, "within -// every column of a particular family, give just the two most recent cells -// which are older than timestamp X." -// -// There are two broad categories of RowFilters (true filters and transformers), -// as well as two ways to compose simple filters into more complex ones -// (chains and interleaves). They work as follows: -// -// * True filters alter the input row by excluding some of its cells wholesale -// from the output row. An example of a true filter is the `value_regex_filter`, -// which excludes cells whose values don't match the specified pattern. All -// regex true filters use RE2 syntax (https://github.com/google/re2/wiki/Syntax) -// in raw byte mode (RE2::Latin1), and are evaluated as full matches. An -// important point to keep in mind is that `RE2(.)` is equivalent by default to -// `RE2([^\n])`, meaning that it does not match newlines. When attempting to -// match an arbitrary byte, you should therefore use the escape sequence `\C`, -// which may need to be further escaped as `\\C` in your client language. -// -// * Transformers alter the input row by changing the values of some of its -// cells in the output, without excluding them completely. Currently, the only -// supported transformer is the `strip_value_transformer`, which replaces every -// cell's value with the empty string. -// -// * Chains and interleaves are described in more detail in the -// RowFilter.Chain and RowFilter.Interleave documentation. -// -// The total serialized size of a RowFilter message must not -// exceed 20480 bytes, and RowFilters may not be nested within each other -// (in Chains or Interleaves) to a depth of more than 20. -message RowFilter { - // A RowFilter which sends rows through several RowFilters in sequence. - message Chain { - // The elements of "filters" are chained together to process the input row: - // in row -> f(0) -> intermediate row -> f(1) -> ... -> f(N) -> out row - // The full chain is executed atomically. - repeated RowFilter filters = 1; - } - - // A RowFilter which sends each row to each of several component - // RowFilters and interleaves the results. - message Interleave { - // The elements of "filters" all process a copy of the input row, and the - // results are pooled, sorted, and combined into a single output row. - // If multiple cells are produced with the same column and timestamp, - // they will all appear in the output row in an unspecified mutual order. - // Consider the following example, with three filters: - // - // input row - // | - // ----------------------------------------------------- - // | | | - // f(0) f(1) f(2) - // | | | - // 1: foo,bar,10,x foo,bar,10,z far,bar,7,a - // 2: foo,blah,11,z far,blah,5,x far,blah,5,x - // | | | - // ----------------------------------------------------- - // | - // 1: foo,bar,10,z // could have switched with #2 - // 2: foo,bar,10,x // could have switched with #1 - // 3: foo,blah,11,z - // 4: far,bar,7,a - // 5: far,blah,5,x // identical to #6 - // 6: far,blah,5,x // identical to #5 - // - // All interleaved filters are executed atomically. - repeated RowFilter filters = 1; - } - - // A RowFilter which evaluates one of two possible RowFilters, depending on - // whether or not a predicate RowFilter outputs any cells from the input row. - // - // IMPORTANT NOTE: The predicate filter does not execute atomically with the - // true and false filters, which may lead to inconsistent or unexpected - // results. Additionally, Condition filters have poor performance, especially - // when filters are set for the false condition. - message Condition { - // If `predicate_filter` outputs any cells, then `true_filter` will be - // evaluated on the input row. Otherwise, `false_filter` will be evaluated. - RowFilter predicate_filter = 1; - - // The filter to apply to the input row if `predicate_filter` returns any - // results. If not provided, no results will be returned in the true case. - RowFilter true_filter = 2; - - // The filter to apply to the input row if `predicate_filter` does not - // return any results. If not provided, no results will be returned in the - // false case. - RowFilter false_filter = 3; - } - - // Which of the possible RowFilter types to apply. If none are set, this - // RowFilter returns all cells in the input row. - oneof filter { - // Applies several RowFilters to the data in sequence, progressively - // narrowing the results. - Chain chain = 1; - - // Applies several RowFilters to the data in parallel and combines the - // results. - Interleave interleave = 2; - - // Applies one of two possible RowFilters to the data based on the output of - // a predicate RowFilter. - Condition condition = 3; - - // ADVANCED USE ONLY. - // Hook for introspection into the RowFilter. Outputs all cells directly to - // the output of the read rather than to any parent filter. Consider the - // following example: - // - // Chain( - // FamilyRegex("A"), - // Interleave( - // All(), - // Chain(Label("foo"), Sink()) - // ), - // QualifierRegex("B") - // ) - // - // A,A,1,w - // A,B,2,x - // B,B,4,z - // | - // FamilyRegex("A") - // | - // A,A,1,w - // A,B,2,x - // | - // +------------+-------------+ - // | | - // All() Label(foo) - // | | - // A,A,1,w A,A,1,w,labels:[foo] - // A,B,2,x A,B,2,x,labels:[foo] - // | | - // | Sink() --------------+ - // | | | - // +------------+ x------+ A,A,1,w,labels:[foo] - // | A,B,2,x,labels:[foo] - // A,A,1,w | - // A,B,2,x | - // | | - // QualifierRegex("B") | - // | | - // A,B,2,x | - // | | - // +--------------------------------+ - // | - // A,A,1,w,labels:[foo] - // A,B,2,x,labels:[foo] // could be switched - // A,B,2,x // could be switched - // - // Despite being excluded by the qualifier filter, a copy of every cell - // that reaches the sink is present in the final result. - // - // As with an [Interleave][google.bigtable.v2.RowFilter.Interleave], - // duplicate cells are possible, and appear in an unspecified mutual order. - // In this case we have a duplicate with column "A:B" and timestamp 2, - // because one copy passed through the all filter while the other was - // passed through the label and sink. Note that one copy has label "foo", - // while the other does not. - // - // Cannot be used within the `predicate_filter`, `true_filter`, or - // `false_filter` of a [Condition][google.bigtable.v2.RowFilter.Condition]. - bool sink = 16; - - // Matches all cells, regardless of input. Functionally equivalent to - // leaving `filter` unset, but included for completeness. - bool pass_all_filter = 17; - - // Does not match any cells, regardless of input. Useful for temporarily - // disabling just part of a filter. - bool block_all_filter = 18; - - // Matches only cells from rows whose keys satisfy the given RE2 regex. In - // other words, passes through the entire row when the key matches, and - // otherwise produces an empty row. - // Note that, since row keys can contain arbitrary bytes, the `\C` escape - // sequence must be used if a true wildcard is desired. The `.` character - // will not match the new line character `\n`, which may be present in a - // binary key. - bytes row_key_regex_filter = 4; - - // Matches all cells from a row with probability p, and matches no cells - // from the row with probability 1-p. - double row_sample_filter = 14; - - // Matches only cells from columns whose families satisfy the given RE2 - // regex. For technical reasons, the regex must not contain the `:` - // character, even if it is not being used as a literal. - // Note that, since column families cannot contain the new line character - // `\n`, it is sufficient to use `.` as a full wildcard when matching - // column family names. - string family_name_regex_filter = 5; - - // Matches only cells from columns whose qualifiers satisfy the given RE2 - // regex. - // Note that, since column qualifiers can contain arbitrary bytes, the `\C` - // escape sequence must be used if a true wildcard is desired. The `.` - // character will not match the new line character `\n`, which may be - // present in a binary qualifier. - bytes column_qualifier_regex_filter = 6; - - // Matches only cells from columns within the given range. - ColumnRange column_range_filter = 7; - - // Matches only cells with timestamps within the given range. - TimestampRange timestamp_range_filter = 8; - - // Matches only cells with values that satisfy the given regular expression. - // Note that, since cell values can contain arbitrary bytes, the `\C` escape - // sequence must be used if a true wildcard is desired. The `.` character - // will not match the new line character `\n`, which may be present in a - // binary value. - bytes value_regex_filter = 9; - - // Matches only cells with values that fall within the given range. - ValueRange value_range_filter = 15; - - // Skips the first N cells of each row, matching all subsequent cells. - // If duplicate cells are present, as is possible when using an Interleave, - // each copy of the cell is counted separately. - int32 cells_per_row_offset_filter = 10; - - // Matches only the first N cells of each row. - // If duplicate cells are present, as is possible when using an Interleave, - // each copy of the cell is counted separately. - int32 cells_per_row_limit_filter = 11; - - // Matches only the most recent N cells within each column. For example, - // if N=2, this filter would match column `foo:bar` at timestamps 10 and 9, - // skip all earlier cells in `foo:bar`, and then begin matching again in - // column `foo:bar2`. - // If duplicate cells are present, as is possible when using an Interleave, - // each copy of the cell is counted separately. - int32 cells_per_column_limit_filter = 12; - - // Replaces each cell's value with the empty string. - bool strip_value_transformer = 13; - - // Applies the given label to all cells in the output row. This allows - // the client to determine which results were produced from which part of - // the filter. - // - // Values must be at most 15 characters in length, and match the RE2 - // pattern `[a-z0-9\\-]+` - // - // Due to a technical limitation, it is not currently possible to apply - // multiple labels to a cell. As a result, a Chain may have no more than - // one sub-filter which contains a `apply_label_transformer`. It is okay for - // an Interleave to contain multiple `apply_label_transformers`, as they - // will be applied to separate copies of the input. This may be relaxed in - // the future. - string apply_label_transformer = 19; - } -} - -// Specifies a particular change to be made to the contents of a row. -message Mutation { - // A Mutation which sets the value of the specified cell. - message SetCell { - // The name of the family into which new data should be written. - // Must match `[-_.a-zA-Z0-9]+` - string family_name = 1; - - // The qualifier of the column into which new data should be written. - // Can be any byte string, including the empty string. - bytes column_qualifier = 2; - - // The timestamp of the cell into which new data should be written. - // Use -1 for current Bigtable server time. - // Otherwise, the client should set this value itself, noting that the - // default value is a timestamp of zero if the field is left unspecified. - // Values must match the granularity of the table (e.g. micros, millis). - int64 timestamp_micros = 3; - - // The value to be written into the specified cell. - bytes value = 4; - } - - // A Mutation which deletes cells from the specified column, optionally - // restricting the deletions to a given timestamp range. - message DeleteFromColumn { - // The name of the family from which cells should be deleted. - // Must match `[-_.a-zA-Z0-9]+` - string family_name = 1; - - // The qualifier of the column from which cells should be deleted. - // Can be any byte string, including the empty string. - bytes column_qualifier = 2; - - // The range of timestamps within which cells should be deleted. - TimestampRange time_range = 3; - } - - // A Mutation which deletes all cells from the specified column family. - message DeleteFromFamily { - // The name of the family from which cells should be deleted. - // Must match `[-_.a-zA-Z0-9]+` - string family_name = 1; - } - - // A Mutation which deletes all cells from the containing row. - message DeleteFromRow {} - - // Which of the possible Mutation types to apply. - oneof mutation { - // Set a cell's value. - SetCell set_cell = 1; - - // Deletes cells from a column. - DeleteFromColumn delete_from_column = 2; - - // Deletes cells from a column family. - DeleteFromFamily delete_from_family = 3; - - // Deletes cells from the entire row. - DeleteFromRow delete_from_row = 4; - } -} - -// Specifies an atomic read/modify/write operation on the latest value of the -// specified column. -message ReadModifyWriteRule { - // The name of the family to which the read/modify/write should be applied. - // Must match `[-_.a-zA-Z0-9]+` - string family_name = 1; - - // The qualifier of the column to which the read/modify/write should be - // applied. - // Can be any byte string, including the empty string. - bytes column_qualifier = 2; - - // The rule used to determine the column's new latest value from its current - // latest value. - oneof rule { - // Rule specifying that `append_value` be appended to the existing value. - // If the targeted cell is unset, it will be treated as containing the - // empty string. - bytes append_value = 3; - - // Rule specifying that `increment_amount` be added to the existing value. - // If the targeted cell is unset, it will be treated as containing a zero. - // Otherwise, the targeted cell must contain an 8-byte value (interpreted - // as a 64-bit big-endian signed integer), or the entire request will fail. - int64 increment_amount = 4; - } -} - -// NOTE: This API is intended to be used by Apache Beam BigtableIO. -// A partition of a change stream. -message StreamPartition { - // The row range covered by this partition and is specified by - // [`start_key_closed`, `end_key_open`). - RowRange row_range = 1; -} - -// NOTE: This API is intended to be used by Apache Beam BigtableIO. -// The information required to continue reading the data from multiple -// `StreamPartitions` from where a previous read left off. -message StreamContinuationTokens { - // List of continuation tokens. - repeated StreamContinuationToken tokens = 1; -} - -// NOTE: This API is intended to be used by Apache Beam BigtableIO. -// The information required to continue reading the data from a -// `StreamPartition` from where a previous read left off. -message StreamContinuationToken { - // The partition that this token applies to. - StreamPartition partition = 1; - - // An encoded position in the stream to restart reading from. - string token = 2; -} diff --git a/owl-bot-staging/v2/protos/google/bigtable/v2/feature_flags.proto b/owl-bot-staging/v2/protos/google/bigtable/v2/feature_flags.proto deleted file mode 100644 index 942646c6b..000000000 --- a/owl-bot-staging/v2/protos/google/bigtable/v2/feature_flags.proto +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2023 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.bigtable.v2; - -option csharp_namespace = "Google.Cloud.Bigtable.V2"; -option go_package = "google.golang.org/genproto/googleapis/bigtable/v2;bigtable"; -option java_multiple_files = true; -option java_outer_classname = "FeatureFlagsProto"; -option java_package = "com.google.bigtable.v2"; -option php_namespace = "Google\\Cloud\\Bigtable\\V2"; -option ruby_package = "Google::Cloud::Bigtable::V2"; - -// Feature flags supported or enabled by a client. -// This is intended to be sent as part of request metadata to assure the server -// that certain behaviors are safe to enable. This proto is meant to be -// serialized and websafe-base64 encoded under the `bigtable-features` metadata -// key. The value will remain constant for the lifetime of a client and due to -// HTTP2's HPACK compression, the request overhead will be tiny. -// This is an internal implementation detail and should not be used by end users -// directly. -message FeatureFlags { - // Notify the server that the client supports reverse scans. The server will - // reject ReadRowsRequests with the reverse bit set when this is absent. - bool reverse_scans = 1; - - // Notify the server that the client enables batch write flow control by - // requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons, - // this disables partial retries. - bool mutate_rows_rate_limit = 3; - - // Notify the server that the client enables batch write flow control by - // requesting RateLimitInfo from MutateRowsResponse. With partial retries - // enabled. - bool mutate_rows_rate_limit2 = 5; - - // Notify the server that the client supports the last_scanned_row field - // in ReadRowsResponse for long-running scans. - bool last_scanned_row_responses = 4; -} diff --git a/owl-bot-staging/v2/protos/google/bigtable/v2/request_stats.proto b/owl-bot-staging/v2/protos/google/bigtable/v2/request_stats.proto deleted file mode 100644 index f650abe09..000000000 --- a/owl-bot-staging/v2/protos/google/bigtable/v2/request_stats.proto +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.bigtable.v2; - -import "google/protobuf/duration.proto"; - -option csharp_namespace = "Google.Cloud.Bigtable.V2"; -option go_package = "google.golang.org/genproto/googleapis/bigtable/v2;bigtable"; -option java_multiple_files = true; -option java_outer_classname = "RequestStatsProto"; -option java_package = "com.google.bigtable.v2"; -option php_namespace = "Google\\Cloud\\Bigtable\\V2"; -option ruby_package = "Google::Cloud::Bigtable::V2"; - -// -// Messages related to RequestStats, part of the Query Stats feature, that can -// help understand the performance of requests. -// -// The layout of requests below is as follows: -// * RequestStats serves as the top-level container for statistics and -// measures related to Bigtable requests. This common object is returned as -// part of methods in the Data API. -// * RequestStats contains multiple *views* of related data, chosen by an -// option in the source Data API method. The view that is returned is -// designed to have all submessages (and their submessages, and so on) -// filled-in, to provide a comprehensive selection of statistics and -// measures related to the requested view. - -// ReadIterationStats captures information about the iteration of rows or cells -// over the course of a read, e.g. how many results were scanned in a read -// operation versus the results returned. -message ReadIterationStats { - // The rows seen (scanned) as part of the request. This includes the count of - // rows returned, as captured below. - int64 rows_seen_count = 1; - - // The rows returned as part of the request. - int64 rows_returned_count = 2; - - // The cells seen (scanned) as part of the request. This includes the count of - // cells returned, as captured below. - int64 cells_seen_count = 3; - - // The cells returned as part of the request. - int64 cells_returned_count = 4; -} - -// RequestLatencyStats provides a measurement of the latency of the request as -// it interacts with different systems over its lifetime, e.g. how long the -// request took to execute within a frontend server. -message RequestLatencyStats { - // The latency measured by the frontend server handling this request, from - // when the request was received, to when this value is sent back in the - // response. For more context on the component that is measuring this latency, - // see: https://cloud.google.com/bigtable/docs/overview - // - // Note: This value may be slightly shorter than the value reported into - // aggregate latency metrics in Monitoring for this request - // (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value - // needs to be sent in the response before the latency measurement including - // that transmission is finalized. - // - // Note: This value includes the end-to-end latency of contacting nodes in - // the targeted cluster, e.g. measuring from when the first byte arrives at - // the frontend server, to when this value is sent back as the last value in - // the response, including any latency incurred by contacting nodes, waiting - // for results from nodes, and finally sending results from nodes back to the - // caller. - google.protobuf.Duration frontend_server_latency = 1; -} - -// FullReadStatsView captures all known information about a read. -message FullReadStatsView { - // Iteration stats describe how efficient the read is, e.g. comparing - // rows seen vs. rows returned or cells seen vs cells returned can provide an - // indication of read efficiency (the higher the ratio of seen to retuned the - // better). - ReadIterationStats read_iteration_stats = 1; - - // Request latency stats describe the time taken to complete a request, from - // the server side. - RequestLatencyStats request_latency_stats = 2; -} - -// RequestStats is the container for additional information pertaining to a -// single request, helpful for evaluating the performance of the sent request. -// Currently, there are the following supported methods: -// * google.bigtable.v2.ReadRows -message RequestStats { - // Information pertaining to each request type received. The type is chosen - // based on the requested view. - // - // See the messages above for additional context. - oneof stats_view { - // Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL - // view, see package google.bigtable.v2. - FullReadStatsView full_read_stats_view = 1; - } -} diff --git a/owl-bot-staging/v2/protos/google/bigtable/v2/response_params.proto b/owl-bot-staging/v2/protos/google/bigtable/v2/response_params.proto deleted file mode 100644 index a8105911c..000000000 --- a/owl-bot-staging/v2/protos/google/bigtable/v2/response_params.proto +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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.bigtable.v2; - -option csharp_namespace = "Google.Cloud.Bigtable.V2"; -option go_package = "google.golang.org/genproto/googleapis/bigtable/v2;bigtable"; -option java_multiple_files = true; -option java_outer_classname = "ResponseParamsProto"; -option java_package = "com.google.bigtable.v2"; -option php_namespace = "Google\\Cloud\\Bigtable\\V2"; -option ruby_package = "Google::Cloud::Bigtable::V2"; - -// Response metadata proto -// This is an experimental feature that will be used to get zone_id and -// cluster_id from response trailers to tag the metrics. This should not be -// used by customers directly -message ResponseParams { - // The cloud bigtable zone associated with the cluster. - optional string zone_id = 1; - - // Identifier for a cluster that represents set of - // bigtable resources. - optional string cluster_id = 2; -} diff --git a/owl-bot-staging/v2/samples/generated/v2/bigtable.check_and_mutate_row.js b/owl-bot-staging/v2/samples/generated/v2/bigtable.check_and_mutate_row.js deleted file mode 100644 index 3b66cbe2f..000000000 --- a/owl-bot-staging/v2/samples/generated/v2/bigtable.check_and_mutate_row.js +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2023 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. ** - - - /** - * NOTE: This sample is autogenerated, but this library contains handwritten - * samples that are the recommended way to use this library. Please refer to - * samples outside of the generated/ folder for these recommendations. - */ -'use strict'; - -function main(tableName, rowKey) { - // [START bigtable_v2_generated_Bigtable_CheckAndMutateRow_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 unique name of the table to which the conditional mutation - * should be applied. Values are of the form - * `projects//instances//tables/
`. - */ - // const tableName = 'abc123' - /** - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - */ - // const appProfileId = 'abc123' - /** - * Required. The key of the row to which the conditional mutation should be - * applied. - */ - // const rowKey = Buffer.from('string') - /** - * The filter to be applied to the contents of the specified row. Depending - * on whether or not any results are yielded, either `true_mutations` or - * `false_mutations` will be executed. If unset, checks that the row contains - * any values at all. - */ - // const predicateFilter = {} - /** - * Changes to be atomically applied to the specified row if `predicate_filter` - * yields at least one cell when applied to `row_key`. Entries are applied in - * order, meaning that earlier mutations can be masked by later ones. - * Must contain at least one entry if `false_mutations` is empty, and at most - * 100000. - */ - // const trueMutations = [1,2,3,4] - /** - * Changes to be atomically applied to the specified row if `predicate_filter` - * does not yield any cells when applied to `row_key`. Entries are applied in - * order, meaning that earlier mutations can be masked by later ones. - * Must contain at least one entry if `true_mutations` is empty, and at most - * 100000. - */ - // const falseMutations = [1,2,3,4] - - // Imports the Bigtable library - const {BigtableClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const bigtableClient = new BigtableClient(); - - async function callCheckAndMutateRow() { - // Construct request - const request = { - tableName, - rowKey, - }; - - // Run request - const response = await bigtableClient.checkAndMutateRow(request); - console.log(response); - } - - callCheckAndMutateRow(); - // [END bigtable_v2_generated_Bigtable_CheckAndMutateRow_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/bigtable.generate_initial_change_stream_partitions.js b/owl-bot-staging/v2/samples/generated/v2/bigtable.generate_initial_change_stream_partitions.js deleted file mode 100644 index 28781ed85..000000000 --- a/owl-bot-staging/v2/samples/generated/v2/bigtable.generate_initial_change_stream_partitions.js +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2023 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. ** - - - /** - * NOTE: This sample is autogenerated, but this library contains handwritten - * samples that are the recommended way to use this library. Please refer to - * samples outside of the generated/ folder for these recommendations. - */ -'use strict'; - -function main(tableName) { - // [START bigtable_v2_generated_Bigtable_GenerateInitialChangeStreamPartitions_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 unique name of the table from which to get change stream - * partitions. Values are of the form - * `projects//instances//tables/
`. - * Change streaming must be enabled on the table. - */ - // const tableName = 'abc123' - /** - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * Single cluster routing must be configured on the profile. - */ - // const appProfileId = 'abc123' - - // Imports the Bigtable library - const {BigtableClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const bigtableClient = new BigtableClient(); - - async function callGenerateInitialChangeStreamPartitions() { - // Construct request - const request = { - tableName, - }; - - // Run request - const stream = await bigtableClient.generateInitialChangeStreamPartitions(request); - stream.on('data', (response) => { console.log(response) }); - stream.on('error', (err) => { throw(err) }); - stream.on('end', () => { /* API call completed */ }); - } - - callGenerateInitialChangeStreamPartitions(); - // [END bigtable_v2_generated_Bigtable_GenerateInitialChangeStreamPartitions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/bigtable.mutate_row.js b/owl-bot-staging/v2/samples/generated/v2/bigtable.mutate_row.js deleted file mode 100644 index 14487b859..000000000 --- a/owl-bot-staging/v2/samples/generated/v2/bigtable.mutate_row.js +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2023 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. ** - - - /** - * NOTE: This sample is autogenerated, but this library contains handwritten - * samples that are the recommended way to use this library. Please refer to - * samples outside of the generated/ folder for these recommendations. - */ -'use strict'; - -function main(tableName, rowKey, mutations) { - // [START bigtable_v2_generated_Bigtable_MutateRow_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 unique name of the table to which the mutation should be - * applied. Values are of the form - * `projects//instances//tables/
`. - */ - // const tableName = 'abc123' - /** - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - */ - // const appProfileId = 'abc123' - /** - * Required. The key of the row to which the mutation should be applied. - */ - // const rowKey = Buffer.from('string') - /** - * Required. Changes to be atomically applied to the specified row. Entries - * are applied in order, meaning that earlier mutations can be masked by later - * ones. Must contain at least one entry and at most 100000. - */ - // const mutations = [1,2,3,4] - - // Imports the Bigtable library - const {BigtableClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const bigtableClient = new BigtableClient(); - - async function callMutateRow() { - // Construct request - const request = { - tableName, - rowKey, - mutations, - }; - - // Run request - const response = await bigtableClient.mutateRow(request); - console.log(response); - } - - callMutateRow(); - // [END bigtable_v2_generated_Bigtable_MutateRow_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/bigtable.mutate_rows.js b/owl-bot-staging/v2/samples/generated/v2/bigtable.mutate_rows.js deleted file mode 100644 index f47039b9b..000000000 --- a/owl-bot-staging/v2/samples/generated/v2/bigtable.mutate_rows.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2023 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. ** - - - /** - * NOTE: This sample is autogenerated, but this library contains handwritten - * samples that are the recommended way to use this library. Please refer to - * samples outside of the generated/ folder for these recommendations. - */ -'use strict'; - -function main(tableName, entries) { - // [START bigtable_v2_generated_Bigtable_MutateRows_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 unique name of the table to which the mutations should be - * applied. - */ - // const tableName = 'abc123' - /** - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - */ - // const appProfileId = 'abc123' - /** - * Required. The row keys and corresponding mutations to be applied in bulk. - * Each entry is applied as an atomic mutation, but the entries may be - * applied in arbitrary order (even between entries for the same row). - * At least one entry must be specified, and in total the entries can - * contain at most 100000 mutations. - */ - // const entries = [1,2,3,4] - - // Imports the Bigtable library - const {BigtableClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const bigtableClient = new BigtableClient(); - - async function callMutateRows() { - // Construct request - const request = { - tableName, - entries, - }; - - // Run request - const stream = await bigtableClient.mutateRows(request); - stream.on('data', (response) => { console.log(response) }); - stream.on('error', (err) => { throw(err) }); - stream.on('end', () => { /* API call completed */ }); - } - - callMutateRows(); - // [END bigtable_v2_generated_Bigtable_MutateRows_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/bigtable.ping_and_warm.js b/owl-bot-staging/v2/samples/generated/v2/bigtable.ping_and_warm.js deleted file mode 100644 index eca37dfab..000000000 --- a/owl-bot-staging/v2/samples/generated/v2/bigtable.ping_and_warm.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2023 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. ** - - - /** - * NOTE: This sample is autogenerated, but this library contains handwritten - * samples that are the recommended way to use this library. Please refer to - * samples outside of the generated/ folder for these recommendations. - */ -'use strict'; - -function main(name) { - // [START bigtable_v2_generated_Bigtable_PingAndWarm_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 unique name of the instance to check permissions for as well - * as respond. Values are of the form - * `projects//instances/`. - */ - // const name = 'abc123' - /** - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - */ - // const appProfileId = 'abc123' - - // Imports the Bigtable library - const {BigtableClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const bigtableClient = new BigtableClient(); - - async function callPingAndWarm() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await bigtableClient.pingAndWarm(request); - console.log(response); - } - - callPingAndWarm(); - // [END bigtable_v2_generated_Bigtable_PingAndWarm_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/bigtable.read_change_stream.js b/owl-bot-staging/v2/samples/generated/v2/bigtable.read_change_stream.js deleted file mode 100644 index 183ccdad1..000000000 --- a/owl-bot-staging/v2/samples/generated/v2/bigtable.read_change_stream.js +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2023 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. ** - - - /** - * NOTE: This sample is autogenerated, but this library contains handwritten - * samples that are the recommended way to use this library. Please refer to - * samples outside of the generated/ folder for these recommendations. - */ -'use strict'; - -function main(tableName) { - // [START bigtable_v2_generated_Bigtable_ReadChangeStream_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 unique name of the table from which to read a change stream. - * Values are of the form - * `projects//instances//tables/
`. - * Change streaming must be enabled on the table. - */ - // const tableName = 'abc123' - /** - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * Single cluster routing must be configured on the profile. - */ - // const appProfileId = 'abc123' - /** - * The partition to read changes from. - */ - // const partition = {} - /** - * Start reading the stream at the specified timestamp. This timestamp must - * be within the change stream retention period, less than or equal to the - * current time, and after change stream creation, whichever is greater. - * This value is inclusive and will be truncated to microsecond granularity. - */ - // const startTime = {} - /** - * Tokens that describe how to resume reading a stream where reading - * previously left off. If specified, changes will be read starting at the - * the position. Tokens are delivered on the stream as part of `Heartbeat` - * and `CloseStream` messages. - * If a single token is provided, the token’s partition must exactly match - * the request’s partition. If multiple tokens are provided, as in the case - * of a partition merge, the union of the token partitions must exactly - * cover the request’s partition. Otherwise, INVALID_ARGUMENT will be - * returned. - */ - // const continuationTokens = {} - /** - * If specified, OK will be returned when the stream advances beyond - * this time. Otherwise, changes will be continuously delivered on the stream. - * This value is inclusive and will be truncated to microsecond granularity. - */ - // const endTime = {} - /** - * If specified, the duration between `Heartbeat` messages on the stream. - * Otherwise, defaults to 5 seconds. - */ - // const heartbeatDuration = {} - - // Imports the Bigtable library - const {BigtableClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const bigtableClient = new BigtableClient(); - - async function callReadChangeStream() { - // Construct request - const request = { - tableName, - }; - - // Run request - const stream = await bigtableClient.readChangeStream(request); - stream.on('data', (response) => { console.log(response) }); - stream.on('error', (err) => { throw(err) }); - stream.on('end', () => { /* API call completed */ }); - } - - callReadChangeStream(); - // [END bigtable_v2_generated_Bigtable_ReadChangeStream_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/bigtable.read_modify_write_row.js b/owl-bot-staging/v2/samples/generated/v2/bigtable.read_modify_write_row.js deleted file mode 100644 index 19c5d03a2..000000000 --- a/owl-bot-staging/v2/samples/generated/v2/bigtable.read_modify_write_row.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2023 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. ** - - - /** - * NOTE: This sample is autogenerated, but this library contains handwritten - * samples that are the recommended way to use this library. Please refer to - * samples outside of the generated/ folder for these recommendations. - */ -'use strict'; - -function main(tableName, rowKey, rules) { - // [START bigtable_v2_generated_Bigtable_ReadModifyWriteRow_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 unique name of the table to which the read/modify/write rules - * should be applied. Values are of the form - * `projects//instances//tables/
`. - */ - // const tableName = 'abc123' - /** - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - */ - // const appProfileId = 'abc123' - /** - * Required. The key of the row to which the read/modify/write rules should be - * applied. - */ - // const rowKey = Buffer.from('string') - /** - * Required. Rules specifying how the specified row's contents are to be - * transformed into writes. Entries are applied in order, meaning that earlier - * rules will affect the results of later ones. - */ - // const rules = [1,2,3,4] - - // Imports the Bigtable library - const {BigtableClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const bigtableClient = new BigtableClient(); - - async function callReadModifyWriteRow() { - // Construct request - const request = { - tableName, - rowKey, - rules, - }; - - // Run request - const response = await bigtableClient.readModifyWriteRow(request); - console.log(response); - } - - callReadModifyWriteRow(); - // [END bigtable_v2_generated_Bigtable_ReadModifyWriteRow_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/bigtable.read_rows.js b/owl-bot-staging/v2/samples/generated/v2/bigtable.read_rows.js deleted file mode 100644 index b2d83a8bf..000000000 --- a/owl-bot-staging/v2/samples/generated/v2/bigtable.read_rows.js +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2023 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. ** - - - /** - * NOTE: This sample is autogenerated, but this library contains handwritten - * samples that are the recommended way to use this library. Please refer to - * samples outside of the generated/ folder for these recommendations. - */ -'use strict'; - -function main(tableName) { - // [START bigtable_v2_generated_Bigtable_ReadRows_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 unique name of the table from which to read. - * Values are of the form - * `projects//instances//tables/
`. - */ - // const tableName = 'abc123' - /** - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - */ - // const appProfileId = 'abc123' - /** - * The row keys and/or ranges to read sequentially. If not specified, reads - * from all rows. - */ - // const rows = {} - /** - * The filter to apply to the contents of the specified row(s). If unset, - * reads the entirety of each row. - */ - // const filter = {} - /** - * The read will stop after committing to N rows' worth of results. The - * default (zero) is to return all results. - */ - // const rowsLimit = 1234 - /** - * The view into RequestStats, as described above. - */ - // const requestStatsView = {} - /** - * Experimental API - Please note that this API is currently experimental - * and can change in the future. - * Return rows in lexiographical descending order of the row keys. The row - * contents will not be affected by this flag. - * Example result set: - * - * {key: "k2", "f:col1": "v1", "f:col2": "v1"}, - * {key: "k1", "f:col1": "v2", "f:col2": "v2"} - * - */ - // const reversed = true - - // Imports the Bigtable library - const {BigtableClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const bigtableClient = new BigtableClient(); - - async function callReadRows() { - // Construct request - const request = { - tableName, - }; - - // Run request - const stream = await bigtableClient.readRows(request); - stream.on('data', (response) => { console.log(response) }); - stream.on('error', (err) => { throw(err) }); - stream.on('end', () => { /* API call completed */ }); - } - - callReadRows(); - // [END bigtable_v2_generated_Bigtable_ReadRows_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/bigtable.sample_row_keys.js b/owl-bot-staging/v2/samples/generated/v2/bigtable.sample_row_keys.js deleted file mode 100644 index 4fef29214..000000000 --- a/owl-bot-staging/v2/samples/generated/v2/bigtable.sample_row_keys.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2023 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. ** - - - /** - * NOTE: This sample is autogenerated, but this library contains handwritten - * samples that are the recommended way to use this library. Please refer to - * samples outside of the generated/ folder for these recommendations. - */ -'use strict'; - -function main(tableName) { - // [START bigtable_v2_generated_Bigtable_SampleRowKeys_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 unique name of the table from which to sample row keys. - * Values are of the form - * `projects//instances//tables/
`. - */ - // const tableName = 'abc123' - /** - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - */ - // const appProfileId = 'abc123' - - // Imports the Bigtable library - const {BigtableClient} = require('@google-cloud/bigtable').v2; - - // Instantiates a client - const bigtableClient = new BigtableClient(); - - async function callSampleRowKeys() { - // Construct request - const request = { - tableName, - }; - - // Run request - const stream = await bigtableClient.sampleRowKeys(request); - stream.on('data', (response) => { console.log(response) }); - stream.on('error', (err) => { throw(err) }); - stream.on('end', () => { /* API call completed */ }); - } - - callSampleRowKeys(); - // [END bigtable_v2_generated_Bigtable_SampleRowKeys_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v2/samples/generated/v2/snippet_metadata_google.bigtable.v2.json b/owl-bot-staging/v2/samples/generated/v2/snippet_metadata_google.bigtable.v2.json deleted file mode 100644 index b84efb027..000000000 --- a/owl-bot-staging/v2/samples/generated/v2/snippet_metadata_google.bigtable.v2.json +++ /dev/null @@ -1,487 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-bigtable", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.bigtable.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "regionTag": "bigtable_v2_generated_Bigtable_ReadRows_async", - "title": "bigtable readRows Sample", - "origin": "API_DEFINITION", - "description": " Streams back the contents of all requested rows in key order, optionally applying the same Reader filter to each. Depending on their size, rows and cells may be broken up across multiple responses, but atomicity of each row will still be preserved. See the ReadRowsResponse documentation for details.", - "canonical": false, - "file": "bigtable.read_rows.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 29, - "end": 97, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ReadRows", - "fullName": "google.bigtable.v2.Bigtable.ReadRows", - "async": true, - "parameters": [ - { - "name": "table_name", - "type": "TYPE_STRING" - }, - { - "name": "app_profile_id", - "type": "TYPE_STRING" - }, - { - "name": "rows", - "type": ".google.bigtable.v2.RowSet" - }, - { - "name": "filter", - "type": ".google.bigtable.v2.RowFilter" - }, - { - "name": "rows_limit", - "type": "TYPE_INT64" - }, - { - "name": "request_stats_view", - "type": ".google.bigtable.v2.ReadRowsRequest.RequestStatsView" - }, - { - "name": "reversed", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.bigtable.v2.ReadRowsResponse", - "client": { - "shortName": "BigtableClient", - "fullName": "google.bigtable.v2.BigtableClient" - }, - "method": { - "shortName": "ReadRows", - "fullName": "google.bigtable.v2.Bigtable.ReadRows", - "service": { - "shortName": "Bigtable", - "fullName": "google.bigtable.v2.Bigtable" - } - } - } - }, - { - "regionTag": "bigtable_v2_generated_Bigtable_SampleRowKeys_async", - "title": "bigtable sampleRowKeys Sample", - "origin": "API_DEFINITION", - "description": " Returns a sample of row keys in the table. The returned row keys will delimit contiguous sections of the table of approximately equal size, which can be used to break up the data for distributed tasks like mapreduces.", - "canonical": false, - "file": "bigtable.sample_row_keys.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 29, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SampleRowKeys", - "fullName": "google.bigtable.v2.Bigtable.SampleRowKeys", - "async": true, - "parameters": [ - { - "name": "table_name", - "type": "TYPE_STRING" - }, - { - "name": "app_profile_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.v2.SampleRowKeysResponse", - "client": { - "shortName": "BigtableClient", - "fullName": "google.bigtable.v2.BigtableClient" - }, - "method": { - "shortName": "SampleRowKeys", - "fullName": "google.bigtable.v2.Bigtable.SampleRowKeys", - "service": { - "shortName": "Bigtable", - "fullName": "google.bigtable.v2.Bigtable" - } - } - } - }, - { - "regionTag": "bigtable_v2_generated_Bigtable_MutateRow_async", - "title": "bigtable mutateRow Sample", - "origin": "API_DEFINITION", - "description": " Mutates a row atomically. Cells already present in the row are left unchanged unless explicitly changed by `mutation`.", - "canonical": false, - "file": "bigtable.mutate_row.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 29, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "MutateRow", - "fullName": "google.bigtable.v2.Bigtable.MutateRow", - "async": true, - "parameters": [ - { - "name": "table_name", - "type": "TYPE_STRING" - }, - { - "name": "app_profile_id", - "type": "TYPE_STRING" - }, - { - "name": "row_key", - "type": "TYPE_BYTES" - }, - { - "name": "mutations", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.bigtable.v2.MutateRowResponse", - "client": { - "shortName": "BigtableClient", - "fullName": "google.bigtable.v2.BigtableClient" - }, - "method": { - "shortName": "MutateRow", - "fullName": "google.bigtable.v2.Bigtable.MutateRow", - "service": { - "shortName": "Bigtable", - "fullName": "google.bigtable.v2.Bigtable" - } - } - } - }, - { - "regionTag": "bigtable_v2_generated_Bigtable_MutateRows_async", - "title": "bigtable mutateRows Sample", - "origin": "API_DEFINITION", - "description": " Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow, but the entire batch is not executed atomically.", - "canonical": false, - "file": "bigtable.mutate_rows.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 29, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "MutateRows", - "fullName": "google.bigtable.v2.Bigtable.MutateRows", - "async": true, - "parameters": [ - { - "name": "table_name", - "type": "TYPE_STRING" - }, - { - "name": "app_profile_id", - "type": "TYPE_STRING" - }, - { - "name": "entries", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.bigtable.v2.MutateRowsResponse", - "client": { - "shortName": "BigtableClient", - "fullName": "google.bigtable.v2.BigtableClient" - }, - "method": { - "shortName": "MutateRows", - "fullName": "google.bigtable.v2.Bigtable.MutateRows", - "service": { - "shortName": "Bigtable", - "fullName": "google.bigtable.v2.Bigtable" - } - } - } - }, - { - "regionTag": "bigtable_v2_generated_Bigtable_CheckAndMutateRow_async", - "title": "bigtable checkAndMutateRow Sample", - "origin": "API_DEFINITION", - "description": " Mutates a row atomically based on the output of a predicate Reader filter.", - "canonical": false, - "file": "bigtable.check_and_mutate_row.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 29, - "end": 93, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CheckAndMutateRow", - "fullName": "google.bigtable.v2.Bigtable.CheckAndMutateRow", - "async": true, - "parameters": [ - { - "name": "table_name", - "type": "TYPE_STRING" - }, - { - "name": "app_profile_id", - "type": "TYPE_STRING" - }, - { - "name": "row_key", - "type": "TYPE_BYTES" - }, - { - "name": "predicate_filter", - "type": ".google.bigtable.v2.RowFilter" - }, - { - "name": "true_mutations", - "type": "TYPE_MESSAGE[]" - }, - { - "name": "false_mutations", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.bigtable.v2.CheckAndMutateRowResponse", - "client": { - "shortName": "BigtableClient", - "fullName": "google.bigtable.v2.BigtableClient" - }, - "method": { - "shortName": "CheckAndMutateRow", - "fullName": "google.bigtable.v2.Bigtable.CheckAndMutateRow", - "service": { - "shortName": "Bigtable", - "fullName": "google.bigtable.v2.Bigtable" - } - } - } - }, - { - "regionTag": "bigtable_v2_generated_Bigtable_PingAndWarm_async", - "title": "bigtable pingAndWarm Sample", - "origin": "API_DEFINITION", - "description": " Warm up associated instance metadata for this connection. This call is not required but may be useful for connection keep-alive.", - "canonical": false, - "file": "bigtable.ping_and_warm.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 29, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PingAndWarm", - "fullName": "google.bigtable.v2.Bigtable.PingAndWarm", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "app_profile_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.v2.PingAndWarmResponse", - "client": { - "shortName": "BigtableClient", - "fullName": "google.bigtable.v2.BigtableClient" - }, - "method": { - "shortName": "PingAndWarm", - "fullName": "google.bigtable.v2.Bigtable.PingAndWarm", - "service": { - "shortName": "Bigtable", - "fullName": "google.bigtable.v2.Bigtable" - } - } - } - }, - { - "regionTag": "bigtable_v2_generated_Bigtable_ReadModifyWriteRow_async", - "title": "bigtable readModifyWriteRow Sample", - "origin": "API_DEFINITION", - "description": " Modifies a row atomically on the server. The method reads the latest existing timestamp and value from the specified columns and writes a new entry based on pre-defined read/modify/write rules. The new value for the timestamp is the greater of the existing timestamp or the current server time. The method returns the new contents of all modified cells.", - "canonical": false, - "file": "bigtable.read_modify_write_row.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 29, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ReadModifyWriteRow", - "fullName": "google.bigtable.v2.Bigtable.ReadModifyWriteRow", - "async": true, - "parameters": [ - { - "name": "table_name", - "type": "TYPE_STRING" - }, - { - "name": "app_profile_id", - "type": "TYPE_STRING" - }, - { - "name": "row_key", - "type": "TYPE_BYTES" - }, - { - "name": "rules", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.bigtable.v2.ReadModifyWriteRowResponse", - "client": { - "shortName": "BigtableClient", - "fullName": "google.bigtable.v2.BigtableClient" - }, - "method": { - "shortName": "ReadModifyWriteRow", - "fullName": "google.bigtable.v2.Bigtable.ReadModifyWriteRow", - "service": { - "shortName": "Bigtable", - "fullName": "google.bigtable.v2.Bigtable" - } - } - } - }, - { - "regionTag": "bigtable_v2_generated_Bigtable_GenerateInitialChangeStreamPartitions_async", - "title": "bigtable generateInitialChangeStreamPartitions Sample", - "origin": "API_DEFINITION", - "description": " NOTE: This API is intended to be used by Apache Beam BigtableIO. Returns the current list of partitions that make up the table's change stream. The union of partitions will cover the entire keyspace. Partitions can be read with `ReadChangeStream`.", - "canonical": false, - "file": "bigtable.generate_initial_change_stream_partitions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 29, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GenerateInitialChangeStreamPartitions", - "fullName": "google.bigtable.v2.Bigtable.GenerateInitialChangeStreamPartitions", - "async": true, - "parameters": [ - { - "name": "table_name", - "type": "TYPE_STRING" - }, - { - "name": "app_profile_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse", - "client": { - "shortName": "BigtableClient", - "fullName": "google.bigtable.v2.BigtableClient" - }, - "method": { - "shortName": "GenerateInitialChangeStreamPartitions", - "fullName": "google.bigtable.v2.Bigtable.GenerateInitialChangeStreamPartitions", - "service": { - "shortName": "Bigtable", - "fullName": "google.bigtable.v2.Bigtable" - } - } - } - }, - { - "regionTag": "bigtable_v2_generated_Bigtable_ReadChangeStream_async", - "title": "bigtable readChangeStream Sample", - "origin": "API_DEFINITION", - "description": " NOTE: This API is intended to be used by Apache Beam BigtableIO. Reads changes from a table's change stream. Changes will reflect both user-initiated mutations and mutations that are caused by garbage collection.", - "canonical": false, - "file": "bigtable.read_change_stream.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 29, - "end": 102, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ReadChangeStream", - "fullName": "google.bigtable.v2.Bigtable.ReadChangeStream", - "async": true, - "parameters": [ - { - "name": "table_name", - "type": "TYPE_STRING" - }, - { - "name": "app_profile_id", - "type": "TYPE_STRING" - }, - { - "name": "partition", - "type": ".google.bigtable.v2.StreamPartition" - }, - { - "name": "start_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "continuation_tokens", - "type": ".google.bigtable.v2.StreamContinuationTokens" - }, - { - "name": "end_time", - "type": ".google.protobuf.Timestamp" - }, - { - "name": "heartbeat_duration", - "type": ".google.protobuf.Duration" - } - ], - "resultType": ".google.bigtable.v2.ReadChangeStreamResponse", - "client": { - "shortName": "BigtableClient", - "fullName": "google.bigtable.v2.BigtableClient" - }, - "method": { - "shortName": "ReadChangeStream", - "fullName": "google.bigtable.v2.Bigtable.ReadChangeStream", - "service": { - "shortName": "Bigtable", - "fullName": "google.bigtable.v2.Bigtable" - } - } - } - } - ] -} diff --git a/owl-bot-staging/v2/src/index.ts b/owl-bot-staging/v2/src/index.ts deleted file mode 100644 index 5e19c8f06..000000000 --- a/owl-bot-staging/v2/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2023 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 v2 from './v2'; -const BigtableClient = v2.BigtableClient; -type BigtableClient = v2.BigtableClient; -export {v2, BigtableClient}; -export default {v2, BigtableClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/v2/src/v2/bigtable_client.ts b/owl-bot-staging/v2/src/v2/bigtable_client.ts deleted file mode 100644 index 3655a25db..000000000 --- a/owl-bot-staging/v2/src/v2/bigtable_client.ts +++ /dev/null @@ -1,1161 +0,0 @@ -// Copyright 2023 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} from 'google-gax'; -import {PassThrough} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v2/bigtable_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './bigtable_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Service for reading from and writing to existing Bigtable tables. - * @class - * @memberof v2 - */ -export class BigtableClient { - 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}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - bigtableStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BigtableClient. - * - * @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 BigtableClient({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 BigtableClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.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 !== staticMembers.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 = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && '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 = { - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}' - ), - tablePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/instances/{instance}/tables/{table}' - ), - }; - - // Some of the methods on this service provide streaming responses. - // Provide descriptors for these. - this.descriptors.stream = { - readRows: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback), - sampleRowKeys: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback), - mutateRows: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback), - generateInitialChangeStreamPartitions: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback), - readChangeStream: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.bigtable.v2.Bigtable', 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.bigtableStub) { - return this.bigtableStub; - } - - // Put together the "service stub" for - // google.bigtable.v2.Bigtable. - this.bigtableStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.bigtable.v2.Bigtable') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.bigtable.v2.Bigtable, - 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 bigtableStubMethods = - ['readRows', 'sampleRowKeys', 'mutateRow', 'mutateRows', 'checkAndMutateRow', 'pingAndWarm', 'readModifyWriteRow', 'generateInitialChangeStreamPartitions', 'readChangeStream']; - for (const methodName of bigtableStubMethods) { - const callPromise = this.bigtableStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - if (methodName in this.descriptors.stream) { - const stream = new PassThrough(); - setImmediate(() => { - stream.emit('error', new this._gaxModule.GoogleError('The client has already been closed.')); - }); - return stream; - } - 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.stream[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.bigtableStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'bigtable.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'bigtable.googleapis.com'; - } - - /** - * 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/bigtable.data', - 'https://www.googleapis.com/auth/bigtable.data.readonly', - 'https://www.googleapis.com/auth/cloud-bigtable.data', - 'https://www.googleapis.com/auth/cloud-bigtable.data.readonly', - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/cloud-platform.read-only' - ]; - } - - 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 -- - // ------------------- -/** - * Mutates a row atomically. Cells already present in the row are left - * unchanged unless explicitly changed by `mutation`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tableName - * Required. The unique name of the table to which the mutation should be - * applied. Values are of the form - * `projects//instances//tables/
`. - * @param {string} request.appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @param {Buffer} request.rowKey - * Required. The key of the row to which the mutation should be applied. - * @param {number[]} request.mutations - * Required. Changes to be atomically applied to the specified row. Entries - * are applied in order, meaning that earlier mutations can be masked by later - * ones. Must contain at least one entry and at most 100000. - * @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.bigtable.v2.MutateRowResponse|MutateRowResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - mutateRow( - request?: protos.google.bigtable.v2.IMutateRowRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.v2.IMutateRowResponse, - protos.google.bigtable.v2.IMutateRowRequest|undefined, {}|undefined - ]>; - mutateRow( - request: protos.google.bigtable.v2.IMutateRowRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.v2.IMutateRowResponse, - protos.google.bigtable.v2.IMutateRowRequest|null|undefined, - {}|null|undefined>): void; - mutateRow( - request: protos.google.bigtable.v2.IMutateRowRequest, - callback: Callback< - protos.google.bigtable.v2.IMutateRowResponse, - protos.google.bigtable.v2.IMutateRowRequest|null|undefined, - {}|null|undefined>): void; - mutateRow( - request?: protos.google.bigtable.v2.IMutateRowRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.v2.IMutateRowResponse, - protos.google.bigtable.v2.IMutateRowRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.v2.IMutateRowResponse, - protos.google.bigtable.v2.IMutateRowRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.v2.IMutateRowResponse, - protos.google.bigtable.v2.IMutateRowRequest|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 || {}; - let routingParameter = {}; - { - const fieldValue = request.tableName; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/instances/[^/]+/tables/[^/]+)')); - if (match) { - const parameterValue = match.groups?.['table_name'] ?? fieldValue; - Object.assign(routingParameter, { table_name: parameterValue }); - } - } - } - { - const fieldValue = request.appProfileId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; - Object.assign(routingParameter, { app_profile_id: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize(); - return this.innerApiCalls.mutateRow(request, options, callback); - } -/** - * Mutates a row atomically based on the output of a predicate Reader filter. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tableName - * Required. The unique name of the table to which the conditional mutation - * should be applied. Values are of the form - * `projects//instances//tables/
`. - * @param {string} request.appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @param {Buffer} request.rowKey - * Required. The key of the row to which the conditional mutation should be - * applied. - * @param {google.bigtable.v2.RowFilter} request.predicateFilter - * The filter to be applied to the contents of the specified row. Depending - * on whether or not any results are yielded, either `true_mutations` or - * `false_mutations` will be executed. If unset, checks that the row contains - * any values at all. - * @param {number[]} request.trueMutations - * Changes to be atomically applied to the specified row if `predicate_filter` - * yields at least one cell when applied to `row_key`. Entries are applied in - * order, meaning that earlier mutations can be masked by later ones. - * Must contain at least one entry if `false_mutations` is empty, and at most - * 100000. - * @param {number[]} request.falseMutations - * Changes to be atomically applied to the specified row if `predicate_filter` - * does not yield any cells when applied to `row_key`. Entries are applied in - * order, meaning that earlier mutations can be masked by later ones. - * Must contain at least one entry if `true_mutations` is empty, and at most - * 100000. - * @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.bigtable.v2.CheckAndMutateRowResponse|CheckAndMutateRowResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - checkAndMutateRow( - request?: protos.google.bigtable.v2.ICheckAndMutateRowRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.v2.ICheckAndMutateRowResponse, - protos.google.bigtable.v2.ICheckAndMutateRowRequest|undefined, {}|undefined - ]>; - checkAndMutateRow( - request: protos.google.bigtable.v2.ICheckAndMutateRowRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.v2.ICheckAndMutateRowResponse, - protos.google.bigtable.v2.ICheckAndMutateRowRequest|null|undefined, - {}|null|undefined>): void; - checkAndMutateRow( - request: protos.google.bigtable.v2.ICheckAndMutateRowRequest, - callback: Callback< - protos.google.bigtable.v2.ICheckAndMutateRowResponse, - protos.google.bigtable.v2.ICheckAndMutateRowRequest|null|undefined, - {}|null|undefined>): void; - checkAndMutateRow( - request?: protos.google.bigtable.v2.ICheckAndMutateRowRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.v2.ICheckAndMutateRowResponse, - protos.google.bigtable.v2.ICheckAndMutateRowRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.v2.ICheckAndMutateRowResponse, - protos.google.bigtable.v2.ICheckAndMutateRowRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.v2.ICheckAndMutateRowResponse, - protos.google.bigtable.v2.ICheckAndMutateRowRequest|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 || {}; - let routingParameter = {}; - { - const fieldValue = request.tableName; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/instances/[^/]+/tables/[^/]+)')); - if (match) { - const parameterValue = match.groups?.['table_name'] ?? fieldValue; - Object.assign(routingParameter, { table_name: parameterValue }); - } - } - } - { - const fieldValue = request.appProfileId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; - Object.assign(routingParameter, { app_profile_id: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize(); - return this.innerApiCalls.checkAndMutateRow(request, options, callback); - } -/** - * Warm up associated instance metadata for this connection. - * This call is not required but may be useful for connection keep-alive. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The unique name of the instance to check permissions for as well - * as respond. Values are of the form - * `projects//instances/`. - * @param {string} request.appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @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.bigtable.v2.PingAndWarmResponse|PingAndWarmResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - pingAndWarm( - request?: protos.google.bigtable.v2.IPingAndWarmRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.v2.IPingAndWarmResponse, - protos.google.bigtable.v2.IPingAndWarmRequest|undefined, {}|undefined - ]>; - pingAndWarm( - request: protos.google.bigtable.v2.IPingAndWarmRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.v2.IPingAndWarmResponse, - protos.google.bigtable.v2.IPingAndWarmRequest|null|undefined, - {}|null|undefined>): void; - pingAndWarm( - request: protos.google.bigtable.v2.IPingAndWarmRequest, - callback: Callback< - protos.google.bigtable.v2.IPingAndWarmResponse, - protos.google.bigtable.v2.IPingAndWarmRequest|null|undefined, - {}|null|undefined>): void; - pingAndWarm( - request?: protos.google.bigtable.v2.IPingAndWarmRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.v2.IPingAndWarmResponse, - protos.google.bigtable.v2.IPingAndWarmRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.v2.IPingAndWarmResponse, - protos.google.bigtable.v2.IPingAndWarmRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.v2.IPingAndWarmResponse, - protos.google.bigtable.v2.IPingAndWarmRequest|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 || {}; - let routingParameter = {}; - { - const fieldValue = request.name; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/instances/[^/]+)')); - if (match) { - const parameterValue = match.groups?.['name'] ?? fieldValue; - Object.assign(routingParameter, { name: parameterValue }); - } - } - } - { - const fieldValue = request.appProfileId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; - Object.assign(routingParameter, { app_profile_id: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize(); - return this.innerApiCalls.pingAndWarm(request, options, callback); - } -/** - * Modifies a row atomically on the server. The method reads the latest - * existing timestamp and value from the specified columns and writes a new - * entry based on pre-defined read/modify/write rules. The new value for the - * timestamp is the greater of the existing timestamp or the current server - * time. The method returns the new contents of all modified cells. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tableName - * Required. The unique name of the table to which the read/modify/write rules - * should be applied. Values are of the form - * `projects//instances//tables/
`. - * @param {string} request.appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @param {Buffer} request.rowKey - * Required. The key of the row to which the read/modify/write rules should be - * applied. - * @param {number[]} request.rules - * Required. Rules specifying how the specified row's contents are to be - * transformed into writes. Entries are applied in order, meaning that earlier - * rules will affect the results of later ones. - * @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.bigtable.v2.ReadModifyWriteRowResponse|ReadModifyWriteRowResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - */ - readModifyWriteRow( - request?: protos.google.bigtable.v2.IReadModifyWriteRowRequest, - options?: CallOptions): - Promise<[ - protos.google.bigtable.v2.IReadModifyWriteRowResponse, - protos.google.bigtable.v2.IReadModifyWriteRowRequest|undefined, {}|undefined - ]>; - readModifyWriteRow( - request: protos.google.bigtable.v2.IReadModifyWriteRowRequest, - options: CallOptions, - callback: Callback< - protos.google.bigtable.v2.IReadModifyWriteRowResponse, - protos.google.bigtable.v2.IReadModifyWriteRowRequest|null|undefined, - {}|null|undefined>): void; - readModifyWriteRow( - request: protos.google.bigtable.v2.IReadModifyWriteRowRequest, - callback: Callback< - protos.google.bigtable.v2.IReadModifyWriteRowResponse, - protos.google.bigtable.v2.IReadModifyWriteRowRequest|null|undefined, - {}|null|undefined>): void; - readModifyWriteRow( - request?: protos.google.bigtable.v2.IReadModifyWriteRowRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.bigtable.v2.IReadModifyWriteRowResponse, - protos.google.bigtable.v2.IReadModifyWriteRowRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.bigtable.v2.IReadModifyWriteRowResponse, - protos.google.bigtable.v2.IReadModifyWriteRowRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.bigtable.v2.IReadModifyWriteRowResponse, - protos.google.bigtable.v2.IReadModifyWriteRowRequest|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 || {}; - let routingParameter = {}; - { - const fieldValue = request.tableName; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/instances/[^/]+/tables/[^/]+)')); - if (match) { - const parameterValue = match.groups?.['table_name'] ?? fieldValue; - Object.assign(routingParameter, { table_name: parameterValue }); - } - } - } - { - const fieldValue = request.appProfileId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; - Object.assign(routingParameter, { app_profile_id: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize(); - return this.innerApiCalls.readModifyWriteRow(request, options, callback); - } - -/** - * Streams back the contents of all requested rows in key order, optionally - * applying the same Reader filter to each. Depending on their size, - * rows and cells may be broken up across multiple responses, but - * atomicity of each row will still be preserved. See the - * ReadRowsResponse documentation for details. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tableName - * Required. The unique name of the table from which to read. - * Values are of the form - * `projects//instances//tables/
`. - * @param {string} request.appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @param {google.bigtable.v2.RowSet} request.rows - * The row keys and/or ranges to read sequentially. If not specified, reads - * from all rows. - * @param {google.bigtable.v2.RowFilter} request.filter - * The filter to apply to the contents of the specified row(s). If unset, - * reads the entirety of each row. - * @param {number} request.rowsLimit - * The read will stop after committing to N rows' worth of results. The - * default (zero) is to return all results. - * @param {google.bigtable.v2.ReadRowsRequest.RequestStatsView} request.requestStatsView - * The view into RequestStats, as described above. - * @param {boolean} request.reversed - * Experimental API - Please note that this API is currently experimental - * and can change in the future. - * - * Return rows in lexiographical descending order of the row keys. The row - * contents will not be affected by this flag. - * - * Example result set: - * - * [ - * {key: "k2", "f:col1": "v1", "f:col2": "v1"}, - * {key: "k1", "f:col1": "v2", "f:col2": "v2"} - * ] - * @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 {@link protos.google.bigtable.v2.ReadRowsResponse|ReadRowsResponse} on 'data' event. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } - * for more details and examples. - */ - readRows( - request?: protos.google.bigtable.v2.IReadRowsRequest, - options?: CallOptions): - gax.CancellableStream{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.tableName; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/instances/[^/]+/tables/[^/]+)')); - if (match) { - const parameterValue = match.groups?.['table_name'] ?? fieldValue; - Object.assign(routingParameter, { table_name: parameterValue }); - } - } - } - { - const fieldValue = request.appProfileId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; - Object.assign(routingParameter, { app_profile_id: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize(); - return this.innerApiCalls.readRows(request, options); - } - -/** - * Returns a sample of row keys in the table. The returned row keys will - * delimit contiguous sections of the table of approximately equal size, - * which can be used to break up the data for distributed tasks like - * mapreduces. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tableName - * Required. The unique name of the table from which to sample row keys. - * Values are of the form - * `projects//instances//tables/
`. - * @param {string} request.appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @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 {@link protos.google.bigtable.v2.SampleRowKeysResponse|SampleRowKeysResponse} on 'data' event. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } - * for more details and examples. - */ - sampleRowKeys( - request?: protos.google.bigtable.v2.ISampleRowKeysRequest, - options?: CallOptions): - gax.CancellableStream{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.tableName; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/instances/[^/]+/tables/[^/]+)')); - if (match) { - const parameterValue = match.groups?.['table_name'] ?? fieldValue; - Object.assign(routingParameter, { table_name: parameterValue }); - } - } - } - { - const fieldValue = request.appProfileId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; - Object.assign(routingParameter, { app_profile_id: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize(); - return this.innerApiCalls.sampleRowKeys(request, options); - } - -/** - * Mutates multiple rows in a batch. Each individual row is mutated - * atomically as in MutateRow, but the entire batch is not executed - * atomically. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tableName - * Required. The unique name of the table to which the mutations should be - * applied. - * @param {string} request.appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * @param {number[]} request.entries - * Required. The row keys and corresponding mutations to be applied in bulk. - * Each entry is applied as an atomic mutation, but the entries may be - * applied in arbitrary order (even between entries for the same row). - * At least one entry must be specified, and in total the entries can - * contain at most 100000 mutations. - * @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 {@link protos.google.bigtable.v2.MutateRowsResponse|MutateRowsResponse} on 'data' event. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } - * for more details and examples. - */ - mutateRows( - request?: protos.google.bigtable.v2.IMutateRowsRequest, - options?: CallOptions): - gax.CancellableStream{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.tableName; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?projects/[^/]+/instances/[^/]+/tables/[^/]+)')); - if (match) { - const parameterValue = match.groups?.['table_name'] ?? fieldValue; - Object.assign(routingParameter, { table_name: parameterValue }); - } - } - } - { - const fieldValue = request.appProfileId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['app_profile_id'] ?? fieldValue; - Object.assign(routingParameter, { app_profile_id: parameterValue }); - } - } - } - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams( - routingParameter - ); - this.initialize(); - return this.innerApiCalls.mutateRows(request, options); - } - -/** - * NOTE: This API is intended to be used by Apache Beam BigtableIO. - * Returns the current list of partitions that make up the table's - * change stream. The union of partitions will cover the entire keyspace. - * Partitions can be read with `ReadChangeStream`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tableName - * Required. The unique name of the table from which to get change stream - * partitions. Values are of the form - * `projects//instances//tables/
`. - * Change streaming must be enabled on the table. - * @param {string} request.appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * Single cluster routing must be configured on the profile. - * @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 {@link protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse|GenerateInitialChangeStreamPartitionsResponse} on 'data' event. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } - * for more details and examples. - */ - generateInitialChangeStreamPartitions( - request?: protos.google.bigtable.v2.IGenerateInitialChangeStreamPartitionsRequest, - options?: CallOptions): - gax.CancellableStream{ - 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({ - 'table_name': request.tableName ?? '', - }); - this.initialize(); - return this.innerApiCalls.generateInitialChangeStreamPartitions(request, options); - } - -/** - * NOTE: This API is intended to be used by Apache Beam BigtableIO. - * Reads changes from a table's change stream. Changes will - * reflect both user-initiated mutations and mutations that are caused by - * garbage collection. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.tableName - * Required. The unique name of the table from which to read a change stream. - * Values are of the form - * `projects//instances//tables/
`. - * Change streaming must be enabled on the table. - * @param {string} request.appProfileId - * This value specifies routing for replication. If not specified, the - * "default" application profile will be used. - * Single cluster routing must be configured on the profile. - * @param {google.bigtable.v2.StreamPartition} request.partition - * The partition to read changes from. - * @param {google.protobuf.Timestamp} request.startTime - * Start reading the stream at the specified timestamp. This timestamp must - * be within the change stream retention period, less than or equal to the - * current time, and after change stream creation, whichever is greater. - * This value is inclusive and will be truncated to microsecond granularity. - * @param {google.bigtable.v2.StreamContinuationTokens} request.continuationTokens - * Tokens that describe how to resume reading a stream where reading - * previously left off. If specified, changes will be read starting at the - * the position. Tokens are delivered on the stream as part of `Heartbeat` - * and `CloseStream` messages. - * - * If a single token is provided, the token’s partition must exactly match - * the request’s partition. If multiple tokens are provided, as in the case - * of a partition merge, the union of the token partitions must exactly - * cover the request’s partition. Otherwise, INVALID_ARGUMENT will be - * returned. - * @param {google.protobuf.Timestamp} request.endTime - * If specified, OK will be returned when the stream advances beyond - * this time. Otherwise, changes will be continuously delivered on the stream. - * This value is inclusive and will be truncated to microsecond granularity. - * @param {google.protobuf.Duration} request.heartbeatDuration - * If specified, the duration between `Heartbeat` messages on the stream. - * Otherwise, defaults to 5 seconds. - * @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 {@link protos.google.bigtable.v2.ReadChangeStreamResponse|ReadChangeStreamResponse} on 'data' event. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation } - * for more details and examples. - */ - readChangeStream( - request?: protos.google.bigtable.v2.IReadChangeStreamRequest, - options?: CallOptions): - gax.CancellableStream{ - 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({ - 'table_name': request.tableName ?? '', - }); - this.initialize(); - return this.innerApiCalls.readChangeStream(request, options); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - 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 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 table resource name string. - * - * @param {string} project - * @param {string} instance - * @param {string} table - * @returns {string} Resource name string. - */ - tablePath(project:string,instance:string,table:string) { - return this.pathTemplates.tablePathTemplate.render({ - project: project, - instance: instance, - table: table, - }); - } - - /** - * Parse the project from Table resource. - * - * @param {string} tableName - * A fully-qualified path representing Table resource. - * @returns {string} A string representing the project. - */ - matchProjectFromTableName(tableName: string) { - return this.pathTemplates.tablePathTemplate.match(tableName).project; - } - - /** - * Parse the instance from Table resource. - * - * @param {string} tableName - * A fully-qualified path representing Table resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromTableName(tableName: string) { - return this.pathTemplates.tablePathTemplate.match(tableName).instance; - } - - /** - * Parse the table from Table resource. - * - * @param {string} tableName - * A fully-qualified path representing Table resource. - * @returns {string} A string representing the table. - */ - matchTableFromTableName(tableName: string) { - return this.pathTemplates.tablePathTemplate.match(tableName).table; - } - - /** - * 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.bigtableStub && !this._terminated) { - return this.bigtableStub.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v2/src/v2/bigtable_client_config.json b/owl-bot-staging/v2/src/v2/bigtable_client_config.json deleted file mode 100644 index 2f8a128c4..000000000 --- a/owl-bot-staging/v2/src/v2/bigtable_client_config.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "interfaces": { - "google.bigtable.v2.Bigtable": { - "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 - }, - "5af39a0f6db447f61c4f695240caeccb74f78362": { - "initial_retry_delay_millis": 10, - "retry_delay_multiplier": 2, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ReadRows": { - "timeout_millis": 43200000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "SampleRowKeys": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "MutateRow": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "5af39a0f6db447f61c4f695240caeccb74f78362" - }, - "MutateRows": { - "timeout_millis": 600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CheckAndMutateRow": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PingAndWarm": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ReadModifyWriteRow": { - "timeout_millis": 20000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GenerateInitialChangeStreamPartitions": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ReadChangeStream": { - "timeout_millis": 43200000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v2/src/v2/bigtable_proto_list.json b/owl-bot-staging/v2/src/v2/bigtable_proto_list.json deleted file mode 100644 index c6f577144..000000000 --- a/owl-bot-staging/v2/src/v2/bigtable_proto_list.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "../../protos/google/bigtable/v2/bigtable.proto", - "../../protos/google/bigtable/v2/data.proto", - "../../protos/google/bigtable/v2/feature_flags.proto", - "../../protos/google/bigtable/v2/request_stats.proto", - "../../protos/google/bigtable/v2/response_params.proto" -] diff --git a/owl-bot-staging/v2/src/v2/gapic_metadata.json b/owl-bot-staging/v2/src/v2/gapic_metadata.json deleted file mode 100644 index 0a063a06e..000000000 --- a/owl-bot-staging/v2/src/v2/gapic_metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.bigtable.v2", - "libraryPackage": "@google-cloud/bigtable", - "services": { - "Bigtable": { - "clients": { - "grpc": { - "libraryClient": "BigtableClient", - "rpcs": { - "MutateRow": { - "methods": [ - "mutateRow" - ] - }, - "CheckAndMutateRow": { - "methods": [ - "checkAndMutateRow" - ] - }, - "PingAndWarm": { - "methods": [ - "pingAndWarm" - ] - }, - "ReadModifyWriteRow": { - "methods": [ - "readModifyWriteRow" - ] - }, - "ReadRows": { - "methods": [ - "readRows" - ] - }, - "SampleRowKeys": { - "methods": [ - "sampleRowKeys" - ] - }, - "MutateRows": { - "methods": [ - "mutateRows" - ] - }, - "GenerateInitialChangeStreamPartitions": { - "methods": [ - "generateInitialChangeStreamPartitions" - ] - }, - "ReadChangeStream": { - "methods": [ - "readChangeStream" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BigtableClient", - "rpcs": { - "MutateRow": { - "methods": [ - "mutateRow" - ] - }, - "CheckAndMutateRow": { - "methods": [ - "checkAndMutateRow" - ] - }, - "PingAndWarm": { - "methods": [ - "pingAndWarm" - ] - }, - "ReadModifyWriteRow": { - "methods": [ - "readModifyWriteRow" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v2/src/v2/index.ts b/owl-bot-staging/v2/src/v2/index.ts deleted file mode 100644 index 93aff8f9c..000000000 --- a/owl-bot-staging/v2/src/v2/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2023 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 {BigtableClient} from './bigtable_client'; diff --git a/owl-bot-staging/v2/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v2/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 9f94c7813..000000000 --- a/owl-bot-staging/v2/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2023 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. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const bigtable = require('@google-cloud/bigtable'); - -function main() { - const bigtableClient = new bigtable.BigtableClient(); -} - -main(); diff --git a/owl-bot-staging/v2/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v2/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index ae47c61a9..000000000 --- a/owl-bot-staging/v2/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2023 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 {BigtableClient} from '@google-cloud/bigtable'; - -// check that the client class type name can be used -function doStuffWithBigtableClient(client: BigtableClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const bigtableClient = new BigtableClient(); - doStuffWithBigtableClient(bigtableClient); -} - -main(); diff --git a/owl-bot-staging/v2/system-test/install.ts b/owl-bot-staging/v2/system-test/install.ts deleted file mode 100644 index c8f81b25a..000000000 --- a/owl-bot-staging/v2/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2023 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 {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/v2/test/gapic_bigtable_v2.ts b/owl-bot-staging/v2/test/gapic_bigtable_v2.ts deleted file mode 100644 index 09074faad..000000000 --- a/owl-bot-staging/v2/test/gapic_bigtable_v2.ts +++ /dev/null @@ -1,1143 +0,0 @@ -// Copyright 2023 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 bigtableModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf} 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 stubServerStreamingCall(response?: ResponseType, error?: Error) { - const transformStub = error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // write something to the stream to trigger transformStub and send the response back to the client - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - return sinon.stub().returns(mockStream); -} - -describe('v2.BigtableClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = bigtableModule.v2.BigtableClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = bigtableModule.v2.BigtableClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = bigtableModule.v2.BigtableClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new bigtableModule.v2.BigtableClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new bigtableModule.v2.BigtableClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.bigtableStub, undefined); - await client.initialize(); - assert(client.bigtableStub); - }); - - it('has close method for the initialized client', done => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.bigtableStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.bigtableStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new bigtableModule.v2.BigtableClient({ - 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 bigtableModule.v2.BigtableClient({ - 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('mutateRow', () => { - it('invokes mutateRow without error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.MutateRowRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.v2.MutateRowResponse() - ); - client.innerApiCalls.mutateRow = stubSimpleCall(expectedResponse); - const [response] = await client.mutateRow(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.mutateRow as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateRow as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mutateRow without error using callback', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.MutateRowRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.v2.MutateRowResponse() - ); - client.innerApiCalls.mutateRow = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.mutateRow( - request, - (err?: Error|null, result?: protos.google.bigtable.v2.IMutateRowResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.mutateRow as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateRow as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mutateRow with error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.MutateRowRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateRow = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.mutateRow(request), expectedError); - const actualRequest = (client.innerApiCalls.mutateRow as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateRow as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mutateRow with closed client', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.MutateRowRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.mutateRow(request), expectedError); - }); - }); - - describe('checkAndMutateRow', () => { - it('invokes checkAndMutateRow without error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.CheckAndMutateRowRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.v2.CheckAndMutateRowResponse() - ); - client.innerApiCalls.checkAndMutateRow = stubSimpleCall(expectedResponse); - const [response] = await client.checkAndMutateRow(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.checkAndMutateRow as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAndMutateRow as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAndMutateRow without error using callback', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.CheckAndMutateRowRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.v2.CheckAndMutateRowResponse() - ); - client.innerApiCalls.checkAndMutateRow = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.checkAndMutateRow( - request, - (err?: Error|null, result?: protos.google.bigtable.v2.ICheckAndMutateRowResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.checkAndMutateRow as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAndMutateRow as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAndMutateRow with error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.CheckAndMutateRowRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.checkAndMutateRow = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkAndMutateRow(request), expectedError); - const actualRequest = (client.innerApiCalls.checkAndMutateRow as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.checkAndMutateRow as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkAndMutateRow with closed client', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.CheckAndMutateRowRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.checkAndMutateRow(request), expectedError); - }); - }); - - describe('pingAndWarm', () => { - it('invokes pingAndWarm without error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.PingAndWarmRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.v2.PingAndWarmResponse() - ); - client.innerApiCalls.pingAndWarm = stubSimpleCall(expectedResponse); - const [response] = await client.pingAndWarm(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.pingAndWarm as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pingAndWarm as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pingAndWarm without error using callback', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.PingAndWarmRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.v2.PingAndWarmResponse() - ); - client.innerApiCalls.pingAndWarm = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.pingAndWarm( - request, - (err?: Error|null, result?: protos.google.bigtable.v2.IPingAndWarmResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.pingAndWarm as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pingAndWarm as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pingAndWarm with error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.PingAndWarmRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.pingAndWarm = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.pingAndWarm(request), expectedError); - const actualRequest = (client.innerApiCalls.pingAndWarm as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.pingAndWarm as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes pingAndWarm with closed client', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.PingAndWarmRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.pingAndWarm(request), expectedError); - }); - }); - - describe('readModifyWriteRow', () => { - it('invokes readModifyWriteRow without error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.ReadModifyWriteRowRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.v2.ReadModifyWriteRowResponse() - ); - client.innerApiCalls.readModifyWriteRow = stubSimpleCall(expectedResponse); - const [response] = await client.readModifyWriteRow(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.readModifyWriteRow as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readModifyWriteRow as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readModifyWriteRow without error using callback', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.ReadModifyWriteRowRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.v2.ReadModifyWriteRowResponse() - ); - client.innerApiCalls.readModifyWriteRow = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.readModifyWriteRow( - request, - (err?: Error|null, result?: protos.google.bigtable.v2.IReadModifyWriteRowResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.readModifyWriteRow as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readModifyWriteRow as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readModifyWriteRow with error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.ReadModifyWriteRowRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.readModifyWriteRow = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readModifyWriteRow(request), expectedError); - const actualRequest = (client.innerApiCalls.readModifyWriteRow as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readModifyWriteRow as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readModifyWriteRow with closed client', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.ReadModifyWriteRowRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.readModifyWriteRow(request), expectedError); - }); - }); - - describe('readRows', () => { - it('invokes readRows without error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.ReadRowsRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.v2.ReadRowsResponse() - ); - client.innerApiCalls.readRows = stubServerStreamingCall(expectedResponse); - const stream = client.readRows(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.ReadRowsResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.readRows as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readRows as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readRows with error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.ReadRowsRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.readRows = stubServerStreamingCall(undefined, expectedError); - const stream = client.readRows(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.ReadRowsResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - const actualRequest = (client.innerApiCalls.readRows as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readRows as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readRows with closed client', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.ReadRowsRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close(); - const stream = client.readRows(request, {retryRequestOptions: {noResponseRetries: 0}}); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.ReadRowsResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - }); - - describe('sampleRowKeys', () => { - it('invokes sampleRowKeys without error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.SampleRowKeysRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.v2.SampleRowKeysResponse() - ); - client.innerApiCalls.sampleRowKeys = stubServerStreamingCall(expectedResponse); - const stream = client.sampleRowKeys(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.SampleRowKeysResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.sampleRowKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.sampleRowKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes sampleRowKeys with error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.SampleRowKeysRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.sampleRowKeys = stubServerStreamingCall(undefined, expectedError); - const stream = client.sampleRowKeys(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.SampleRowKeysResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - const actualRequest = (client.innerApiCalls.sampleRowKeys as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.sampleRowKeys as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes sampleRowKeys with closed client', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.SampleRowKeysRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close(); - const stream = client.sampleRowKeys(request, {retryRequestOptions: {noResponseRetries: 0}}); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.SampleRowKeysResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - }); - - describe('mutateRows', () => { - it('invokes mutateRows without error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.MutateRowsRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.v2.MutateRowsResponse() - ); - client.innerApiCalls.mutateRows = stubServerStreamingCall(expectedResponse); - const stream = client.mutateRows(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.MutateRowsResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.mutateRows as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateRows as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mutateRows with error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.MutateRowsRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedHeaderRequestParams = 'app_profile_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.mutateRows = stubServerStreamingCall(undefined, expectedError); - const stream = client.mutateRows(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.MutateRowsResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - const actualRequest = (client.innerApiCalls.mutateRows as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.mutateRows as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes mutateRows with closed client', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.MutateRowsRequest() - ); - // path template is empty - request.appProfileId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close(); - const stream = client.mutateRows(request, {retryRequestOptions: {noResponseRetries: 0}}); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.MutateRowsResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - }); - - describe('generateInitialChangeStreamPartitions', () => { - it('invokes generateInitialChangeStreamPartitions without error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest', ['tableName']); - request.tableName = defaultValue1; - const expectedHeaderRequestParams = `table_name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse() - ); - client.innerApiCalls.generateInitialChangeStreamPartitions = stubServerStreamingCall(expectedResponse); - const stream = client.generateInitialChangeStreamPartitions(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.generateInitialChangeStreamPartitions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateInitialChangeStreamPartitions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateInitialChangeStreamPartitions with error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest', ['tableName']); - request.tableName = defaultValue1; - const expectedHeaderRequestParams = `table_name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.generateInitialChangeStreamPartitions = stubServerStreamingCall(undefined, expectedError); - const stream = client.generateInitialChangeStreamPartitions(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - const actualRequest = (client.innerApiCalls.generateInitialChangeStreamPartitions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.generateInitialChangeStreamPartitions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes generateInitialChangeStreamPartitions with closed client', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.v2.GenerateInitialChangeStreamPartitionsRequest', ['tableName']); - request.tableName = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - const stream = client.generateInitialChangeStreamPartitions(request, {retryRequestOptions: {noResponseRetries: 0}}); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.GenerateInitialChangeStreamPartitionsResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - }); - - describe('readChangeStream', () => { - it('invokes readChangeStream without error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.ReadChangeStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.v2.ReadChangeStreamRequest', ['tableName']); - request.tableName = defaultValue1; - const expectedHeaderRequestParams = `table_name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.bigtable.v2.ReadChangeStreamResponse() - ); - client.innerApiCalls.readChangeStream = stubServerStreamingCall(expectedResponse); - const stream = client.readChangeStream(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.ReadChangeStreamResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.readChangeStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readChangeStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readChangeStream with error', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.ReadChangeStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.v2.ReadChangeStreamRequest', ['tableName']); - request.tableName = defaultValue1; - const expectedHeaderRequestParams = `table_name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.readChangeStream = stubServerStreamingCall(undefined, expectedError); - const stream = client.readChangeStream(request); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.ReadChangeStreamResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - const actualRequest = (client.innerApiCalls.readChangeStream as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.readChangeStream as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes readChangeStream with closed client', async () => { - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.bigtable.v2.ReadChangeStreamRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.bigtable.v2.ReadChangeStreamRequest', ['tableName']); - request.tableName = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - const stream = client.readChangeStream(request, {retryRequestOptions: {noResponseRetries: 0}}); - const promise = new Promise((resolve, reject) => { - stream.on('data', (response: protos.google.bigtable.v2.ReadChangeStreamResponse) => { - resolve(response); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - }); - }); - - describe('Path templates', () => { - - describe('instance', () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - }; - const client = new bigtableModule.v2.BigtableClient({ - 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", "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('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('table', () => { - const fakePath = "/rendered/path/table"; - const expectedParameters = { - project: "projectValue", - instance: "instanceValue", - table: "tableValue", - }; - const client = new bigtableModule.v2.BigtableClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.tablePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.tablePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('tablePath', () => { - const result = client.tablePath("projectValue", "instanceValue", "tableValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.tablePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromTableName', () => { - const result = client.matchProjectFromTableName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.tablePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromTableName', () => { - const result = client.matchInstanceFromTableName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.tablePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTableFromTableName', () => { - const result = client.matchTableFromTableName(fakePath); - assert.strictEqual(result, "tableValue"); - assert((client.pathTemplates.tablePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v2/tsconfig.json b/owl-bot-staging/v2/tsconfig.json deleted file mode 100644 index c78f1c884..000000000 --- a/owl-bot-staging/v2/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/v2/webpack.config.js b/owl-bot-staging/v2/webpack.config.js deleted file mode 100644 index 9b488aad8..000000000 --- a/owl-bot-staging/v2/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// 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. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'bigtable', - filename: './bigtable.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/protos/google/bigtable/v2/feature_flags.proto b/protos/google/bigtable/v2/feature_flags.proto index 62b55582d..942646c6b 100644 --- a/protos/google/bigtable/v2/feature_flags.proto +++ b/protos/google/bigtable/v2/feature_flags.proto @@ -24,13 +24,13 @@ option java_package = "com.google.bigtable.v2"; option php_namespace = "Google\\Cloud\\Bigtable\\V2"; option ruby_package = "Google::Cloud::Bigtable::V2"; -// Feature flags supported by a client. +// Feature flags supported or enabled by a client. // This is intended to be sent as part of request metadata to assure the server // that certain behaviors are safe to enable. This proto is meant to be // serialized and websafe-base64 encoded under the `bigtable-features` metadata // key. The value will remain constant for the lifetime of a client and due to // HTTP2's HPACK compression, the request overhead will be tiny. -// This is an internal implementation detail and should not be used by endusers +// This is an internal implementation detail and should not be used by end users // directly. message FeatureFlags { // Notify the server that the client supports reverse scans. The server will @@ -38,10 +38,16 @@ message FeatureFlags { bool reverse_scans = 1; // Notify the server that the client enables batch write flow control by - // requesting RateLimitInfo from MutateRowsResponse. + // requesting RateLimitInfo from MutateRowsResponse. Due to technical reasons, + // this disables partial retries. bool mutate_rows_rate_limit = 3; + // Notify the server that the client enables batch write flow control by + // requesting RateLimitInfo from MutateRowsResponse. With partial retries + // enabled. + bool mutate_rows_rate_limit2 = 5; + // Notify the server that the client supports the last_scanned_row field - // in ReadRowsResponse for long-running sparse scans. + // in ReadRowsResponse for long-running scans. bool last_scanned_row_responses = 4; } diff --git a/protos/protos.d.ts b/protos/protos.d.ts index f16e4d934..ba59fdbbd 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -16770,6 +16770,9 @@ export namespace google { /** FeatureFlags mutateRowsRateLimit */ mutateRowsRateLimit?: (boolean|null); + /** FeatureFlags mutateRowsRateLimit2 */ + mutateRowsRateLimit2?: (boolean|null); + /** FeatureFlags lastScannedRowResponses */ lastScannedRowResponses?: (boolean|null); } @@ -16789,6 +16792,9 @@ export namespace google { /** FeatureFlags mutateRowsRateLimit. */ public mutateRowsRateLimit: boolean; + /** FeatureFlags mutateRowsRateLimit2. */ + public mutateRowsRateLimit2: boolean; + /** FeatureFlags lastScannedRowResponses. */ public lastScannedRowResponses: boolean; diff --git a/protos/protos.js b/protos/protos.js index 4bec960ed..67ba313be 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -40187,6 +40187,7 @@ * @interface IFeatureFlags * @property {boolean|null} [reverseScans] FeatureFlags reverseScans * @property {boolean|null} [mutateRowsRateLimit] FeatureFlags mutateRowsRateLimit + * @property {boolean|null} [mutateRowsRateLimit2] FeatureFlags mutateRowsRateLimit2 * @property {boolean|null} [lastScannedRowResponses] FeatureFlags lastScannedRowResponses */ @@ -40221,6 +40222,14 @@ */ FeatureFlags.prototype.mutateRowsRateLimit = false; + /** + * FeatureFlags mutateRowsRateLimit2. + * @member {boolean} mutateRowsRateLimit2 + * @memberof google.bigtable.v2.FeatureFlags + * @instance + */ + FeatureFlags.prototype.mutateRowsRateLimit2 = false; + /** * FeatureFlags lastScannedRowResponses. * @member {boolean} lastScannedRowResponses @@ -40259,6 +40268,8 @@ writer.uint32(/* id 3, wireType 0 =*/24).bool(message.mutateRowsRateLimit); if (message.lastScannedRowResponses != null && Object.hasOwnProperty.call(message, "lastScannedRowResponses")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.lastScannedRowResponses); + if (message.mutateRowsRateLimit2 != null && Object.hasOwnProperty.call(message, "mutateRowsRateLimit2")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.mutateRowsRateLimit2); return writer; }; @@ -40301,6 +40312,10 @@ message.mutateRowsRateLimit = reader.bool(); break; } + case 5: { + message.mutateRowsRateLimit2 = reader.bool(); + break; + } case 4: { message.lastScannedRowResponses = reader.bool(); break; @@ -40346,6 +40361,9 @@ if (message.mutateRowsRateLimit != null && message.hasOwnProperty("mutateRowsRateLimit")) if (typeof message.mutateRowsRateLimit !== "boolean") return "mutateRowsRateLimit: boolean expected"; + if (message.mutateRowsRateLimit2 != null && message.hasOwnProperty("mutateRowsRateLimit2")) + if (typeof message.mutateRowsRateLimit2 !== "boolean") + return "mutateRowsRateLimit2: boolean expected"; if (message.lastScannedRowResponses != null && message.hasOwnProperty("lastScannedRowResponses")) if (typeof message.lastScannedRowResponses !== "boolean") return "lastScannedRowResponses: boolean expected"; @@ -40368,6 +40386,8 @@ message.reverseScans = Boolean(object.reverseScans); if (object.mutateRowsRateLimit != null) message.mutateRowsRateLimit = Boolean(object.mutateRowsRateLimit); + if (object.mutateRowsRateLimit2 != null) + message.mutateRowsRateLimit2 = Boolean(object.mutateRowsRateLimit2); if (object.lastScannedRowResponses != null) message.lastScannedRowResponses = Boolean(object.lastScannedRowResponses); return message; @@ -40390,6 +40410,7 @@ object.reverseScans = false; object.mutateRowsRateLimit = false; object.lastScannedRowResponses = false; + object.mutateRowsRateLimit2 = false; } if (message.reverseScans != null && message.hasOwnProperty("reverseScans")) object.reverseScans = message.reverseScans; @@ -40397,6 +40418,8 @@ object.mutateRowsRateLimit = message.mutateRowsRateLimit; if (message.lastScannedRowResponses != null && message.hasOwnProperty("lastScannedRowResponses")) object.lastScannedRowResponses = message.lastScannedRowResponses; + if (message.mutateRowsRateLimit2 != null && message.hasOwnProperty("mutateRowsRateLimit2")) + object.mutateRowsRateLimit2 = message.mutateRowsRateLimit2; return object; }; diff --git a/protos/protos.json b/protos/protos.json index d19bac24a..eeaf30093 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -4391,6 +4391,10 @@ "type": "bool", "id": 3 }, + "mutateRowsRateLimit2": { + "type": "bool", + "id": 5 + }, "lastScannedRowResponses": { "type": "bool", "id": 4