From a8aa9cb20fe6edcb6990c0090189f91f9738742a Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 8 Aug 2023 02:58:23 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20post-p?= =?UTF-8?q?rocessor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- owl-bot-staging/v1/.eslintignore | 7 - owl-bot-staging/v1/.eslintrc.json | 3 - owl-bot-staging/v1/.gitignore | 14 - owl-bot-staging/v1/.jsdoc.js | 55 - owl-bot-staging/v1/.mocharc.js | 33 - owl-bot-staging/v1/.prettierrc.js | 22 - owl-bot-staging/v1/README.md | 1 - owl-bot-staging/v1/package.json | 59 - .../v1/provisioning_service.proto | 205 - .../apigeeregistry/v1/registry_models.proto | 364 - .../apigeeregistry/v1/registry_service.proto | 1133 ---- .../v1/provisioning.create_instance.js | 73 - .../v1/provisioning.delete_instance.js | 63 - .../generated/v1/provisioning.get_instance.js | 62 - .../generated/v1/registry.create_api.js | 76 - .../v1/registry.create_api_deployment.js | 76 - .../generated/v1/registry.create_api_spec.js | 76 - .../v1/registry.create_api_version.js | 76 - .../generated/v1/registry.create_artifact.js | 76 - .../generated/v1/registry.delete_api.js | 67 - .../v1/registry.delete_api_deployment.js | 67 - ...registry.delete_api_deployment_revision.js | 64 - .../generated/v1/registry.delete_api_spec.js | 67 - .../v1/registry.delete_api_spec_revision.js | 64 - .../v1/registry.delete_api_version.js | 67 - .../generated/v1/registry.delete_artifact.js | 62 - .../samples/generated/v1/registry.get_api.js | 62 - .../v1/registry.get_api_deployment.js | 62 - .../generated/v1/registry.get_api_spec.js | 62 - .../v1/registry.get_api_spec_contents.js | 62 - .../generated/v1/registry.get_api_version.js | 62 - .../generated/v1/registry.get_artifact.js | 62 - .../v1/registry.get_artifact_contents.js | 62 - .../registry.list_api_deployment_revisions.js | 72 - .../v1/registry.list_api_deployments.js | 83 - .../v1/registry.list_api_spec_revisions.js | 72 - .../generated/v1/registry.list_api_specs.js | 83 - .../v1/registry.list_api_versions.js | 83 - .../generated/v1/registry.list_apis.js | 83 - .../generated/v1/registry.list_artifacts.js | 83 - .../generated/v1/registry.replace_artifact.js | 63 - .../v1/registry.rollback_api_deployment.js | 68 - .../v1/registry.rollback_api_spec.js | 68 - .../registry.tag_api_deployment_revision.js | 67 - .../v1/registry.tag_api_spec_revision.js | 67 - .../generated/v1/registry.update_api.js | 75 - .../v1/registry.update_api_deployment.js | 75 - .../generated/v1/registry.update_api_spec.js | 75 - .../v1/registry.update_api_version.js | 75 - ...tadata_google.cloud.apigeeregistry.v1.json | 1723 ----- owl-bot-staging/v1/src/index.ts | 27 - owl-bot-staging/v1/src/v1/gapic_metadata.json | 445 -- owl-bot-staging/v1/src/v1/index.ts | 20 - .../v1/src/v1/provisioning_client.ts | 1729 ----- .../v1/src/v1/provisioning_client_config.json | 38 - .../v1/src/v1/provisioning_proto_list.json | 5 - owl-bot-staging/v1/src/v1/registry_client.ts | 4792 ------------- .../v1/src/v1/registry_client_config.json | 216 - .../v1/src/v1/registry_proto_list.json | 5 - .../system-test/fixtures/sample/src/index.js | 28 - .../system-test/fixtures/sample/src/index.ts | 38 - owl-bot-staging/v1/system-test/install.ts | 49 - .../v1/test/gapic_provisioning_v1.ts | 1896 ------ owl-bot-staging/v1/test/gapic_registry_v1.ts | 6025 ----------------- owl-bot-staging/v1/tsconfig.json | 19 - owl-bot-staging/v1/webpack.config.js | 64 - 66 files changed, 21677 deletions(-) delete mode 100644 owl-bot-staging/v1/.eslintignore delete mode 100644 owl-bot-staging/v1/.eslintrc.json delete mode 100644 owl-bot-staging/v1/.gitignore delete mode 100644 owl-bot-staging/v1/.jsdoc.js delete mode 100644 owl-bot-staging/v1/.mocharc.js delete mode 100644 owl-bot-staging/v1/.prettierrc.js delete mode 100644 owl-bot-staging/v1/README.md delete mode 100644 owl-bot-staging/v1/package.json delete mode 100644 owl-bot-staging/v1/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/apigeeregistry/v1/registry_models.proto delete mode 100644 owl-bot-staging/v1/protos/google/cloud/apigeeregistry/v1/registry_service.proto delete mode 100644 owl-bot-staging/v1/samples/generated/v1/provisioning.create_instance.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/provisioning.delete_instance.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/provisioning.get_instance.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.create_api.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.create_api_deployment.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.create_api_spec.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.create_api_version.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.create_artifact.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.delete_api.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.delete_api_deployment.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.delete_api_deployment_revision.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.delete_api_spec.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.delete_api_spec_revision.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.delete_api_version.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.delete_artifact.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.get_api.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.get_api_deployment.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.get_api_spec.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.get_api_spec_contents.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.get_api_version.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.get_artifact.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.get_artifact_contents.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.list_api_deployment_revisions.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.list_api_deployments.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.list_api_spec_revisions.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.list_api_specs.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.list_api_versions.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.list_apis.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.list_artifacts.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.replace_artifact.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.rollback_api_deployment.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.rollback_api_spec.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.tag_api_deployment_revision.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.tag_api_spec_revision.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.update_api.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.update_api_deployment.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.update_api_spec.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/registry.update_api_version.js delete mode 100644 owl-bot-staging/v1/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json delete mode 100644 owl-bot-staging/v1/src/index.ts delete mode 100644 owl-bot-staging/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/v1/src/v1/provisioning_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/provisioning_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/provisioning_proto_list.json delete mode 100644 owl-bot-staging/v1/src/v1/registry_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/registry_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/registry_proto_list.json delete mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/v1/system-test/install.ts delete mode 100644 owl-bot-staging/v1/test/gapic_provisioning_v1.ts delete mode 100644 owl-bot-staging/v1/test/gapic_registry_v1.ts delete mode 100644 owl-bot-staging/v1/tsconfig.json delete mode 100644 owl-bot-staging/v1/webpack.config.js diff --git a/owl-bot-staging/v1/.eslintignore b/owl-bot-staging/v1/.eslintignore deleted file mode 100644 index cfc348e..0000000 --- a/owl-bot-staging/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/v1/.eslintrc.json b/owl-bot-staging/v1/.eslintrc.json deleted file mode 100644 index 7821534..0000000 --- a/owl-bot-staging/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v1/.gitignore b/owl-bot-staging/v1/.gitignore deleted file mode 100644 index d4f03a0..0000000 --- a/owl-bot-staging/v1/.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/v1/.jsdoc.js b/owl-bot-staging/v1/.jsdoc.js deleted file mode 100644 index 671ff23..0000000 --- a/owl-bot-staging/v1/.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/apigee-registry', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v1/.mocharc.js b/owl-bot-staging/v1/.mocharc.js deleted file mode 100644 index 1a38f25..0000000 --- a/owl-bot-staging/v1/.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/v1/.prettierrc.js b/owl-bot-staging/v1/.prettierrc.js deleted file mode 100644 index 55639e7..0000000 --- a/owl-bot-staging/v1/.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/v1/README.md b/owl-bot-staging/v1/README.md deleted file mode 100644 index 1c7b46e..0000000 --- a/owl-bot-staging/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Apigeeregistry: Nodejs Client diff --git a/owl-bot-staging/v1/package.json b/owl-bot-staging/v1/package.json deleted file mode 100644 index 1f5e8b5..0000000 --- a/owl-bot-staging/v1/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "@google-cloud/apigee-registry", - "version": "0.1.0", - "description": "Apigeeregistry client for Node.js", - "repository": "googleapis/nodejs-apigeeregistry", - "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 apigeeregistry", - "apigeeregistry", - "provisioning", - "registry" - ], - "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.0", - "jsdoc": "^4.0.2", - "jsdoc-fresh": "^2.0.2", - "jsdoc-region-tag": "^2.0.1", - "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/v1/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto b/owl-bot-staging/v1/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto deleted file mode 100644 index cca6753..0000000 --- a/owl-bot-staging/v1/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto +++ /dev/null @@ -1,205 +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.cloud.apigeeregistry.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.ApigeeRegistry.V1"; -option go_package = "cloud.google.com/go/apigeeregistry/apiv1/apigeeregistrypb;apigeeregistrypb"; -option java_multiple_files = true; -option java_outer_classname = "ProvisioningServiceProto"; -option java_package = "com.google.cloud.apigeeregistry.v1"; -option php_namespace = "Google\\Cloud\\ApigeeRegistry\\V1"; -option ruby_package = "Google::Cloud::ApigeeRegistry::V1"; - -// The service that is used for managing the data plane provisioning of the -// Registry. -service Provisioning { - option (google.api.default_host) = "apigeeregistry.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Provisions instance resources for the Registry. - rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/instances" - body: "instance" - }; - option (google.api.method_signature) = "parent,instance,instance_id"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Deletes the Registry instance. - rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Gets details of a single Instance. - rpc GetInstance(GetInstanceRequest) returns (Instance) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// Request message for CreateInstance. -message CreateInstanceRequest { - // Required. Parent resource of the Instance, of the form: `projects/*/locations/*` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. Identifier to assign to the Instance. Must be unique within scope of the - // parent resource. - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Instance. - Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DeleteInstance. -message DeleteInstanceRequest { - // Required. The name of the Instance to delete. - // Format: `projects/*/locations/*/instances/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/Instance" - } - ]; -} - -// Request message for GetInstance. -message GetInstanceRequest { - // Required. The name of the Instance to retrieve. - // Format: `projects/*/locations/*/instances/*`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/Instance" - } - ]; -} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // The time the operation was created. - google.protobuf.Timestamp create_time = 1; - - // The time the operation finished running. - google.protobuf.Timestamp end_time = 2; - - // Server-defined resource path for the target of the operation. - string target = 3; - - // Name of the verb executed by the operation. - string verb = 4; - - // Human-readable status of the operation, if any. - string status_message = 5; - - // Identifies whether the user has requested cancellation - // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - bool cancellation_requested = 6; - - // API version used to start the operation. - string api_version = 7; -} - -// An Instance represents the instance resources of the Registry. -// Currently, only one instance is allowed for each project. -message Instance { - option (google.api.resource) = { - type: "apigeeregistry.googleapis.com/Instance" - pattern: "projects/{project}/locations/{location}/instances/{instance}" - }; - - // State of the Instance. - enum State { - // The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0; - - // The Instance has not been initialized or has been deleted. - INACTIVE = 1; - - // The Instance is being created. - CREATING = 2; - - // The Instance has been created and is ready for use. - ACTIVE = 3; - - // The Instance is being updated. - UPDATING = 4; - - // The Instance is being deleted. - DELETING = 5; - - // The Instance encountered an error during a state change. - FAILED = 6; - } - - // Available configurations to provision an Instance. - message Config { - // Output only. The GCP location where the Instance resides. - string location = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The Customer Managed Encryption Key (CMEK) used for data encryption. - // The CMEK name should follow the format of - // `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`, - // where the `location` must match InstanceConfig.location. - string cmek_key_name = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // Format: `projects/*/locations/*/instance`. - // Currently only `locations/global` is supported. - string name = 1; - - // Output only. Creation timestamp. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Last update timestamp. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current state of the Instance. - State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Extra information of Instance.State if the state is `FAILED`. - string state_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. Config of the Instance. - Config config = 6 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/apigeeregistry/v1/registry_models.proto b/owl-bot-staging/v1/protos/google/cloud/apigeeregistry/v1/registry_models.proto deleted file mode 100644 index a1c29b4..0000000 --- a/owl-bot-staging/v1/protos/google/cloud/apigeeregistry/v1/registry_models.proto +++ /dev/null @@ -1,364 +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.cloud.apigeeregistry.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.ApigeeRegistry.V1"; -option go_package = "cloud.google.com/go/apigeeregistry/apiv1/apigeeregistrypb;apigeeregistrypb"; -option java_multiple_files = true; -option java_outer_classname = "RegistryModelsProto"; -option java_package = "com.google.cloud.apigeeregistry.v1"; -option php_namespace = "Google\\Cloud\\ApigeeRegistry\\V1"; -option ruby_package = "Google::Cloud::ApigeeRegistry::V1"; - -// A top-level description of an API. -// Produced by producers and are commitments to provide services. -message Api { - option (google.api.resource) = { - type: "apigeeregistry.googleapis.com/Api" - pattern: "projects/{project}/locations/{location}/apis/{api}" - }; - - // Resource name. - string name = 1; - - // Human-meaningful name. - string display_name = 2; - - // A detailed description. - string description = 3; - - // Output only. Creation timestamp. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Last update timestamp. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A user-definable description of the availability of this service. - // Format: free-form, but we expect single words that describe availability, - // e.g., "NONE", "TESTING", "PREVIEW", "GENERAL", "DEPRECATED", "SHUTDOWN". - string availability = 6; - - // The recommended version of the API. - // Format: `apis/{api}/versions/{version}` - string recommended_version = 7 [(google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiVersion" - }]; - - // The recommended deployment of the API. - // Format: `apis/{api}/deployments/{deployment}` - string recommended_deployment = 8 [(google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiDeployment" - }]; - - // Labels attach identifying metadata to resources. Identifying metadata can - // be used to filter list operations. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores, and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one resource (System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with - // `apigeeregistry.googleapis.com/` and cannot be changed. - map labels = 9; - - // Annotations attach non-identifying metadata to resources. - // - // Annotation keys and values are less restricted than those of labels, but - // should be generally used for small values of broad interest. Larger, topic- - // specific metadata should be stored in Artifacts. - map annotations = 10; -} - -// Describes a particular version of an API. -// ApiVersions are what consumers actually use. -message ApiVersion { - option (google.api.resource) = { - type: "apigeeregistry.googleapis.com/ApiVersion" - pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}" - }; - - // Resource name. - string name = 1; - - // Human-meaningful name. - string display_name = 2; - - // A detailed description. - string description = 3; - - // Output only. Creation timestamp. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Last update timestamp. - google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A user-definable description of the lifecycle phase of this API version. - // Format: free-form, but we expect single words that describe API maturity, - // e.g., "CONCEPT", "DESIGN", "DEVELOPMENT", "STAGING", "PRODUCTION", - // "DEPRECATED", "RETIRED". - string state = 6; - - // Labels attach identifying metadata to resources. Identifying metadata can - // be used to filter list operations. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one resource (System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with - // `apigeeregistry.googleapis.com/` and cannot be changed. - map labels = 7; - - // Annotations attach non-identifying metadata to resources. - // - // Annotation keys and values are less restricted than those of labels, but - // should be generally used for small values of broad interest. Larger, topic- - // specific metadata should be stored in Artifacts. - map annotations = 8; -} - -// Describes a version of an API in a structured way. -// ApiSpecs provide formal descriptions that consumers can use to use a version. -// ApiSpec resources are intended to be fully-resolved descriptions of an -// ApiVersion. When specs consist of multiple files, these should be bundled -// together (e.g., in a zip archive) and stored as a unit. Multiple specs can -// exist to provide representations in different API description formats. -// Synchronization of these representations would be provided by tooling and -// background services. -message ApiSpec { - option (google.api.resource) = { - type: "apigeeregistry.googleapis.com/ApiSpec" - pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}" - }; - - // Resource name. - string name = 1; - - // A possibly-hierarchical name used to refer to the spec from other specs. - string filename = 2; - - // A detailed description. - string description = 3; - - // Output only. Immutable. The revision ID of the spec. - // A new revision is committed whenever the spec contents are changed. - // The format is an 8-character hexadecimal string. - string revision_id = 4 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Output only. Creation timestamp; when the spec resource was created. - google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Revision creation timestamp; when the represented revision was created. - google.protobuf.Timestamp revision_create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Last update timestamp: when the represented revision was last modified. - google.protobuf.Timestamp revision_update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A style (format) descriptor for this spec that is specified as a Media Type - // (https://en.wikipedia.org/wiki/Media_type). Possible values include - // `application/vnd.apigee.proto`, `application/vnd.apigee.openapi`, and - // `application/vnd.apigee.graphql`, with possible suffixes representing - // compression types. These hypothetical names are defined in the vendor tree - // defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final. - // Content types can specify compression. Currently only GZip compression is - // supported (indicated with "+gzip"). - string mime_type = 8; - - // Output only. The size of the spec file in bytes. If the spec is gzipped, this is the - // size of the uncompressed spec. - int32 size_bytes = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is - // the hash of the uncompressed spec. - string hash = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The original source URI of the spec (if one exists). - // This is an external location that can be used for reference purposes - // but which may not be authoritative since this external resource may - // change after the spec is retrieved. - string source_uri = 11; - - // Input only. The contents of the spec. - // Provided by API callers when specs are created or updated. - // To access the contents of a spec, use GetApiSpecContents. - bytes contents = 12 [(google.api.field_behavior) = INPUT_ONLY]; - - // Labels attach identifying metadata to resources. Identifying metadata can - // be used to filter list operations. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one resource (System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with - // `apigeeregistry.googleapis.com/` and cannot be changed. - map labels = 14; - - // Annotations attach non-identifying metadata to resources. - // - // Annotation keys and values are less restricted than those of labels, but - // should be generally used for small values of broad interest. Larger, topic- - // specific metadata should be stored in Artifacts. - map annotations = 15; -} - -// Describes a service running at particular address that -// provides a particular version of an API. ApiDeployments have revisions which -// correspond to different configurations of a single deployment in time. -// Revision identifiers should be updated whenever the served API spec or -// endpoint address changes. -message ApiDeployment { - option (google.api.resource) = { - type: "apigeeregistry.googleapis.com/ApiDeployment" - pattern: "projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}" - }; - - // Resource name. - string name = 1; - - // Human-meaningful name. - string display_name = 2; - - // A detailed description. - string description = 3; - - // Output only. Immutable. The revision ID of the deployment. - // A new revision is committed whenever the deployment contents are changed. - // The format is an 8-character hexadecimal string. - string revision_id = 4 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Output only. Creation timestamp; when the deployment resource was created. - google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Revision creation timestamp; when the represented revision was created. - google.protobuf.Timestamp revision_create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Last update timestamp: when the represented revision was last modified. - google.protobuf.Timestamp revision_update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The full resource name (including revision ID) of the spec of the API being - // served by the deployment. Changes to this value will update the revision. - // Format: `apis/{api}/deployments/{deployment}` - string api_spec_revision = 8 [(google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiSpec" - }]; - - // The address where the deployment is serving. Changes to this value will - // update the revision. - string endpoint_uri = 9; - - // The address of the external channel of the API (e.g., the Developer - // Portal). Changes to this value will not affect the revision. - string external_channel_uri = 10; - - // Text briefly identifying the intended audience of the API. Changes to this - // value will not affect the revision. - string intended_audience = 11; - - // Text briefly describing how to access the endpoint. Changes to this value - // will not affect the revision. - string access_guidance = 12; - - // Labels attach identifying metadata to resources. Identifying metadata can - // be used to filter list operations. - // - // Label keys and values can be no longer than 64 characters - // (Unicode codepoints), can only contain lowercase letters, numeric - // characters, underscores and dashes. International characters are allowed. - // No more than 64 user labels can be associated with one resource (System - // labels are excluded). - // - // See https://goo.gl/xmQnxf for more information and examples of labels. - // System reserved label keys are prefixed with - // `apigeeregistry.googleapis.com/` and cannot be changed. - map labels = 14; - - // Annotations attach non-identifying metadata to resources. - // - // Annotation keys and values are less restricted than those of labels, but - // should be generally used for small values of broad interest. Larger, topic- - // specific metadata should be stored in Artifacts. - map annotations = 15; -} - -// Artifacts of resources. Artifacts are unique (single-value) per resource -// and are used to store metadata that is too large or numerous to be stored -// directly on the resource. Since artifacts are stored separately from parent -// resources, they should generally be used for metadata that is needed -// infrequently, i.e., not for display in primary views of the resource but -// perhaps displayed or downloaded upon request. The `ListArtifacts` method -// allows artifacts to be quickly enumerated and checked for presence without -// downloading their (potentially-large) contents. -message Artifact { - option (google.api.resource) = { - type: "apigeeregistry.googleapis.com/Artifact" - pattern: "projects/{project}/locations/{location}/artifacts/{artifact}" - pattern: "projects/{project}/locations/{location}/apis/{api}/artifacts/{artifact}" - pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/artifacts/{artifact}" - pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}/artifacts/{artifact}" - pattern: "projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}" - }; - - // Resource name. - string name = 1; - - // Output only. Creation timestamp. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Last update timestamp. - google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A content type specifier for the artifact. - // Content type specifiers are Media Types - // (https://en.wikipedia.org/wiki/Media_type) with a possible "schema" - // parameter that specifies a schema for the stored information. - // Content types can specify compression. Currently only GZip compression is - // supported (indicated with "+gzip"). - string mime_type = 4; - - // Output only. The size of the artifact in bytes. If the artifact is gzipped, this is - // the size of the uncompressed artifact. - int32 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A SHA-256 hash of the artifact's contents. If the artifact is gzipped, - // this is the hash of the uncompressed artifact. - string hash = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Input only. The contents of the artifact. - // Provided by API callers when artifacts are created or replaced. - // To access the contents of an artifact, use GetArtifactContents. - bytes contents = 7 [(google.api.field_behavior) = INPUT_ONLY]; -} diff --git a/owl-bot-staging/v1/protos/google/cloud/apigeeregistry/v1/registry_service.proto b/owl-bot-staging/v1/protos/google/cloud/apigeeregistry/v1/registry_service.proto deleted file mode 100644 index 041796b..0000000 --- a/owl-bot-staging/v1/protos/google/cloud/apigeeregistry/v1/registry_service.proto +++ /dev/null @@ -1,1133 +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.cloud.apigeeregistry.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/httpbody.proto"; -import "google/api/resource.proto"; -import "google/cloud/apigeeregistry/v1/registry_models.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option csharp_namespace = "Google.Cloud.ApigeeRegistry.V1"; -option go_package = "cloud.google.com/go/apigeeregistry/apiv1/apigeeregistrypb;apigeeregistrypb"; -option java_multiple_files = true; -option java_outer_classname = "RegistryServiceProto"; -option java_package = "com.google.cloud.apigeeregistry.v1"; -option php_namespace = "Google\\Cloud\\ApigeeRegistry\\V1"; -option ruby_package = "Google::Cloud::ApigeeRegistry::V1"; - -// The Registry service allows teams to manage descriptions of APIs. -service Registry { - option (google.api.default_host) = "apigeeregistry.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Returns matching APIs. - rpc ListApis(ListApisRequest) returns (ListApisResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/apis" - }; - option (google.api.method_signature) = "parent"; - } - - // Returns a specified API. - rpc GetApi(GetApiRequest) returns (Api) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apis/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a specified API. - rpc CreateApi(CreateApiRequest) returns (Api) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/apis" - body: "api" - }; - option (google.api.method_signature) = "parent,api,api_id"; - } - - // Used to modify a specified API. - rpc UpdateApi(UpdateApiRequest) returns (Api) { - option (google.api.http) = { - patch: "/v1/{api.name=projects/*/locations/*/apis/*}" - body: "api" - }; - option (google.api.method_signature) = "api,update_mask"; - } - - // Removes a specified API and all of the resources that it - // owns. - rpc DeleteApi(DeleteApiRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apis/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Returns matching versions. - rpc ListApiVersions(ListApiVersionsRequest) returns (ListApiVersionsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apis/*}/versions" - }; - option (google.api.method_signature) = "parent"; - } - - // Returns a specified version. - rpc GetApiVersion(GetApiVersionRequest) returns (ApiVersion) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a specified version. - rpc CreateApiVersion(CreateApiVersionRequest) returns (ApiVersion) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apis/*}/versions" - body: "api_version" - }; - option (google.api.method_signature) = "parent,api_version,api_version_id"; - } - - // Used to modify a specified version. - rpc UpdateApiVersion(UpdateApiVersionRequest) returns (ApiVersion) { - option (google.api.http) = { - patch: "/v1/{api_version.name=projects/*/locations/*/apis/*/versions/*}" - body: "api_version" - }; - option (google.api.method_signature) = "api_version,update_mask"; - } - - // Removes a specified version and all of the resources that - // it owns. - rpc DeleteApiVersion(DeleteApiVersionRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Returns matching specs. - rpc ListApiSpecs(ListApiSpecsRequest) returns (ListApiSpecsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" - }; - option (google.api.method_signature) = "parent"; - } - - // Returns a specified spec. - rpc GetApiSpec(GetApiSpecRequest) returns (ApiSpec) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Returns the contents of a specified spec. - // If specs are stored with GZip compression, the default behavior - // is to return the spec uncompressed (the mime_type response field - // indicates the exact format returned). - rpc GetApiSpecContents(GetApiSpecContentsRequest) returns (google.api.HttpBody) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:getContents" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a specified spec. - rpc CreateApiSpec(CreateApiSpecRequest) returns (ApiSpec) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" - body: "api_spec" - }; - option (google.api.method_signature) = "parent,api_spec,api_spec_id"; - } - - // Used to modify a specified spec. - rpc UpdateApiSpec(UpdateApiSpecRequest) returns (ApiSpec) { - option (google.api.http) = { - patch: "/v1/{api_spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}" - body: "api_spec" - }; - option (google.api.method_signature) = "api_spec,update_mask"; - } - - // Removes a specified spec, all revisions, and all child - // resources (e.g., artifacts). - rpc DeleteApiSpec(DeleteApiSpecRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Adds a tag to a specified revision of a spec. - rpc TagApiSpecRevision(TagApiSpecRevisionRequest) returns (ApiSpec) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:tagRevision" - body: "*" - }; - } - - // Lists all revisions of a spec. - // Revisions are returned in descending order of revision creation time. - rpc ListApiSpecRevisions(ListApiSpecRevisionsRequest) returns (ListApiSpecRevisionsResponse) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:listRevisions" - }; - } - - // Sets the current revision to a specified prior revision. - // Note that this creates a new revision with a new revision ID. - rpc RollbackApiSpec(RollbackApiSpecRequest) returns (ApiSpec) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:rollback" - body: "*" - }; - } - - // Deletes a revision of a spec. - rpc DeleteApiSpecRevision(DeleteApiSpecRevisionRequest) returns (ApiSpec) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:deleteRevision" - }; - option (google.api.method_signature) = "name"; - } - - // Returns matching deployments. - rpc ListApiDeployments(ListApiDeploymentsRequest) returns (ListApiDeploymentsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/apis/*}/deployments" - }; - option (google.api.method_signature) = "parent"; - } - - // Returns a specified deployment. - rpc GetApiDeployment(GetApiDeploymentRequest) returns (ApiDeployment) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a specified deployment. - rpc CreateApiDeployment(CreateApiDeploymentRequest) returns (ApiDeployment) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*/apis/*}/deployments" - body: "api_deployment" - }; - option (google.api.method_signature) = "parent,api_deployment,api_deployment_id"; - } - - // Used to modify a specified deployment. - rpc UpdateApiDeployment(UpdateApiDeploymentRequest) returns (ApiDeployment) { - option (google.api.http) = { - patch: "/v1/{api_deployment.name=projects/*/locations/*/apis/*/deployments/*}" - body: "api_deployment" - }; - option (google.api.method_signature) = "api_deployment,update_mask"; - } - - // Removes a specified deployment, all revisions, and all - // child resources (e.g., artifacts). - rpc DeleteApiDeployment(DeleteApiDeploymentRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Adds a tag to a specified revision of a - // deployment. - rpc TagApiDeploymentRevision(TagApiDeploymentRevisionRequest) returns (ApiDeployment) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:tagRevision" - body: "*" - }; - } - - // Lists all revisions of a deployment. - // Revisions are returned in descending order of revision creation time. - rpc ListApiDeploymentRevisions(ListApiDeploymentRevisionsRequest) returns (ListApiDeploymentRevisionsResponse) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:listRevisions" - }; - } - - // Sets the current revision to a specified prior - // revision. Note that this creates a new revision with a new revision ID. - rpc RollbackApiDeployment(RollbackApiDeploymentRequest) returns (ApiDeployment) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:rollback" - body: "*" - }; - } - - // Deletes a revision of a deployment. - rpc DeleteApiDeploymentRevision(DeleteApiDeploymentRevisionRequest) returns (ApiDeployment) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:deleteRevision" - }; - option (google.api.method_signature) = "name"; - } - - // Returns matching artifacts. - rpc ListArtifacts(ListArtifactsRequest) returns (ListArtifactsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/artifacts" - additional_bindings { - get: "/v1/{parent=projects/*/locations/*/apis/*}/artifacts" - } - additional_bindings { - get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/artifacts" - } - additional_bindings { - get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*/specs/*}/artifacts" - } - additional_bindings { - get: "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Returns a specified artifact. - rpc GetArtifact(GetArtifactRequest) returns (Artifact) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/artifacts/*}" - additional_bindings { - get: "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}" - } - additional_bindings { - get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}" - } - additional_bindings { - get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}" - } - additional_bindings { - get: "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Returns the contents of a specified artifact. - // If artifacts are stored with GZip compression, the default behavior - // is to return the artifact uncompressed (the mime_type response field - // indicates the exact format returned). - rpc GetArtifactContents(GetArtifactContentsRequest) returns (google.api.HttpBody) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/artifacts/*}:getContents" - additional_bindings { - get: "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}:getContents" - } - additional_bindings { - get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}:getContents" - } - additional_bindings { - get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:getContents" - } - additional_bindings { - get: "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}:getContents" - } - }; - option (google.api.method_signature) = "name"; - } - - // Creates a specified artifact. - rpc CreateArtifact(CreateArtifactRequest) returns (Artifact) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/artifacts" - body: "artifact" - additional_bindings { - post: "/v1/{parent=projects/*/locations/*/apis/*}/artifacts" - body: "artifact" - } - additional_bindings { - post: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/artifacts" - body: "artifact" - } - additional_bindings { - post: "/v1/{parent=projects/*/locations/*/apis/*/versions/*/specs/*}/artifacts" - body: "artifact" - } - additional_bindings { - post: "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts" - body: "artifact" - } - }; - option (google.api.method_signature) = "parent,artifact,artifact_id"; - } - - // Used to replace a specified artifact. - rpc ReplaceArtifact(ReplaceArtifactRequest) returns (Artifact) { - option (google.api.http) = { - put: "/v1/{artifact.name=projects/*/locations/*/artifacts/*}" - body: "artifact" - additional_bindings { - put: "/v1/{artifact.name=projects/*/locations/*/apis/*/artifacts/*}" - body: "artifact" - } - additional_bindings { - put: "/v1/{artifact.name=projects/*/locations/*/apis/*/versions/*/artifacts/*}" - body: "artifact" - } - additional_bindings { - put: "/v1/{artifact.name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}" - body: "artifact" - } - additional_bindings { - put: "/v1/{artifact.name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}" - body: "artifact" - } - }; - option (google.api.method_signature) = "artifact"; - } - - // Removes a specified artifact. - rpc DeleteArtifact(DeleteArtifactRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/artifacts/*}" - additional_bindings { - delete: "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}" - } - additional_bindings { - delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}" - } - additional_bindings { - delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}" - } - additional_bindings { - delete: "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}" - } - }; - option (google.api.method_signature) = "name"; - } -} - -// Request message for ListApis. -message ListApisRequest { - // Required. The parent, which owns this collection of APIs. - // Format: `projects/*/locations/*` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apigeeregistry.googleapis.com/Api" - } - ]; - - // The maximum number of APIs to return. - // The service may return fewer than this value. - // If unspecified, at most 50 values will be returned. - // The maximum is 1000; values above 1000 will be coerced to 1000. - int32 page_size = 2; - - // A page token, received from a previous `ListApis` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListApis` must match - // the call that provided the page token. - string page_token = 3; - - // An expression that can be used to filter the list. Filters use the Common - // Expression Language and can refer to all message fields. - string filter = 4; -} - -// Response message for ListApis. -message ListApisResponse { - // The APIs from the specified publisher. - repeated Api apis = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for GetApi. -message GetApiRequest { - // Required. The name of the API to retrieve. - // Format: `projects/*/locations/*/apis/*` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/Api" - } - ]; -} - -// Request message for CreateApi. -message CreateApiRequest { - // Required. The parent, which owns this collection of APIs. - // Format: `projects/*/locations/*` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apigeeregistry.googleapis.com/Api" - } - ]; - - // Required. The API to create. - Api api = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the API, which will become the final component of - // the API's resource name. - // - // This value should be 4-63 characters, and valid characters - // are /[a-z][0-9]-/. - // - // Following AIP-162, IDs must not have the form of a UUID. - string api_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for UpdateApi. -message UpdateApiRequest { - // Required. The API to update. - // - // The `name` field is used to identify the API to update. - // Format: `projects/*/locations/*/apis/*` - Api api = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. If omitted, all fields are updated that - // are set in the request message (fields set to default values are ignored). - // If an asterisk "*" is specified, all fields are updated, including fields - // that are unspecified/default in the request. - google.protobuf.FieldMask update_mask = 2; - - // If set to true, and the API is not found, a new API will be created. - // In this situation, `update_mask` is ignored. - bool allow_missing = 3; -} - -// Request message for DeleteApi. -message DeleteApiRequest { - // Required. The name of the API to delete. - // Format: `projects/*/locations/*/apis/*` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/Api" - } - ]; - - // If set to true, any child resources will also be deleted. - // (Otherwise, the request will only work if there are no child resources.) - bool force = 2; -} - -// Request message for ListApiVersions. -message ListApiVersionsRequest { - // Required. The parent, which owns this collection of versions. - // Format: `projects/*/locations/*/apis/*` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apigeeregistry.googleapis.com/ApiVersion" - } - ]; - - // The maximum number of versions to return. - // The service may return fewer than this value. - // If unspecified, at most 50 values will be returned. - // The maximum is 1000; values above 1000 will be coerced to 1000. - int32 page_size = 2; - - // A page token, received from a previous `ListApiVersions` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListApiVersions` must - // match the call that provided the page token. - string page_token = 3; - - // An expression that can be used to filter the list. Filters use the Common - // Expression Language and can refer to all message fields. - string filter = 4; -} - -// Response message for ListApiVersions. -message ListApiVersionsResponse { - // The versions from the specified publisher. - repeated ApiVersion api_versions = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for GetApiVersion. -message GetApiVersionRequest { - // Required. The name of the version to retrieve. - // Format: `projects/*/locations/*/apis/*/versions/*` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiVersion" - } - ]; -} - -// Request message for CreateApiVersion. -message CreateApiVersionRequest { - // Required. The parent, which owns this collection of versions. - // Format: `projects/*/locations/*/apis/*` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apigeeregistry.googleapis.com/ApiVersion" - } - ]; - - // Required. The version to create. - ApiVersion api_version = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the version, which will become the final component of - // the version's resource name. - // - // This value should be 1-63 characters, and valid characters - // are /[a-z][0-9]-/. - // - // Following AIP-162, IDs must not have the form of a UUID. - string api_version_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for UpdateApiVersion. -message UpdateApiVersionRequest { - // Required. The version to update. - // - // The `name` field is used to identify the version to update. - // Format: `projects/*/locations/*/apis/*/versions/*` - ApiVersion api_version = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. If omitted, all fields are updated that - // are set in the request message (fields set to default values are ignored). - // If an asterisk "*" is specified, all fields are updated, including fields - // that are unspecified/default in the request. - google.protobuf.FieldMask update_mask = 2; - - // If set to true, and the version is not found, a new version will be - // created. In this situation, `update_mask` is ignored. - bool allow_missing = 3; -} - -// Request message for DeleteApiVersion. -message DeleteApiVersionRequest { - // Required. The name of the version to delete. - // Format: `projects/*/locations/*/apis/*/versions/*` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiVersion" - } - ]; - - // If set to true, any child resources will also be deleted. - // (Otherwise, the request will only work if there are no child resources.) - bool force = 2; -} - -// Request message for ListApiSpecs. -message ListApiSpecsRequest { - // Required. The parent, which owns this collection of specs. - // Format: `projects/*/locations/*/apis/*/versions/*` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apigeeregistry.googleapis.com/ApiSpec" - } - ]; - - // The maximum number of specs to return. - // The service may return fewer than this value. - // If unspecified, at most 50 values will be returned. - // The maximum is 1000; values above 1000 will be coerced to 1000. - int32 page_size = 2; - - // A page token, received from a previous `ListApiSpecs` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListApiSpecs` must match - // the call that provided the page token. - string page_token = 3; - - // An expression that can be used to filter the list. Filters use the Common - // Expression Language and can refer to all message fields except contents. - string filter = 4; -} - -// Response message for ListApiSpecs. -message ListApiSpecsResponse { - // The specs from the specified publisher. - repeated ApiSpec api_specs = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for GetApiSpec. -message GetApiSpecRequest { - // Required. The name of the spec to retrieve. - // Format: `projects/*/locations/*/apis/*/versions/*/specs/*` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiSpec" - } - ]; -} - -// Request message for GetApiSpecContents. -message GetApiSpecContentsRequest { - // Required. The name of the spec whose contents should be retrieved. - // Format: `projects/*/locations/*/apis/*/versions/*/specs/*` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiSpec" - } - ]; -} - -// Request message for CreateApiSpec. -message CreateApiSpecRequest { - // Required. The parent, which owns this collection of specs. - // Format: `projects/*/locations/*/apis/*/versions/*` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apigeeregistry.googleapis.com/ApiSpec" - } - ]; - - // Required. The spec to create. - ApiSpec api_spec = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the spec, which will become the final component of - // the spec's resource name. - // - // This value should be 4-63 characters, and valid characters - // are /[a-z][0-9]-/. - // - // Following AIP-162, IDs must not have the form of a UUID. - string api_spec_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for UpdateApiSpec. -message UpdateApiSpecRequest { - // Required. The spec to update. - // - // The `name` field is used to identify the spec to update. - // Format: `projects/*/locations/*/apis/*/versions/*/specs/*` - ApiSpec api_spec = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. If omitted, all fields are updated that - // are set in the request message (fields set to default values are ignored). - // If an asterisk "*" is specified, all fields are updated, including fields - // that are unspecified/default in the request. - google.protobuf.FieldMask update_mask = 2; - - // If set to true, and the spec is not found, a new spec will be created. - // In this situation, `update_mask` is ignored. - bool allow_missing = 3; -} - -// Request message for DeleteApiSpec. -message DeleteApiSpecRequest { - // Required. The name of the spec to delete. - // Format: `projects/*/locations/*/apis/*/versions/*/specs/*` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiSpec" - } - ]; - - // If set to true, any child resources will also be deleted. - // (Otherwise, the request will only work if there are no child resources.) - bool force = 2; -} - -// Request message for TagApiSpecRevision. -message TagApiSpecRevisionRequest { - // Required. The name of the spec to be tagged, including the revision ID. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiSpec" - } - ]; - - // Required. The tag to apply. - // The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`. - string tag = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for ListApiSpecRevisions. -message ListApiSpecRevisionsRequest { - // Required. The name of the spec to list revisions for. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiSpec" - } - ]; - - // The maximum number of revisions to return per page. - int32 page_size = 2; - - // The page token, received from a previous ListApiSpecRevisions call. - // Provide this to retrieve the subsequent page. - string page_token = 3; -} - -// Response message for ListApiSpecRevisionsResponse. -message ListApiSpecRevisionsResponse { - // The revisions of the spec. - repeated ApiSpec api_specs = 1; - - // A token that can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for RollbackApiSpec. -message RollbackApiSpecRequest { - // Required. The spec being rolled back. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiSpec" - } - ]; - - // Required. The revision ID to roll back to. - // It must be a revision of the same spec. - // - // Example: `c7cfa2a8` - string revision_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DeleteApiSpecRevision. -message DeleteApiSpecRevisionRequest { - // Required. The name of the spec revision to be deleted, - // with a revision ID explicitly included. - // - // Example: - // `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiSpec" - } - ]; -} - -// Request message for ListApiDeployments. -message ListApiDeploymentsRequest { - // Required. The parent, which owns this collection of deployments. - // Format: `projects/*/locations/*/apis/*` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apigeeregistry.googleapis.com/ApiDeployment" - } - ]; - - // The maximum number of deployments to return. - // The service may return fewer than this value. - // If unspecified, at most 50 values will be returned. - // The maximum is 1000; values above 1000 will be coerced to 1000. - int32 page_size = 2; - - // A page token, received from a previous `ListApiDeployments` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListApiDeployments` must - // match the call that provided the page token. - string page_token = 3; - - // An expression that can be used to filter the list. Filters use the Common - // Expression Language and can refer to all message fields. - string filter = 4; -} - -// Response message for ListApiDeployments. -message ListApiDeploymentsResponse { - // The deployments from the specified publisher. - repeated ApiDeployment api_deployments = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for GetApiDeployment. -message GetApiDeploymentRequest { - // Required. The name of the deployment to retrieve. - // Format: `projects/*/locations/*/apis/*/deployments/*` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiDeployment" - } - ]; -} - -// Request message for CreateApiDeployment. -message CreateApiDeploymentRequest { - // Required. The parent, which owns this collection of deployments. - // Format: `projects/*/locations/*/apis/*` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apigeeregistry.googleapis.com/ApiDeployment" - } - ]; - - // Required. The deployment to create. - ApiDeployment api_deployment = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the deployment, which will become the final component of - // the deployment's resource name. - // - // This value should be 4-63 characters, and valid characters - // are /[a-z][0-9]-/. - // - // Following AIP-162, IDs must not have the form of a UUID. - string api_deployment_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for UpdateApiDeployment. -message UpdateApiDeploymentRequest { - // Required. The deployment to update. - // - // The `name` field is used to identify the deployment to update. - // Format: `projects/*/locations/*/apis/*/deployments/*` - ApiDeployment api_deployment = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. If omitted, all fields are updated that - // are set in the request message (fields set to default values are ignored). - // If an asterisk "*" is specified, all fields are updated, including fields - // that are unspecified/default in the request. - google.protobuf.FieldMask update_mask = 2; - - // If set to true, and the deployment is not found, a new deployment will be - // created. In this situation, `update_mask` is ignored. - bool allow_missing = 3; -} - -// Request message for DeleteApiDeployment. -message DeleteApiDeploymentRequest { - // Required. The name of the deployment to delete. - // Format: `projects/*/locations/*/apis/*/deployments/*` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiDeployment" - } - ]; - - // If set to true, any child resources will also be deleted. - // (Otherwise, the request will only work if there are no child resources.) - bool force = 2; -} - -// Request message for TagApiDeploymentRevision. -message TagApiDeploymentRevisionRequest { - // Required. The name of the deployment to be tagged, including the revision ID. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiDeployment" - } - ]; - - // Required. The tag to apply. - // The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`. - string tag = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for ListApiDeploymentRevisions. -message ListApiDeploymentRevisionsRequest { - // Required. The name of the deployment to list revisions for. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiDeployment" - } - ]; - - // The maximum number of revisions to return per page. - int32 page_size = 2; - - // The page token, received from a previous ListApiDeploymentRevisions call. - // Provide this to retrieve the subsequent page. - string page_token = 3; -} - -// Response message for ListApiDeploymentRevisionsResponse. -message ListApiDeploymentRevisionsResponse { - // The revisions of the deployment. - repeated ApiDeployment api_deployments = 1; - - // A token that can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for RollbackApiDeployment. -message RollbackApiDeploymentRequest { - // Required. The deployment being rolled back. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiDeployment" - } - ]; - - // Required. The revision ID to roll back to. - // It must be a revision of the same deployment. - // - // Example: `c7cfa2a8` - string revision_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DeleteApiDeploymentRevision. -message DeleteApiDeploymentRevisionRequest { - // Required. The name of the deployment revision to be deleted, - // with a revision ID explicitly included. - // - // Example: - // `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/ApiDeployment" - } - ]; -} - -// Request message for ListArtifacts. -message ListArtifactsRequest { - // Required. The parent, which owns this collection of artifacts. - // Format: `{parent}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apigeeregistry.googleapis.com/Artifact" - } - ]; - - // The maximum number of artifacts to return. - // The service may return fewer than this value. - // If unspecified, at most 50 values will be returned. - // The maximum is 1000; values above 1000 will be coerced to 1000. - int32 page_size = 2; - - // A page token, received from a previous `ListArtifacts` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListArtifacts` must - // match the call that provided the page token. - string page_token = 3; - - // An expression that can be used to filter the list. Filters use the Common - // Expression Language and can refer to all message fields except contents. - string filter = 4; -} - -// Response message for ListArtifacts. -message ListArtifactsResponse { - // The artifacts from the specified publisher. - repeated Artifact artifacts = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Request message for GetArtifact. -message GetArtifactRequest { - // Required. The name of the artifact to retrieve. - // Format: `{parent}/artifacts/*` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/Artifact" - } - ]; -} - -// Request message for GetArtifactContents. -message GetArtifactContentsRequest { - // Required. The name of the artifact whose contents should be retrieved. - // Format: `{parent}/artifacts/*` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/Artifact" - } - ]; -} - -// Request message for CreateArtifact. -message CreateArtifactRequest { - // Required. The parent, which owns this collection of artifacts. - // Format: `{parent}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "apigeeregistry.googleapis.com/Artifact" - } - ]; - - // Required. The artifact to create. - Artifact artifact = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the artifact, which will become the final component of - // the artifact's resource name. - // - // This value should be 4-63 characters, and valid characters - // are /[a-z][0-9]-/. - // - // Following AIP-162, IDs must not have the form of a UUID. - string artifact_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for ReplaceArtifact. -message ReplaceArtifactRequest { - // Required. The artifact to replace. - // - // The `name` field is used to identify the artifact to replace. - // Format: `{parent}/artifacts/*` - Artifact artifact = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Request message for DeleteArtifact. -message DeleteArtifactRequest { - // Required. The name of the artifact to delete. - // Format: `{parent}/artifacts/*` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "apigeeregistry.googleapis.com/Artifact" - } - ]; -} diff --git a/owl-bot-staging/v1/samples/generated/v1/provisioning.create_instance.js b/owl-bot-staging/v1/samples/generated/v1/provisioning.create_instance.js deleted file mode 100644 index b4ca96b..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/provisioning.create_instance.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(parent, instanceId, instance) { - // [START apigeeregistry_v1_generated_Provisioning_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. Parent resource of the Instance, of the form: `projects/* /locations/*` - */ - // const parent = 'abc123' - /** - * Required. Identifier to assign to the Instance. Must be unique within scope of the - * parent resource. - */ - // const instanceId = 'abc123' - /** - * Required. The Instance. - */ - // const instance = {} - - // Imports the Apigeeregistry library - const {ProvisioningClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new ProvisioningClient(); - - async function callCreateInstance() { - // Construct request - const request = { - parent, - instanceId, - instance, - }; - - // Run request - const [operation] = await apigeeregistryClient.createInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateInstance(); - // [END apigeeregistry_v1_generated_Provisioning_CreateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/provisioning.delete_instance.js b/owl-bot-staging/v1/samples/generated/v1/provisioning.delete_instance.js deleted file mode 100644 index 74e702d..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/provisioning.delete_instance.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 apigeeregistry_v1_generated_Provisioning_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 name of the Instance to delete. - * Format: `projects/* /locations/* /instances/*`. - */ - // const name = 'abc123' - - // Imports the Apigeeregistry library - const {ProvisioningClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new ProvisioningClient(); - - async function callDeleteInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await apigeeregistryClient.deleteInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteInstance(); - // [END apigeeregistry_v1_generated_Provisioning_DeleteInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/provisioning.get_instance.js b/owl-bot-staging/v1/samples/generated/v1/provisioning.get_instance.js deleted file mode 100644 index 9724a92..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/provisioning.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 apigeeregistry_v1_generated_Provisioning_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 name of the Instance to retrieve. - * Format: `projects/* /locations/* /instances/*`. - */ - // const name = 'abc123' - - // Imports the Apigeeregistry library - const {ProvisioningClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new ProvisioningClient(); - - async function callGetInstance() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.getInstance(request); - console.log(response); - } - - callGetInstance(); - // [END apigeeregistry_v1_generated_Provisioning_GetInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.create_api.js b/owl-bot-staging/v1/samples/generated/v1/registry.create_api.js deleted file mode 100644 index 113640e..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.create_api.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, api, apiId) { - // [START apigeeregistry_v1_generated_Registry_CreateApi_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 parent, which owns this collection of APIs. - * Format: `projects/* /locations/*` - */ - // const parent = 'abc123' - /** - * Required. The API to create. - */ - // const api = {} - /** - * Required. The ID to use for the API, which will become the final component of - * the API's resource name. - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-/. - * Following AIP-162, IDs must not have the form of a UUID. - */ - // const apiId = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callCreateApi() { - // Construct request - const request = { - parent, - api, - apiId, - }; - - // Run request - const response = await apigeeregistryClient.createApi(request); - console.log(response); - } - - callCreateApi(); - // [END apigeeregistry_v1_generated_Registry_CreateApi_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.create_api_deployment.js b/owl-bot-staging/v1/samples/generated/v1/registry.create_api_deployment.js deleted file mode 100644 index 7a4c1c8..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.create_api_deployment.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, apiDeployment, apiDeploymentId) { - // [START apigeeregistry_v1_generated_Registry_CreateApiDeployment_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 parent, which owns this collection of deployments. - * Format: `projects/* /locations/* /apis/*` - */ - // const parent = 'abc123' - /** - * Required. The deployment to create. - */ - // const apiDeployment = {} - /** - * Required. The ID to use for the deployment, which will become the final component of - * the deployment's resource name. - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-/. - * Following AIP-162, IDs must not have the form of a UUID. - */ - // const apiDeploymentId = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callCreateApiDeployment() { - // Construct request - const request = { - parent, - apiDeployment, - apiDeploymentId, - }; - - // Run request - const response = await apigeeregistryClient.createApiDeployment(request); - console.log(response); - } - - callCreateApiDeployment(); - // [END apigeeregistry_v1_generated_Registry_CreateApiDeployment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.create_api_spec.js b/owl-bot-staging/v1/samples/generated/v1/registry.create_api_spec.js deleted file mode 100644 index 58b8584..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.create_api_spec.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, apiSpec, apiSpecId) { - // [START apigeeregistry_v1_generated_Registry_CreateApiSpec_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 parent, which owns this collection of specs. - * Format: `projects/* /locations/* /apis/* /versions/*` - */ - // const parent = 'abc123' - /** - * Required. The spec to create. - */ - // const apiSpec = {} - /** - * Required. The ID to use for the spec, which will become the final component of - * the spec's resource name. - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-/. - * Following AIP-162, IDs must not have the form of a UUID. - */ - // const apiSpecId = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callCreateApiSpec() { - // Construct request - const request = { - parent, - apiSpec, - apiSpecId, - }; - - // Run request - const response = await apigeeregistryClient.createApiSpec(request); - console.log(response); - } - - callCreateApiSpec(); - // [END apigeeregistry_v1_generated_Registry_CreateApiSpec_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.create_api_version.js b/owl-bot-staging/v1/samples/generated/v1/registry.create_api_version.js deleted file mode 100644 index 1a5dc3f..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.create_api_version.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, apiVersion, apiVersionId) { - // [START apigeeregistry_v1_generated_Registry_CreateApiVersion_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 parent, which owns this collection of versions. - * Format: `projects/* /locations/* /apis/*` - */ - // const parent = 'abc123' - /** - * Required. The version to create. - */ - // const apiVersion = {} - /** - * Required. The ID to use for the version, which will become the final component of - * the version's resource name. - * This value should be 1-63 characters, and valid characters - * are /[a-z][0-9]-/. - * Following AIP-162, IDs must not have the form of a UUID. - */ - // const apiVersionId = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callCreateApiVersion() { - // Construct request - const request = { - parent, - apiVersion, - apiVersionId, - }; - - // Run request - const response = await apigeeregistryClient.createApiVersion(request); - console.log(response); - } - - callCreateApiVersion(); - // [END apigeeregistry_v1_generated_Registry_CreateApiVersion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.create_artifact.js b/owl-bot-staging/v1/samples/generated/v1/registry.create_artifact.js deleted file mode 100644 index e9052fe..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.create_artifact.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, artifact, artifactId) { - // [START apigeeregistry_v1_generated_Registry_CreateArtifact_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 parent, which owns this collection of artifacts. - * Format: `{parent}` - */ - // const parent = 'abc123' - /** - * Required. The artifact to create. - */ - // const artifact = {} - /** - * Required. The ID to use for the artifact, which will become the final component of - * the artifact's resource name. - * This value should be 4-63 characters, and valid characters - * are /[a-z][0-9]-/. - * Following AIP-162, IDs must not have the form of a UUID. - */ - // const artifactId = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callCreateArtifact() { - // Construct request - const request = { - parent, - artifact, - artifactId, - }; - - // Run request - const response = await apigeeregistryClient.createArtifact(request); - console.log(response); - } - - callCreateArtifact(); - // [END apigeeregistry_v1_generated_Registry_CreateArtifact_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.delete_api.js b/owl-bot-staging/v1/samples/generated/v1/registry.delete_api.js deleted file mode 100644 index 917b1dd..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.delete_api.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) { - // [START apigeeregistry_v1_generated_Registry_DeleteApi_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 API to delete. - * Format: `projects/* /locations/* /apis/*` - */ - // const name = 'abc123' - /** - * If set to true, any child resources will also be deleted. - * (Otherwise, the request will only work if there are no child resources.) - */ - // const force = true - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callDeleteApi() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.deleteApi(request); - console.log(response); - } - - callDeleteApi(); - // [END apigeeregistry_v1_generated_Registry_DeleteApi_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_deployment.js b/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_deployment.js deleted file mode 100644 index 863cd8c..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_deployment.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) { - // [START apigeeregistry_v1_generated_Registry_DeleteApiDeployment_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 deployment to delete. - * Format: `projects/* /locations/* /apis/* /deployments/*` - */ - // const name = 'abc123' - /** - * If set to true, any child resources will also be deleted. - * (Otherwise, the request will only work if there are no child resources.) - */ - // const force = true - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callDeleteApiDeployment() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.deleteApiDeployment(request); - console.log(response); - } - - callDeleteApiDeployment(); - // [END apigeeregistry_v1_generated_Registry_DeleteApiDeployment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_deployment_revision.js b/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_deployment_revision.js deleted file mode 100644 index 369deb1..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_deployment_revision.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 apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_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 deployment revision to be deleted, - * with a revision ID explicitly included. - * Example: - * `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8` - */ - // const name = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callDeleteApiDeploymentRevision() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.deleteApiDeploymentRevision(request); - console.log(response); - } - - callDeleteApiDeploymentRevision(); - // [END apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_spec.js b/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_spec.js deleted file mode 100644 index 15fc88e..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_spec.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) { - // [START apigeeregistry_v1_generated_Registry_DeleteApiSpec_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 spec to delete. - * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` - */ - // const name = 'abc123' - /** - * If set to true, any child resources will also be deleted. - * (Otherwise, the request will only work if there are no child resources.) - */ - // const force = true - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callDeleteApiSpec() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.deleteApiSpec(request); - console.log(response); - } - - callDeleteApiSpec(); - // [END apigeeregistry_v1_generated_Registry_DeleteApiSpec_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_spec_revision.js b/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_spec_revision.js deleted file mode 100644 index fa2a1e8..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_spec_revision.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 apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_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 spec revision to be deleted, - * with a revision ID explicitly included. - * Example: - * `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8` - */ - // const name = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callDeleteApiSpecRevision() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.deleteApiSpecRevision(request); - console.log(response); - } - - callDeleteApiSpecRevision(); - // [END apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_version.js b/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_version.js deleted file mode 100644 index 7c4454a..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.delete_api_version.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) { - // [START apigeeregistry_v1_generated_Registry_DeleteApiVersion_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 version to delete. - * Format: `projects/* /locations/* /apis/* /versions/*` - */ - // const name = 'abc123' - /** - * If set to true, any child resources will also be deleted. - * (Otherwise, the request will only work if there are no child resources.) - */ - // const force = true - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callDeleteApiVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.deleteApiVersion(request); - console.log(response); - } - - callDeleteApiVersion(); - // [END apigeeregistry_v1_generated_Registry_DeleteApiVersion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.delete_artifact.js b/owl-bot-staging/v1/samples/generated/v1/registry.delete_artifact.js deleted file mode 100644 index 99da99a..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.delete_artifact.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 apigeeregistry_v1_generated_Registry_DeleteArtifact_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 artifact to delete. - * Format: `{parent}/artifacts/*` - */ - // const name = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callDeleteArtifact() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.deleteArtifact(request); - console.log(response); - } - - callDeleteArtifact(); - // [END apigeeregistry_v1_generated_Registry_DeleteArtifact_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.get_api.js b/owl-bot-staging/v1/samples/generated/v1/registry.get_api.js deleted file mode 100644 index 2351204..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.get_api.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 apigeeregistry_v1_generated_Registry_GetApi_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 API to retrieve. - * Format: `projects/* /locations/* /apis/*` - */ - // const name = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callGetApi() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.getApi(request); - console.log(response); - } - - callGetApi(); - // [END apigeeregistry_v1_generated_Registry_GetApi_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.get_api_deployment.js b/owl-bot-staging/v1/samples/generated/v1/registry.get_api_deployment.js deleted file mode 100644 index 1414dc5..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.get_api_deployment.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 apigeeregistry_v1_generated_Registry_GetApiDeployment_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 deployment to retrieve. - * Format: `projects/* /locations/* /apis/* /deployments/*` - */ - // const name = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callGetApiDeployment() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.getApiDeployment(request); - console.log(response); - } - - callGetApiDeployment(); - // [END apigeeregistry_v1_generated_Registry_GetApiDeployment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.get_api_spec.js b/owl-bot-staging/v1/samples/generated/v1/registry.get_api_spec.js deleted file mode 100644 index e644034..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.get_api_spec.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 apigeeregistry_v1_generated_Registry_GetApiSpec_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 spec to retrieve. - * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` - */ - // const name = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callGetApiSpec() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.getApiSpec(request); - console.log(response); - } - - callGetApiSpec(); - // [END apigeeregistry_v1_generated_Registry_GetApiSpec_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.get_api_spec_contents.js b/owl-bot-staging/v1/samples/generated/v1/registry.get_api_spec_contents.js deleted file mode 100644 index d3f17e4..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.get_api_spec_contents.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 apigeeregistry_v1_generated_Registry_GetApiSpecContents_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 spec whose contents should be retrieved. - * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` - */ - // const name = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callGetApiSpecContents() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.getApiSpecContents(request); - console.log(response); - } - - callGetApiSpecContents(); - // [END apigeeregistry_v1_generated_Registry_GetApiSpecContents_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.get_api_version.js b/owl-bot-staging/v1/samples/generated/v1/registry.get_api_version.js deleted file mode 100644 index 2a288b3..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.get_api_version.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 apigeeregistry_v1_generated_Registry_GetApiVersion_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 version to retrieve. - * Format: `projects/* /locations/* /apis/* /versions/*` - */ - // const name = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callGetApiVersion() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.getApiVersion(request); - console.log(response); - } - - callGetApiVersion(); - // [END apigeeregistry_v1_generated_Registry_GetApiVersion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.get_artifact.js b/owl-bot-staging/v1/samples/generated/v1/registry.get_artifact.js deleted file mode 100644 index 67eaf70..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.get_artifact.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 apigeeregistry_v1_generated_Registry_GetArtifact_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 artifact to retrieve. - * Format: `{parent}/artifacts/*` - */ - // const name = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callGetArtifact() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.getArtifact(request); - console.log(response); - } - - callGetArtifact(); - // [END apigeeregistry_v1_generated_Registry_GetArtifact_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.get_artifact_contents.js b/owl-bot-staging/v1/samples/generated/v1/registry.get_artifact_contents.js deleted file mode 100644 index ea2d32d..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.get_artifact_contents.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 apigeeregistry_v1_generated_Registry_GetArtifactContents_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 artifact whose contents should be retrieved. - * Format: `{parent}/artifacts/*` - */ - // const name = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callGetArtifactContents() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await apigeeregistryClient.getArtifactContents(request); - console.log(response); - } - - callGetArtifactContents(); - // [END apigeeregistry_v1_generated_Registry_GetArtifactContents_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.list_api_deployment_revisions.js b/owl-bot-staging/v1/samples/generated/v1/registry.list_api_deployment_revisions.js deleted file mode 100644 index 21685cd..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.list_api_deployment_revisions.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 apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_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 deployment to list revisions for. - */ - // const name = 'abc123' - /** - * The maximum number of revisions to return per page. - */ - // const pageSize = 1234 - /** - * The page token, received from a previous ListApiDeploymentRevisions call. - * Provide this to retrieve the subsequent page. - */ - // const pageToken = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callListApiDeploymentRevisions() { - // Construct request - const request = { - name, - }; - - // Run request - const iterable = await apigeeregistryClient.listApiDeploymentRevisionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListApiDeploymentRevisions(); - // [END apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.list_api_deployments.js b/owl-bot-staging/v1/samples/generated/v1/registry.list_api_deployments.js deleted file mode 100644 index 6412a28..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.list_api_deployments.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 apigeeregistry_v1_generated_Registry_ListApiDeployments_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 parent, which owns this collection of deployments. - * Format: `projects/* /locations/* /apis/*` - */ - // const parent = 'abc123' - /** - * The maximum number of deployments to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListApiDeployments` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListApiDeployments` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields. - */ - // const filter = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callListApiDeployments() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await apigeeregistryClient.listApiDeploymentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListApiDeployments(); - // [END apigeeregistry_v1_generated_Registry_ListApiDeployments_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.list_api_spec_revisions.js b/owl-bot-staging/v1/samples/generated/v1/registry.list_api_spec_revisions.js deleted file mode 100644 index c6726ae..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.list_api_spec_revisions.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 apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_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 spec to list revisions for. - */ - // const name = 'abc123' - /** - * The maximum number of revisions to return per page. - */ - // const pageSize = 1234 - /** - * The page token, received from a previous ListApiSpecRevisions call. - * Provide this to retrieve the subsequent page. - */ - // const pageToken = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callListApiSpecRevisions() { - // Construct request - const request = { - name, - }; - - // Run request - const iterable = await apigeeregistryClient.listApiSpecRevisionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListApiSpecRevisions(); - // [END apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.list_api_specs.js b/owl-bot-staging/v1/samples/generated/v1/registry.list_api_specs.js deleted file mode 100644 index 396e724..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.list_api_specs.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 apigeeregistry_v1_generated_Registry_ListApiSpecs_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 parent, which owns this collection of specs. - * Format: `projects/* /locations/* /apis/* /versions/*` - */ - // const parent = 'abc123' - /** - * The maximum number of specs to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListApiSpecs` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListApiSpecs` must match - * the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields except contents. - */ - // const filter = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callListApiSpecs() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await apigeeregistryClient.listApiSpecsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListApiSpecs(); - // [END apigeeregistry_v1_generated_Registry_ListApiSpecs_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.list_api_versions.js b/owl-bot-staging/v1/samples/generated/v1/registry.list_api_versions.js deleted file mode 100644 index 2b077b5..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.list_api_versions.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 apigeeregistry_v1_generated_Registry_ListApiVersions_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 parent, which owns this collection of versions. - * Format: `projects/* /locations/* /apis/*` - */ - // const parent = 'abc123' - /** - * The maximum number of versions to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListApiVersions` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListApiVersions` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields. - */ - // const filter = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callListApiVersions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await apigeeregistryClient.listApiVersionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListApiVersions(); - // [END apigeeregistry_v1_generated_Registry_ListApiVersions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.list_apis.js b/owl-bot-staging/v1/samples/generated/v1/registry.list_apis.js deleted file mode 100644 index ea22549..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.list_apis.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 apigeeregistry_v1_generated_Registry_ListApis_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 parent, which owns this collection of APIs. - * Format: `projects/* /locations/*` - */ - // const parent = 'abc123' - /** - * The maximum number of APIs to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListApis` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListApis` must match - * the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields. - */ - // const filter = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callListApis() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await apigeeregistryClient.listApisAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListApis(); - // [END apigeeregistry_v1_generated_Registry_ListApis_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.list_artifacts.js b/owl-bot-staging/v1/samples/generated/v1/registry.list_artifacts.js deleted file mode 100644 index ca9a2c0..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.list_artifacts.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 apigeeregistry_v1_generated_Registry_ListArtifacts_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 parent, which owns this collection of artifacts. - * Format: `{parent}` - */ - // const parent = 'abc123' - /** - * The maximum number of artifacts to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - */ - // const pageSize = 1234 - /** - * A page token, received from a previous `ListArtifacts` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListArtifacts` must - * match the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields except contents. - */ - // const filter = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callListArtifacts() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await apigeeregistryClient.listArtifactsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListArtifacts(); - // [END apigeeregistry_v1_generated_Registry_ListArtifacts_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.replace_artifact.js b/owl-bot-staging/v1/samples/generated/v1/registry.replace_artifact.js deleted file mode 100644 index 91f3904..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.replace_artifact.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(artifact) { - // [START apigeeregistry_v1_generated_Registry_ReplaceArtifact_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 artifact to replace. - * The `name` field is used to identify the artifact to replace. - * Format: `{parent}/artifacts/*` - */ - // const artifact = {} - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callReplaceArtifact() { - // Construct request - const request = { - artifact, - }; - - // Run request - const response = await apigeeregistryClient.replaceArtifact(request); - console.log(response); - } - - callReplaceArtifact(); - // [END apigeeregistry_v1_generated_Registry_ReplaceArtifact_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.rollback_api_deployment.js b/owl-bot-staging/v1/samples/generated/v1/registry.rollback_api_deployment.js deleted file mode 100644 index 41317e3..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.rollback_api_deployment.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, revisionId) { - // [START apigeeregistry_v1_generated_Registry_RollbackApiDeployment_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 deployment being rolled back. - */ - // const name = 'abc123' - /** - * Required. The revision ID to roll back to. - * It must be a revision of the same deployment. - * Example: `c7cfa2a8` - */ - // const revisionId = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callRollbackApiDeployment() { - // Construct request - const request = { - name, - revisionId, - }; - - // Run request - const response = await apigeeregistryClient.rollbackApiDeployment(request); - console.log(response); - } - - callRollbackApiDeployment(); - // [END apigeeregistry_v1_generated_Registry_RollbackApiDeployment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.rollback_api_spec.js b/owl-bot-staging/v1/samples/generated/v1/registry.rollback_api_spec.js deleted file mode 100644 index bc7a521..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.rollback_api_spec.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, revisionId) { - // [START apigeeregistry_v1_generated_Registry_RollbackApiSpec_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 spec being rolled back. - */ - // const name = 'abc123' - /** - * Required. The revision ID to roll back to. - * It must be a revision of the same spec. - * Example: `c7cfa2a8` - */ - // const revisionId = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callRollbackApiSpec() { - // Construct request - const request = { - name, - revisionId, - }; - - // Run request - const response = await apigeeregistryClient.rollbackApiSpec(request); - console.log(response); - } - - callRollbackApiSpec(); - // [END apigeeregistry_v1_generated_Registry_RollbackApiSpec_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.tag_api_deployment_revision.js b/owl-bot-staging/v1/samples/generated/v1/registry.tag_api_deployment_revision.js deleted file mode 100644 index 29cb0bd..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.tag_api_deployment_revision.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, tag) { - // [START apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_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 deployment to be tagged, including the revision ID. - */ - // const name = 'abc123' - /** - * Required. The tag to apply. - * The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`. - */ - // const tag = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callTagApiDeploymentRevision() { - // Construct request - const request = { - name, - tag, - }; - - // Run request - const response = await apigeeregistryClient.tagApiDeploymentRevision(request); - console.log(response); - } - - callTagApiDeploymentRevision(); - // [END apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.tag_api_spec_revision.js b/owl-bot-staging/v1/samples/generated/v1/registry.tag_api_spec_revision.js deleted file mode 100644 index e76171e..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.tag_api_spec_revision.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, tag) { - // [START apigeeregistry_v1_generated_Registry_TagApiSpecRevision_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 spec to be tagged, including the revision ID. - */ - // const name = 'abc123' - /** - * Required. The tag to apply. - * The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`. - */ - // const tag = 'abc123' - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callTagApiSpecRevision() { - // Construct request - const request = { - name, - tag, - }; - - // Run request - const response = await apigeeregistryClient.tagApiSpecRevision(request); - console.log(response); - } - - callTagApiSpecRevision(); - // [END apigeeregistry_v1_generated_Registry_TagApiSpecRevision_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.update_api.js b/owl-bot-staging/v1/samples/generated/v1/registry.update_api.js deleted file mode 100644 index a4dd852..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.update_api.js +++ /dev/null @@ -1,75 +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(api) { - // [START apigeeregistry_v1_generated_Registry_UpdateApi_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 API to update. - * The `name` field is used to identify the API to update. - * Format: `projects/* /locations/* /apis/*` - */ - // const api = {} - /** - * The list of fields to be updated. If omitted, all fields are updated that - * are set in the request message (fields set to default values are ignored). - * If an asterisk "*" is specified, all fields are updated, including fields - * that are unspecified/default in the request. - */ - // const updateMask = {} - /** - * If set to true, and the API is not found, a new API will be created. - * In this situation, `update_mask` is ignored. - */ - // const allowMissing = true - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callUpdateApi() { - // Construct request - const request = { - api, - }; - - // Run request - const response = await apigeeregistryClient.updateApi(request); - console.log(response); - } - - callUpdateApi(); - // [END apigeeregistry_v1_generated_Registry_UpdateApi_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.update_api_deployment.js b/owl-bot-staging/v1/samples/generated/v1/registry.update_api_deployment.js deleted file mode 100644 index 9016653..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.update_api_deployment.js +++ /dev/null @@ -1,75 +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(apiDeployment) { - // [START apigeeregistry_v1_generated_Registry_UpdateApiDeployment_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 deployment to update. - * The `name` field is used to identify the deployment to update. - * Format: `projects/* /locations/* /apis/* /deployments/*` - */ - // const apiDeployment = {} - /** - * The list of fields to be updated. If omitted, all fields are updated that - * are set in the request message (fields set to default values are ignored). - * If an asterisk "*" is specified, all fields are updated, including fields - * that are unspecified/default in the request. - */ - // const updateMask = {} - /** - * If set to true, and the deployment is not found, a new deployment will be - * created. In this situation, `update_mask` is ignored. - */ - // const allowMissing = true - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callUpdateApiDeployment() { - // Construct request - const request = { - apiDeployment, - }; - - // Run request - const response = await apigeeregistryClient.updateApiDeployment(request); - console.log(response); - } - - callUpdateApiDeployment(); - // [END apigeeregistry_v1_generated_Registry_UpdateApiDeployment_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.update_api_spec.js b/owl-bot-staging/v1/samples/generated/v1/registry.update_api_spec.js deleted file mode 100644 index a3f5037..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.update_api_spec.js +++ /dev/null @@ -1,75 +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(apiSpec) { - // [START apigeeregistry_v1_generated_Registry_UpdateApiSpec_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 spec to update. - * The `name` field is used to identify the spec to update. - * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` - */ - // const apiSpec = {} - /** - * The list of fields to be updated. If omitted, all fields are updated that - * are set in the request message (fields set to default values are ignored). - * If an asterisk "*" is specified, all fields are updated, including fields - * that are unspecified/default in the request. - */ - // const updateMask = {} - /** - * If set to true, and the spec is not found, a new spec will be created. - * In this situation, `update_mask` is ignored. - */ - // const allowMissing = true - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callUpdateApiSpec() { - // Construct request - const request = { - apiSpec, - }; - - // Run request - const response = await apigeeregistryClient.updateApiSpec(request); - console.log(response); - } - - callUpdateApiSpec(); - // [END apigeeregistry_v1_generated_Registry_UpdateApiSpec_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/registry.update_api_version.js b/owl-bot-staging/v1/samples/generated/v1/registry.update_api_version.js deleted file mode 100644 index 38b633e..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/registry.update_api_version.js +++ /dev/null @@ -1,75 +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(apiVersion) { - // [START apigeeregistry_v1_generated_Registry_UpdateApiVersion_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 version to update. - * The `name` field is used to identify the version to update. - * Format: `projects/* /locations/* /apis/* /versions/*` - */ - // const apiVersion = {} - /** - * The list of fields to be updated. If omitted, all fields are updated that - * are set in the request message (fields set to default values are ignored). - * If an asterisk "*" is specified, all fields are updated, including fields - * that are unspecified/default in the request. - */ - // const updateMask = {} - /** - * If set to true, and the version is not found, a new version will be - * created. In this situation, `update_mask` is ignored. - */ - // const allowMissing = true - - // Imports the Apigeeregistry library - const {RegistryClient} = require('@google-cloud/apigee-registry').v1; - - // Instantiates a client - const apigeeregistryClient = new RegistryClient(); - - async function callUpdateApiVersion() { - // Construct request - const request = { - apiVersion, - }; - - // Run request - const response = await apigeeregistryClient.updateApiVersion(request); - console.log(response); - } - - callUpdateApiVersion(); - // [END apigeeregistry_v1_generated_Registry_UpdateApiVersion_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json b/owl-bot-staging/v1/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json deleted file mode 100644 index 56680c6..0000000 --- a/owl-bot-staging/v1/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json +++ /dev/null @@ -1,1723 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-apigeeregistry", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.apigeeregistry.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "apigeeregistry_v1_generated_Provisioning_CreateInstance_async", - "title": "Provisioning createInstance Sample", - "origin": "API_DEFINITION", - "description": " Provisions instance resources for the Registry.", - "canonical": true, - "file": "provisioning.create_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInstance", - "fullName": "google.cloud.apigeeregistry.v1.Provisioning.CreateInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.apigeeregistry.v1.Instance" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ProvisioningClient", - "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" - }, - "method": { - "shortName": "CreateInstance", - "fullName": "google.cloud.apigeeregistry.v1.Provisioning.CreateInstance", - "service": { - "shortName": "Provisioning", - "fullName": "google.cloud.apigeeregistry.v1.Provisioning" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Provisioning_DeleteInstance_async", - "title": "Provisioning deleteInstance Sample", - "origin": "API_DEFINITION", - "description": " Deletes the Registry instance.", - "canonical": true, - "file": "provisioning.delete_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.apigeeregistry.v1.Provisioning.DeleteInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ProvisioningClient", - "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" - }, - "method": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.apigeeregistry.v1.Provisioning.DeleteInstance", - "service": { - "shortName": "Provisioning", - "fullName": "google.cloud.apigeeregistry.v1.Provisioning" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Provisioning_GetInstance_async", - "title": "Provisioning getInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Instance.", - "canonical": true, - "file": "provisioning.get_instance.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInstance", - "fullName": "google.cloud.apigeeregistry.v1.Provisioning.GetInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.Instance", - "client": { - "shortName": "ProvisioningClient", - "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" - }, - "method": { - "shortName": "GetInstance", - "fullName": "google.cloud.apigeeregistry.v1.Provisioning.GetInstance", - "service": { - "shortName": "Provisioning", - "fullName": "google.cloud.apigeeregistry.v1.Provisioning" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_ListApis_async", - "title": "Provisioning listApis Sample", - "origin": "API_DEFINITION", - "description": " Returns matching APIs.", - "canonical": true, - "file": "registry.list_apis.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListApis", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApis", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ListApisResponse", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "ListApis", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApis", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_GetApi_async", - "title": "Provisioning getApi Sample", - "origin": "API_DEFINITION", - "description": " Returns a specified API.", - "canonical": true, - "file": "registry.get_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetApi", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApi", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.Api", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "GetApi", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApi", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_CreateApi_async", - "title": "Provisioning createApi Sample", - "origin": "API_DEFINITION", - "description": " Creates a specified API.", - "canonical": true, - "file": "registry.create_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateApi", - "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApi", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "api", - "type": ".google.cloud.apigeeregistry.v1.Api" - }, - { - "name": "api_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.Api", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "CreateApi", - "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApi", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApi_async", - "title": "Provisioning updateApi Sample", - "origin": "API_DEFINITION", - "description": " Used to modify a specified API.", - "canonical": true, - "file": "registry.update_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateApi", - "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApi", - "async": true, - "parameters": [ - { - "name": "api", - "type": ".google.cloud.apigeeregistry.v1.Api" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.Api", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "UpdateApi", - "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApi", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApi_async", - "title": "Provisioning deleteApi Sample", - "origin": "API_DEFINITION", - "description": " Removes a specified API and all of the resources that it owns.", - "canonical": true, - "file": "registry.delete_api.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteApi", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApi", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "DeleteApi", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApi", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_ListApiVersions_async", - "title": "Provisioning listApiVersions Sample", - "origin": "API_DEFINITION", - "description": " Returns matching versions.", - "canonical": true, - "file": "registry.list_api_versions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListApiVersions", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiVersions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ListApiVersionsResponse", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "ListApiVersions", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiVersions", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_GetApiVersion_async", - "title": "Provisioning getApiVersion Sample", - "origin": "API_DEFINITION", - "description": " Returns a specified version.", - "canonical": true, - "file": "registry.get_api_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetApiVersion", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "GetApiVersion", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiVersion", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiVersion_async", - "title": "Provisioning createApiVersion Sample", - "origin": "API_DEFINITION", - "description": " Creates a specified version.", - "canonical": true, - "file": "registry.create_api_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateApiVersion", - "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiVersion", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "api_version", - "type": ".google.cloud.apigeeregistry.v1.ApiVersion" - }, - { - "name": "api_version_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "CreateApiVersion", - "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiVersion", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiVersion_async", - "title": "Provisioning updateApiVersion Sample", - "origin": "API_DEFINITION", - "description": " Used to modify a specified version.", - "canonical": true, - "file": "registry.update_api_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateApiVersion", - "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiVersion", - "async": true, - "parameters": [ - { - "name": "api_version", - "type": ".google.cloud.apigeeregistry.v1.ApiVersion" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "UpdateApiVersion", - "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiVersion", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiVersion_async", - "title": "Provisioning deleteApiVersion Sample", - "origin": "API_DEFINITION", - "description": " Removes a specified version and all of the resources that it owns.", - "canonical": true, - "file": "registry.delete_api_version.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteApiVersion", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiVersion", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "DeleteApiVersion", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiVersion", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_ListApiSpecs_async", - "title": "Provisioning listApiSpecs Sample", - "origin": "API_DEFINITION", - "description": " Returns matching specs.", - "canonical": true, - "file": "registry.list_api_specs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListApiSpecs", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecs", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ListApiSpecsResponse", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "ListApiSpecs", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecs", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_GetApiSpec_async", - "title": "Provisioning getApiSpec Sample", - "origin": "API_DEFINITION", - "description": " Returns a specified spec.", - "canonical": true, - "file": "registry.get_api_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetApiSpec", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpec", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "GetApiSpec", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpec", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_GetApiSpecContents_async", - "title": "Provisioning getApiSpecContents Sample", - "origin": "API_DEFINITION", - "description": " Returns the contents of a specified spec. If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned).", - "canonical": true, - "file": "registry.get_api_spec_contents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetApiSpecContents", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpecContents", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.api.HttpBody", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "GetApiSpecContents", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpecContents", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiSpec_async", - "title": "Provisioning createApiSpec Sample", - "origin": "API_DEFINITION", - "description": " Creates a specified spec.", - "canonical": true, - "file": "registry.create_api_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateApiSpec", - "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiSpec", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "api_spec", - "type": ".google.cloud.apigeeregistry.v1.ApiSpec" - }, - { - "name": "api_spec_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "CreateApiSpec", - "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiSpec", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiSpec_async", - "title": "Provisioning updateApiSpec Sample", - "origin": "API_DEFINITION", - "description": " Used to modify a specified spec.", - "canonical": true, - "file": "registry.update_api_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateApiSpec", - "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiSpec", - "async": true, - "parameters": [ - { - "name": "api_spec", - "type": ".google.cloud.apigeeregistry.v1.ApiSpec" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "UpdateApiSpec", - "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiSpec", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiSpec_async", - "title": "Provisioning deleteApiSpec Sample", - "origin": "API_DEFINITION", - "description": " Removes a specified spec, all revisions, and all child resources (e.g., artifacts).", - "canonical": true, - "file": "registry.delete_api_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteApiSpec", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpec", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "DeleteApiSpec", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpec", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_TagApiSpecRevision_async", - "title": "Provisioning tagApiSpecRevision Sample", - "origin": "API_DEFINITION", - "description": " Adds a tag to a specified revision of a spec.", - "canonical": true, - "file": "registry.tag_api_spec_revision.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TagApiSpecRevision", - "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevision", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "tag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "TagApiSpecRevision", - "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevision", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_async", - "title": "Provisioning listApiSpecRevisions Sample", - "origin": "API_DEFINITION", - "description": " Lists all revisions of a spec. Revisions are returned in descending order of revision creation time.", - "canonical": true, - "file": "registry.list_api_spec_revisions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListApiSpecRevisions", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisions", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "ListApiSpecRevisions", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisions", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_RollbackApiSpec_async", - "title": "Provisioning rollbackApiSpec Sample", - "origin": "API_DEFINITION", - "description": " Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.", - "canonical": true, - "file": "registry.rollback_api_spec.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RollbackApiSpec", - "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiSpec", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "revision_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "RollbackApiSpec", - "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiSpec", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_async", - "title": "Provisioning deleteApiSpecRevision Sample", - "origin": "API_DEFINITION", - "description": " Deletes a revision of a spec.", - "canonical": true, - "file": "registry.delete_api_spec_revision.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteApiSpecRevision", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevision", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "DeleteApiSpecRevision", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevision", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_ListApiDeployments_async", - "title": "Provisioning listApiDeployments Sample", - "origin": "API_DEFINITION", - "description": " Returns matching deployments.", - "canonical": true, - "file": "registry.list_api_deployments.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListApiDeployments", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeployments", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "ListApiDeployments", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeployments", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_GetApiDeployment_async", - "title": "Provisioning getApiDeployment Sample", - "origin": "API_DEFINITION", - "description": " Returns a specified deployment.", - "canonical": true, - "file": "registry.get_api_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetApiDeployment", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiDeployment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "GetApiDeployment", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiDeployment", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiDeployment_async", - "title": "Provisioning createApiDeployment Sample", - "origin": "API_DEFINITION", - "description": " Creates a specified deployment.", - "canonical": true, - "file": "registry.create_api_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateApiDeployment", - "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiDeployment", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "api_deployment", - "type": ".google.cloud.apigeeregistry.v1.ApiDeployment" - }, - { - "name": "api_deployment_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "CreateApiDeployment", - "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiDeployment", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiDeployment_async", - "title": "Provisioning updateApiDeployment Sample", - "origin": "API_DEFINITION", - "description": " Used to modify a specified deployment.", - "canonical": true, - "file": "registry.update_api_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateApiDeployment", - "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiDeployment", - "async": true, - "parameters": [ - { - "name": "api_deployment", - "type": ".google.cloud.apigeeregistry.v1.ApiDeployment" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "UpdateApiDeployment", - "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiDeployment", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiDeployment_async", - "title": "Provisioning deleteApiDeployment Sample", - "origin": "API_DEFINITION", - "description": " Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).", - "canonical": true, - "file": "registry.delete_api_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteApiDeployment", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeployment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "DeleteApiDeployment", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeployment", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_async", - "title": "Provisioning tagApiDeploymentRevision Sample", - "origin": "API_DEFINITION", - "description": " Adds a tag to a specified revision of a deployment.", - "canonical": true, - "file": "registry.tag_api_deployment_revision.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TagApiDeploymentRevision", - "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevision", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "tag", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "TagApiDeploymentRevision", - "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevision", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_async", - "title": "Provisioning listApiDeploymentRevisions Sample", - "origin": "API_DEFINITION", - "description": " Lists all revisions of a deployment. Revisions are returned in descending order of revision creation time.", - "canonical": true, - "file": "registry.list_api_deployment_revisions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListApiDeploymentRevisions", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisions", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "ListApiDeploymentRevisions", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisions", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_RollbackApiDeployment_async", - "title": "Provisioning rollbackApiDeployment Sample", - "origin": "API_DEFINITION", - "description": " Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.", - "canonical": true, - "file": "registry.rollback_api_deployment.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RollbackApiDeployment", - "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiDeployment", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "revision_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "RollbackApiDeployment", - "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiDeployment", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_async", - "title": "Provisioning deleteApiDeploymentRevision Sample", - "origin": "API_DEFINITION", - "description": " Deletes a revision of a deployment.", - "canonical": true, - "file": "registry.delete_api_deployment_revision.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 56, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteApiDeploymentRevision", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevision", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "DeleteApiDeploymentRevision", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevision", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_ListArtifacts_async", - "title": "Provisioning listArtifacts Sample", - "origin": "API_DEFINITION", - "description": " Returns matching artifacts.", - "canonical": true, - "file": "registry.list_artifacts.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListArtifacts", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListArtifacts", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.ListArtifactsResponse", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "ListArtifacts", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ListArtifacts", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_GetArtifact_async", - "title": "Provisioning getArtifact Sample", - "origin": "API_DEFINITION", - "description": " Returns a specified artifact.", - "canonical": true, - "file": "registry.get_artifact.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetArtifact", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifact", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.Artifact", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "GetArtifact", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifact", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_GetArtifactContents_async", - "title": "Provisioning getArtifactContents Sample", - "origin": "API_DEFINITION", - "description": " Returns the contents of a specified artifact. If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned).", - "canonical": true, - "file": "registry.get_artifact_contents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetArtifactContents", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifactContents", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.api.HttpBody", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "GetArtifactContents", - "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifactContents", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_CreateArtifact_async", - "title": "Provisioning createArtifact Sample", - "origin": "API_DEFINITION", - "description": " Creates a specified artifact.", - "canonical": true, - "file": "registry.create_artifact.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateArtifact", - "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateArtifact", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "artifact", - "type": ".google.cloud.apigeeregistry.v1.Artifact" - }, - { - "name": "artifact_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.Artifact", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "CreateArtifact", - "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateArtifact", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_ReplaceArtifact_async", - "title": "Provisioning replaceArtifact Sample", - "origin": "API_DEFINITION", - "description": " Used to replace a specified artifact.", - "canonical": true, - "file": "registry.replace_artifact.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ReplaceArtifact", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ReplaceArtifact", - "async": true, - "parameters": [ - { - "name": "artifact", - "type": ".google.cloud.apigeeregistry.v1.Artifact" - } - ], - "resultType": ".google.cloud.apigeeregistry.v1.Artifact", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "ReplaceArtifact", - "fullName": "google.cloud.apigeeregistry.v1.Registry.ReplaceArtifact", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - }, - { - "regionTag": "apigeeregistry_v1_generated_Registry_DeleteArtifact_async", - "title": "Provisioning deleteArtifact Sample", - "origin": "API_DEFINITION", - "description": " Removes a specified artifact.", - "canonical": true, - "file": "registry.delete_artifact.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteArtifact", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteArtifact", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "RegistryClient", - "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" - }, - "method": { - "shortName": "DeleteArtifact", - "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteArtifact", - "service": { - "shortName": "Registry", - "fullName": "google.cloud.apigeeregistry.v1.Registry" - } - } - } - } - ] -} diff --git a/owl-bot-staging/v1/src/index.ts b/owl-bot-staging/v1/src/index.ts deleted file mode 100644 index 23e18ff..0000000 --- a/owl-bot-staging/v1/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 v1 from './v1'; -const ProvisioningClient = v1.ProvisioningClient; -type ProvisioningClient = v1.ProvisioningClient; -const RegistryClient = v1.RegistryClient; -type RegistryClient = v1.RegistryClient; -export {v1, ProvisioningClient, RegistryClient}; -export default {v1, ProvisioningClient, RegistryClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/v1/src/v1/gapic_metadata.json b/owl-bot-staging/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 783049f..0000000 --- a/owl-bot-staging/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,445 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.apigeeregistry.v1", - "libraryPackage": "@google-cloud/apigee-registry", - "services": { - "Provisioning": { - "clients": { - "grpc": { - "libraryClient": "ProvisioningClient", - "rpcs": { - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ProvisioningClient", - "rpcs": { - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - } - } - } - } - }, - "Registry": { - "clients": { - "grpc": { - "libraryClient": "RegistryClient", - "rpcs": { - "GetApi": { - "methods": [ - "getApi" - ] - }, - "CreateApi": { - "methods": [ - "createApi" - ] - }, - "UpdateApi": { - "methods": [ - "updateApi" - ] - }, - "DeleteApi": { - "methods": [ - "deleteApi" - ] - }, - "GetApiVersion": { - "methods": [ - "getApiVersion" - ] - }, - "CreateApiVersion": { - "methods": [ - "createApiVersion" - ] - }, - "UpdateApiVersion": { - "methods": [ - "updateApiVersion" - ] - }, - "DeleteApiVersion": { - "methods": [ - "deleteApiVersion" - ] - }, - "GetApiSpec": { - "methods": [ - "getApiSpec" - ] - }, - "GetApiSpecContents": { - "methods": [ - "getApiSpecContents" - ] - }, - "CreateApiSpec": { - "methods": [ - "createApiSpec" - ] - }, - "UpdateApiSpec": { - "methods": [ - "updateApiSpec" - ] - }, - "DeleteApiSpec": { - "methods": [ - "deleteApiSpec" - ] - }, - "TagApiSpecRevision": { - "methods": [ - "tagApiSpecRevision" - ] - }, - "RollbackApiSpec": { - "methods": [ - "rollbackApiSpec" - ] - }, - "DeleteApiSpecRevision": { - "methods": [ - "deleteApiSpecRevision" - ] - }, - "GetApiDeployment": { - "methods": [ - "getApiDeployment" - ] - }, - "CreateApiDeployment": { - "methods": [ - "createApiDeployment" - ] - }, - "UpdateApiDeployment": { - "methods": [ - "updateApiDeployment" - ] - }, - "DeleteApiDeployment": { - "methods": [ - "deleteApiDeployment" - ] - }, - "TagApiDeploymentRevision": { - "methods": [ - "tagApiDeploymentRevision" - ] - }, - "RollbackApiDeployment": { - "methods": [ - "rollbackApiDeployment" - ] - }, - "DeleteApiDeploymentRevision": { - "methods": [ - "deleteApiDeploymentRevision" - ] - }, - "GetArtifact": { - "methods": [ - "getArtifact" - ] - }, - "GetArtifactContents": { - "methods": [ - "getArtifactContents" - ] - }, - "CreateArtifact": { - "methods": [ - "createArtifact" - ] - }, - "ReplaceArtifact": { - "methods": [ - "replaceArtifact" - ] - }, - "DeleteArtifact": { - "methods": [ - "deleteArtifact" - ] - }, - "ListApis": { - "methods": [ - "listApis", - "listApisStream", - "listApisAsync" - ] - }, - "ListApiVersions": { - "methods": [ - "listApiVersions", - "listApiVersionsStream", - "listApiVersionsAsync" - ] - }, - "ListApiSpecs": { - "methods": [ - "listApiSpecs", - "listApiSpecsStream", - "listApiSpecsAsync" - ] - }, - "ListApiSpecRevisions": { - "methods": [ - "listApiSpecRevisions", - "listApiSpecRevisionsStream", - "listApiSpecRevisionsAsync" - ] - }, - "ListApiDeployments": { - "methods": [ - "listApiDeployments", - "listApiDeploymentsStream", - "listApiDeploymentsAsync" - ] - }, - "ListApiDeploymentRevisions": { - "methods": [ - "listApiDeploymentRevisions", - "listApiDeploymentRevisionsStream", - "listApiDeploymentRevisionsAsync" - ] - }, - "ListArtifacts": { - "methods": [ - "listArtifacts", - "listArtifactsStream", - "listArtifactsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "RegistryClient", - "rpcs": { - "GetApi": { - "methods": [ - "getApi" - ] - }, - "CreateApi": { - "methods": [ - "createApi" - ] - }, - "UpdateApi": { - "methods": [ - "updateApi" - ] - }, - "DeleteApi": { - "methods": [ - "deleteApi" - ] - }, - "GetApiVersion": { - "methods": [ - "getApiVersion" - ] - }, - "CreateApiVersion": { - "methods": [ - "createApiVersion" - ] - }, - "UpdateApiVersion": { - "methods": [ - "updateApiVersion" - ] - }, - "DeleteApiVersion": { - "methods": [ - "deleteApiVersion" - ] - }, - "GetApiSpec": { - "methods": [ - "getApiSpec" - ] - }, - "GetApiSpecContents": { - "methods": [ - "getApiSpecContents" - ] - }, - "CreateApiSpec": { - "methods": [ - "createApiSpec" - ] - }, - "UpdateApiSpec": { - "methods": [ - "updateApiSpec" - ] - }, - "DeleteApiSpec": { - "methods": [ - "deleteApiSpec" - ] - }, - "TagApiSpecRevision": { - "methods": [ - "tagApiSpecRevision" - ] - }, - "RollbackApiSpec": { - "methods": [ - "rollbackApiSpec" - ] - }, - "DeleteApiSpecRevision": { - "methods": [ - "deleteApiSpecRevision" - ] - }, - "GetApiDeployment": { - "methods": [ - "getApiDeployment" - ] - }, - "CreateApiDeployment": { - "methods": [ - "createApiDeployment" - ] - }, - "UpdateApiDeployment": { - "methods": [ - "updateApiDeployment" - ] - }, - "DeleteApiDeployment": { - "methods": [ - "deleteApiDeployment" - ] - }, - "TagApiDeploymentRevision": { - "methods": [ - "tagApiDeploymentRevision" - ] - }, - "RollbackApiDeployment": { - "methods": [ - "rollbackApiDeployment" - ] - }, - "DeleteApiDeploymentRevision": { - "methods": [ - "deleteApiDeploymentRevision" - ] - }, - "GetArtifact": { - "methods": [ - "getArtifact" - ] - }, - "GetArtifactContents": { - "methods": [ - "getArtifactContents" - ] - }, - "CreateArtifact": { - "methods": [ - "createArtifact" - ] - }, - "ReplaceArtifact": { - "methods": [ - "replaceArtifact" - ] - }, - "DeleteArtifact": { - "methods": [ - "deleteArtifact" - ] - }, - "ListApis": { - "methods": [ - "listApis", - "listApisStream", - "listApisAsync" - ] - }, - "ListApiVersions": { - "methods": [ - "listApiVersions", - "listApiVersionsStream", - "listApiVersionsAsync" - ] - }, - "ListApiSpecs": { - "methods": [ - "listApiSpecs", - "listApiSpecsStream", - "listApiSpecsAsync" - ] - }, - "ListApiSpecRevisions": { - "methods": [ - "listApiSpecRevisions", - "listApiSpecRevisionsStream", - "listApiSpecRevisionsAsync" - ] - }, - "ListApiDeployments": { - "methods": [ - "listApiDeployments", - "listApiDeploymentsStream", - "listApiDeploymentsAsync" - ] - }, - "ListApiDeploymentRevisions": { - "methods": [ - "listApiDeploymentRevisions", - "listApiDeploymentRevisionsStream", - "listApiDeploymentRevisionsAsync" - ] - }, - "ListArtifacts": { - "methods": [ - "listArtifacts", - "listArtifactsStream", - "listArtifactsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/index.ts b/owl-bot-staging/v1/src/v1/index.ts deleted file mode 100644 index 6032a7e..0000000 --- a/owl-bot-staging/v1/src/v1/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 {ProvisioningClient} from './provisioning_client'; -export {RegistryClient} from './registry_client'; diff --git a/owl-bot-staging/v1/src/v1/provisioning_client.ts b/owl-bot-staging/v1/src/v1/provisioning_client.ts deleted file mode 100644 index b31c1d1..0000000 --- a/owl-bot-staging/v1/src/v1/provisioning_client.ts +++ /dev/null @@ -1,1729 +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, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/provisioning_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './provisioning_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The service that is used for managing the data plane provisioning of the - * Registry. - * @class - * @memberof v1 - */ -export class ProvisioningClient { - 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}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - provisioningStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ProvisioningClient. - * - * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * 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 ProvisioningClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof ProvisioningClient; - 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== '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 if (opts.fallback === 'rest' ) { - 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 = { - apiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}' - ), - apiDeploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}' - ), - apiSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' - ), - apiVersionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectLocationApiArtifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/artifacts/{artifact}' - ), - projectLocationApiDeploymentArtifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}' - ), - projectLocationApiVersionArtifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/artifacts/{artifact}' - ), - projectLocationApiVersionSpecArtifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}/artifacts/{artifact}' - ), - projectLocationArtifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/artifacts/{artifact}' - ), - }; - - 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 === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/apis/*}:getIamPolicy',additional_bindings: [{get: '/v1/{resource=projects/*/locations/*/apis/*/deployments/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/apis/*/versions/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/artifacts/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/apis/*/artifacts/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/artifacts/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/instances/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/runtime}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/apis/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/apis/*/deployments/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/artifacts/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/apis/*/artifacts/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/artifacts/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/instances/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/runtime}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/apis/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/apis/*/deployments/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/artifacts/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/apis/*/artifacts/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/artifacts/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/instances/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/runtime}:testIamPermissions',body: '*',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.apigeeregistry.v1.Instance') as gax.protobuf.Type; - const createInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.apigeeregistry.v1.OperationMetadata') as gax.protobuf.Type; - const deleteInstanceResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.apigeeregistry.v1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createInstanceResponse.decode.bind(createInstanceResponse), - createInstanceMetadata.decode.bind(createInstanceMetadata)), - deleteInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteInstanceResponse.decode.bind(deleteInstanceResponse), - deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apigeeregistry.v1.Provisioning', 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.provisioningStub) { - return this.provisioningStub; - } - - // Put together the "service stub" for - // google.cloud.apigeeregistry.v1.Provisioning. - this.provisioningStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apigeeregistry.v1.Provisioning') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.apigeeregistry.v1.Provisioning, - 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 provisioningStubMethods = - ['createInstance', 'deleteInstance', 'getInstance']; - for (const methodName of provisioningStubMethods) { - const callPromise = this.provisioningStub.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.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.provisioningStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'apigeeregistry.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 'apigeeregistry.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/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Gets details of a single Instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Instance to retrieve. - * Format: `projects/* /locations/* /instances/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.Instance|Instance}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/provisioning.get_instance.js - * region_tag:apigeeregistry_v1_generated_Provisioning_GetInstance_async - */ - getInstance( - request?: protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IInstance, - protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest|undefined, {}|undefined - ]>; - getInstance( - request: protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IInstance, - protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request: protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IInstance, - protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request?: protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IInstance, - protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IInstance, - protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IInstance, - protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.getInstance(request, options, callback); - } - -/** - * Provisions instance resources for the Registry. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Parent resource of the Instance, of the form: `projects/* /locations/*` - * @param {string} request.instanceId - * Required. Identifier to assign to the Instance. Must be unique within scope of the - * parent resource. - * @param {google.cloud.apigeeregistry.v1.Instance} request.instance - * Required. The Instance. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/provisioning.create_instance.js - * region_tag:apigeeregistry_v1_generated_Provisioning_CreateInstance_async - */ - createInstance( - request?: protos.google.cloud.apigeeregistry.v1.ICreateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createInstance( - request: protos.google.cloud.apigeeregistry.v1.ICreateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request: protos.google.cloud.apigeeregistry.v1.ICreateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request?: protos.google.cloud.apigeeregistry.v1.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 include:samples/generated/v1/provisioning.create_instance.js - * region_tag:apigeeregistry_v1_generated_Provisioning_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; - } -/** - * Deletes the Registry instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the Instance to delete. - * Format: `projects/* /locations/* /instances/*`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/provisioning.delete_instance.js - * region_tag:apigeeregistry_v1_generated_Provisioning_DeleteInstance_async - */ - deleteInstance( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteInstance( - request: protos.google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request: protos.google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, - 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.deleteInstance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteInstance()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/provisioning.delete_instance.js - * region_tag:apigeeregistry_v1_generated_Provisioning_DeleteInstance_async - */ - async checkDeleteInstanceProgress(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.deleteInstance, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and 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 {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified api resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @returns {string} Resource name string. - */ - apiPath(project:string,location:string,api:string) { - return this.pathTemplates.apiPathTemplate.render({ - project: project, - location: location, - api: api, - }); - } - - /** - * Parse the project from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).project; - } - - /** - * Parse the location from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).location; - } - - /** - * Parse the api from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).api; - } - - /** - * Return a fully-qualified apiDeployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} deployment - * @returns {string} Resource name string. - */ - apiDeploymentPath(project:string,location:string,api:string,deployment:string) { - return this.pathTemplates.apiDeploymentPathTemplate.render({ - project: project, - location: location, - api: api, - deployment: deployment, - }); - } - - /** - * Parse the project from ApiDeployment resource. - * - * @param {string} apiDeploymentName - * A fully-qualified path representing ApiDeployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiDeploymentName(apiDeploymentName: string) { - return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName).project; - } - - /** - * Parse the location from ApiDeployment resource. - * - * @param {string} apiDeploymentName - * A fully-qualified path representing ApiDeployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiDeploymentName(apiDeploymentName: string) { - return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName).location; - } - - /** - * Parse the api from ApiDeployment resource. - * - * @param {string} apiDeploymentName - * A fully-qualified path representing ApiDeployment resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiDeploymentName(apiDeploymentName: string) { - return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName).api; - } - - /** - * Parse the deployment from ApiDeployment resource. - * - * @param {string} apiDeploymentName - * A fully-qualified path representing ApiDeployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromApiDeploymentName(apiDeploymentName: string) { - return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName).deployment; - } - - /** - * Return a fully-qualified apiSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} spec - * @returns {string} Resource name string. - */ - apiSpecPath(project:string,location:string,api:string,version:string,spec:string) { - return this.pathTemplates.apiSpecPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - spec: spec, - }); - } - - /** - * Parse the project from ApiSpec resource. - * - * @param {string} apiSpecName - * A fully-qualified path representing ApiSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiSpecName(apiSpecName: string) { - return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).project; - } - - /** - * Parse the location from ApiSpec resource. - * - * @param {string} apiSpecName - * A fully-qualified path representing ApiSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiSpecName(apiSpecName: string) { - return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).location; - } - - /** - * Parse the api from ApiSpec resource. - * - * @param {string} apiSpecName - * A fully-qualified path representing ApiSpec resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiSpecName(apiSpecName: string) { - return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).api; - } - - /** - * Parse the version from ApiSpec resource. - * - * @param {string} apiSpecName - * A fully-qualified path representing ApiSpec resource. - * @returns {string} A string representing the version. - */ - matchVersionFromApiSpecName(apiSpecName: string) { - return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).version; - } - - /** - * Parse the spec from ApiSpec resource. - * - * @param {string} apiSpecName - * A fully-qualified path representing ApiSpec resource. - * @returns {string} A string representing the spec. - */ - matchSpecFromApiSpecName(apiSpecName: string) { - return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).spec; - } - - /** - * Return a fully-qualified apiVersion resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @returns {string} Resource name string. - */ - apiVersionPath(project:string,location:string,api:string,version:string) { - return this.pathTemplates.apiVersionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - }); - } - - /** - * Parse the project from ApiVersion resource. - * - * @param {string} apiVersionName - * A fully-qualified path representing ApiVersion resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiVersionName(apiVersionName: string) { - return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName).project; - } - - /** - * Parse the location from ApiVersion resource. - * - * @param {string} apiVersionName - * A fully-qualified path representing ApiVersion resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiVersionName(apiVersionName: string) { - return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName).location; - } - - /** - * Parse the api from ApiVersion resource. - * - * @param {string} apiVersionName - * A fully-qualified path representing ApiVersion resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiVersionName(apiVersionName: string) { - return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName).api; - } - - /** - * Parse the version from ApiVersion resource. - * - * @param {string} apiVersionName - * A fully-qualified path representing ApiVersion resource. - * @returns {string} A string representing the version. - */ - matchVersionFromApiVersionName(apiVersionName: string) { - return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName).version; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified projectLocationApiArtifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} artifact - * @returns {string} Resource name string. - */ - projectLocationApiArtifactPath(project:string,location:string,api:string,artifact:string) { - return this.pathTemplates.projectLocationApiArtifactPathTemplate.render({ - project: project, - location: location, - api: api, - artifact: artifact, - }); - } - - /** - * Parse the project from ProjectLocationApiArtifact resource. - * - * @param {string} projectLocationApiArtifactName - * A fully-qualified path representing project_location_api_artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationApiArtifactName(projectLocationApiArtifactName: string) { - return this.pathTemplates.projectLocationApiArtifactPathTemplate.match(projectLocationApiArtifactName).project; - } - - /** - * Parse the location from ProjectLocationApiArtifact resource. - * - * @param {string} projectLocationApiArtifactName - * A fully-qualified path representing project_location_api_artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationApiArtifactName(projectLocationApiArtifactName: string) { - return this.pathTemplates.projectLocationApiArtifactPathTemplate.match(projectLocationApiArtifactName).location; - } - - /** - * Parse the api from ProjectLocationApiArtifact resource. - * - * @param {string} projectLocationApiArtifactName - * A fully-qualified path representing project_location_api_artifact resource. - * @returns {string} A string representing the api. - */ - matchApiFromProjectLocationApiArtifactName(projectLocationApiArtifactName: string) { - return this.pathTemplates.projectLocationApiArtifactPathTemplate.match(projectLocationApiArtifactName).api; - } - - /** - * Parse the artifact from ProjectLocationApiArtifact resource. - * - * @param {string} projectLocationApiArtifactName - * A fully-qualified path representing project_location_api_artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromProjectLocationApiArtifactName(projectLocationApiArtifactName: string) { - return this.pathTemplates.projectLocationApiArtifactPathTemplate.match(projectLocationApiArtifactName).artifact; - } - - /** - * Return a fully-qualified projectLocationApiDeploymentArtifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} deployment - * @param {string} artifact - * @returns {string} Resource name string. - */ - projectLocationApiDeploymentArtifactPath(project:string,location:string,api:string,deployment:string,artifact:string) { - return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render({ - project: project, - location: location, - api: api, - deployment: deployment, - artifact: artifact, - }); - } - - /** - * Parse the project from ProjectLocationApiDeploymentArtifact resource. - * - * @param {string} projectLocationApiDeploymentArtifactName - * A fully-qualified path representing project_location_api_deployment_artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationApiDeploymentArtifactName(projectLocationApiDeploymentArtifactName: string) { - return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match(projectLocationApiDeploymentArtifactName).project; - } - - /** - * Parse the location from ProjectLocationApiDeploymentArtifact resource. - * - * @param {string} projectLocationApiDeploymentArtifactName - * A fully-qualified path representing project_location_api_deployment_artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationApiDeploymentArtifactName(projectLocationApiDeploymentArtifactName: string) { - return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match(projectLocationApiDeploymentArtifactName).location; - } - - /** - * Parse the api from ProjectLocationApiDeploymentArtifact resource. - * - * @param {string} projectLocationApiDeploymentArtifactName - * A fully-qualified path representing project_location_api_deployment_artifact resource. - * @returns {string} A string representing the api. - */ - matchApiFromProjectLocationApiDeploymentArtifactName(projectLocationApiDeploymentArtifactName: string) { - return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match(projectLocationApiDeploymentArtifactName).api; - } - - /** - * Parse the deployment from ProjectLocationApiDeploymentArtifact resource. - * - * @param {string} projectLocationApiDeploymentArtifactName - * A fully-qualified path representing project_location_api_deployment_artifact resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromProjectLocationApiDeploymentArtifactName(projectLocationApiDeploymentArtifactName: string) { - return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match(projectLocationApiDeploymentArtifactName).deployment; - } - - /** - * Parse the artifact from ProjectLocationApiDeploymentArtifact resource. - * - * @param {string} projectLocationApiDeploymentArtifactName - * A fully-qualified path representing project_location_api_deployment_artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromProjectLocationApiDeploymentArtifactName(projectLocationApiDeploymentArtifactName: string) { - return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match(projectLocationApiDeploymentArtifactName).artifact; - } - - /** - * Return a fully-qualified projectLocationApiVersionArtifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} artifact - * @returns {string} Resource name string. - */ - projectLocationApiVersionArtifactPath(project:string,location:string,api:string,version:string,artifact:string) { - return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - artifact: artifact, - }); - } - - /** - * Parse the project from ProjectLocationApiVersionArtifact resource. - * - * @param {string} projectLocationApiVersionArtifactName - * A fully-qualified path representing project_location_api_version_artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationApiVersionArtifactName(projectLocationApiVersionArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match(projectLocationApiVersionArtifactName).project; - } - - /** - * Parse the location from ProjectLocationApiVersionArtifact resource. - * - * @param {string} projectLocationApiVersionArtifactName - * A fully-qualified path representing project_location_api_version_artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationApiVersionArtifactName(projectLocationApiVersionArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match(projectLocationApiVersionArtifactName).location; - } - - /** - * Parse the api from ProjectLocationApiVersionArtifact resource. - * - * @param {string} projectLocationApiVersionArtifactName - * A fully-qualified path representing project_location_api_version_artifact resource. - * @returns {string} A string representing the api. - */ - matchApiFromProjectLocationApiVersionArtifactName(projectLocationApiVersionArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match(projectLocationApiVersionArtifactName).api; - } - - /** - * Parse the version from ProjectLocationApiVersionArtifact resource. - * - * @param {string} projectLocationApiVersionArtifactName - * A fully-qualified path representing project_location_api_version_artifact resource. - * @returns {string} A string representing the version. - */ - matchVersionFromProjectLocationApiVersionArtifactName(projectLocationApiVersionArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match(projectLocationApiVersionArtifactName).version; - } - - /** - * Parse the artifact from ProjectLocationApiVersionArtifact resource. - * - * @param {string} projectLocationApiVersionArtifactName - * A fully-qualified path representing project_location_api_version_artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromProjectLocationApiVersionArtifactName(projectLocationApiVersionArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match(projectLocationApiVersionArtifactName).artifact; - } - - /** - * Return a fully-qualified projectLocationApiVersionSpecArtifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} spec - * @param {string} artifact - * @returns {string} Resource name string. - */ - projectLocationApiVersionSpecArtifactPath(project:string,location:string,api:string,version:string,spec:string,artifact:string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - spec: spec, - artifact: artifact, - }); - } - - /** - * Parse the project from ProjectLocationApiVersionSpecArtifact resource. - * - * @param {string} projectLocationApiVersionSpecArtifactName - * A fully-qualified path representing project_location_api_version_spec_artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationApiVersionSpecArtifactName(projectLocationApiVersionSpecArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match(projectLocationApiVersionSpecArtifactName).project; - } - - /** - * Parse the location from ProjectLocationApiVersionSpecArtifact resource. - * - * @param {string} projectLocationApiVersionSpecArtifactName - * A fully-qualified path representing project_location_api_version_spec_artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationApiVersionSpecArtifactName(projectLocationApiVersionSpecArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match(projectLocationApiVersionSpecArtifactName).location; - } - - /** - * Parse the api from ProjectLocationApiVersionSpecArtifact resource. - * - * @param {string} projectLocationApiVersionSpecArtifactName - * A fully-qualified path representing project_location_api_version_spec_artifact resource. - * @returns {string} A string representing the api. - */ - matchApiFromProjectLocationApiVersionSpecArtifactName(projectLocationApiVersionSpecArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match(projectLocationApiVersionSpecArtifactName).api; - } - - /** - * Parse the version from ProjectLocationApiVersionSpecArtifact resource. - * - * @param {string} projectLocationApiVersionSpecArtifactName - * A fully-qualified path representing project_location_api_version_spec_artifact resource. - * @returns {string} A string representing the version. - */ - matchVersionFromProjectLocationApiVersionSpecArtifactName(projectLocationApiVersionSpecArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match(projectLocationApiVersionSpecArtifactName).version; - } - - /** - * Parse the spec from ProjectLocationApiVersionSpecArtifact resource. - * - * @param {string} projectLocationApiVersionSpecArtifactName - * A fully-qualified path representing project_location_api_version_spec_artifact resource. - * @returns {string} A string representing the spec. - */ - matchSpecFromProjectLocationApiVersionSpecArtifactName(projectLocationApiVersionSpecArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match(projectLocationApiVersionSpecArtifactName).spec; - } - - /** - * Parse the artifact from ProjectLocationApiVersionSpecArtifact resource. - * - * @param {string} projectLocationApiVersionSpecArtifactName - * A fully-qualified path representing project_location_api_version_spec_artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromProjectLocationApiVersionSpecArtifactName(projectLocationApiVersionSpecArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match(projectLocationApiVersionSpecArtifactName).artifact; - } - - /** - * Return a fully-qualified projectLocationArtifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} artifact - * @returns {string} Resource name string. - */ - projectLocationArtifactPath(project:string,location:string,artifact:string) { - return this.pathTemplates.projectLocationArtifactPathTemplate.render({ - project: project, - location: location, - artifact: artifact, - }); - } - - /** - * Parse the project from ProjectLocationArtifact resource. - * - * @param {string} projectLocationArtifactName - * A fully-qualified path representing project_location_artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationArtifactName(projectLocationArtifactName: string) { - return this.pathTemplates.projectLocationArtifactPathTemplate.match(projectLocationArtifactName).project; - } - - /** - * Parse the location from ProjectLocationArtifact resource. - * - * @param {string} projectLocationArtifactName - * A fully-qualified path representing project_location_artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationArtifactName(projectLocationArtifactName: string) { - return this.pathTemplates.projectLocationArtifactPathTemplate.match(projectLocationArtifactName).location; - } - - /** - * Parse the artifact from ProjectLocationArtifact resource. - * - * @param {string} projectLocationArtifactName - * A fully-qualified path representing project_location_artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromProjectLocationArtifactName(projectLocationArtifactName: string) { - return this.pathTemplates.projectLocationArtifactPathTemplate.match(projectLocationArtifactName).artifact; - } - - /** - * 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.provisioningStub && !this._terminated) { - return this.provisioningStub.then(stub => { - this._terminated = true; - stub.close(); - this.iamClient.close(); - this.locationsClient.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/provisioning_client_config.json b/owl-bot-staging/v1/src/v1/provisioning_client_config.json deleted file mode 100644 index 2e37ea8..0000000 --- a/owl-bot-staging/v1/src/v1/provisioning_client_config.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "interfaces": { - "google.cloud.apigeeregistry.v1.Provisioning": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "CreateInstance": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteInstance": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetInstance": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/provisioning_proto_list.json b/owl-bot-staging/v1/src/v1/provisioning_proto_list.json deleted file mode 100644 index 4fdc846..0000000 --- a/owl-bot-staging/v1/src/v1/provisioning_proto_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "../../protos/google/cloud/apigeeregistry/v1/provisioning_service.proto", - "../../protos/google/cloud/apigeeregistry/v1/registry_models.proto", - "../../protos/google/cloud/apigeeregistry/v1/registry_service.proto" -] diff --git a/owl-bot-staging/v1/src/v1/registry_client.ts b/owl-bot-staging/v1/src/v1/registry_client.ts deleted file mode 100644 index 7e4019b..0000000 --- a/owl-bot-staging/v1/src/v1/registry_client.ts +++ /dev/null @@ -1,4792 +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, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/registry_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './registry_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The Registry service allows teams to manage descriptions of APIs. - * @class - * @memberof v1 - */ -export class RegistryClient { - 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}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - registryStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of RegistryClient. - * - * @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 | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * 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 RegistryClient({fallback: 'rest'}, gax); - * ``` - */ - constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof RegistryClient; - 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; - } - this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== '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 if (opts.fallback === 'rest' ) { - 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 = { - apiPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}' - ), - apiDeploymentPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}' - ), - apiSpecPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' - ), - apiVersionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' - ), - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationApiArtifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/artifacts/{artifact}' - ), - projectLocationApiDeploymentArtifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}' - ), - projectLocationApiVersionArtifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/artifacts/{artifact}' - ), - projectLocationApiVersionSpecArtifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}/artifacts/{artifact}' - ), - projectLocationArtifactPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/artifacts/{artifact}' - ), - }; - - // 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 = { - listApis: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apis'), - listApiVersions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apiVersions'), - listApiSpecs: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apiSpecs'), - listApiSpecRevisions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apiSpecs'), - listApiDeployments: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apiDeployments'), - listApiDeploymentRevisions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'apiDeployments'), - listArtifacts: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'artifacts') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.apigeeregistry.v1.Registry', 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.registryStub) { - return this.registryStub; - } - - // Put together the "service stub" for - // google.cloud.apigeeregistry.v1.Registry. - this.registryStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.apigeeregistry.v1.Registry') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.apigeeregistry.v1.Registry, - 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 registryStubMethods = - ['listApis', 'getApi', 'createApi', 'updateApi', 'deleteApi', 'listApiVersions', 'getApiVersion', 'createApiVersion', 'updateApiVersion', 'deleteApiVersion', 'listApiSpecs', 'getApiSpec', 'getApiSpecContents', 'createApiSpec', 'updateApiSpec', 'deleteApiSpec', 'tagApiSpecRevision', 'listApiSpecRevisions', 'rollbackApiSpec', 'deleteApiSpecRevision', 'listApiDeployments', 'getApiDeployment', 'createApiDeployment', 'updateApiDeployment', 'deleteApiDeployment', 'tagApiDeploymentRevision', 'listApiDeploymentRevisions', 'rollbackApiDeployment', 'deleteApiDeploymentRevision', 'listArtifacts', 'getArtifact', 'getArtifactContents', 'createArtifact', 'replaceArtifact', 'deleteArtifact']; - for (const methodName of registryStubMethods) { - const callPromise = this.registryStub.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] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.registryStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'apigeeregistry.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 'apigeeregistry.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/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Returns a specified API. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the API to retrieve. - * Format: `projects/* /locations/* /apis/*` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.Api|Api}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.get_api.js - * region_tag:apigeeregistry_v1_generated_Registry_GetApi_async - */ - getApi( - request?: protos.google.cloud.apigeeregistry.v1.IGetApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.IGetApiRequest|undefined, {}|undefined - ]>; - getApi( - request: protos.google.cloud.apigeeregistry.v1.IGetApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.IGetApiRequest|null|undefined, - {}|null|undefined>): void; - getApi( - request: protos.google.cloud.apigeeregistry.v1.IGetApiRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.IGetApiRequest|null|undefined, - {}|null|undefined>): void; - getApi( - request?: protos.google.cloud.apigeeregistry.v1.IGetApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.IGetApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.IGetApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.IGetApiRequest|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.getApi(request, options, callback); - } -/** - * Creates a specified API. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of APIs. - * Format: `projects/* /locations/*` - * @param {google.cloud.apigeeregistry.v1.Api} request.api - * Required. The API to create. - * @param {string} request.apiId - * Required. The ID to use for the API, which will become the final component of - * the API's resource name. - * - * This value should be 4-63 characters, and valid characters - * are /{@link protos.0-9|a-z}-/. - * - * Following AIP-162, IDs must not have the form of a UUID. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.Api|Api}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.create_api.js - * region_tag:apigeeregistry_v1_generated_Registry_CreateApi_async - */ - createApi( - request?: protos.google.cloud.apigeeregistry.v1.ICreateApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.ICreateApiRequest|undefined, {}|undefined - ]>; - createApi( - request: protos.google.cloud.apigeeregistry.v1.ICreateApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.ICreateApiRequest|null|undefined, - {}|null|undefined>): void; - createApi( - request: protos.google.cloud.apigeeregistry.v1.ICreateApiRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.ICreateApiRequest|null|undefined, - {}|null|undefined>): void; - createApi( - request?: protos.google.cloud.apigeeregistry.v1.ICreateApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.ICreateApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.ICreateApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.ICreateApiRequest|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.createApi(request, options, callback); - } -/** - * Used to modify a specified API. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apigeeregistry.v1.Api} request.api - * Required. The API to update. - * - * The `name` field is used to identify the API to update. - * Format: `projects/* /locations/* /apis/*` - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be updated. If omitted, all fields are updated that - * are set in the request message (fields set to default values are ignored). - * If an asterisk "*" is specified, all fields are updated, including fields - * that are unspecified/default in the request. - * @param {boolean} request.allowMissing - * If set to true, and the API is not found, a new API will be created. - * In this situation, `update_mask` is 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.cloud.apigeeregistry.v1.Api|Api}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.update_api.js - * region_tag:apigeeregistry_v1_generated_Registry_UpdateApi_async - */ - updateApi( - request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest|undefined, {}|undefined - ]>; - updateApi( - request: protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest|null|undefined, - {}|null|undefined>): void; - updateApi( - request: protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest|null|undefined, - {}|null|undefined>): void; - updateApi( - request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApi, - protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest|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({ - 'api.name': request.api!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateApi(request, options, callback); - } -/** - * Removes a specified API and all of the resources that it - * owns. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the API to delete. - * Format: `projects/* /locations/* /apis/*` - * @param {boolean} request.force - * If set to true, any child resources will also be deleted. - * (Otherwise, the request will only work if there are no child resources.) - * @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 include:samples/generated/v1/registry.delete_api.js - * region_tag:apigeeregistry_v1_generated_Registry_DeleteApi_async - */ - deleteApi( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest|undefined, {}|undefined - ]>; - deleteApi( - request: protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest|null|undefined, - {}|null|undefined>): void; - deleteApi( - request: protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest|null|undefined, - {}|null|undefined>): void; - deleteApi( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest|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.deleteApi(request, options, callback); - } -/** - * Returns a specified version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the version to retrieve. - * Format: `projects/* /locations/* /apis/* /versions/*` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiVersion|ApiVersion}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.get_api_version.js - * region_tag:apigeeregistry_v1_generated_Registry_GetApiVersion_async - */ - getApiVersion( - request?: protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest|undefined, {}|undefined - ]>; - getApiVersion( - request: protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest|null|undefined, - {}|null|undefined>): void; - getApiVersion( - request: protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest|null|undefined, - {}|null|undefined>): void; - getApiVersion( - request?: protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest|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.getApiVersion(request, options, callback); - } -/** - * Creates a specified version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of versions. - * Format: `projects/* /locations/* /apis/*` - * @param {google.cloud.apigeeregistry.v1.ApiVersion} request.apiVersion - * Required. The version to create. - * @param {string} request.apiVersionId - * Required. The ID to use for the version, which will become the final component of - * the version's resource name. - * - * This value should be 1-63 characters, and valid characters - * are /{@link protos.0-9|a-z}-/. - * - * Following AIP-162, IDs must not have the form of a UUID. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiVersion|ApiVersion}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.create_api_version.js - * region_tag:apigeeregistry_v1_generated_Registry_CreateApiVersion_async - */ - createApiVersion( - request?: protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest|undefined, {}|undefined - ]>; - createApiVersion( - request: protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest|null|undefined, - {}|null|undefined>): void; - createApiVersion( - request: protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest|null|undefined, - {}|null|undefined>): void; - createApiVersion( - request?: protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest|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.createApiVersion(request, options, callback); - } -/** - * Used to modify a specified version. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apigeeregistry.v1.ApiVersion} request.apiVersion - * Required. The version to update. - * - * The `name` field is used to identify the version to update. - * Format: `projects/* /locations/* /apis/* /versions/*` - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be updated. If omitted, all fields are updated that - * are set in the request message (fields set to default values are ignored). - * If an asterisk "*" is specified, all fields are updated, including fields - * that are unspecified/default in the request. - * @param {boolean} request.allowMissing - * If set to true, and the version is not found, a new version will be - * created. In this situation, `update_mask` is 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.cloud.apigeeregistry.v1.ApiVersion|ApiVersion}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.update_api_version.js - * region_tag:apigeeregistry_v1_generated_Registry_UpdateApiVersion_async - */ - updateApiVersion( - request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest|undefined, {}|undefined - ]>; - updateApiVersion( - request: protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest|null|undefined, - {}|null|undefined>): void; - updateApiVersion( - request: protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest|null|undefined, - {}|null|undefined>): void; - updateApiVersion( - request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiVersion, - protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest|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({ - 'api_version.name': request.apiVersion!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateApiVersion(request, options, callback); - } -/** - * Removes a specified version and all of the resources that - * it owns. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the version to delete. - * Format: `projects/* /locations/* /apis/* /versions/*` - * @param {boolean} request.force - * If set to true, any child resources will also be deleted. - * (Otherwise, the request will only work if there are no child resources.) - * @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 include:samples/generated/v1/registry.delete_api_version.js - * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiVersion_async - */ - deleteApiVersion( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest|undefined, {}|undefined - ]>; - deleteApiVersion( - request: protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest|null|undefined, - {}|null|undefined>): void; - deleteApiVersion( - request: protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest|null|undefined, - {}|null|undefined>): void; - deleteApiVersion( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest|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.deleteApiVersion(request, options, callback); - } -/** - * Returns a specified spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec to retrieve. - * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiSpec|ApiSpec}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.get_api_spec.js - * region_tag:apigeeregistry_v1_generated_Registry_GetApiSpec_async - */ - getApiSpec( - request?: protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest|undefined, {}|undefined - ]>; - getApiSpec( - request: protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest|null|undefined, - {}|null|undefined>): void; - getApiSpec( - request: protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest|null|undefined, - {}|null|undefined>): void; - getApiSpec( - request?: protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest|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.getApiSpec(request, options, callback); - } -/** - * Returns the contents of a specified spec. - * If specs are stored with GZip compression, the default behavior - * is to return the spec uncompressed (the mime_type response field - * indicates the exact format returned). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec whose contents should be retrieved. - * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` - * @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.api.HttpBody|HttpBody}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.get_api_spec_contents.js - * region_tag:apigeeregistry_v1_generated_Registry_GetApiSpecContents_async - */ - getApiSpecContents( - request?: protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, - options?: CallOptions): - Promise<[ - protos.google.api.IHttpBody, - protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest|undefined, {}|undefined - ]>; - getApiSpecContents( - request: protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, - options: CallOptions, - callback: Callback< - protos.google.api.IHttpBody, - protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest|null|undefined, - {}|null|undefined>): void; - getApiSpecContents( - request: protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, - callback: Callback< - protos.google.api.IHttpBody, - protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest|null|undefined, - {}|null|undefined>): void; - getApiSpecContents( - request?: protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.api.IHttpBody, - protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.api.IHttpBody, - protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.api.IHttpBody, - protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest|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.getApiSpecContents(request, options, callback); - } -/** - * Creates a specified spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of specs. - * Format: `projects/* /locations/* /apis/* /versions/*` - * @param {google.cloud.apigeeregistry.v1.ApiSpec} request.apiSpec - * Required. The spec to create. - * @param {string} request.apiSpecId - * Required. The ID to use for the spec, which will become the final component of - * the spec's resource name. - * - * This value should be 4-63 characters, and valid characters - * are /{@link protos.0-9|a-z}-/. - * - * Following AIP-162, IDs must not have the form of a UUID. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiSpec|ApiSpec}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.create_api_spec.js - * region_tag:apigeeregistry_v1_generated_Registry_CreateApiSpec_async - */ - createApiSpec( - request?: protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest|undefined, {}|undefined - ]>; - createApiSpec( - request: protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest|null|undefined, - {}|null|undefined>): void; - createApiSpec( - request: protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest|null|undefined, - {}|null|undefined>): void; - createApiSpec( - request?: protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest|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.createApiSpec(request, options, callback); - } -/** - * Used to modify a specified spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apigeeregistry.v1.ApiSpec} request.apiSpec - * Required. The spec to update. - * - * The `name` field is used to identify the spec to update. - * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be updated. If omitted, all fields are updated that - * are set in the request message (fields set to default values are ignored). - * If an asterisk "*" is specified, all fields are updated, including fields - * that are unspecified/default in the request. - * @param {boolean} request.allowMissing - * If set to true, and the spec is not found, a new spec will be created. - * In this situation, `update_mask` is 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.cloud.apigeeregistry.v1.ApiSpec|ApiSpec}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.update_api_spec.js - * region_tag:apigeeregistry_v1_generated_Registry_UpdateApiSpec_async - */ - updateApiSpec( - request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest|undefined, {}|undefined - ]>; - updateApiSpec( - request: protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest|null|undefined, - {}|null|undefined>): void; - updateApiSpec( - request: protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest|null|undefined, - {}|null|undefined>): void; - updateApiSpec( - request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest|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({ - 'api_spec.name': request.apiSpec!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateApiSpec(request, options, callback); - } -/** - * Removes a specified spec, all revisions, and all child - * resources (e.g., artifacts). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec to delete. - * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` - * @param {boolean} request.force - * If set to true, any child resources will also be deleted. - * (Otherwise, the request will only work if there are no child resources.) - * @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 include:samples/generated/v1/registry.delete_api_spec.js - * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiSpec_async - */ - deleteApiSpec( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest|undefined, {}|undefined - ]>; - deleteApiSpec( - request: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest|null|undefined, - {}|null|undefined>): void; - deleteApiSpec( - request: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest|null|undefined, - {}|null|undefined>): void; - deleteApiSpec( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest|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.deleteApiSpec(request, options, callback); - } -/** - * Adds a tag to a specified revision of a spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec to be tagged, including the revision ID. - * @param {string} request.tag - * Required. The tag to apply. - * The tag should be at most 40 characters, and match `{@link protos.a-z0-9-|a-z}{3,39}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiSpec|ApiSpec}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.tag_api_spec_revision.js - * region_tag:apigeeregistry_v1_generated_Registry_TagApiSpecRevision_async - */ - tagApiSpecRevision( - request?: protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest|undefined, {}|undefined - ]>; - tagApiSpecRevision( - request: protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest|null|undefined, - {}|null|undefined>): void; - tagApiSpecRevision( - request: protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest|null|undefined, - {}|null|undefined>): void; - tagApiSpecRevision( - request?: protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest|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.tagApiSpecRevision(request, options, callback); - } -/** - * Sets the current revision to a specified prior revision. - * Note that this creates a new revision with a new revision ID. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The spec being rolled back. - * @param {string} request.revisionId - * Required. The revision ID to roll back to. - * It must be a revision of the same spec. - * - * Example: `c7cfa2a8` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiSpec|ApiSpec}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.rollback_api_spec.js - * region_tag:apigeeregistry_v1_generated_Registry_RollbackApiSpec_async - */ - rollbackApiSpec( - request?: protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest|undefined, {}|undefined - ]>; - rollbackApiSpec( - request: protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest|null|undefined, - {}|null|undefined>): void; - rollbackApiSpec( - request: protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest|null|undefined, - {}|null|undefined>): void; - rollbackApiSpec( - request?: protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest|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.rollbackApiSpec(request, options, callback); - } -/** - * Deletes a revision of a spec. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec revision to be deleted, - * with a revision ID explicitly included. - * - * Example: - * `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiSpec|ApiSpec}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.delete_api_spec_revision.js - * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_async - */ - deleteApiSpecRevision( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest|undefined, {}|undefined - ]>; - deleteApiSpecRevision( - request: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest|null|undefined, - {}|null|undefined>): void; - deleteApiSpecRevision( - request: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest|null|undefined, - {}|null|undefined>): void; - deleteApiSpecRevision( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec, - protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest|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.deleteApiSpecRevision(request, options, callback); - } -/** - * Returns a specified deployment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the deployment to retrieve. - * Format: `projects/* /locations/* /apis/* /deployments/*` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiDeployment|ApiDeployment}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.get_api_deployment.js - * region_tag:apigeeregistry_v1_generated_Registry_GetApiDeployment_async - */ - getApiDeployment( - request?: protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest|undefined, {}|undefined - ]>; - getApiDeployment( - request: protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest|null|undefined, - {}|null|undefined>): void; - getApiDeployment( - request: protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest|null|undefined, - {}|null|undefined>): void; - getApiDeployment( - request?: protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest|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.getApiDeployment(request, options, callback); - } -/** - * Creates a specified deployment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of deployments. - * Format: `projects/* /locations/* /apis/*` - * @param {google.cloud.apigeeregistry.v1.ApiDeployment} request.apiDeployment - * Required. The deployment to create. - * @param {string} request.apiDeploymentId - * Required. The ID to use for the deployment, which will become the final component of - * the deployment's resource name. - * - * This value should be 4-63 characters, and valid characters - * are /{@link protos.0-9|a-z}-/. - * - * Following AIP-162, IDs must not have the form of a UUID. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiDeployment|ApiDeployment}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.create_api_deployment.js - * region_tag:apigeeregistry_v1_generated_Registry_CreateApiDeployment_async - */ - createApiDeployment( - request?: protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest|undefined, {}|undefined - ]>; - createApiDeployment( - request: protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest|null|undefined, - {}|null|undefined>): void; - createApiDeployment( - request: protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest|null|undefined, - {}|null|undefined>): void; - createApiDeployment( - request?: protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest|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.createApiDeployment(request, options, callback); - } -/** - * Used to modify a specified deployment. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apigeeregistry.v1.ApiDeployment} request.apiDeployment - * Required. The deployment to update. - * - * The `name` field is used to identify the deployment to update. - * Format: `projects/* /locations/* /apis/* /deployments/*` - * @param {google.protobuf.FieldMask} request.updateMask - * The list of fields to be updated. If omitted, all fields are updated that - * are set in the request message (fields set to default values are ignored). - * If an asterisk "*" is specified, all fields are updated, including fields - * that are unspecified/default in the request. - * @param {boolean} request.allowMissing - * If set to true, and the deployment is not found, a new deployment will be - * created. In this situation, `update_mask` is 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.cloud.apigeeregistry.v1.ApiDeployment|ApiDeployment}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.update_api_deployment.js - * region_tag:apigeeregistry_v1_generated_Registry_UpdateApiDeployment_async - */ - updateApiDeployment( - request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest|undefined, {}|undefined - ]>; - updateApiDeployment( - request: protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest|null|undefined, - {}|null|undefined>): void; - updateApiDeployment( - request: protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest|null|undefined, - {}|null|undefined>): void; - updateApiDeployment( - request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest|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({ - 'api_deployment.name': request.apiDeployment!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.updateApiDeployment(request, options, callback); - } -/** - * Removes a specified deployment, all revisions, and all - * child resources (e.g., artifacts). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the deployment to delete. - * Format: `projects/* /locations/* /apis/* /deployments/*` - * @param {boolean} request.force - * If set to true, any child resources will also be deleted. - * (Otherwise, the request will only work if there are no child resources.) - * @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 include:samples/generated/v1/registry.delete_api_deployment.js - * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiDeployment_async - */ - deleteApiDeployment( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest|undefined, {}|undefined - ]>; - deleteApiDeployment( - request: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest|null|undefined, - {}|null|undefined>): void; - deleteApiDeployment( - request: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest|null|undefined, - {}|null|undefined>): void; - deleteApiDeployment( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest|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.deleteApiDeployment(request, options, callback); - } -/** - * Adds a tag to a specified revision of a - * deployment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the deployment to be tagged, including the revision ID. - * @param {string} request.tag - * Required. The tag to apply. - * The tag should be at most 40 characters, and match `{@link protos.a-z0-9-|a-z}{3,39}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiDeployment|ApiDeployment}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.tag_api_deployment_revision.js - * region_tag:apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_async - */ - tagApiDeploymentRevision( - request?: protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest|undefined, {}|undefined - ]>; - tagApiDeploymentRevision( - request: protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest|null|undefined, - {}|null|undefined>): void; - tagApiDeploymentRevision( - request: protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest|null|undefined, - {}|null|undefined>): void; - tagApiDeploymentRevision( - request?: protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest|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.tagApiDeploymentRevision(request, options, callback); - } -/** - * Sets the current revision to a specified prior - * revision. Note that this creates a new revision with a new revision ID. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The deployment being rolled back. - * @param {string} request.revisionId - * Required. The revision ID to roll back to. - * It must be a revision of the same deployment. - * - * Example: `c7cfa2a8` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiDeployment|ApiDeployment}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.rollback_api_deployment.js - * region_tag:apigeeregistry_v1_generated_Registry_RollbackApiDeployment_async - */ - rollbackApiDeployment( - request?: protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest|undefined, {}|undefined - ]>; - rollbackApiDeployment( - request: protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest|null|undefined, - {}|null|undefined>): void; - rollbackApiDeployment( - request: protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest|null|undefined, - {}|null|undefined>): void; - rollbackApiDeployment( - request?: protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest|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.rollbackApiDeployment(request, options, callback); - } -/** - * Deletes a revision of a deployment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the deployment revision to be deleted, - * with a revision ID explicitly included. - * - * Example: - * `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiDeployment|ApiDeployment}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.delete_api_deployment_revision.js - * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_async - */ - deleteApiDeploymentRevision( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest|undefined, {}|undefined - ]>; - deleteApiDeploymentRevision( - request: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest|null|undefined, - {}|null|undefined>): void; - deleteApiDeploymentRevision( - request: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest|null|undefined, - {}|null|undefined>): void; - deleteApiDeploymentRevision( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment, - protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest|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.deleteApiDeploymentRevision(request, options, callback); - } -/** - * Returns a specified artifact. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the artifact to retrieve. - * Format: `{parent}/artifacts/*` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.Artifact|Artifact}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.get_artifact.js - * region_tag:apigeeregistry_v1_generated_Registry_GetArtifact_async - */ - getArtifact( - request?: protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest|undefined, {}|undefined - ]>; - getArtifact( - request: protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest|null|undefined, - {}|null|undefined>): void; - getArtifact( - request: protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest|null|undefined, - {}|null|undefined>): void; - getArtifact( - request?: protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest|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.getArtifact(request, options, callback); - } -/** - * Returns the contents of a specified artifact. - * If artifacts are stored with GZip compression, the default behavior - * is to return the artifact uncompressed (the mime_type response field - * indicates the exact format returned). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the artifact whose contents should be retrieved. - * Format: `{parent}/artifacts/*` - * @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.api.HttpBody|HttpBody}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.get_artifact_contents.js - * region_tag:apigeeregistry_v1_generated_Registry_GetArtifactContents_async - */ - getArtifactContents( - request?: protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, - options?: CallOptions): - Promise<[ - protos.google.api.IHttpBody, - protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest|undefined, {}|undefined - ]>; - getArtifactContents( - request: protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, - options: CallOptions, - callback: Callback< - protos.google.api.IHttpBody, - protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest|null|undefined, - {}|null|undefined>): void; - getArtifactContents( - request: protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, - callback: Callback< - protos.google.api.IHttpBody, - protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest|null|undefined, - {}|null|undefined>): void; - getArtifactContents( - request?: protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.api.IHttpBody, - protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.api.IHttpBody, - protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.api.IHttpBody, - protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest|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.getArtifactContents(request, options, callback); - } -/** - * Creates a specified artifact. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of artifacts. - * Format: `{parent}` - * @param {google.cloud.apigeeregistry.v1.Artifact} request.artifact - * Required. The artifact to create. - * @param {string} request.artifactId - * Required. The ID to use for the artifact, which will become the final component of - * the artifact's resource name. - * - * This value should be 4-63 characters, and valid characters - * are /{@link protos.0-9|a-z}-/. - * - * Following AIP-162, IDs must not have the form of a UUID. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.Artifact|Artifact}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.create_artifact.js - * region_tag:apigeeregistry_v1_generated_Registry_CreateArtifact_async - */ - createArtifact( - request?: protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest|undefined, {}|undefined - ]>; - createArtifact( - request: protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest|null|undefined, - {}|null|undefined>): void; - createArtifact( - request: protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest|null|undefined, - {}|null|undefined>): void; - createArtifact( - request?: protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest|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.createArtifact(request, options, callback); - } -/** - * Used to replace a specified artifact. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.apigeeregistry.v1.Artifact} request.artifact - * Required. The artifact to replace. - * - * The `name` field is used to identify the artifact to replace. - * Format: `{parent}/artifacts/*` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.apigeeregistry.v1.Artifact|Artifact}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.replace_artifact.js - * region_tag:apigeeregistry_v1_generated_Registry_ReplaceArtifact_async - */ - replaceArtifact( - request?: protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest|undefined, {}|undefined - ]>; - replaceArtifact( - request: protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest|null|undefined, - {}|null|undefined>): void; - replaceArtifact( - request: protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, - callback: Callback< - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest|null|undefined, - {}|null|undefined>): void; - replaceArtifact( - request?: protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IArtifact, - protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest|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({ - 'artifact.name': request.artifact!.name ?? '', - }); - this.initialize(); - return this.innerApiCalls.replaceArtifact(request, options, callback); - } -/** - * Removes a specified artifact. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the artifact to delete. - * Format: `{parent}/artifacts/*` - * @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 include:samples/generated/v1/registry.delete_artifact.js - * region_tag:apigeeregistry_v1_generated_Registry_DeleteArtifact_async - */ - deleteArtifact( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest|undefined, {}|undefined - ]>; - deleteArtifact( - request: protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest|null|undefined, - {}|null|undefined>): void; - deleteArtifact( - request: protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest|null|undefined, - {}|null|undefined>): void; - deleteArtifact( - request?: protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest|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.deleteArtifact(request, options, callback); - } - - /** - * Returns matching APIs. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of APIs. - * Format: `projects/* /locations/*` - * @param {number} request.pageSize - * The maximum number of APIs to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListApis` must match - * the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apigeeregistry.v1.Api|Api}. - * 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 `listApisAsync()` - * 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. - */ - listApis( - request?: protos.google.cloud.apigeeregistry.v1.IListApisRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApi[], - protos.google.cloud.apigeeregistry.v1.IListApisRequest|null, - protos.google.cloud.apigeeregistry.v1.IListApisResponse - ]>; - listApis( - request: protos.google.cloud.apigeeregistry.v1.IListApisRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApisRequest, - protos.google.cloud.apigeeregistry.v1.IListApisResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApi>): void; - listApis( - request: protos.google.cloud.apigeeregistry.v1.IListApisRequest, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApisRequest, - protos.google.cloud.apigeeregistry.v1.IListApisResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApi>): void; - listApis( - request?: protos.google.cloud.apigeeregistry.v1.IListApisRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApisRequest, - protos.google.cloud.apigeeregistry.v1.IListApisResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApi>, - callback?: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApisRequest, - protos.google.cloud.apigeeregistry.v1.IListApisResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApi>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApi[], - protos.google.cloud.apigeeregistry.v1.IListApisRequest|null, - protos.google.cloud.apigeeregistry.v1.IListApisResponse - ]>|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.listApis(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 parent, which owns this collection of APIs. - * Format: `projects/* /locations/*` - * @param {number} request.pageSize - * The maximum number of APIs to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListApis` must match - * the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apigeeregistry.v1.Api|Api} 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 `listApisAsync()` - * 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. - */ - listApisStream( - request?: protos.google.cloud.apigeeregistry.v1.IListApisRequest, - 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['listApis']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApis.createStream( - this.innerApiCalls.listApis as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listApis`, 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 parent, which owns this collection of APIs. - * Format: `projects/* /locations/*` - * @param {number} request.pageSize - * The maximum number of APIs to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListApis` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListApis` must match - * the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.apigeeregistry.v1.Api|Api}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.list_apis.js - * region_tag:apigeeregistry_v1_generated_Registry_ListApis_async - */ - listApisAsync( - request?: protos.google.cloud.apigeeregistry.v1.IListApisRequest, - 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['listApis']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApis.asyncIterate( - this.innerApiCalls['listApis'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns matching versions. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of versions. - * Format: `projects/* /locations/* /apis/*` - * @param {number} request.pageSize - * The maximum number of versions to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListApiVersions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListApiVersions` must - * match the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apigeeregistry.v1.ApiVersion|ApiVersion}. - * 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 `listApiVersionsAsync()` - * 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. - */ - listApiVersions( - request?: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiVersion[], - protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest|null, - protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse - ]>; - listApiVersions( - request: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiVersion>): void; - listApiVersions( - request: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiVersion>): void; - listApiVersions( - request?: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiVersion>, - callback?: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiVersion>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiVersion[], - protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest|null, - protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse - ]>|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.listApiVersions(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 parent, which owns this collection of versions. - * Format: `projects/* /locations/* /apis/*` - * @param {number} request.pageSize - * The maximum number of versions to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListApiVersions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListApiVersions` must - * match the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiVersion|ApiVersion} 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 `listApiVersionsAsync()` - * 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. - */ - listApiVersionsStream( - request?: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, - 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['listApiVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiVersions.createStream( - this.innerApiCalls.listApiVersions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listApiVersions`, 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 parent, which owns this collection of versions. - * Format: `projects/* /locations/* /apis/*` - * @param {number} request.pageSize - * The maximum number of versions to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListApiVersions` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListApiVersions` must - * match the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.apigeeregistry.v1.ApiVersion|ApiVersion}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.list_api_versions.js - * region_tag:apigeeregistry_v1_generated_Registry_ListApiVersions_async - */ - listApiVersionsAsync( - request?: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, - 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['listApiVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiVersions.asyncIterate( - this.innerApiCalls['listApiVersions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns matching specs. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of specs. - * Format: `projects/* /locations/* /apis/* /versions/*` - * @param {number} request.pageSize - * The maximum number of specs to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListApiSpecs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListApiSpecs` must match - * the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields except contents. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apigeeregistry.v1.ApiSpec|ApiSpec}. - * 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 `listApiSpecsAsync()` - * 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. - */ - listApiSpecs( - request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec[], - protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest|null, - protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse - ]>; - listApiSpecs( - request: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiSpec>): void; - listApiSpecs( - request: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiSpec>): void; - listApiSpecs( - request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiSpec>, - callback?: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiSpec>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec[], - protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest|null, - protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse - ]>|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.listApiSpecs(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 parent, which owns this collection of specs. - * Format: `projects/* /locations/* /apis/* /versions/*` - * @param {number} request.pageSize - * The maximum number of specs to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListApiSpecs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListApiSpecs` must match - * the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields except contents. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiSpec|ApiSpec} 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 `listApiSpecsAsync()` - * 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. - */ - listApiSpecsStream( - request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, - 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['listApiSpecs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiSpecs.createStream( - this.innerApiCalls.listApiSpecs as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listApiSpecs`, 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 parent, which owns this collection of specs. - * Format: `projects/* /locations/* /apis/* /versions/*` - * @param {number} request.pageSize - * The maximum number of specs to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListApiSpecs` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListApiSpecs` must match - * the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields except contents. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.apigeeregistry.v1.ApiSpec|ApiSpec}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.list_api_specs.js - * region_tag:apigeeregistry_v1_generated_Registry_ListApiSpecs_async - */ - listApiSpecsAsync( - request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, - 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['listApiSpecs']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiSpecs.asyncIterate( - this.innerApiCalls['listApiSpecs'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all revisions of a spec. - * Revisions are returned in descending order of revision creation time. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the spec to list revisions for. - * @param {number} request.pageSize - * The maximum number of revisions to return per page. - * @param {string} request.pageToken - * The page token, received from a previous ListApiSpecRevisions call. - * Provide this to retrieve the subsequent page. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apigeeregistry.v1.ApiSpec|ApiSpec}. - * 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 `listApiSpecRevisionsAsync()` - * 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. - */ - listApiSpecRevisions( - request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec[], - protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest|null, - protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse - ]>; - listApiSpecRevisions( - request: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiSpec>): void; - listApiSpecRevisions( - request: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiSpec>): void; - listApiSpecRevisions( - request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiSpec>, - callback?: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiSpec>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiSpec[], - protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest|null, - protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse - ]>|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.listApiSpecRevisions(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.name - * Required. The name of the spec to list revisions for. - * @param {number} request.pageSize - * The maximum number of revisions to return per page. - * @param {string} request.pageToken - * The page token, received from a previous ListApiSpecRevisions call. - * Provide this to retrieve the subsequent page. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiSpec|ApiSpec} 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 `listApiSpecRevisionsAsync()` - * 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. - */ - listApiSpecRevisionsStream( - request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, - 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({ - 'name': request.name ?? '', - }); - const defaultCallSettings = this._defaults['listApiSpecRevisions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiSpecRevisions.createStream( - this.innerApiCalls.listApiSpecRevisions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listApiSpecRevisions`, 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.name - * Required. The name of the spec to list revisions for. - * @param {number} request.pageSize - * The maximum number of revisions to return per page. - * @param {string} request.pageToken - * The page token, received from a previous ListApiSpecRevisions call. - * Provide this to retrieve the subsequent page. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.apigeeregistry.v1.ApiSpec|ApiSpec}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.list_api_spec_revisions.js - * region_tag:apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_async - */ - listApiSpecRevisionsAsync( - request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, - 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({ - 'name': request.name ?? '', - }); - const defaultCallSettings = this._defaults['listApiSpecRevisions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiSpecRevisions.asyncIterate( - this.innerApiCalls['listApiSpecRevisions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns matching deployments. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of deployments. - * Format: `projects/* /locations/* /apis/*` - * @param {number} request.pageSize - * The maximum number of deployments to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListApiDeployments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListApiDeployments` must - * match the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apigeeregistry.v1.ApiDeployment|ApiDeployment}. - * 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 `listApiDeploymentsAsync()` - * 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. - */ - listApiDeployments( - request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment[], - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest|null, - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse - ]>; - listApiDeployments( - request: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiDeployment>): void; - listApiDeployments( - request: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiDeployment>): void; - listApiDeployments( - request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiDeployment>, - callback?: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiDeployment>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment[], - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest|null, - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse - ]>|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.listApiDeployments(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 parent, which owns this collection of deployments. - * Format: `projects/* /locations/* /apis/*` - * @param {number} request.pageSize - * The maximum number of deployments to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListApiDeployments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListApiDeployments` must - * match the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiDeployment|ApiDeployment} 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 `listApiDeploymentsAsync()` - * 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. - */ - listApiDeploymentsStream( - request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, - 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['listApiDeployments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiDeployments.createStream( - this.innerApiCalls.listApiDeployments as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listApiDeployments`, 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 parent, which owns this collection of deployments. - * Format: `projects/* /locations/* /apis/*` - * @param {number} request.pageSize - * The maximum number of deployments to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListApiDeployments` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListApiDeployments` must - * match the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.apigeeregistry.v1.ApiDeployment|ApiDeployment}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.list_api_deployments.js - * region_tag:apigeeregistry_v1_generated_Registry_ListApiDeployments_async - */ - listApiDeploymentsAsync( - request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, - 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['listApiDeployments']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiDeployments.asyncIterate( - this.innerApiCalls['listApiDeployments'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists all revisions of a deployment. - * Revisions are returned in descending order of revision creation time. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the deployment to list revisions for. - * @param {number} request.pageSize - * The maximum number of revisions to return per page. - * @param {string} request.pageToken - * The page token, received from a previous ListApiDeploymentRevisions call. - * Provide this to retrieve the subsequent page. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apigeeregistry.v1.ApiDeployment|ApiDeployment}. - * 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 `listApiDeploymentRevisionsAsync()` - * 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. - */ - listApiDeploymentRevisions( - request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment[], - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest|null, - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse - ]>; - listApiDeploymentRevisions( - request: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiDeployment>): void; - listApiDeploymentRevisions( - request: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiDeployment>): void; - listApiDeploymentRevisions( - request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiDeployment>, - callback?: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IApiDeployment>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IApiDeployment[], - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest|null, - protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse - ]>|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.listApiDeploymentRevisions(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.name - * Required. The name of the deployment to list revisions for. - * @param {number} request.pageSize - * The maximum number of revisions to return per page. - * @param {string} request.pageToken - * The page token, received from a previous ListApiDeploymentRevisions call. - * Provide this to retrieve the subsequent page. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apigeeregistry.v1.ApiDeployment|ApiDeployment} 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 `listApiDeploymentRevisionsAsync()` - * 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. - */ - listApiDeploymentRevisionsStream( - request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, - 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({ - 'name': request.name ?? '', - }); - const defaultCallSettings = this._defaults['listApiDeploymentRevisions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiDeploymentRevisions.createStream( - this.innerApiCalls.listApiDeploymentRevisions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listApiDeploymentRevisions`, 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.name - * Required. The name of the deployment to list revisions for. - * @param {number} request.pageSize - * The maximum number of revisions to return per page. - * @param {string} request.pageToken - * The page token, received from a previous ListApiDeploymentRevisions call. - * Provide this to retrieve the subsequent page. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.apigeeregistry.v1.ApiDeployment|ApiDeployment}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.list_api_deployment_revisions.js - * region_tag:apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_async - */ - listApiDeploymentRevisionsAsync( - request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, - 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({ - 'name': request.name ?? '', - }); - const defaultCallSettings = this._defaults['listApiDeploymentRevisions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listApiDeploymentRevisions.asyncIterate( - this.innerApiCalls['listApiDeploymentRevisions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns matching artifacts. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of artifacts. - * Format: `{parent}` - * @param {number} request.pageSize - * The maximum number of artifacts to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListArtifacts` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListArtifacts` must - * match the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields except contents. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.apigeeregistry.v1.Artifact|Artifact}. - * 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 `listArtifactsAsync()` - * 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. - */ - listArtifacts( - request?: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IArtifact[], - protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest|null, - protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse - ]>; - listArtifacts( - request: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, - protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IArtifact>): void; - listArtifacts( - request: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, - callback: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, - protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IArtifact>): void; - listArtifacts( - request?: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, - protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IArtifact>, - callback?: PaginationCallback< - protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, - protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse|null|undefined, - protos.google.cloud.apigeeregistry.v1.IArtifact>): - Promise<[ - protos.google.cloud.apigeeregistry.v1.IArtifact[], - protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest|null, - protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse - ]>|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.listArtifacts(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 parent, which owns this collection of artifacts. - * Format: `{parent}` - * @param {number} request.pageSize - * The maximum number of artifacts to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListArtifacts` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListArtifacts` must - * match the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields except contents. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.apigeeregistry.v1.Artifact|Artifact} 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 `listArtifactsAsync()` - * 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. - */ - listArtifactsStream( - request?: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, - 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['listArtifacts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listArtifacts.createStream( - this.innerApiCalls.listArtifacts as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listArtifacts`, 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 parent, which owns this collection of artifacts. - * Format: `{parent}` - * @param {number} request.pageSize - * The maximum number of artifacts to return. - * The service may return fewer than this value. - * If unspecified, at most 50 values will be returned. - * The maximum is 1000; values above 1000 will be coerced to 1000. - * @param {string} request.pageToken - * A page token, received from a previous `ListArtifacts` call. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to `ListArtifacts` must - * match the call that provided the page token. - * @param {string} request.filter - * An expression that can be used to filter the list. Filters use the Common - * Expression Language and can refer to all message fields except contents. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.apigeeregistry.v1.Artifact|Artifact}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/registry.list_artifacts.js - * region_tag:apigeeregistry_v1_generated_Registry_ListArtifacts_async - */ - listArtifactsAsync( - request?: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, - 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['listArtifacts']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listArtifacts.asyncIterate( - this.innerApiCalls['listArtifacts'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and 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 {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified api resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @returns {string} Resource name string. - */ - apiPath(project:string,location:string,api:string) { - return this.pathTemplates.apiPathTemplate.render({ - project: project, - location: location, - api: api, - }); - } - - /** - * Parse the project from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).project; - } - - /** - * Parse the location from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).location; - } - - /** - * Parse the api from Api resource. - * - * @param {string} apiName - * A fully-qualified path representing Api resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiName(apiName: string) { - return this.pathTemplates.apiPathTemplate.match(apiName).api; - } - - /** - * Return a fully-qualified apiDeployment resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} deployment - * @returns {string} Resource name string. - */ - apiDeploymentPath(project:string,location:string,api:string,deployment:string) { - return this.pathTemplates.apiDeploymentPathTemplate.render({ - project: project, - location: location, - api: api, - deployment: deployment, - }); - } - - /** - * Parse the project from ApiDeployment resource. - * - * @param {string} apiDeploymentName - * A fully-qualified path representing ApiDeployment resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiDeploymentName(apiDeploymentName: string) { - return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName).project; - } - - /** - * Parse the location from ApiDeployment resource. - * - * @param {string} apiDeploymentName - * A fully-qualified path representing ApiDeployment resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiDeploymentName(apiDeploymentName: string) { - return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName).location; - } - - /** - * Parse the api from ApiDeployment resource. - * - * @param {string} apiDeploymentName - * A fully-qualified path representing ApiDeployment resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiDeploymentName(apiDeploymentName: string) { - return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName).api; - } - - /** - * Parse the deployment from ApiDeployment resource. - * - * @param {string} apiDeploymentName - * A fully-qualified path representing ApiDeployment resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromApiDeploymentName(apiDeploymentName: string) { - return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName).deployment; - } - - /** - * Return a fully-qualified apiSpec resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} spec - * @returns {string} Resource name string. - */ - apiSpecPath(project:string,location:string,api:string,version:string,spec:string) { - return this.pathTemplates.apiSpecPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - spec: spec, - }); - } - - /** - * Parse the project from ApiSpec resource. - * - * @param {string} apiSpecName - * A fully-qualified path representing ApiSpec resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiSpecName(apiSpecName: string) { - return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).project; - } - - /** - * Parse the location from ApiSpec resource. - * - * @param {string} apiSpecName - * A fully-qualified path representing ApiSpec resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiSpecName(apiSpecName: string) { - return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).location; - } - - /** - * Parse the api from ApiSpec resource. - * - * @param {string} apiSpecName - * A fully-qualified path representing ApiSpec resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiSpecName(apiSpecName: string) { - return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).api; - } - - /** - * Parse the version from ApiSpec resource. - * - * @param {string} apiSpecName - * A fully-qualified path representing ApiSpec resource. - * @returns {string} A string representing the version. - */ - matchVersionFromApiSpecName(apiSpecName: string) { - return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).version; - } - - /** - * Parse the spec from ApiSpec resource. - * - * @param {string} apiSpecName - * A fully-qualified path representing ApiSpec resource. - * @returns {string} A string representing the spec. - */ - matchSpecFromApiSpecName(apiSpecName: string) { - return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).spec; - } - - /** - * Return a fully-qualified apiVersion resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @returns {string} Resource name string. - */ - apiVersionPath(project:string,location:string,api:string,version:string) { - return this.pathTemplates.apiVersionPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - }); - } - - /** - * Parse the project from ApiVersion resource. - * - * @param {string} apiVersionName - * A fully-qualified path representing ApiVersion resource. - * @returns {string} A string representing the project. - */ - matchProjectFromApiVersionName(apiVersionName: string) { - return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName).project; - } - - /** - * Parse the location from ApiVersion resource. - * - * @param {string} apiVersionName - * A fully-qualified path representing ApiVersion resource. - * @returns {string} A string representing the location. - */ - matchLocationFromApiVersionName(apiVersionName: string) { - return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName).location; - } - - /** - * Parse the api from ApiVersion resource. - * - * @param {string} apiVersionName - * A fully-qualified path representing ApiVersion resource. - * @returns {string} A string representing the api. - */ - matchApiFromApiVersionName(apiVersionName: string) { - return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName).api; - } - - /** - * Parse the version from ApiVersion resource. - * - * @param {string} apiVersionName - * A fully-qualified path representing ApiVersion resource. - * @returns {string} A string representing the version. - */ - matchVersionFromApiVersionName(apiVersionName: string) { - return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName).version; - } - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified 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 projectLocationApiArtifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} artifact - * @returns {string} Resource name string. - */ - projectLocationApiArtifactPath(project:string,location:string,api:string,artifact:string) { - return this.pathTemplates.projectLocationApiArtifactPathTemplate.render({ - project: project, - location: location, - api: api, - artifact: artifact, - }); - } - - /** - * Parse the project from ProjectLocationApiArtifact resource. - * - * @param {string} projectLocationApiArtifactName - * A fully-qualified path representing project_location_api_artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationApiArtifactName(projectLocationApiArtifactName: string) { - return this.pathTemplates.projectLocationApiArtifactPathTemplate.match(projectLocationApiArtifactName).project; - } - - /** - * Parse the location from ProjectLocationApiArtifact resource. - * - * @param {string} projectLocationApiArtifactName - * A fully-qualified path representing project_location_api_artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationApiArtifactName(projectLocationApiArtifactName: string) { - return this.pathTemplates.projectLocationApiArtifactPathTemplate.match(projectLocationApiArtifactName).location; - } - - /** - * Parse the api from ProjectLocationApiArtifact resource. - * - * @param {string} projectLocationApiArtifactName - * A fully-qualified path representing project_location_api_artifact resource. - * @returns {string} A string representing the api. - */ - matchApiFromProjectLocationApiArtifactName(projectLocationApiArtifactName: string) { - return this.pathTemplates.projectLocationApiArtifactPathTemplate.match(projectLocationApiArtifactName).api; - } - - /** - * Parse the artifact from ProjectLocationApiArtifact resource. - * - * @param {string} projectLocationApiArtifactName - * A fully-qualified path representing project_location_api_artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromProjectLocationApiArtifactName(projectLocationApiArtifactName: string) { - return this.pathTemplates.projectLocationApiArtifactPathTemplate.match(projectLocationApiArtifactName).artifact; - } - - /** - * Return a fully-qualified projectLocationApiDeploymentArtifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} deployment - * @param {string} artifact - * @returns {string} Resource name string. - */ - projectLocationApiDeploymentArtifactPath(project:string,location:string,api:string,deployment:string,artifact:string) { - return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render({ - project: project, - location: location, - api: api, - deployment: deployment, - artifact: artifact, - }); - } - - /** - * Parse the project from ProjectLocationApiDeploymentArtifact resource. - * - * @param {string} projectLocationApiDeploymentArtifactName - * A fully-qualified path representing project_location_api_deployment_artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationApiDeploymentArtifactName(projectLocationApiDeploymentArtifactName: string) { - return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match(projectLocationApiDeploymentArtifactName).project; - } - - /** - * Parse the location from ProjectLocationApiDeploymentArtifact resource. - * - * @param {string} projectLocationApiDeploymentArtifactName - * A fully-qualified path representing project_location_api_deployment_artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationApiDeploymentArtifactName(projectLocationApiDeploymentArtifactName: string) { - return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match(projectLocationApiDeploymentArtifactName).location; - } - - /** - * Parse the api from ProjectLocationApiDeploymentArtifact resource. - * - * @param {string} projectLocationApiDeploymentArtifactName - * A fully-qualified path representing project_location_api_deployment_artifact resource. - * @returns {string} A string representing the api. - */ - matchApiFromProjectLocationApiDeploymentArtifactName(projectLocationApiDeploymentArtifactName: string) { - return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match(projectLocationApiDeploymentArtifactName).api; - } - - /** - * Parse the deployment from ProjectLocationApiDeploymentArtifact resource. - * - * @param {string} projectLocationApiDeploymentArtifactName - * A fully-qualified path representing project_location_api_deployment_artifact resource. - * @returns {string} A string representing the deployment. - */ - matchDeploymentFromProjectLocationApiDeploymentArtifactName(projectLocationApiDeploymentArtifactName: string) { - return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match(projectLocationApiDeploymentArtifactName).deployment; - } - - /** - * Parse the artifact from ProjectLocationApiDeploymentArtifact resource. - * - * @param {string} projectLocationApiDeploymentArtifactName - * A fully-qualified path representing project_location_api_deployment_artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromProjectLocationApiDeploymentArtifactName(projectLocationApiDeploymentArtifactName: string) { - return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match(projectLocationApiDeploymentArtifactName).artifact; - } - - /** - * Return a fully-qualified projectLocationApiVersionArtifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} artifact - * @returns {string} Resource name string. - */ - projectLocationApiVersionArtifactPath(project:string,location:string,api:string,version:string,artifact:string) { - return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - artifact: artifact, - }); - } - - /** - * Parse the project from ProjectLocationApiVersionArtifact resource. - * - * @param {string} projectLocationApiVersionArtifactName - * A fully-qualified path representing project_location_api_version_artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationApiVersionArtifactName(projectLocationApiVersionArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match(projectLocationApiVersionArtifactName).project; - } - - /** - * Parse the location from ProjectLocationApiVersionArtifact resource. - * - * @param {string} projectLocationApiVersionArtifactName - * A fully-qualified path representing project_location_api_version_artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationApiVersionArtifactName(projectLocationApiVersionArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match(projectLocationApiVersionArtifactName).location; - } - - /** - * Parse the api from ProjectLocationApiVersionArtifact resource. - * - * @param {string} projectLocationApiVersionArtifactName - * A fully-qualified path representing project_location_api_version_artifact resource. - * @returns {string} A string representing the api. - */ - matchApiFromProjectLocationApiVersionArtifactName(projectLocationApiVersionArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match(projectLocationApiVersionArtifactName).api; - } - - /** - * Parse the version from ProjectLocationApiVersionArtifact resource. - * - * @param {string} projectLocationApiVersionArtifactName - * A fully-qualified path representing project_location_api_version_artifact resource. - * @returns {string} A string representing the version. - */ - matchVersionFromProjectLocationApiVersionArtifactName(projectLocationApiVersionArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match(projectLocationApiVersionArtifactName).version; - } - - /** - * Parse the artifact from ProjectLocationApiVersionArtifact resource. - * - * @param {string} projectLocationApiVersionArtifactName - * A fully-qualified path representing project_location_api_version_artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromProjectLocationApiVersionArtifactName(projectLocationApiVersionArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match(projectLocationApiVersionArtifactName).artifact; - } - - /** - * Return a fully-qualified projectLocationApiVersionSpecArtifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} api - * @param {string} version - * @param {string} spec - * @param {string} artifact - * @returns {string} Resource name string. - */ - projectLocationApiVersionSpecArtifactPath(project:string,location:string,api:string,version:string,spec:string,artifact:string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render({ - project: project, - location: location, - api: api, - version: version, - spec: spec, - artifact: artifact, - }); - } - - /** - * Parse the project from ProjectLocationApiVersionSpecArtifact resource. - * - * @param {string} projectLocationApiVersionSpecArtifactName - * A fully-qualified path representing project_location_api_version_spec_artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationApiVersionSpecArtifactName(projectLocationApiVersionSpecArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match(projectLocationApiVersionSpecArtifactName).project; - } - - /** - * Parse the location from ProjectLocationApiVersionSpecArtifact resource. - * - * @param {string} projectLocationApiVersionSpecArtifactName - * A fully-qualified path representing project_location_api_version_spec_artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationApiVersionSpecArtifactName(projectLocationApiVersionSpecArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match(projectLocationApiVersionSpecArtifactName).location; - } - - /** - * Parse the api from ProjectLocationApiVersionSpecArtifact resource. - * - * @param {string} projectLocationApiVersionSpecArtifactName - * A fully-qualified path representing project_location_api_version_spec_artifact resource. - * @returns {string} A string representing the api. - */ - matchApiFromProjectLocationApiVersionSpecArtifactName(projectLocationApiVersionSpecArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match(projectLocationApiVersionSpecArtifactName).api; - } - - /** - * Parse the version from ProjectLocationApiVersionSpecArtifact resource. - * - * @param {string} projectLocationApiVersionSpecArtifactName - * A fully-qualified path representing project_location_api_version_spec_artifact resource. - * @returns {string} A string representing the version. - */ - matchVersionFromProjectLocationApiVersionSpecArtifactName(projectLocationApiVersionSpecArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match(projectLocationApiVersionSpecArtifactName).version; - } - - /** - * Parse the spec from ProjectLocationApiVersionSpecArtifact resource. - * - * @param {string} projectLocationApiVersionSpecArtifactName - * A fully-qualified path representing project_location_api_version_spec_artifact resource. - * @returns {string} A string representing the spec. - */ - matchSpecFromProjectLocationApiVersionSpecArtifactName(projectLocationApiVersionSpecArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match(projectLocationApiVersionSpecArtifactName).spec; - } - - /** - * Parse the artifact from ProjectLocationApiVersionSpecArtifact resource. - * - * @param {string} projectLocationApiVersionSpecArtifactName - * A fully-qualified path representing project_location_api_version_spec_artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromProjectLocationApiVersionSpecArtifactName(projectLocationApiVersionSpecArtifactName: string) { - return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match(projectLocationApiVersionSpecArtifactName).artifact; - } - - /** - * Return a fully-qualified projectLocationArtifact resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} artifact - * @returns {string} Resource name string. - */ - projectLocationArtifactPath(project:string,location:string,artifact:string) { - return this.pathTemplates.projectLocationArtifactPathTemplate.render({ - project: project, - location: location, - artifact: artifact, - }); - } - - /** - * Parse the project from ProjectLocationArtifact resource. - * - * @param {string} projectLocationArtifactName - * A fully-qualified path representing project_location_artifact resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationArtifactName(projectLocationArtifactName: string) { - return this.pathTemplates.projectLocationArtifactPathTemplate.match(projectLocationArtifactName).project; - } - - /** - * Parse the location from ProjectLocationArtifact resource. - * - * @param {string} projectLocationArtifactName - * A fully-qualified path representing project_location_artifact resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationArtifactName(projectLocationArtifactName: string) { - return this.pathTemplates.projectLocationArtifactPathTemplate.match(projectLocationArtifactName).location; - } - - /** - * Parse the artifact from ProjectLocationArtifact resource. - * - * @param {string} projectLocationArtifactName - * A fully-qualified path representing project_location_artifact resource. - * @returns {string} A string representing the artifact. - */ - matchArtifactFromProjectLocationArtifactName(projectLocationArtifactName: string) { - return this.pathTemplates.projectLocationArtifactPathTemplate.match(projectLocationArtifactName).artifact; - } - - /** - * 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.registryStub && !this._terminated) { - return this.registryStub.then(stub => { - this._terminated = true; - stub.close(); - this.iamClient.close(); - this.locationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/registry_client_config.json b/owl-bot-staging/v1/src/v1/registry_client_config.json deleted file mode 100644 index c26bf95..0000000 --- a/owl-bot-staging/v1/src/v1/registry_client_config.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "interfaces": { - "google.cloud.apigeeregistry.v1.Registry": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "cancelled_deadline_exceeded_aborted_unavailable": [ - "CANCELLED", - "DEADLINE_EXCEEDED", - "ABORTED", - "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 - }, - "5763d5cb4f40f09b4de469b8a0f10443a7a49d00": { - "initial_retry_delay_millis": 200, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListApis": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "GetApi": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "CreateApi": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "UpdateApi": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "DeleteApi": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "ListApiVersions": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "GetApiVersion": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "CreateApiVersion": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "UpdateApiVersion": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "DeleteApiVersion": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "ListApiSpecs": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "GetApiSpec": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "GetApiSpecContents": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "CreateApiSpec": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "UpdateApiSpec": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "DeleteApiSpec": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "TagApiSpecRevision": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "ListApiSpecRevisions": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "RollbackApiSpec": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteApiSpecRevision": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "ListApiDeployments": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "GetApiDeployment": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "CreateApiDeployment": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "UpdateApiDeployment": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "DeleteApiDeployment": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "TagApiDeploymentRevision": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "ListApiDeploymentRevisions": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "RollbackApiDeployment": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteApiDeploymentRevision": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "ListArtifacts": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "GetArtifact": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "GetArtifactContents": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "CreateArtifact": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "ReplaceArtifact": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - }, - "DeleteArtifact": { - "timeout_millis": 60000, - "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", - "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/registry_proto_list.json b/owl-bot-staging/v1/src/v1/registry_proto_list.json deleted file mode 100644 index 4fdc846..0000000 --- a/owl-bot-staging/v1/src/v1/registry_proto_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "../../protos/google/cloud/apigeeregistry/v1/provisioning_service.proto", - "../../protos/google/cloud/apigeeregistry/v1/registry_models.proto", - "../../protos/google/cloud/apigeeregistry/v1/registry_service.proto" -] diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index cca3da8..0000000 --- a/owl-bot-staging/v1/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 apigeeregistry = require('@google-cloud/apigee-registry'); - -function main() { - const provisioningClient = new apigeeregistry.ProvisioningClient(); - const registryClient = new apigeeregistry.RegistryClient(); -} - -main(); diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 64af11c..0000000 --- a/owl-bot-staging/v1/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 {ProvisioningClient, RegistryClient} from '@google-cloud/apigee-registry'; - -// check that the client class type name can be used -function doStuffWithProvisioningClient(client: ProvisioningClient) { - client.close(); -} -function doStuffWithRegistryClient(client: RegistryClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const provisioningClient = new ProvisioningClient(); - doStuffWithProvisioningClient(provisioningClient); - // check that the client instance can be created - const registryClient = new RegistryClient(); - doStuffWithRegistryClient(registryClient); -} - -main(); diff --git a/owl-bot-staging/v1/system-test/install.ts b/owl-bot-staging/v1/system-test/install.ts deleted file mode 100644 index c8f81b2..0000000 --- a/owl-bot-staging/v1/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/v1/test/gapic_provisioning_v1.ts b/owl-bot-staging/v1/test/gapic_provisioning_v1.ts deleted file mode 100644 index 7f78eb3..0000000 --- a/owl-bot-staging/v1/test/gapic_provisioning_v1.ts +++ /dev/null @@ -1,1896 +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 provisioningModule from '../src'; - -import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.ProvisioningClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = provisioningModule.v1.ProvisioningClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = provisioningModule.v1.ProvisioningClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = provisioningModule.v1.ProvisioningClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new provisioningModule.v1.ProvisioningClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new provisioningModule.v1.ProvisioningClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.provisioningStub, undefined); - await client.initialize(); - assert(client.provisioningStub); - }); - - it('has close method for the initialized client', done => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.provisioningStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.provisioningStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Instance() - ); - client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); - const [response] = await client.getInstance(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Instance() - ); - client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInstance( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IInstance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getInstance with closed client', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getInstance(request), expectedError); - }); - }); - - describe('createInstance', () => { - it('invokes createInstance without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createInstance( - request, - (err?: Error|null, - result?: LROperation|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 provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createInstance with LRO error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateInstanceRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateInstanceProgress without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - 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 provisioningModule.v1.ProvisioningClient({ - 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('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInstance( - request, - (err?: Error|null, - result?: LROperation|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.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance with call error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteInstance(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteInstance with LRO error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteInstanceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteInstanceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteInstance(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteInstanceProgress without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteInstanceProgress with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); - }); - - describe('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiDeployment', () => { - const fakePath = "/rendered/path/apiDeployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - deployment: "deploymentValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiDeploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiDeploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiDeploymentPath', () => { - const result = client.apiDeploymentPath("projectValue", "locationValue", "apiValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiDeploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiDeploymentName', () => { - const result = client.matchProjectFromApiDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiDeploymentName', () => { - const result = client.matchLocationFromApiDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiDeploymentName', () => { - const result = client.matchApiFromApiDeploymentName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromApiDeploymentName', () => { - const result = client.matchDeploymentFromApiDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiSpec', () => { - const fakePath = "/rendered/path/apiSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiSpecPath', () => { - const result = client.apiSpecPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiSpecName', () => { - const result = client.matchProjectFromApiSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiSpecName', () => { - const result = client.matchLocationFromApiSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiSpecName', () => { - const result = client.matchApiFromApiSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiSpecName', () => { - const result = client.matchVersionFromApiSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromApiSpecName', () => { - const result = client.matchSpecFromApiSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.apiSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiVersion', () => { - const fakePath = "/rendered/path/apiVersion"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiVersionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiVersionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiVersionPath', () => { - const result = client.apiVersionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiVersionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiVersionName', () => { - const result = client.matchProjectFromApiVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiVersionName', () => { - const result = client.matchLocationFromApiVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiVersionName', () => { - const result = client.matchApiFromApiVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiVersionName', () => { - const result = client.matchVersionFromApiVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationApiArtifact', () => { - const fakePath = "/rendered/path/projectLocationApiArtifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - artifact: "artifactValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationApiArtifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationApiArtifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationApiArtifactPath', () => { - const result = client.projectLocationApiArtifactPath("projectValue", "locationValue", "apiValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationApiArtifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationApiArtifactName', () => { - const result = client.matchProjectFromProjectLocationApiArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationApiArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationApiArtifactName', () => { - const result = client.matchLocationFromProjectLocationApiArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationApiArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromProjectLocationApiArtifactName', () => { - const result = client.matchApiFromProjectLocationApiArtifactName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.projectLocationApiArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromProjectLocationApiArtifactName', () => { - const result = client.matchArtifactFromProjectLocationApiArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.projectLocationApiArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationApiDeploymentArtifact', () => { - const fakePath = "/rendered/path/projectLocationApiDeploymentArtifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - deployment: "deploymentValue", - artifact: "artifactValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationApiDeploymentArtifactPath', () => { - const result = client.projectLocationApiDeploymentArtifactPath("projectValue", "locationValue", "apiValue", "deploymentValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationApiDeploymentArtifactName', () => { - const result = client.matchProjectFromProjectLocationApiDeploymentArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationApiDeploymentArtifactName', () => { - const result = client.matchLocationFromProjectLocationApiDeploymentArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromProjectLocationApiDeploymentArtifactName', () => { - const result = client.matchApiFromProjectLocationApiDeploymentArtifactName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromProjectLocationApiDeploymentArtifactName', () => { - const result = client.matchDeploymentFromProjectLocationApiDeploymentArtifactName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromProjectLocationApiDeploymentArtifactName', () => { - const result = client.matchArtifactFromProjectLocationApiDeploymentArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationApiVersionArtifact', () => { - const fakePath = "/rendered/path/projectLocationApiVersionArtifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - artifact: "artifactValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationApiVersionArtifactPath', () => { - const result = client.projectLocationApiVersionArtifactPath("projectValue", "locationValue", "apiValue", "versionValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationApiVersionArtifactName', () => { - const result = client.matchProjectFromProjectLocationApiVersionArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationApiVersionArtifactName', () => { - const result = client.matchLocationFromProjectLocationApiVersionArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromProjectLocationApiVersionArtifactName', () => { - const result = client.matchApiFromProjectLocationApiVersionArtifactName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromProjectLocationApiVersionArtifactName', () => { - const result = client.matchVersionFromProjectLocationApiVersionArtifactName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromProjectLocationApiVersionArtifactName', () => { - const result = client.matchArtifactFromProjectLocationApiVersionArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationApiVersionSpecArtifact', () => { - const fakePath = "/rendered/path/projectLocationApiVersionSpecArtifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - artifact: "artifactValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationApiVersionSpecArtifactPath', () => { - const result = client.projectLocationApiVersionSpecArtifactPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationApiVersionSpecArtifactName', () => { - const result = client.matchProjectFromProjectLocationApiVersionSpecArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationApiVersionSpecArtifactName', () => { - const result = client.matchLocationFromProjectLocationApiVersionSpecArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromProjectLocationApiVersionSpecArtifactName', () => { - const result = client.matchApiFromProjectLocationApiVersionSpecArtifactName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromProjectLocationApiVersionSpecArtifactName', () => { - const result = client.matchVersionFromProjectLocationApiVersionSpecArtifactName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromProjectLocationApiVersionSpecArtifactName', () => { - const result = client.matchSpecFromProjectLocationApiVersionSpecArtifactName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromProjectLocationApiVersionSpecArtifactName', () => { - const result = client.matchArtifactFromProjectLocationApiVersionSpecArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationArtifact', () => { - const fakePath = "/rendered/path/projectLocationArtifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - artifact: "artifactValue", - }; - const client = new provisioningModule.v1.ProvisioningClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationArtifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationArtifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationArtifactPath', () => { - const result = client.projectLocationArtifactPath("projectValue", "locationValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationArtifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationArtifactName', () => { - const result = client.matchProjectFromProjectLocationArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationArtifactName', () => { - const result = client.matchLocationFromProjectLocationArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromProjectLocationArtifactName', () => { - const result = client.matchArtifactFromProjectLocationArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.projectLocationArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/test/gapic_registry_v1.ts b/owl-bot-staging/v1/test/gapic_registry_v1.ts deleted file mode 100644 index 7f88ff7..0000000 --- a/owl-bot-staging/v1/test/gapic_registry_v1.ts +++ /dev/null @@ -1,6025 +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 registryModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.RegistryClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = registryModule.v1.RegistryClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = registryModule.v1.RegistryClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = registryModule.v1.RegistryClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new registryModule.v1.RegistryClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new registryModule.v1.RegistryClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.registryStub, undefined); - await client.initialize(); - assert(client.registryStub); - }); - - it('has close method for the initialized client', done => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.registryStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.registryStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new registryModule.v1.RegistryClient({ - 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 registryModule.v1.RegistryClient({ - 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('getApi', () => { - it('invokes getApi without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Api() - ); - client.innerApiCalls.getApi = stubSimpleCall(expectedResponse); - const [response] = await client.getApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApi without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Api() - ); - client.innerApiCalls.getApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getApi( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApi with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getApi(request), expectedError); - const actualRequest = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApi with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getApi(request), expectedError); - }); - }); - - describe('createApi', () => { - it('invokes createApi without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Api() - ); - client.innerApiCalls.createApi = stubSimpleCall(expectedResponse); - const [response] = await client.createApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApi without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Api() - ); - client.innerApiCalls.createApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createApi( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApi with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createApi(request), expectedError); - const actualRequest = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApi with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createApi(request), expectedError); - }); - }); - - describe('updateApi', () => { - it('invokes updateApi without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiRequest() - ); - request.api ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiRequest', ['api', 'name']); - request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Api() - ); - client.innerApiCalls.updateApi = stubSimpleCall(expectedResponse); - const [response] = await client.updateApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApi without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiRequest() - ); - request.api ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiRequest', ['api', 'name']); - request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Api() - ); - client.innerApiCalls.updateApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateApi( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApi|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApi with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiRequest() - ); - request.api ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiRequest', ['api', 'name']); - request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateApi(request), expectedError); - const actualRequest = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApi with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiRequest() - ); - request.api ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiRequest', ['api', 'name']); - request.api.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateApi(request), expectedError); - }); - }); - - describe('deleteApi', () => { - it('invokes deleteApi without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteApi = stubSimpleCall(expectedResponse); - const [response] = await client.deleteApi(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApi without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteApi = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteApi( - 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.deleteApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApi with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteApi = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteApi(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApi as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApi with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteApi(request), expectedError); - }); - }); - - describe('getApiVersion', () => { - it('invokes getApiVersion without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiVersion() - ); - client.innerApiCalls.getApiVersion = stubSimpleCall(expectedResponse); - const [response] = await client.getApiVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiVersion without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiVersion() - ); - client.innerApiCalls.getApiVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getApiVersion( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiVersion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiVersion with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getApiVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getApiVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.getApiVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiVersion with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiVersionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getApiVersion(request), expectedError); - }); - }); - - describe('createApiVersion', () => { - it('invokes createApiVersion without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiVersion() - ); - client.innerApiCalls.createApiVersion = stubSimpleCall(expectedResponse); - const [response] = await client.createApiVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApiVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiVersion without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiVersion() - ); - client.innerApiCalls.createApiVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createApiVersion( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiVersion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApiVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiVersion with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createApiVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createApiVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.createApiVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiVersion with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiVersionRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createApiVersion(request), expectedError); - }); - }); - - describe('updateApiVersion', () => { - it('invokes updateApiVersion without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest() - ); - request.apiVersion ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest', ['apiVersion', 'name']); - request.apiVersion.name = defaultValue1; - const expectedHeaderRequestParams = `api_version.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiVersion() - ); - client.innerApiCalls.updateApiVersion = stubSimpleCall(expectedResponse); - const [response] = await client.updateApiVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApiVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApiVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApiVersion without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest() - ); - request.apiVersion ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest', ['apiVersion', 'name']); - request.apiVersion.name = defaultValue1; - const expectedHeaderRequestParams = `api_version.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiVersion() - ); - client.innerApiCalls.updateApiVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateApiVersion( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiVersion|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApiVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApiVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApiVersion with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest() - ); - request.apiVersion ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest', ['apiVersion', 'name']); - request.apiVersion.name = defaultValue1; - const expectedHeaderRequestParams = `api_version.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateApiVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateApiVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.updateApiVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApiVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApiVersion with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest() - ); - request.apiVersion ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest', ['apiVersion', 'name']); - request.apiVersion.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateApiVersion(request), expectedError); - }); - }); - - describe('deleteApiVersion', () => { - it('invokes deleteApiVersion without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteApiVersion = stubSimpleCall(expectedResponse); - const [response] = await client.deleteApiVersion(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteApiVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiVersion without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteApiVersion = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteApiVersion( - 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.deleteApiVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiVersion with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteApiVersion = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteApiVersion(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteApiVersion as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiVersion as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiVersion with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteApiVersion(request), expectedError); - }); - }); - - describe('getApiSpec', () => { - it('invokes getApiSpec without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiSpec() - ); - client.innerApiCalls.getApiSpec = stubSimpleCall(expectedResponse); - const [response] = await client.getApiSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiSpec without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiSpec() - ); - client.innerApiCalls.getApiSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getApiSpec( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiSpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiSpec with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getApiSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getApiSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.getApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiSpec with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiSpecRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getApiSpec(request), expectedError); - }); - }); - - describe('getApiSpecContents', () => { - it('invokes getApiSpecContents without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.getApiSpecContents = stubSimpleCall(expectedResponse); - const [response] = await client.getApiSpecContents(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiSpecContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiSpecContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiSpecContents without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.getApiSpecContents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getApiSpecContents( - request, - (err?: Error|null, result?: protos.google.api.IHttpBody|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiSpecContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiSpecContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiSpecContents with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getApiSpecContents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getApiSpecContents(request), expectedError); - const actualRequest = (client.innerApiCalls.getApiSpecContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiSpecContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiSpecContents with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getApiSpecContents(request), expectedError); - }); - }); - - describe('createApiSpec', () => { - it('invokes createApiSpec without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiSpecRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiSpec() - ); - client.innerApiCalls.createApiSpec = stubSimpleCall(expectedResponse); - const [response] = await client.createApiSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiSpec without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiSpecRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiSpec() - ); - client.innerApiCalls.createApiSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createApiSpec( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiSpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiSpec with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiSpecRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createApiSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createApiSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.createApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiSpec with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiSpecRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createApiSpec(request), expectedError); - }); - }); - - describe('updateApiSpec', () => { - it('invokes updateApiSpec without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest() - ); - request.apiSpec ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest', ['apiSpec', 'name']); - request.apiSpec.name = defaultValue1; - const expectedHeaderRequestParams = `api_spec.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiSpec() - ); - client.innerApiCalls.updateApiSpec = stubSimpleCall(expectedResponse); - const [response] = await client.updateApiSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApiSpec without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest() - ); - request.apiSpec ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest', ['apiSpec', 'name']); - request.apiSpec.name = defaultValue1; - const expectedHeaderRequestParams = `api_spec.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiSpec() - ); - client.innerApiCalls.updateApiSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateApiSpec( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiSpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApiSpec with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest() - ); - request.apiSpec ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest', ['apiSpec', 'name']); - request.apiSpec.name = defaultValue1; - const expectedHeaderRequestParams = `api_spec.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateApiSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateApiSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.updateApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApiSpec with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest() - ); - request.apiSpec ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest', ['apiSpec', 'name']); - request.apiSpec.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateApiSpec(request), expectedError); - }); - }); - - describe('deleteApiSpec', () => { - it('invokes deleteApiSpec without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteApiSpec = stubSimpleCall(expectedResponse); - const [response] = await client.deleteApiSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiSpec without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteApiSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteApiSpec( - 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.deleteApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiSpec with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteApiSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteApiSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiSpec with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteApiSpec(request), expectedError); - }); - }); - - describe('tagApiSpecRevision', () => { - it('invokes tagApiSpecRevision without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiSpec() - ); - client.innerApiCalls.tagApiSpecRevision = stubSimpleCall(expectedResponse); - const [response] = await client.tagApiSpecRevision(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.tagApiSpecRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.tagApiSpecRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes tagApiSpecRevision without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiSpec() - ); - client.innerApiCalls.tagApiSpecRevision = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.tagApiSpecRevision( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiSpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.tagApiSpecRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.tagApiSpecRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes tagApiSpecRevision with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.tagApiSpecRevision = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.tagApiSpecRevision(request), expectedError); - const actualRequest = (client.innerApiCalls.tagApiSpecRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.tagApiSpecRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes tagApiSpecRevision with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.tagApiSpecRevision(request), expectedError); - }); - }); - - describe('rollbackApiSpec', () => { - it('invokes rollbackApiSpec without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiSpec() - ); - client.innerApiCalls.rollbackApiSpec = stubSimpleCall(expectedResponse); - const [response] = await client.rollbackApiSpec(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackApiSpec without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiSpec() - ); - client.innerApiCalls.rollbackApiSpec = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rollbackApiSpec( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiSpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackApiSpec with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.rollbackApiSpec = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rollbackApiSpec(request), expectedError); - const actualRequest = (client.innerApiCalls.rollbackApiSpec as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackApiSpec as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackApiSpec with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.rollbackApiSpec(request), expectedError); - }); - }); - - describe('deleteApiSpecRevision', () => { - it('invokes deleteApiSpecRevision without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiSpec() - ); - client.innerApiCalls.deleteApiSpecRevision = stubSimpleCall(expectedResponse); - const [response] = await client.deleteApiSpecRevision(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteApiSpecRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiSpecRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiSpecRevision without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiSpec() - ); - client.innerApiCalls.deleteApiSpecRevision = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteApiSpecRevision( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiSpec|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteApiSpecRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiSpecRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiSpecRevision with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteApiSpecRevision = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteApiSpecRevision(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteApiSpecRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiSpecRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiSpecRevision with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteApiSpecRevision(request), expectedError); - }); - }); - - describe('getApiDeployment', () => { - it('invokes getApiDeployment without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiDeployment() - ); - client.innerApiCalls.getApiDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.getApiDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiDeployment without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiDeployment() - ); - client.innerApiCalls.getApiDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getApiDeployment( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiDeployment with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getApiDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getApiDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.getApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getApiDeployment with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getApiDeployment(request), expectedError); - }); - }); - - describe('createApiDeployment', () => { - it('invokes createApiDeployment without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiDeployment() - ); - client.innerApiCalls.createApiDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.createApiDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiDeployment without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiDeployment() - ); - client.innerApiCalls.createApiDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createApiDeployment( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiDeployment with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createApiDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createApiDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.createApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createApiDeployment with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createApiDeployment(request), expectedError); - }); - }); - - describe('updateApiDeployment', () => { - it('invokes updateApiDeployment without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest() - ); - request.apiDeployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest', ['apiDeployment', 'name']); - request.apiDeployment.name = defaultValue1; - const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiDeployment() - ); - client.innerApiCalls.updateApiDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.updateApiDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApiDeployment without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest() - ); - request.apiDeployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest', ['apiDeployment', 'name']); - request.apiDeployment.name = defaultValue1; - const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiDeployment() - ); - client.innerApiCalls.updateApiDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateApiDeployment( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApiDeployment with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest() - ); - request.apiDeployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest', ['apiDeployment', 'name']); - request.apiDeployment.name = defaultValue1; - const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateApiDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateApiDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.updateApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateApiDeployment with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest() - ); - request.apiDeployment ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest', ['apiDeployment', 'name']); - request.apiDeployment.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateApiDeployment(request), expectedError); - }); - }); - - describe('deleteApiDeployment', () => { - it('invokes deleteApiDeployment without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteApiDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.deleteApiDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiDeployment without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteApiDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteApiDeployment( - 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.deleteApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiDeployment with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteApiDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteApiDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiDeployment with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteApiDeployment(request), expectedError); - }); - }); - - describe('tagApiDeploymentRevision', () => { - it('invokes tagApiDeploymentRevision without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiDeployment() - ); - client.innerApiCalls.tagApiDeploymentRevision = stubSimpleCall(expectedResponse); - const [response] = await client.tagApiDeploymentRevision(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.tagApiDeploymentRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.tagApiDeploymentRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes tagApiDeploymentRevision without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiDeployment() - ); - client.innerApiCalls.tagApiDeploymentRevision = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.tagApiDeploymentRevision( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.tagApiDeploymentRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.tagApiDeploymentRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes tagApiDeploymentRevision with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.tagApiDeploymentRevision = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.tagApiDeploymentRevision(request), expectedError); - const actualRequest = (client.innerApiCalls.tagApiDeploymentRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.tagApiDeploymentRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes tagApiDeploymentRevision with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.tagApiDeploymentRevision(request), expectedError); - }); - }); - - describe('rollbackApiDeployment', () => { - it('invokes rollbackApiDeployment without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiDeployment() - ); - client.innerApiCalls.rollbackApiDeployment = stubSimpleCall(expectedResponse); - const [response] = await client.rollbackApiDeployment(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackApiDeployment without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiDeployment() - ); - client.innerApiCalls.rollbackApiDeployment = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rollbackApiDeployment( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.rollbackApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackApiDeployment with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.rollbackApiDeployment = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rollbackApiDeployment(request), expectedError); - const actualRequest = (client.innerApiCalls.rollbackApiDeployment as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.rollbackApiDeployment as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollbackApiDeployment with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.rollbackApiDeployment(request), expectedError); - }); - }); - - describe('deleteApiDeploymentRevision', () => { - it('invokes deleteApiDeploymentRevision without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiDeployment() - ); - client.innerApiCalls.deleteApiDeploymentRevision = stubSimpleCall(expectedResponse); - const [response] = await client.deleteApiDeploymentRevision(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteApiDeploymentRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiDeploymentRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiDeploymentRevision without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ApiDeployment() - ); - client.innerApiCalls.deleteApiDeploymentRevision = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteApiDeploymentRevision( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteApiDeploymentRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiDeploymentRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiDeploymentRevision with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteApiDeploymentRevision = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteApiDeploymentRevision(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteApiDeploymentRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteApiDeploymentRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteApiDeploymentRevision with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteApiDeploymentRevision(request), expectedError); - }); - }); - - describe('getArtifact', () => { - it('invokes getArtifact without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetArtifactRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Artifact() - ); - client.innerApiCalls.getArtifact = stubSimpleCall(expectedResponse); - const [response] = await client.getArtifact(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getArtifact without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetArtifactRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Artifact() - ); - client.innerApiCalls.getArtifact = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getArtifact( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IArtifact|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getArtifact with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetArtifactRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getArtifact(request), expectedError); - const actualRequest = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getArtifact with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetArtifactRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getArtifact(request), expectedError); - }); - }); - - describe('getArtifactContents', () => { - it('invokes getArtifactContents without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.getArtifactContents = stubSimpleCall(expectedResponse); - const [response] = await client.getArtifactContents(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getArtifactContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getArtifactContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getArtifactContents without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.api.HttpBody() - ); - client.innerApiCalls.getArtifactContents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getArtifactContents( - request, - (err?: Error|null, result?: protos.google.api.IHttpBody|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getArtifactContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getArtifactContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getArtifactContents with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getArtifactContents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getArtifactContents(request), expectedError); - const actualRequest = (client.innerApiCalls.getArtifactContents as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getArtifactContents as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getArtifactContents with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getArtifactContents(request), expectedError); - }); - }); - - describe('createArtifact', () => { - it('invokes createArtifact without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateArtifactRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateArtifactRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Artifact() - ); - client.innerApiCalls.createArtifact = stubSimpleCall(expectedResponse); - const [response] = await client.createArtifact(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createArtifact without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateArtifactRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateArtifactRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Artifact() - ); - client.innerApiCalls.createArtifact = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createArtifact( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IArtifact|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createArtifact with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateArtifactRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateArtifactRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createArtifact(request), expectedError); - const actualRequest = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createArtifact with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.CreateArtifactRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.CreateArtifactRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createArtifact(request), expectedError); - }); - }); - - describe('replaceArtifact', () => { - it('invokes replaceArtifact without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest() - ); - request.artifact ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest', ['artifact', 'name']); - request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Artifact() - ); - client.innerApiCalls.replaceArtifact = stubSimpleCall(expectedResponse); - const [response] = await client.replaceArtifact(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.replaceArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.replaceArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes replaceArtifact without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest() - ); - request.artifact ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest', ['artifact', 'name']); - request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.Artifact() - ); - client.innerApiCalls.replaceArtifact = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.replaceArtifact( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IArtifact|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.replaceArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.replaceArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes replaceArtifact with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest() - ); - request.artifact ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest', ['artifact', 'name']); - request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.replaceArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.replaceArtifact(request), expectedError); - const actualRequest = (client.innerApiCalls.replaceArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.replaceArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes replaceArtifact with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest() - ); - request.artifact ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest', ['artifact', 'name']); - request.artifact.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.replaceArtifact(request), expectedError); - }); - }); - - describe('deleteArtifact', () => { - it('invokes deleteArtifact without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteArtifactRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteArtifact = stubSimpleCall(expectedResponse); - const [response] = await client.deleteArtifact(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteArtifact without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteArtifactRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteArtifact = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteArtifact( - 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.deleteArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteArtifact with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteArtifactRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteArtifact = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteArtifact(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteArtifact as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteArtifact with closed client', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.DeleteArtifactRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.DeleteArtifactRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteArtifact(request), expectedError); - }); - }); - - describe('listApis', () => { - it('invokes listApis without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), - ]; - client.innerApiCalls.listApis = stubSimpleCall(expectedResponse); - const [response] = await client.listApis(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApis without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), - ]; - client.innerApiCalls.listApis = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listApis( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApi[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApis with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listApis = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listApis(request), expectedError); - const actualRequest = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApis as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApisStream without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), - ]; - client.descriptors.page.listApis.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listApisStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.Api[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.Api) => { - 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.listApis.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApis, request)); - assert( - (client.descriptors.page.listApis.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listApisStream with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApis.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listApisStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.Api[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.Api) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listApis.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApis, request)); - assert( - (client.descriptors.page.listApis.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApis without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), - ]; - client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apigeeregistry.v1.IApi[] = []; - const iterable = client.listApisAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listApis.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApis.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApis with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApisRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApisRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listApisAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apigeeregistry.v1.IApi[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listApis.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApis.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listApiVersions', () => { - it('invokes listApiVersions without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiVersion()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiVersion()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiVersion()), - ]; - client.innerApiCalls.listApiVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listApiVersions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiVersions without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiVersion()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiVersion()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiVersion()), - ]; - client.innerApiCalls.listApiVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listApiVersions( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiVersion[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiVersions with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listApiVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listApiVersions(request), expectedError); - const actualRequest = (client.innerApiCalls.listApiVersions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiVersions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiVersionsStream without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiVersion()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiVersion()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiVersion()), - ]; - client.descriptors.page.listApiVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listApiVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.ApiVersion[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.ApiVersion) => { - 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.listApiVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiVersions, request)); - assert( - (client.descriptors.page.listApiVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listApiVersionsStream with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiVersions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listApiVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.ApiVersion[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.ApiVersion) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listApiVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiVersions, request)); - assert( - (client.descriptors.page.listApiVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiVersions without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiVersion()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiVersion()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiVersion()), - ]; - client.descriptors.page.listApiVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apigeeregistry.v1.IApiVersion[] = []; - const iterable = client.listApiVersionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listApiVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiVersions with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listApiVersionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apigeeregistry.v1.IApiVersion[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listApiVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listApiSpecs', () => { - it('invokes listApiSpecs without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - ]; - client.innerApiCalls.listApiSpecs = stubSimpleCall(expectedResponse); - const [response] = await client.listApiSpecs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiSpecs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiSpecs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiSpecs without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - ]; - client.innerApiCalls.listApiSpecs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listApiSpecs( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiSpec[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiSpecs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiSpecs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiSpecs with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listApiSpecs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listApiSpecs(request), expectedError); - const actualRequest = (client.innerApiCalls.listApiSpecs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiSpecs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiSpecsStream without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - ]; - client.descriptors.page.listApiSpecs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listApiSpecsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.ApiSpec[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.ApiSpec) => { - 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.listApiSpecs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiSpecs, request)); - assert( - (client.descriptors.page.listApiSpecs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listApiSpecsStream with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiSpecs.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listApiSpecsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.ApiSpec[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.ApiSpec) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listApiSpecs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiSpecs, request)); - assert( - (client.descriptors.page.listApiSpecs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiSpecs without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - ]; - client.descriptors.page.listApiSpecs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apigeeregistry.v1.IApiSpec[] = []; - const iterable = client.listApiSpecsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listApiSpecs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiSpecs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiSpecs with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiSpecs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listApiSpecsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apigeeregistry.v1.IApiSpec[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listApiSpecs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiSpecs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listApiSpecRevisions', () => { - it('invokes listApiSpecRevisions without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - ]; - client.innerApiCalls.listApiSpecRevisions = stubSimpleCall(expectedResponse); - const [response] = await client.listApiSpecRevisions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiSpecRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiSpecRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiSpecRevisions without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - ]; - client.innerApiCalls.listApiSpecRevisions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listApiSpecRevisions( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiSpec[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiSpecRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiSpecRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiSpecRevisions with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listApiSpecRevisions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listApiSpecRevisions(request), expectedError); - const actualRequest = (client.innerApiCalls.listApiSpecRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiSpecRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiSpecRevisionsStream without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - ]; - client.descriptors.page.listApiSpecRevisions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listApiSpecRevisionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.ApiSpec[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.ApiSpec) => { - 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.listApiSpecRevisions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiSpecRevisions, request)); - assert( - (client.descriptors.page.listApiSpecRevisions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listApiSpecRevisionsStream with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiSpecRevisions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listApiSpecRevisionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.ApiSpec[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.ApiSpec) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listApiSpecRevisions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiSpecRevisions, request)); - assert( - (client.descriptors.page.listApiSpecRevisions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiSpecRevisions without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiSpec()), - ]; - client.descriptors.page.listApiSpecRevisions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apigeeregistry.v1.IApiSpec[] = []; - const iterable = client.listApiSpecRevisionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listApiSpecRevisions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiSpecRevisions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiSpecRevisions with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiSpecRevisions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listApiSpecRevisionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apigeeregistry.v1.IApiSpec[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listApiSpecRevisions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiSpecRevisions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listApiDeployments', () => { - it('invokes listApiDeployments without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - ]; - client.innerApiCalls.listApiDeployments = stubSimpleCall(expectedResponse); - const [response] = await client.listApiDeployments(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiDeployments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiDeployments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiDeployments without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - ]; - client.innerApiCalls.listApiDeployments = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listApiDeployments( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiDeployments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiDeployments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiDeployments with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listApiDeployments = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listApiDeployments(request), expectedError); - const actualRequest = (client.innerApiCalls.listApiDeployments as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiDeployments as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiDeploymentsStream without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - ]; - client.descriptors.page.listApiDeployments.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listApiDeploymentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.ApiDeployment[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.ApiDeployment) => { - 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.listApiDeployments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiDeployments, request)); - assert( - (client.descriptors.page.listApiDeployments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listApiDeploymentsStream with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiDeployments.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listApiDeploymentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.ApiDeployment[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.ApiDeployment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listApiDeployments.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiDeployments, request)); - assert( - (client.descriptors.page.listApiDeployments.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiDeployments without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - ]; - client.descriptors.page.listApiDeployments.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apigeeregistry.v1.IApiDeployment[] = []; - const iterable = client.listApiDeploymentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listApiDeployments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiDeployments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiDeployments with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listApiDeploymentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apigeeregistry.v1.IApiDeployment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listApiDeployments.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiDeployments.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listApiDeploymentRevisions', () => { - it('invokes listApiDeploymentRevisions without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - ]; - client.innerApiCalls.listApiDeploymentRevisions = stubSimpleCall(expectedResponse); - const [response] = await client.listApiDeploymentRevisions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiDeploymentRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiDeploymentRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiDeploymentRevisions without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - ]; - client.innerApiCalls.listApiDeploymentRevisions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listApiDeploymentRevisions( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listApiDeploymentRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiDeploymentRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiDeploymentRevisions with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listApiDeploymentRevisions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listApiDeploymentRevisions(request), expectedError); - const actualRequest = (client.innerApiCalls.listApiDeploymentRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listApiDeploymentRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listApiDeploymentRevisionsStream without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - ]; - client.descriptors.page.listApiDeploymentRevisions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listApiDeploymentRevisionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.ApiDeployment[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.ApiDeployment) => { - 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.listApiDeploymentRevisions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiDeploymentRevisions, request)); - assert( - (client.descriptors.page.listApiDeploymentRevisions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listApiDeploymentRevisionsStream with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiDeploymentRevisions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listApiDeploymentRevisionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.ApiDeployment[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.ApiDeployment) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listApiDeploymentRevisions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listApiDeploymentRevisions, request)); - assert( - (client.descriptors.page.listApiDeploymentRevisions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiDeploymentRevisions without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.ApiDeployment()), - ]; - client.descriptors.page.listApiDeploymentRevisions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apigeeregistry.v1.IApiDeployment[] = []; - const iterable = client.listApiDeploymentRevisionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listApiDeploymentRevisions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiDeploymentRevisions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listApiDeploymentRevisions with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listApiDeploymentRevisions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listApiDeploymentRevisionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apigeeregistry.v1.IApiDeployment[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listApiDeploymentRevisions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listApiDeploymentRevisions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listArtifacts', () => { - it('invokes listArtifacts without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Artifact()), - ]; - client.innerApiCalls.listArtifacts = stubSimpleCall(expectedResponse); - const [response] = await client.listArtifacts(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listArtifacts without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Artifact()), - ]; - client.innerApiCalls.listArtifacts = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listArtifacts( - request, - (err?: Error|null, result?: protos.google.cloud.apigeeregistry.v1.IArtifact[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listArtifacts with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listArtifacts = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listArtifacts(request), expectedError); - const actualRequest = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listArtifacts as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listArtifactsStream without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Artifact()), - ]; - client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listArtifactsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.Artifact[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.Artifact) => { - 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.listArtifacts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listArtifacts, request)); - assert( - (client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listArtifactsStream with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listArtifactsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.apigeeregistry.v1.Artifact[] = []; - stream.on('data', (response: protos.google.cloud.apigeeregistry.v1.Artifact) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listArtifacts, request)); - assert( - (client.descriptors.page.listArtifacts.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listArtifacts without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Artifact()), - generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Artifact()), - ]; - client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.apigeeregistry.v1.IArtifact[] = []; - const iterable = client.listArtifactsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listArtifacts with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.apigeeregistry.v1.ListArtifactsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listArtifactsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.apigeeregistry.v1.IArtifact[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('Path templates', () => { - - describe('api', () => { - const fakePath = "/rendered/path/api"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - }; - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiPath', () => { - const result = client.apiPath("projectValue", "locationValue", "apiValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiName', () => { - const result = client.matchProjectFromApiName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiName', () => { - const result = client.matchLocationFromApiName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiName', () => { - const result = client.matchApiFromApiName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiDeployment', () => { - const fakePath = "/rendered/path/apiDeployment"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - deployment: "deploymentValue", - }; - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiDeploymentPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiDeploymentPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiDeploymentPath', () => { - const result = client.apiDeploymentPath("projectValue", "locationValue", "apiValue", "deploymentValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiDeploymentPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiDeploymentName', () => { - const result = client.matchProjectFromApiDeploymentName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiDeploymentName', () => { - const result = client.matchLocationFromApiDeploymentName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiDeploymentName', () => { - const result = client.matchApiFromApiDeploymentName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromApiDeploymentName', () => { - const result = client.matchDeploymentFromApiDeploymentName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiSpec', () => { - const fakePath = "/rendered/path/apiSpec"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - }; - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiSpecPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiSpecPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiSpecPath', () => { - const result = client.apiSpecPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiSpecPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiSpecName', () => { - const result = client.matchProjectFromApiSpecName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiSpecName', () => { - const result = client.matchLocationFromApiSpecName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiSpecName', () => { - const result = client.matchApiFromApiSpecName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiSpecName', () => { - const result = client.matchVersionFromApiSpecName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromApiSpecName', () => { - const result = client.matchSpecFromApiSpecName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.apiSpecPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('apiVersion', () => { - const fakePath = "/rendered/path/apiVersion"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - }; - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.apiVersionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.apiVersionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('apiVersionPath', () => { - const result = client.apiVersionPath("projectValue", "locationValue", "apiValue", "versionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.apiVersionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromApiVersionName', () => { - const result = client.matchProjectFromApiVersionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.apiVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromApiVersionName', () => { - const result = client.matchLocationFromApiVersionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.apiVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromApiVersionName', () => { - const result = client.matchApiFromApiVersionName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.apiVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromApiVersionName', () => { - const result = client.matchVersionFromApiVersionName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.apiVersionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('instance', () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new registryModule.v1.RegistryClient({ - 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('projectLocationApiArtifact', () => { - const fakePath = "/rendered/path/projectLocationApiArtifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - artifact: "artifactValue", - }; - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationApiArtifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationApiArtifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationApiArtifactPath', () => { - const result = client.projectLocationApiArtifactPath("projectValue", "locationValue", "apiValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationApiArtifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationApiArtifactName', () => { - const result = client.matchProjectFromProjectLocationApiArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationApiArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationApiArtifactName', () => { - const result = client.matchLocationFromProjectLocationApiArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationApiArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromProjectLocationApiArtifactName', () => { - const result = client.matchApiFromProjectLocationApiArtifactName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.projectLocationApiArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromProjectLocationApiArtifactName', () => { - const result = client.matchArtifactFromProjectLocationApiArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.projectLocationApiArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationApiDeploymentArtifact', () => { - const fakePath = "/rendered/path/projectLocationApiDeploymentArtifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - deployment: "deploymentValue", - artifact: "artifactValue", - }; - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationApiDeploymentArtifactPath', () => { - const result = client.projectLocationApiDeploymentArtifactPath("projectValue", "locationValue", "apiValue", "deploymentValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationApiDeploymentArtifactName', () => { - const result = client.matchProjectFromProjectLocationApiDeploymentArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationApiDeploymentArtifactName', () => { - const result = client.matchLocationFromProjectLocationApiDeploymentArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromProjectLocationApiDeploymentArtifactName', () => { - const result = client.matchApiFromProjectLocationApiDeploymentArtifactName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDeploymentFromProjectLocationApiDeploymentArtifactName', () => { - const result = client.matchDeploymentFromProjectLocationApiDeploymentArtifactName(fakePath); - assert.strictEqual(result, "deploymentValue"); - assert((client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromProjectLocationApiDeploymentArtifactName', () => { - const result = client.matchArtifactFromProjectLocationApiDeploymentArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationApiVersionArtifact', () => { - const fakePath = "/rendered/path/projectLocationApiVersionArtifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - artifact: "artifactValue", - }; - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationApiVersionArtifactPath', () => { - const result = client.projectLocationApiVersionArtifactPath("projectValue", "locationValue", "apiValue", "versionValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationApiVersionArtifactName', () => { - const result = client.matchProjectFromProjectLocationApiVersionArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationApiVersionArtifactName', () => { - const result = client.matchLocationFromProjectLocationApiVersionArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromProjectLocationApiVersionArtifactName', () => { - const result = client.matchApiFromProjectLocationApiVersionArtifactName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromProjectLocationApiVersionArtifactName', () => { - const result = client.matchVersionFromProjectLocationApiVersionArtifactName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromProjectLocationApiVersionArtifactName', () => { - const result = client.matchArtifactFromProjectLocationApiVersionArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationApiVersionSpecArtifact', () => { - const fakePath = "/rendered/path/projectLocationApiVersionSpecArtifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - api: "apiValue", - version: "versionValue", - spec: "specValue", - artifact: "artifactValue", - }; - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationApiVersionSpecArtifactPath', () => { - const result = client.projectLocationApiVersionSpecArtifactPath("projectValue", "locationValue", "apiValue", "versionValue", "specValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationApiVersionSpecArtifactName', () => { - const result = client.matchProjectFromProjectLocationApiVersionSpecArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationApiVersionSpecArtifactName', () => { - const result = client.matchLocationFromProjectLocationApiVersionSpecArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchApiFromProjectLocationApiVersionSpecArtifactName', () => { - const result = client.matchApiFromProjectLocationApiVersionSpecArtifactName(fakePath); - assert.strictEqual(result, "apiValue"); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchVersionFromProjectLocationApiVersionSpecArtifactName', () => { - const result = client.matchVersionFromProjectLocationApiVersionSpecArtifactName(fakePath); - assert.strictEqual(result, "versionValue"); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSpecFromProjectLocationApiVersionSpecArtifactName', () => { - const result = client.matchSpecFromProjectLocationApiVersionSpecArtifactName(fakePath); - assert.strictEqual(result, "specValue"); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromProjectLocationApiVersionSpecArtifactName', () => { - const result = client.matchArtifactFromProjectLocationApiVersionSpecArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationArtifact', () => { - const fakePath = "/rendered/path/projectLocationArtifact"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - artifact: "artifactValue", - }; - const client = new registryModule.v1.RegistryClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.projectLocationArtifactPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationArtifactPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationArtifactPath', () => { - const result = client.projectLocationArtifactPath("projectValue", "locationValue", "artifactValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationArtifactPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationArtifactName', () => { - const result = client.matchProjectFromProjectLocationArtifactName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationArtifactName', () => { - const result = client.matchLocationFromProjectLocationArtifactName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchArtifactFromProjectLocationArtifactName', () => { - const result = client.matchArtifactFromProjectLocationArtifactName(fakePath); - assert.strictEqual(result, "artifactValue"); - assert((client.pathTemplates.projectLocationArtifactPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1/tsconfig.json b/owl-bot-staging/v1/tsconfig.json deleted file mode 100644 index c78f1c8..0000000 --- a/owl-bot-staging/v1/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/v1/webpack.config.js b/owl-bot-staging/v1/webpack.config.js deleted file mode 100644 index c94e0fd..0000000 --- a/owl-bot-staging/v1/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: 'Provisioning', - filename: './provisioning.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', -};